Example #1
0
    if (Config::Get('DEBUG_MODE') == true) {
        DB::show_errors();
    } else {
        DB::hide_errors();
    }
    if (!DB::connect(DBASE_USER, DBASE_PASS, DBASE_NAME, DBASE_SERVER)) {
        Debug::showCritical(Lang::gs('database.connection.failed') . ' (' . DB::$errno . ': ' . DB::$error . ')');
        die;
    }
    # Set the charset type to send to mysql
    if (Config::Get('DB_CHARSET_NAME') !== '') {
        DB::query('SET NAMES \'' . Config::Get('DB_CHARSET_NAME') . '\'');
    }
    # Include ORM
    #include_once(VENDORS_PATH.DS.'orm'.DS.'idiorm.php');
    #include_once(VENDORS_PATH.DS.'orm'.DS.'paris.php');
    #ORM::configure('mysql:host='.DBASE_SERVER.';dbname='.DBASE_NAME);
    #ORM::configure('username', DBASE_USER);
    #ORM::configure('password', DBASE_PASS);
}
include CORE_PATH . DS . 'bootstrap.inc.php';
if (function_exists('pre_module_load')) {
    pre_module_load();
}
MainController::loadEngineTasks();
define('ACTIVE_SKIN_PATH', LIB_PATH . DS . 'skins' . DS . CURRENT_SKIN);
Template::setTemplatePath(TEMPLATES_PATH);
Template::setSkinPath(ACTIVE_SKIN_PATH);
if (function_exists('post_module_load')) {
    post_module_load();
}
Example #2
0
 *
 * @author Nabeel Shahzad
 * @copyright Copyright (c) 2008, Nabeel Shahzad
 * @link http://www.nsslive.net/codon
 * @license BSD License
 * @package codon_core
 */
/**
 * @author Nabeel Shahzad <www.phpvms.net>
 * @desc Handles AJAX calls
 */
define('ADMIN_PANEL', true);
include '../core/codon.config.php';
error_reporting(E_ALL ^ E_NOTICE);
if (!Auth::LoggedIn() && !PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) {
    Debug::showCritical('Unauthorized access!');
    die;
}
$tplname = Config::Get('ADMIN_SKIN');
if ($tplname == '') {
    $tplname = 'layout';
}
$settings_file = SITE_ROOT . '/admin/lib/' . $tplname . '/' . $tplname . '.php';
if (file_exists($settings_file)) {
    include $settings_file;
}
Template::setTemplatePath(dirname(__FILE__) . '/templates');
Template::setSkinPath(SITE_ROOT . '/admin/lib/' . $tplname);
MainController::runAllActions();
# Force connection close
DB::close();
Example #3
0
 *
 * @author Nabeel Shahzad
 * @copyright Copyright (c) 2008, Nabeel Shahzad
 * @link http://www.nsslive.net/codon
 * @license BSD License
 * @package codon_core
 */
/**
 *Package modifications made by David Clark (simpilotgroup)
 * git hub notated as phpvms5.5.x
 */
define('CODON_MODULES_PATH', dirname(__FILE__) . '/core/modules');
define('CODON_DEFAULT_MODULE', 'Frontpage');
include 'core/codon.config.php';
define('SKINS_PATH', LIB_PATH . DS . 'skins' . DS . CURRENT_SKIN);
Template::setSkinPath(SKINS_PATH);
if (Config::Get('XDEBUG_BENCHMARK')) {
    $memory_start = xdebug_memory_usage();
}
$BaseTemplate = new TemplateSet();
# Load the main skin
$settings_file = SKINS_PATH . DS . CURRENT_SKIN . '.php';
if (file_exists($settings_file)) {
    include $settings_file;
}
$BaseTemplate->template_path = SKINS_PATH;
$BaseTemplate->skin_path = SKINS_PATH;
Template::Set('MODULE_NAV_INC', $NAVBAR);
Template::Set('MODULE_HEAD_INC', $HTMLHead);
ob_start();
MainController::RunAllActions();
Example #4
0
if (!Auth::LoggedIn()) {
    Debug::showCritical('Please login first');
    die;
}
if (!PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) {
    Debug::showCritical('Unauthorized access');
    die;
}
$BaseTemplate = new TemplateSet();
$tplname = Config::Get('ADMIN_SKIN');
if ($tplname == '') {
    $tplname = 'layout';
}
//load the main skin
$settings_file = SITE_ROOT . 'admin' . DS . 'lib' . DS . $tplname . DS . $tplname . '.php';
if (file_exists($settings_file)) {
    include $settings_file;
}
Template::setTemplatePath(SITE_ROOT . 'admin' . DS . 'templates');
Template::setSkinPath(SITE_ROOT . 'admin' . DS . 'lib' . DS . $tplname);
$BaseTemplate->template_path = SITE_ROOT . 'admin' . DS . 'lib' . DS . $tplname;
$BaseTemplate->skin_path = SITE_ROOT . 'admin' . DS . 'lib' . DS . $tplname;
$BaseTemplate->Set('title', SITE_NAME);
Template::Set('MODULE_NAV_INC', $NAVBAR);
Template::Set('MODULE_HEAD_INC', $HTMLHead);
$BaseTemplate->Show('header.php');
flush();
MainController::runAllActions();
$BaseTemplate->Show('footer.php');
# Force connection close
DB::close();
Example #5
0
 /**
  * PilotAdmin::RejectPilot()
  * 
  * @return
  */
 protected function RejectPilot()
 {
     $pilot = PilotData::GetPilotData($this->post->id);
     # Send pilot notification
     $subject = Lang::gs('email.register.rejected.subject');
     $this->set('pilot', $pilot);
     $oldPath = Template::setTemplatePath(TEMPLATES_PATH);
     $oldSkinPath = Template::setSkinPath(ACTIVE_SKIN_PATH);
     $message = Template::Get('email_registrationdenied.tpl', true, true, true);
     Template::setTemplatePath($oldPath);
     Template::setSkinPath($oldSkinPath);
     Util::SendEmail($pilot->email, $subject, $message);
     # Reject in the end, since it's delted
     PilotData::RejectPilot($this->post->id);
     CodonEvent::Dispatch('pilot_rejected', 'PilotAdmin', $pilot);
     LogData::addLog(Auth::$userinfo->pilotid, 'Approved ' . PilotData::getPilotCode($pilot->code, $pilot->pilotid) . ' - ' . $pilot->firstname . ' ' . $pilot->lastname);
 }
 /**
  * RegistrationData::SendEmailConfirm()
  * 
  * @param mixed $email
  * @param mixed $firstname
  * @param mixed $lastname
  * @param string $newpw
  * @return void
  */
 public static function SendEmailConfirm($email, $firstname, $lastname, $newpw = '')
 {
     $confid = self::$salt;
     $subject = SITE_NAME . ' Registration';
     Template::Set('firstname', $firstname);
     Template::Set('lastname', $lastname);
     Template::Set('confid', $confid);
     $oldPath = Template::setTemplatePath(TEMPLATES_PATH);
     $oldSkinPath = Template::setSkinPath(ACTIVE_SKIN_PATH);
     $message = Template::getTemplate('email_registered.tpl', true, true, true);
     Template::setTemplatePath($oldPath);
     Template::setSkinPath($oldSkinPath);
     //email them the confirmation
     Util::sendEmail($email, $subject, $message);
 }