|
|
6 hari lalu | |
|---|---|---|
| admin | 6 hari lalu | |
| css | 6 hari lalu | |
| database_migrations | 6 hari lalu | |
| includes | 6 hari lalu | |
| js | 6 hari lalu | |
| languages | 6 hari lalu | |
| public | 6 hari lalu | |
| setup | 6 hari lalu | |
| .gitignore | 6 hari lalu | |
| INSTALL.md | 6 hari lalu | |
| README.md | 6 hari lalu | |
| fix_slug_issue.sql | 6 hari lalu | |
| index.php | 6 hari lalu | |
| run_migration.php | 6 hari lalu | |
| test_language.php | 6 hari lalu | |
| test_switcher.php | 6 hari lalu | |
| test_wysiwyg.html | 6 hari lalu |
A simple, clean web publication system built with PHP and MariaDB. This system allows you to create, manage, and publish articles or blog posts with categories, search functionality, and a responsive admin interface.
Create a database and user for the system:
CREATE DATABASE webpub;
CREATE USER 'webpub_user'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON webpub.* TO 'webpub_user'@'localhost';
FLUSH PRIVILEGES;
Place the files in your web root or a subdirectory. For example:
/var/www/html/web-pub-system/
setup/ directory is accessible via web browserhttp://your-domain.com/setup/The system supports optional LDAP directory authentication for enterprise environments.
When running the setup script, you can enable LDAP authentication by checking the "Enable LDAP Authentication" option. You'll need to provide:
dc=example,dc=com)(uid={username}))LDAP Server Host: ldap://ad.example.com
LDAP Port: 389
LDAP Base DN: dc=example,dc=com
User Search Filter: (sAMAccountName={username})
Email Attribute: mail
Name Attribute: cn
LDAP Server Host: ldap://ldap.example.com
LDAP Port: 389
LDAP Base DN: ou=users,dc=example,dc=com
User Search Filter: (uid={username})
Email Attribute: mail
Name Attribute: cn
After enabling LDAP authentication:
After successful installation:
Delete the setup directory for security:
rm -rf /path/to/web-pub-system/setup/
Set proper file permissions:
chmod 755 /path/to/web-pub-system/
chmod 644 /path/to/web-pub-system/includes/config.php
website/
|-- admin/ # Admin interface files
| |-- index.php # Dashboard
| |-- login.php # Login page (supports LDAP)
| |-- edit.php # Create/edit publications
| |-- logout.php # Logout handler
| |-- publications.php # Publication management
| |-- categories.php # Category management
| |-- ldap-users.php # LDAP user management
|-- public/ # Public-facing pages
| |-- index.php # Homepage with publication list
| |-- publication.php # Individual publication view
| |-- search.php # Search results
| |-- categories.php # Category listings
|-- includes/ # Core PHP classes
| |-- config.php # Configuration (created during setup)
| |-- database.php # Database connection class
| |-- auth.php # Authentication class (supports LDAP)
| |-- ldap.php # LDAP authentication class
| |-- publication.php # Publication model class
|-- css/ # Stylesheets
| |-- style.css # Main stylesheet (includes LDAP styles)
|-- setup/ # Installation files (delete after use)
| |-- setup.php # Setup wizard (includes LDAP config)
| |-- database.sql # Database schema (supports LDAP)
|-- README.md # This file
http://your-domain.com/admin/If LDAP authentication is enabled:
The public site is available at: http://your-domain.com/public/
Features:
The main configuration is stored in includes/config.php and is created during setup. Key settings include:
// Database configuration
define('DB_HOST', 'localhost');
define('DB_NAME', 'webpub');
define('DB_USER', 'your_db_user');
define('DB_PASS', 'your_db_password');
// Site configuration
define('SITE_TITLE', 'Web Publication System');
define('SITE_URL', 'http://your-domain.com/');
define('ADMIN_EMAIL', 'admin@example.com');
// LDAP configuration (if enabled)
define('LDAP_ENABLED', true);
define('LDAP_HOST', 'ldap.example.com');
define('LDAP_PORT', '389');
define('LDAP_BASE_DN', 'dc=example,dc=com');
define('LDAP_USER_FILTER', '(uid={username})');
define('LDAP_BIND_DN', 'cn=admin,dc=example,dc=com');
define('LDAP_BIND_PASSWORD', 'bind_password');
define('LDAP_EMAIL_ATTRIBUTE', 'mail');
define('LDAP_NAME_ATTRIBUTE', 'cn');
setup/ directory after installationEdit css/style.css to customize the appearance. The CSS is organized with clear sections for:
The database schema is defined in setup/database.sql. You can extend it by:
The system is built with an object-oriented approach, making it easy to extend:
includes/ directoryadmin/ directorypublic/ directoryDatabase Connection Error
includes/config.phpBlank Pages
Login Issues
Enable PHP error logging for debugging:
// Add to top of index.php or config.php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
This project is open source and available under the MIT License.
For issues and questions: