function getbonus() { if (!is_logged()) { redirect(base_url()); } include APPPATH . "config/evote.php"; $this->data['title'] = lang('off_vote'); $text = icon('64x64/chart_up.png') . '<h2>Голосование на TOP EMUDEV</h2><p>После голосования нажмите получить бонус.</p>'; $char = (int) office_secure($this->input->post('char')); if ($char <= 0) { redirect('evote'); } $query = $this->MSSQL->query("SELECT Name FROM " . get_world() . ".dbo.tbl_base WHERE Serial='{$char}'"); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $char = preg_name($row->Name); } //for } else { redirect('evote'); } # Генерация полной ссылки текущего года/месяца $FullLink = $config['logfile'] . md5(date("Ym")) . '.txt'; # Получение данных статистики $data = file_get_contents($FullLink); # Разбитие данных в строки массива $rows = explode("\r\n", $data); $find = 0; for ($i = 0; $i < count($rows) - 1; $i++) { $row = explode("\t", $rows[$i]); if ($row[3] == '') { continue; } if ($row[3] == $char) { if (!$this->_id_exits($row[0])) { $find++; $text .= br(1) . icon('32x32/accept.png') . 'Бонус выдан'; if ($row[4] == 0) { $summ = $config['normal']; } else { $summ = $config['sms']; } bonus_add(Get_AccountSerial(), $summ); $this->_accepted($row); } } } //for if ($find == 0) { $text .= br(1) . icon('32x32/delete.png') . 'Голос не найден'; } $this->data['content'] = $text; compile(); }
function smskey() { if (!is_logged()) { redirect(base_url()); } $this->config->load('rf_sms', FALSE, TRUE); $this->data['title'] = lang('off_votesms'); $s_pair = office_secure(trim($this->input->post('s_pair'))); #http://rf.mmotop.ru/sms/2650/?s_pair=dds34fr&votes_charname=&votes_server=167 $link = config('link') . '?s_pair=' . $s_pair . '&votes_charname=&votes_server=' . config('vote_server'); $html_page = file_get_contents($link); $html_page = iconv('UTF-8', 'CP1251', $html_page); $pos = strpos($html_page, 'Ваш голос учтен'); if ($pos == TRUE) { bonus_add(Get_AccountSerial(), config('pay')); $this->data['content'] = icon('32x32/accept.png') . lang('off_votesms_ok'); log_in_history('Получены бонусы за SMS голосование'); } else { log_in_history('Неудачная попытка получения бонуса за SMS'); $this->data['content'] = icon('32x32/delete.png') . lang('off_votesms_err') . go_back(); } compile(); }
function check() { $this->load->library('validation'); // получем данные $login = office_secure(xss_clean($this->input->post('login'))); $id = office_secure(xss_clean($this->input->post('id'))); $password = office_secure(xss_clean($this->input->post('password'))); $email = office_secure(xss_clean($this->input->post('email'))); $part = office_secure(xss_clean($this->input->post('part'))); $secure = office_secure(xss_clean($this->input->post('secure'))); $stop = array(); // начинаем проверки if (!$this->validation->required($login)) { $stop[] = lang('off_reg_login_check'); } if (!$this->validation->required($password)) { $stop[] = lang('off_reg_pass_chk'); } if ($this->validation->alpha($password)) { $stop[] = lang('off_reg_pass_range'); } if (!$this->validation->valid_email($email)) { $stop[] = lang('off_reg_email'); } $sec_code_session = $this->session->userdata('sec_code_session'); //fix at 03.10.2011 if (preg_match("/[^0-9a-zA-Z_-]/", $login)) { $stop[] = lang('off_useletters'); } if (preg_match("/[^0-9a-zA-Z_-]/", $password)) { $stop[] = lang('off_useletters'); } if ($sec_code_session) { if ($sec_code_session != md5($secure)) { $stop[] = lang('off_reg_captha'); } } else { if ($_SESSION['sec_code_session'] != md5($secure)) { $stop[] = lang('off_reg_captha'); } } if (!$this->validation->valid_ip($this->session->userdata('ip_address'))) { $stop[] = lang('off_reg_chkip'); } if ($login === $password) { $stop[] = lang('off_reg_chk_logpass'); } if (count($stop) == 0) { $user = get_user(); // проверка на логин $query = $this->MSSQL->query("SELECT * FROM {$user}.dbo." . query_config('table_account') . " WHERE id = '{$login}'"); if ($query->num_rows() > 0) { $stop[] = lang('off_reg_loginuse'); } // проверка на мыло $query = $this->MSSQL->query("SELECT * FROM {$user}.dbo." . query_config('table_account') . " WHERE Email = '{$email}'"); if ($query->num_rows() > 0) { $stop[] = lang('off_reg_emailuse'); } // проверка на пароль $query = $this->MSSQL->query("SELECT * FROM {$user}.dbo." . query_config('table_account') . " WHERE password = '******'"); if ($query->num_rows() > 0) { $stop[] = lang('off_reg_passuse'); } // завершение реги if (count($stop) == 0) { // регистрация $this->config->load('core', FALSE, TRUE); $register = query_config('query_register'); $this->MSSQL->query($register, array($login, $password, $email)); var_dump($this); $result = $this->MSSQL->query("SELECT SCOPE_IDENTITY() AS [SCOPE_IDENTITY]"); var_dump($result); exit; $this->config->load('rf_settings', FALSE, TRUE); if ($id != '') { bonus_add($id, $this->config->item('REF_BONUS')); } elseif ($part != '') { bonus_add(GetASerialFromName($part), $this->config->item('REF_BONUS')); } $this->data['content'] = icon('48x48/image_accept.png') . lang('off_reg_comp') . go_back(); // не прошли проверки } else { $this->data['content'] = heading(icon('48x48/delete_image.png') . lang('off_reg_error'), 4) . ul($stop) . go_back('', true); } } else { $this->data['content'] = heading(icon('48x48/delete_image.png') . lang('off_reg_error'), 4) . ul($stop) . go_back('', true); } compile(); }
function page($page = '') { $page = office_secure($page); if (!file_exists(APPPATH . 'views/static/' . $page . '.php')) { $page = 'index'; } $this->data['title'] = 'Static Pages'; $this->data['content'] = $this->parser->parse('static/' . $page, array('title' => 'Static'), true); compile(); }
function _chararray($login = '') { $char = array(); $login = preg_name(office_secure($login)); $query = $this->MSSQL->query("SELECT Serial,Name FROM " . get_world() . ".dbo.tbl_base WHERE Account='{$login}' AND DCK=0"); if ($query->num_rows() > 0) { foreach ($query->result() as $row) { $char[$row->Serial] = $row->Name; } //for } else { return false; } //if return $char; }