Ejemplo n.º 1
0
 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();
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 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();
 }
Ejemplo n.º 4
0
 function getbonus()
 {
     // проверка авторизации
     if (!is_logged()) {
         redirect(base_url());
     }
     include APPPATH . "config/mmotop.php";
     $this->data['title'] = lang('off_vote');
     $text = icon('64x64/chart_up.png') . '<p>ќбработка голосов длитс¤ от 30 минут до 2 часов, только по прошествию этого времени вы можете получить свой бонус.</p>';
     $text .= '<a href="' . $config['votelink'] . '" target="_blank">√олосовать</a>' . icon('32x32/comment.png') . br(1);
     $text .= anchor('mmotop/getbonus/', 'получить бонус') . icon('32x32/note_accept.png');
     //  скачивание лога
     if (!($all_data = $this->cache->load('mmotop', 'file', 60 * 30))) {
         $all_data = @file_get_contents($config['logfile']);
         $this->cache->save($all_data, 'mmotop', 'file');
     }
     if (date('Ymd') == date('Ym') . '01') {
         $this->data['content'] = '—егодн¤ нельз¤ получить бонус, идЄт обработка логов. ѕопробуйте завтра.';
         compile();
     }
     //fix
     $aChars = $this->_chararray(get_login());
     $rows = explode("\n", $all_data);
     $find = 0;
     // обработка строк
     for ($i = 0; $i < count($rows); $i++) {
         $rows[$i] = @iconv('UTF-8', 'CP1251', $rows[$i]);
         $row = explode("\t", $rows[$i]);
         if (count($row) != 5) {
             continue;
         }
         if ($row[3] == '') {
             continue;
         }
         // нет ника
         //check time
         $unix_time = strtotime($row[1]);
         $time_left = time() - $unix_time;
         $days = round($time_left / 60 / 60 / 24);
         if ($days > 20) {
             continue;
         }
         //check time
         if ($row[3] == preg_name(get_login())) {
             // найден логин
             if (!$this->_id_exits($row[0], 0)) {
                 // просмотр записи в базе
                 $find++;
                 $text .= br(1) . icon('32x32/accept.png') . 'бонус выдан';
                 if ($row[4] == 1) {
                     $summ = $config['normal'];
                 } else {
                     $summ = $config['sms'];
                 }
                 $bonus = $summ * (premium_bonus() / 100);
                 $bold = bonus_show(Get_AccountSerial());
                 bonus_add(Get_AccountSerial(), $summ + $bonus);
                 $bnow = bonus_show(Get_AccountSerial());
                 file_put_contents(APPPATH . 'mmotop.log', "add bonus for {$row['3']}, have {$bold} now have {$bnow}\r\n", FILE_APPEND);
                 $this->_accepted($row, 0);
             } else {
                 $text .= br(1) . icon('32x32/block.png') . 'бонус был выдан раньше ' . $row[1];
             }
         } elseif (is_array($aChars) && @in_array($row[3], $aChars)) {
             if (!$this->_id_exits($row[0], 0) && $this->_checkname(office_secure($row[3]))) {
                 $find++;
                 $text .= br(1) . icon('32x32/accept.png') . 'бонус выдан';
                 if ($row[4] == 1) {
                     $summ = $config['normal'];
                 } else {
                     $summ = $config['sms'];
                 }
                 $bonus = $summ * (premium_bonus() / 100);
                 $bold = bonus_show(Get_AccountSerial());
                 bonus_add(Get_AccountSerial(), $summ + $bonus);
                 $bnow = bonus_show(Get_AccountSerial());
                 file_put_contents(APPPATH . 'mmotop.log', "add bonus for {$row['3']}, have {$bold} now have {$bnow}\r\n", FILE_APPEND);
                 $this->_accepted($row, 0);
             }
         }
     }
     //for
     if ($find == 0) {
         $text .= br(1) . icon('32x32/delete.png') . '√олос не найден';
     }
     $this->data['content'] = $text;
     //.br(2).icon('32x32/sms.png').anchor('vote/sms',lang('off_vote_sms'));;
     compile();
 }