/** * Config File Creation Function. * This will create config file at inc/config/config.php during the installation * process. Data is gathered from the session. * * @author Puguh Wijayanto (www.metalgenix.com) * @since 0.0.1 */ public static function makeConfig($file) { $config = "<?php if(!defined('GX_LIB')) die(\"Direct Access Not Allowed!\");\n/**\n* GeniXCMS - Content Management System\n* \n* PHP Based Content Management System and Framework\n*\n* @package GeniXCMS\n* @since 0.0.1 build date 20140925\n* @version 0.0.6\n* @link https://github.com/semplon/GeniXCMS\n* @link http://genixcms.org\n* @author Puguh Wijayanto (www.metalgenix.com)\n* @copyright 2014-2015 Puguh Wijayanto\n* @license http://www.opensource.org/licenses/mit-license.php MIT\n*\n*/error_reporting(0);\n\n// DB CONFIG\ndefine('DB_HOST', '" . Session::val('dbhost') . "');\ndefine('DB_NAME', '" . Session::val('dbname') . "');\ndefine('DB_PASS', '" . Session::val('dbpass') . "');\ndefine('DB_USER', '" . Session::val('dbuser') . "');\ndefine('DB_DRIVER', 'mysqli');\n\ndefine('SMART_URL', false); //set 'true' if you want use SMART URL (SEO Friendly URL)\ndefine('GX_URL_PREFIX', '.html');\n\n\n\n\n\n\n\n\n// DON't REMOVE or EDIT THIS.\ndefine('SECURITY_KEY', '" . Typo::getToken(200) . "'); // for security purpose, will be used for creating password\n\n "; try { $f = fopen($file, "w"); $c = fwrite($f, $config); fclose($f); } catch (Exception $e) { echo $e->getMessage(); } return $config; }
} if (!Xaptcha::verify($_POST['g-recaptcha-response'])) { $alertred[] = "Your Captcha is not correct."; } } if (!User::is_exist($_POST['userid'])) { $alertred[] = MSG_USER_EXIST; } if (!User::is_same($_POST['pass1'], $_POST['pass1'])) { $alertred[] = MSG_USER_PWD_MISMATCH; } if (!User::is_email($_POST['email'])) { $alertred[] = MSG_USER_EMAIL_EXIST; } if (!isset($alertred)) { $activation = Typo::getToken(60); $vars = array('user' => array('userid' => Typo::cleanX(Typo::strip($_POST['userid'])), 'pass' => User::randpass($_POST['pass1']), 'email' => $_POST['email'], 'group' => '4', 'status' => '0', 'join_date' => date("Y-m-d H:i:s"), 'activation' => $activation), 'user_detail' => array('userid' => Typo::cleanX(Typo::strip($_POST['userid'])))); if (User::create($vars) === true) { $data['alertgreen'][] = REG_ACTIVATE_ACCOUNT; } else { $alertred[] = REG_CANT_CREATE_ACCOUNT; } $vars = array('to' => $_POST['email'], 'to_name' => $_POST['userid'], 'subject' => 'Account Activation Needed at ' . Site::$name, 'message' => ' Hi ' . $_POST['userid'] . ', Thank You for Registering with Us. Please activate your account by clicking this link : ' . Site::$url . '/register.php?activation=' . $activation . ' Sincerely, {$sitename} ', 'mailtype' => 'text');