Example #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();
 }
Example #2
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();
 }
Example #3
0
    function lost2()
    {
        $this->load->library('validation');
        $this->load->library('email');
        $rules['login'] = "******";
        $rules['email'] = "required|valid_email";
        $this->validation->set_rules($rules);
        $fields['login'] = lang('off_main_login');
        $fields['email'] = lang('off_acc_email');
        $this->validation->set_fields($fields);
        if ($this->validation->run() == FALSE) {
            $this->table->set_template(tpl_table());
            $this->table->add_row(lang('off_main_login'), form_input('login'));
            $this->table->add_row(lang('off_acc_email'), form_input('email'));
            $this->table->add_row(form_submit('mysubmit', lang('off_lostbtn')), '');
            $text = '
	    <div align="center">' . $this->validation->error_string . heading(icon('64x64/lock.png') . lang('off_lostmastertitle'), 3) . form_open('main_index/lost2') . $this->table->generate() . '</form></div>' . anchor("main_index/lost", lang('off_lostemail'));
            $this->data['content'] = $text;
        } else {
            $login = office_secure(trim($this->input->post('login', true)));
            $email = office_secure(trim($this->input->post('email', true)));
            if ($this->login_is_exit($login, $email)) {
                $this->data['content'] = lang('off_emailsend');
                include APPPATH . 'config/mail.php';
                $this->email->initialize($config);
                $PWD = $this->login_is_exit($login, $email);
                $FGPWD = $this->get_FGPWD($login);
                $this->email->from('*****@*****.**', 'Lost Password');
                $this->email->to($email);
                $name = gen_name_profile(Get_AccountSerial($login));
                $this->email->subject('Repair Password');
                $this->email->message(sprintf(lang('off_emailsubject'), $name, $login, $PWD, $FGPWD, site_url(), config('office_name', 'rf_settings')));
                $this->email->send();
            } else {
                $this->data['content'] = lang('off_dataerror');
            }
        }
        compile();
    }
Example #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();
 }
Example #5
0
 function uprofile()
 {
     $this->data['title'] = lang('off_acc') . get_login();
     $username = urlencode(office_secure($this->input->post('username')));
     $icq = (int) trim(office_secure($this->input->post('icq')), "-");
     $skype = urlencode(office_secure($this->input->post('skype')));
     $master_answer = office_secure($this->input->post('master_answer'));
     $allow_ip = office_secure($this->input->post('allow_ip'));
     $mac_adress = urlencode(office_secure($this->input->post('mac_adress')));
     if ($master_answer != $this->input->post('master_answer')) {
         redirect(base_url() . 'profile/#error');
     }
     $block = TRUE;
     if (strlen($this->session->userdata('ip_address')) > 2) {
         if (substr($this->session->userdata('ip_address'), 0, strlen($allow_ip)) != $allow_ip) {
             $this->data['content'] = icon('32x32/edit_profile.png') . lang('off_profile_check_ip');
             compile();
             $block = FALSE;
         }
     }
     if (!check_master_answer() && $master_answer && $block != FALSE) {
         $this->MYSQL->query("\n        INSERT INTO profile SET username='******',\n            icq='{$icq}',\n            skype='{$skype}',\n            master_answer='" . md5($master_answer) . "',\n            mac_adress='{$mac_adress}',\n            allow_ip='{$allow_ip}',\n            AccountSerial=" . Get_AccountSerial());
         $this->data['content'] = icon('32x32/edit_profile.png') . lang('off_profile_save_ok');
     } else {
         if (check_master_answer() == FALSE && $block != FALSE) {
             redirect('main/profile');
         }
         $this->MYSQL->query("\n        UPDATE profile\n        SET username='******',\n            icq='{$icq}',\n            skype='{$skype}',\n            allow_ip='{$allow_ip}'\n            WHERE AccountSerial=" . Get_AccountSerial());
         $this->data['content'] = icon('32x32/edit_profile.png') . lang('off_profile_save_up');
     }
     compile();
 }
function gen_secure()
{
    $str = md5(get_login() . donate_show(Get_AccountSerial()) . bonus_show(Get_AccountSerial()));
    return $str;
}