Ejemplo n.º 1
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     $parse = $this->_lang;
     $modules_array = '';
     $modules_count = count(explode(';', FunctionsLib::read_config('modules')));
     $row_template = parent::$page->get_template('adm/modules_row_view');
     $module_rows = '';
     $parse['alert'] = '';
     // SAVE PAGE
     if ($_SERVER['REQUEST_METHOD'] == 'POST' && $_POST['save']) {
         for ($i = 0; $i <= $modules_count - 2; $i++) {
             $modules_array .= (isset($_POST["status{$i}"]) ? 1 : 0) . ';';
         }
         FunctionsLib::update_config('modules', $modules_array);
         $parse['alert'] = AdministrationLib::save_message('ok', $this->_lang['se_all_ok_message']);
     }
     // SHOW PAGE
     $modules_array = explode(';', FunctionsLib::read_config('modules'));
     foreach ($modules_array as $module => $status) {
         if ($status != NULL) {
             $parse['module'] = $module;
             $parse['module_name'] = $this->_lang['module'][$module];
             $parse['module_value'] = $status == 1 ? 'checked' : '';
             $parse['color'] = $status == 1 ? 'text-success' : 'text-error';
             $module_rows .= parent::$page->parse_template($row_template, $parse);
         }
     }
     $parse['module_rows'] = $module_rows;
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template("adm/modules_view"), $parse));
 }
Ejemplo n.º 2
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     $parse = $this->_lang;
     $parse['alert'] = '';
     $error = '';
     if (isset($_POST['save'])) {
         if (isset($_POST['premium_url']) && !empty($_POST['premium_url'])) {
             FunctionsLib::update_config('premium_url', FunctionsLib::prep_url($_POST['premium_url']));
         } else {
             $error .= $this->_lang['pr_error_url'];
         }
         if (isset($_POST['trader_darkmatter']) && $_POST['trader_darkmatter'] > 0) {
             FunctionsLib::update_config('trader_darkmatter', $_POST['trader_darkmatter']);
         } else {
             $error .= $this->_lang['pr_error_trader'];
         }
         if ($error != '') {
             $parse['alert'] = AdministrationLib::save_message('warning', $error);
         } else {
             $parse['alert'] = AdministrationLib::save_message('ok', $this->_lang['pr_all_ok_message']);
         }
     }
     $parse['premium_url'] = FunctionsLib::read_config('premium_url');
     $parse['trader_darkmatter'] = FunctionsLib::read_config('trader_darkmatter');
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('adm/premium_view'), $parse));
 }
Ejemplo n.º 3
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     // RUN STATISTICS SCRIPT AND THE SET THE RESULT
     $result = StatisticsLib::make_stats();
     // PREPARE DATA TO PARSE
     $parse = $this->_lang;
     $parse['memory_p'] = str_replace(array("%p", "%m"), $result['memory_peak'], $this->_lang['sb_top_memory']);
     $parse['memory_e'] = str_replace(array("%e", "%m"), $result['end_memory'], $this->_lang['sb_final_memory']);
     $parse['memory_i'] = str_replace(array("%i", "%m"), $result['initial_memory'], $this->_lang['sb_start_memory']);
     $parse['alert'] = AdministrationLib::save_message('ok', str_replace("%t", $result['totaltime'], $this->_lang['sb_stats_update']));
     // UPDATE STATISTICS LAST UPDATE
     FunctionsLib::update_config('stat_last_update', $result['stats_time']);
     // SHOW TEMPLATE
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('adm/buildstats_view'), $parse));
 }
Ejemplo n.º 4
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     $parse = $this->_lang;
     $parse['alert'] = '';
     if (isset($_POST['opt_save']) && $_POST['opt_save'] == '1') {
         // CHECK BEFORE SAVE
         $this->run_validations();
         FunctionsLib::update_config('reg_enable', $this->_game_config['reg_enable']);
         FunctionsLib::update_config('reg_welcome_message', $this->_game_config['reg_welcome_message']);
         FunctionsLib::update_config('reg_welcome_email', $this->_game_config['reg_welcome_email']);
         $parse['alert'] = AdministrationLib::save_message('ok', $this->_lang['ur_all_ok_message']);
     }
     $parse['reg_closed'] = $this->_game_config['reg_enable'] == 1 ? " checked = 'checked' " : "";
     $parse['reg_welcome_message'] = $this->_game_config['reg_welcome_message'] == 1 ? " checked = 'checked' " : "";
     $parse['reg_welcome_email'] = $this->_game_config['reg_welcome_email'] == 1 ? " checked = 'checked' " : "";
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('adm/registration_view'), $parse));
 }
Ejemplo n.º 5
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     $parse = $this->_lang;
     $parse['alert'] = '';
     if (isset($_POST['opt_save']) && $_POST['opt_save'] == '1') {
         // CHECK BEFORE SAVE
         $this->run_validations();
         FunctionsLib::update_config('initial_fields', $this->_game_config['initial_fields']);
         FunctionsLib::update_config('metal_basic_income', $this->_game_config['metal_basic_income']);
         FunctionsLib::update_config('crystal_basic_income', $this->_game_config['crystal_basic_income']);
         FunctionsLib::update_config('deuterium_basic_income', $this->_game_config['deuterium_basic_income']);
         FunctionsLib::update_config('energy_basic_income', $this->_game_config['energy_basic_income']);
         $parse['alert'] = AdministrationLib::save_message('ok', $this->_lang['np_all_ok_message']);
     }
     $parse['initial_fields'] = $this->_game_config['initial_fields'];
     $parse['metal_basic_income'] = $this->_game_config['metal_basic_income'];
     $parse['crystal_basic_income'] = $this->_game_config['crystal_basic_income'];
     $parse['deuterium_basic_income'] = $this->_game_config['deuterium_basic_income'];
     $parse['energy_basic_income'] = $this->_game_config['energy_basic_income'];
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('adm/planets_view'), $parse));
 }
Ejemplo n.º 6
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     $parse = $this->_lang;
     // ON POST
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         // SAVE DATA
         if (isset($_POST['save']) && $_POST['save']) {
             FunctionsLib::update_config('auto_backup', isset($_POST['auto_backup']) && $_POST['auto_backup'] == 'on' ? 1 : 0);
         }
         // BACKUP DATABASE RIGHT NOW
         if (isset($_POST['backup']) && $_POST['backup']) {
             $result = parent::$db->backupDb();
             if ($result != FALSE) {
                 $parse['alert'] = AdministrationLib::save_message('ok', str_replace('%s', round($result / 1024, 2), $this->_lang['bku_backup_done']));
             }
         }
     }
     // PARSE DATA
     $auto_backup_status = FunctionsLib::read_config('auto_backup');
     $parse['color'] = $auto_backup_status == 1 ? 'text-success' : 'text-error';
     $parse['checked'] = $auto_backup_status == 1 ? 'checked' : '';
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template("adm/backup_view"), $parse));
 }
Ejemplo n.º 7
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     $parse = $this->_lang;
     $parse['alert'] = '';
     if (isset($_POST['opt_save']) && $_POST['opt_save'] == '1') {
         // CHECK BEFORE SAVE
         $this->run_validations();
         FunctionsLib::update_config('game_name', $this->_game_config['game_name']);
         FunctionsLib::update_config('game_logo', $this->_game_config['game_logo']);
         FunctionsLib::update_config('lang', $this->_game_config['lang']);
         FunctionsLib::update_config('game_speed', $this->_game_config['game_speed']);
         FunctionsLib::update_config('fleet_speed', $this->_game_config['fleet_speed']);
         FunctionsLib::update_config('resource_multiplier', $this->_game_config['resource_multiplier']);
         FunctionsLib::update_config('admin_email', $this->_game_config['admin_email']);
         FunctionsLib::update_config('forum_url', $this->_game_config['forum_url']);
         FunctionsLib::update_config('reg_enable', $this->_game_config['reg_enable']);
         FunctionsLib::update_config('game_enable', $this->_game_config['game_enable']);
         FunctionsLib::update_config('close_reason', $this->_game_config['close_reason']);
         FunctionsLib::update_config('ssl_enabled', $this->_game_config['ssl_enabled']);
         FunctionsLib::update_config('date_time_zone', $this->_game_config['date_time_zone']);
         FunctionsLib::update_config('date_format', $this->_game_config['date_format']);
         FunctionsLib::update_config('date_format_extended', $this->_game_config['date_format_extended']);
         FunctionsLib::update_config('adm_attack', $this->_game_config['adm_attack']);
         FunctionsLib::update_config('debug', $this->_game_config['debug']);
         FunctionsLib::update_config('fleet_cdr', $this->_game_config['fleet_cdr']);
         FunctionsLib::update_config('defs_cdr', $this->_game_config['defs_cdr']);
         FunctionsLib::update_config('noobprotection', $this->_game_config['noobprotection']);
         FunctionsLib::update_config('noobprotectiontime', $this->_game_config['noobprotectiontime']);
         FunctionsLib::update_config('noobprotectionmulti', $this->_game_config['noobprotectionmulti']);
         $parse['alert'] = AdministrationLib::save_message('ok', $this->_lang['se_all_ok_message']);
     }
     $parse['game_name'] = $this->_game_config['game_name'];
     $parse['game_logo'] = $this->_game_config['game_logo'];
     $parse['language_settings'] = FunctionsLib::get_languages($this->_game_config['lang']);
     $parse['game_speed'] = $this->_game_config['game_speed'] / 2500;
     $parse['fleet_speed'] = $this->_game_config['fleet_speed'] / 2500;
     $parse['resource_multiplier'] = $this->_game_config['resource_multiplier'];
     $parse['admin_email'] = $this->_game_config['admin_email'];
     $parse['forum_url'] = $this->_game_config['forum_url'];
     $parse['closed'] = $this->_game_config['game_enable'] == 1 ? " checked = 'checked' " : "";
     $parse['close_reason'] = stripslashes($this->_game_config['close_reason']);
     $parse['ssl_enabled'] = $this->_game_config['ssl_enabled'] == 1 ? " checked = 'checked' " : "";
     $parse['date_time_zone'] = $this->time_zone_picker();
     $parse['date_format'] = $this->_game_config['date_format'];
     $parse['date_format_extended'] = $this->_game_config['date_format_extended'];
     $parse['adm_attack'] = $this->_game_config['adm_attack'] == 1 ? " checked = 'checked' " : "";
     $parse['debug'] = $this->_game_config['debug'] == 1 ? " checked = 'checked' " : "";
     $parse['shiips'] = $this->_game_config['fleet_cdr'];
     $parse['defenses'] = $this->_game_config['defs_cdr'];
     $parse['noobprot'] = $this->_game_config['noobprotection'] == 1 ? " checked = 'checked' " : "";
     $parse['noobprot2'] = $this->_game_config['noobprotectiontime'];
     $parse['noobprot3'] = $this->_game_config['noobprotectionmulti'];
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('adm/server_view'), $parse));
 }
Ejemplo n.º 8
0
 /**
  * @method createAccount
  * @return negative value if an error ocurred, or 0 if admin account was successfully created
  *          -1: Some field is empty
  *          -2: Admin email is invalid
  */
 private function createAccount()
 {
     // validations
     if (empty($_POST['adm_user']) || empty($_POST['adm_pass']) || empty($_POST['adm_email'])) {
         return -1;
     }
     if (!FunctionsLib::valid_email($_POST['adm_email'])) {
         return -2;
     }
     // some default values
     $adm_name = parent::$db->escapeValue($_POST['adm_user']);
     $adm_email = parent::$db->escapeValue($_POST['adm_email']);
     $adm_pass = sha1($_POST['adm_pass']);
     // a bunch of of queries :/
     parent::$db->query("INSERT INTO " . USERS . " SET\n            `user_id` = '1',\n            `user_name` = '" . $adm_name . "',\n            `user_email` = '" . $adm_email . "',\n            `user_email_permanent` = '" . $adm_email . "',\n            `user_ip_at_reg` = '" . $_SERVER['REMOTE_ADDR'] . "',\n            `user_agent` = '',\n            `user_authlevel` = '3',\n            `user_home_planet_id` = '1',\n            `user_galaxy` = '1',\n            `user_system` = '1',\n            `user_planet` = '1',\n            `user_current_planet` = '1',\n            `user_register_time` = '" . time() . "',\n            `user_password` = '" . $adm_pass . "';");
     $this->_planet->createPlanetWithOptions(array('planet_user_id' => 1, 'planet_name' => $adm_name, 'planet_galaxy' => 1, 'planet_system' => 1, 'planet_planet' => 1, 'planet_last_update' => time(), 'planet_metal' => 500, 'planet_crystal' => 500, 'planet_deuterium' => 0));
     parent::$db->query("INSERT INTO " . RESEARCH . " SET `research_user_id` = '1';");
     parent::$db->query("INSERT INTO " . USERS_STATISTICS . " SET `user_statistic_user_id` = '1';");
     parent::$db->query("INSERT INTO " . PREMIUM . " SET `premium_user_id` = '1';");
     parent::$db->query("INSERT INTO " . SETTINGS . " SET `setting_user_id` = '1';");
     parent::$db->query("INSERT INTO " . BUILDINGS . " SET `building_planet_id` = '1';");
     parent::$db->query("INSERT INTO " . DEFENSES . " SET `defense_planet_id` = '1';");
     parent::$db->query("INSERT INTO " . SHIPS . " SET `ship_planet_id` = '1';");
     // write the new admin email for support and debugging
     FunctionsLib::update_config('admin_email', $adm_email);
     return true;
 }
Ejemplo n.º 9
0
 /**
  * updateStatistics
  *
  * @return void
  */
 private function updateStatistics()
 {
     // LAST UPDATE AND UPDATE INTERVAL, EX: 15 MINUTES
     $stat_last_update = FunctionsLib::read_config('stat_last_update');
     $update_interval = FunctionsLib::read_config('stat_update_time');
     if (time() >= $stat_last_update + 60 * $update_interval) {
         $result = StatisticsLib::make_stats();
         FunctionsLib::update_config('stat_last_update', $result['stats_time']);
     }
 }
Ejemplo n.º 10
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     $parse = $this->_lang;
     $parse['alert'] = '';
     if (isset($_POST['mode']) && $_POST['mode']) {
         $view_m = isset($_POST['view_m']) ? $this->set_rank($_POST['view_m']) : '';
         $edit_m = isset($_POST['edit_m']) ? $this->set_rank($_POST['edit_m']) : '';
         $config_m = isset($_POST['config_m']) ? $this->set_rank($_POST['config_m']) : '';
         $tools_m = isset($_POST['tools_m']) ? $this->set_rank($_POST['tools_m']) : '';
         $log_m = isset($_POST['log_m']) ? $this->set_rank($_POST['log_m']) : '';
         $maintenance_m = isset($_POST['maintenance_m']) ? $this->set_rank($_POST['maintenance_m']) : '';
         $view_o = isset($_POST['view_o']) ? $this->set_rank($_POST['view_o']) : '';
         $edit_o = isset($_POST['edit_o']) ? $this->set_rank($_POST['edit_o']) : '';
         $config_o = isset($_POST['config_o']) ? $this->set_rank($_POST['config_o']) : '';
         $tools_o = isset($_POST['tools_o']) ? $this->set_rank($_POST['tools_o']) : '';
         $log_o = isset($_POST['log_o']) ? $this->set_rank($_POST['log_o']) : '';
         $maintenance_o = isset($_POST['maintenance_o']) ? $this->set_rank($_POST['maintenance_o']) : '';
         $log_a = isset($_POST['log_a']) ? $this->set_rank($_POST['log_a']) : '';
         $QueryEdit = $view_m . "," . $edit_m . "," . $config_m . "," . $tools_m . "," . $log_m . "," . $maintenance_m . ";" . $view_o . "," . $edit_o . "," . $config_o . "," . $tools_o . "," . $log_o . "," . $maintenance_o . ";" . $log_a . ";";
         FunctionsLib::update_config('moderation', $QueryEdit);
         $parse['alert'] = AdministrationLib::save_message('ok', $this->_lang['mod_all_ok_message']);
     }
     $QueryModeration = FunctionsLib::read_config('moderation');
     $QueryModerationEx = explode(";", $QueryModeration);
     $Moderator = explode(",", $QueryModerationEx[0]);
     $Operator = explode(",", $QueryModerationEx[1]);
     $Administrator = explode(",", $QueryModerationEx[2]);
     // MODERADORES
     if ($Moderator[0] == 1) {
         $parse['view_m'] = 'checked = "checked"';
     }
     if ($Moderator[1] == 1) {
         $parse['edit_m'] = 'checked = "checked"';
     }
     if ($Moderator[2] == 1) {
         $parse['config_m'] = 'checked = "checked"';
     }
     if ($Moderator[3] == 1) {
         $parse['tools_m'] = 'checked = "checked"';
     }
     if ($Moderator[4] == 1) {
         $parse['log_m'] = 'checked = "checked"';
     }
     if ($Moderator[5] == 1) {
         $parse['maintenance_m'] = 'checked = "checked"';
     }
     // OPERADORES
     if ($Operator[0] == 1) {
         $parse['view_o'] = 'checked = "checked"';
     }
     if ($Operator[1] == 1) {
         $parse['edit_o'] = 'checked = "checked"';
     }
     if ($Operator[2] == 1) {
         $parse['config_o'] = 'checked = "checked"';
     }
     if ($Operator[3] == 1) {
         $parse['tools_o'] = 'checked = "checked"';
     }
     if ($Operator[4] == 1) {
         $parse['log_o'] = 'checked = "checked"';
     }
     if ($Operator[5] == 1) {
         $parse['maintenance_o'] = 'checked = "checked"';
     }
     // ADMINISTRADOR (SOLO PARA EL HISTORIAL)
     if ($Administrator[0] == 1) {
         $parse['log_a'] = 'checked = "checked"';
     }
     $parse['mods'] = $this->_lang['user_level'][1];
     $parse['oper'] = $this->_lang['user_level'][2];
     $parse['adm'] = $this->_lang['user_level'][3];
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('adm/moderation_view'), $parse));
 }
Ejemplo n.º 11
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     if ($_POST) {
         if (!$this->run_validations()) {
             FunctionsLib::redirect('index.php');
         } else {
             $user_password = $_POST['password'];
             $user_name = $_POST['character'];
             $user_email = $_POST['email'];
             $hashed_password = sha1($user_password);
             parent::$db->query("INSERT INTO " . USERS . " SET\n\t\t\t\t\t\t\t\t\t\t`user_name` = '" . parent::$db->escapeValue(strip_tags($user_name)) . "',\n\t\t\t\t\t\t\t\t\t\t`user_email` = '" . parent::$db->escapeValue($user_email) . "',\n\t\t\t\t\t\t\t\t\t\t`user_email_permanent` = '" . parent::$db->escapeValue($user_email) . "',\n\t\t\t\t\t\t\t\t\t\t`user_ip_at_reg` = '" . $_SERVER['REMOTE_ADDR'] . "',\n\t\t\t\t\t\t\t\t\t\t`user_agent` = '" . $_SERVER['HTTP_USER_AGENT'] . "',\n\t\t\t\t\t\t\t\t\t\t`user_home_planet_id` = '0',\n\t\t\t\t\t\t\t\t\t\t`user_register_time` = '" . time() . "',\n\t\t\t\t\t\t\t\t\t\t`user_password`='" . $hashed_password . "';");
             $user_id = parent::$db->insertId();
             parent::$db->query("INSERT INTO " . RESEARCH . " SET\n\t\t\t\t\t\t\t\t\t\t`research_user_id` = '" . $user_id . "';");
             parent::$db->query("INSERT INTO " . USERS_STATISTICS . " SET\n\t\t\t\t\t\t\t\t\t\t`user_statistic_user_id` = '" . $user_id . "';");
             parent::$db->query("INSERT INTO " . PREMIUM . " SET\n\t\t\t\t\t\t\t\t\t\t`premium_user_id` = '" . $user_id . "';");
             parent::$db->query("INSERT INTO " . SETTINGS . " SET\n\t\t\t\t\t\t\t\t\t\t`setting_user_id` = '" . $user_id . "';");
             $last_galaxy = FunctionsLib::read_config('lastsettedgalaxypos');
             $last_system = FunctionsLib::read_config('lastsettedsystempos');
             $last_planet = FunctionsLib::read_config('lastsettedplanetpos');
             while (!isset($newpos_checked)) {
                 for ($galaxy = $last_galaxy; $galaxy <= MAX_GALAXY_IN_WORLD; $galaxy++) {
                     for ($system = $last_system; $system <= MAX_SYSTEM_IN_GALAXY; $system++) {
                         for ($pos = $last_planet; $pos <= 4; $pos++) {
                             $planet = round(mt_rand(4, 12));
                             switch ($last_planet) {
                                 case 1:
                                     $last_planet += 1;
                                     break;
                                 case 2:
                                     $last_planet += 1;
                                     break;
                                 case 3:
                                     if ($last_system == MAX_SYSTEM_IN_GALAXY) {
                                         $last_galaxy += 1;
                                         $last_system = 1;
                                         $last_planet = 1;
                                         break;
                                     } else {
                                         $last_planet = 1;
                                     }
                                     $last_system += 1;
                                     break;
                             }
                             break;
                         }
                         break;
                     }
                     break;
                 }
                 $planet_row = parent::$db->queryFetch("SELECT *\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM " . PLANETS . "\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `planet_galaxy` = '" . $galaxy . "' AND\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`planet_system` = '" . $system . "' AND\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t`planet_planet` = '" . $planet . "' LIMIT 1;");
                 if ($planet_row['id'] == '0') {
                     $newpos_checked = TRUE;
                 }
                 if (!$planet_row) {
                     $this->_creator->create_planet($galaxy, $system, $planet, $user_id, '', TRUE);
                     $newpos_checked = TRUE;
                 }
                 if ($newpos_checked) {
                     FunctionsLib::update_config('lastsettedgalaxypos', $last_galaxy);
                     FunctionsLib::update_config('lastsettedsystempos', $last_system);
                     FunctionsLib::update_config('lastsettedplanetpos', $last_planet);
                 }
             }
             parent::$db->query("UPDATE " . USERS . " SET\n\t\t\t\t\t\t\t\t\t\t`user_home_planet_id` = (SELECT `planet_id` FROM " . PLANETS . " WHERE `planet_user_id` = '" . $user_id . "' LIMIT 1),\n\t\t\t\t\t\t\t\t\t\t`user_current_planet` = (SELECT `planet_id` FROM " . PLANETS . " WHERE `planet_user_id` = '" . $user_id . "' LIMIT 1),\n\t\t\t\t\t\t\t\t\t\t`user_galaxy` = '" . $galaxy . "',\n\t\t\t\t\t\t\t\t\t\t`user_system` = '" . $system . "',\n\t\t\t\t\t\t\t\t\t\t`user_planet` = '" . $planet . "'\n\t\t\t\t\t\t\t\t\t\t WHERE `user_id` = '" . $user_id . "' LIMIT 1;");
             $from = $this->_lang['re_welcome_message_from'];
             $subject = $this->_lang['re_welcome_message_subject'];
             $message = str_replace('%s', $user_name, $this->_lang['re_welcome_message_content']);
             // Send Welcome Message to the user if the feature is enabled
             if (FunctionsLib::read_config('reg_welcome_message')) {
                 FunctionsLib::send_message($user_id, 0, '', 5, $from, $subject, $message);
             }
             // Send Welcome Email to the user if the feature is enabled
             if (FunctionsLib::read_config('reg_welcome_email')) {
                 $this->send_pass_email($user_email, $user_name, $user_password);
             }
             // User login
             if (parent::$users->user_login($user_id, $user_name, $hashed_password)) {
                 // Redirect to game
                 FunctionsLib::redirect('game.php?page=overview');
             }
         }
     }
     // If login fails
     FunctionsLib::redirect('index.php');
 }
Ejemplo n.º 12
0
 /**
  * method build_page
  * param
  * return main method, loads everything
  */
 private function build_page()
 {
     $game_stat = FunctionsLib::read_config('stat');
     $game_stat_level = FunctionsLib::read_config('stat_level');
     $game_stat_settings = FunctionsLib::read_config('stat_settings');
     $game_stat_update_time = FunctionsLib::read_config('stat_update_time');
     $this->_lang['alert'] = '';
     if (isset($_POST['save']) && $_POST['save'] == $this->_lang['cs_save_changes']) {
         if (isset($_POST['stat']) && $_POST['stat'] != $game_stat) {
             FunctionsLib::update_config('stat', $_POST['stat']);
             $game_stat = $_POST['stat'];
             $ASD3 = $_POST['stat'];
         }
         if (isset($_POST['stat_level']) && is_numeric($_POST['stat_level']) && $_POST['stat_level'] != $game_stat_level) {
             FunctionsLib::update_config('stat_level', $_POST['stat_level']);
             $game_stat_level = $_POST['stat_level'];
             $ASD1 = $_POST['stat_level'];
         }
         if (isset($_POST['stat_settings']) && is_numeric($_POST['stat_settings']) && $_POST['stat_settings'] != $game_stat_settings) {
             FunctionsLib::update_config('stat_settings', $_POST['stat_settings']);
             $game_stat_settings = $_POST['stat_settings'];
         }
         if (isset($_POST['stat_update_time']) && is_numeric($_POST['stat_update_time']) && $_POST['stat_update_time'] != $game_stat_update_time) {
             FunctionsLib::update_config('stat_update_time', $_POST['stat_update_time']);
             $game_stat_update_time = $_POST['stat_update_time'];
         }
         $this->_lang['alert'] = AdministrationLib::save_message('ok', $this->_lang['cs_all_ok_message']);
     }
     $selected = "selected=\"selected\"";
     $stat = $game_stat == 1 ? 'sel_sta1' : 'sel_sta0';
     $this->_lang[$stat] = $selected;
     $this->_lang['stat_level'] = $game_stat_level;
     $this->_lang['stat_settings'] = $game_stat_settings;
     $this->_lang['stat_update_time'] = $game_stat_update_time;
     $this->_lang['yes'] = $this->_lang['cs_yes'][1];
     $this->_lang['no'] = $this->_lang['cs_no'][0];
     parent::$page->display(parent::$page->parse_template(parent::$page->get_template('adm/statistics_view'), $this->_lang));
 }