### Creating SSL Certificate Table - SQL Source: https://github.com/nxts-developers/project-hustal/blob/dev/DATABASE.md This SQL snippet defines the `vhost_ssl` table, intended for storing SSL certificate information. It includes fields for an SSL key, the private key, and a foreign key linking it to a specific client. ```SQL CREATE TABLE IF NOT EXISTS `vhost_ssl` ( `ssl_id` int(11) NOT NULL AUTO_INCREMENT, `ssl_key` int(11) NOT NULL, `private_key` varchar(1200) NOT NULL, `client_id` int(11) NOT NULL, PRIMARY KEY (`ssl_id`) ) ``` -------------------------------- ### Creating Client Account Table - SQL Source: https://github.com/nxts-developers/project-hustal/blob/dev/DATABASE.md This SQL snippet defines the `vhost_client` table, which stores client account information including name, email, hashed password, and status. It includes unique keys to ensure data integrity for client passwords. ```SQL CREATE TABLE IF NOT EXISTS `vhost_client` ( `client_id` int(11) NOT NULL AUTO_INCREMENT, `client_name` varchar(50) NOT NULL, `client_email` varchar(70) NOT NULL, `client_password` varchar(100) NOT NULL, `client_status` int(1) NOT NULL, PRIMARY KEY (`client_id`), UNIQUE KEY `client_password` (`client_password`), UNIQUE KEY `client_password_2` (`client_password`) ) ``` -------------------------------- ### Creating Ticket Reply Table - SQL Source: https://github.com/nxts-developers/project-hustal/blob/dev/DATABASE.md This SQL snippet defines the `vhost_ticket_reply` table, designed to store replies associated with support tickets. It includes the reply content, the ID of the replier, and the date and time of the reply, linked to a `ticket_id`. ```SQL CREATE TABLE IF NOT EXISTS `vhost_ticket_reply` ( `reply_id` int(11) NOT NULL AUTO_INCREMENT, `ticket_id` int(11) NOT NULL, `reply_content` varchar(700) NOT NULL, `reply_by` int(11) NOT NULL, `reply_date` varchar(10) NOT NULL, `reply_time` varchar(10) NOT NULL, PRIMARY KEY (`reply_id`) ) ``` -------------------------------- ### Creating Support Ticket Table - SQL Source: https://github.com/nxts-developers/project-hustal/blob/dev/DATABASE.md This SQL snippet creates the `vhost_ticket` table, which manages customer support tickets. It stores ticket details such as subject, content, submission date and time, and current status, linked to a client ID. ```SQL CREATE TABLE IF NOT EXISTS `vhost_ticket` ( `ticket_id` int(11) NOT NULL AUTO_INCREMENT, `client_id` int(11) NOT NULL, `ticket_subject` varchar(150) NOT NULL, `ticket_content` varchar(700) NOT NULL, `ticket_date` varchar(10) NOT NULL, `ticket_time` varchar(20) NOT NULL, `ticket_status` int(1) NOT NULL, PRIMARY KEY (`ticket_id`) ) ``` -------------------------------- ### Creating cPanel Account Table - SQL Source: https://github.com/nxts-developers/project-hustal/blob/dev/DATABASE.md This SQL snippet creates the `vhost_cpanel` table, designed to link cPanel accounts to specific clients. It stores details like cPanel username, label, client-specific username, password, status, domain, and creation date. ```SQL CREATE TABLE IF NOT EXISTS `vhost_cpanel` ( `cpanel_id` int(11) NOT NULL AUTO_INCREMENT, `client_id` int(11) NOT NULL, `cpanel_username` varchar(20) NOT NULL, `cpanel_label` varchar(150) NOT NULL, `cpanel_client_username` varchar(30) NOT NULL, `cpanel_password` varchar(40) NOT NULL, `cpanel_status` int(1) NOT NULL, `cpanel_domain` varchar(30) NOT NULL, `cpanel_date` varchar(20) NOT NULL, PRIMARY KEY (`cpanel_id`) ) ``` -------------------------------- ### Generating Password Hash - PHP Source: https://github.com/nxts-developers/project-hustal/blob/dev/DATABASE.md This PHP snippet demonstrates how to generate a secure password hash using `password_hash()` with the `PASSWORD_BCRYPT` algorithm. This method should be used to hash passwords before storing them in the database, such as for the `admin_password` field. ```PHP ``` -------------------------------- ### Creating Admin User Table - SQL Source: https://github.com/nxts-developers/project-hustal/blob/dev/DATABASE.md This SQL snippet creates the `vhost_admin` table, designed to store administrative user details including ID, name, email, and a hashed password. The `admin_id` serves as the primary key for unique identification. ```SQL CREATE TABLE IF NOT EXISTS `vhost_admin` ( `admin_id` int(11) NOT NULL AUTO_INCREMENT, `admin_name` varchar(30) NOT NULL, `admin_email` varchar(70) NOT NULL, `admin_password` varchar(100) NOT NULL, PRIMARY KEY (`admin_id`) ) ``` -------------------------------- ### Inserting Initial Admin Account - SQL Source: https://github.com/nxts-developers/project-hustal/blob/dev/DATABASE.md This SQL snippet inserts a default administrative user record into the `vhost_admin` table. It's crucial to replace 'Admin Name', 'Admin Email', and 'Admin password Hashed' with actual values, ensuring the password is securely hashed before insertion. ```SQL INSERT INTO `vhost_admin` (`admin_id`, `admin_name`, `admin_email`, `admin_password`) VALUES (1, 'Admin Name', 'Admin Email', 'Admin password Hashed'); ``` -------------------------------- ### Setting Up Custom Default Index Page (HTML) Source: https://github.com/nxts-developers/project-hustal/blob/dev/SETUP.md This HTML snippet provides a basic default index page to be displayed when a new account is created. It includes a congratulatory message and instructions for the user to change their website files. This page serves as a placeholder until the user uploads their own content. ```HTML
Your account have been created successfully please change your website files using file manager or ftp
``` -------------------------------- ### Applying Custom cPanel Theme Stylesheets (HTML) Source: https://github.com/nxts-developers/project-hustal/blob/dev/SETUP.md This snippet provides CSS link tags to be added to cPanel's advertisement settings. These links point to custom stylesheet files and an icon spritemap, allowing for a custom visual theme for the cPanel interface. Replace 'yourdomain.com/template' with the actual company domain. ```HTML ``` -------------------------------- ### Configuring Project Hustal with PHP Define Statements Source: https://github.com/nxts-developers/project-hustal/blob/dev/README.md This PHP code snippet defines essential configuration constants for Project Hustal. It covers database connection parameters (DB_HOST, DB_USER, DB_PASS, DB_NAME), general site information (SITE_ADDR, SITE_NAME, SITE_EMAIL, SITE_PHONE, SITE_IP, AFF_ID), MOFH WHMCS API credentials (API_USER, API_PASS, API_PLAN), SMTP mail server settings (MAIL_PORT, MAIL_USER, MAIL_PASS, MAIL_HOST), and GoGetSSL API credentials (SSL_USERNAME, SSL_PASSWORD). These definitions are critical for the application's functionality, enabling database interaction, API calls, and email services. ```PHP // database information define('DB_HOST','Databse Hostname');// localhost define('DB_USER','Databse Username');// root define('DB_PASS','Database Password');// password define('DB_NAME','Database Name');// vhost // site info define('SITE_ADDR','Domain Name');// example.com define('SITE_NAME','Website Name');// Flexhost define('SITE_EMAIL','Website Email');// example@example.com define('SITE_PHONE','Website Phone Number');// +1 000 00000000 define('SITE_IP','185.27.134.46');// MOFH Server IP define('AFF_ID','Affiliate ID');// iFastNet Affiliate ID // API Settings define('API_USER','MOFH WHMCS API Username');// resellerpanel -> whmcs -> api define('API_PASS','MOFH WHMCS API Password');// resellerpanel -> whmcs -> api define('API_PLAN','MOFH Reseller Plan Name');// resellerpanel -> plans -> plan name // note: remember to add your server ip to reseller panel // Mail Settings define('MAIL_PORT','SMTP PORT');// 587 define('MAIL_USER','SMTP Username');// example@example.com define('MAIL_PASS','SMTP Password');// example123 define('MAIL_HOST','SMTP Host');// smtp.example.com // SSL Settings define('SSL_USERNAME',SSL API Username');// example@example.com define('SSL_PASSWORD','SSL API Password');// example123 ``` -------------------------------- ### Configuring Custom .htaccess Error Documents (ApacheConf) Source: https://github.com/nxts-developers/project-hustal/blob/dev/SETUP.md This snippet defines custom error pages for various HTTP status codes (400, 401, 403, 404, 503) using the 'ErrorDocument' directive in an .htaccess file. When a specified error occurs, the user will be redirected to the corresponding HTML page. Replace 'yourdomain.com' with the actual company domain. ```ApacheConf ErrorDocument 400 https://yourdomain.com/400.html ErrorDocument 401 https://yourdomain.com/401.html ErrorDocument 403 https://yourdomain.com/403.html ErrorDocument 404 https://yourdomain.com/404.html ErrorDocument 503 https://yourdomain.com/503.html ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.