Exemplo n.º 1
0
 public function __construct()
 {
     parent::__construct();
     $this->db->where('remember_me', FALSE)->where('UNIX_TIMESTAMP(last_activity) <', time() - strtoseconds($this->config->nf_cookie_expire))->delete('nf_sessions');
     $this->_ip_address = isset($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['HTTP_X_REAL_IP'] : $_SERVER['REMOTE_ADDR'];
     $this->_host_name = utf8_string(gethostbyaddr($this->_ip_address));
     if (isset($_COOKIE[$this->config->nf_cookie_name]) && $this->_check_cookie($cookie = $_COOKIE[$this->config->nf_cookie_name], $last_activity)) {
         if (strtotime($this->config->nf_cookie_expire, $last_activity) < time()) {
             $this->_session_id();
         } else {
             $this->_session_id = $cookie;
         }
         $this->db->where('session_id', $cookie)->update('nf_sessions', array('session_id' => $this->_session_id, 'ip_address' => $this->_ip_address, 'host_name' => $this->_host_name, 'last_activity' => now()));
         if (!is_null($time_zone = $this('session', 'time_zone'))) {
             set_time_zone($time_zone);
             $this->db->update_time_zone();
         }
     } else {
         if (!is_asset() && !$this->config->ajax_url && !$this->config->ajax_header && $_SERVER['REQUEST_METHOD'] != 'OPTIONS') {
             $this->_session_id();
             $crawler = is_crawler();
             if ($crawler !== FALSE) {
                 $this->db->insert('nf_crawlers', array('name' => $crawler, 'path' => $this->config->request_url));
             }
             $this->db->insert('nf_sessions', array('session_id' => $this->_session_id, 'ip_address' => $this->_ip_address, 'host_name' => $this->_host_name, 'is_crawler' => $crawler !== FALSE));
             $this->_user_data['session']['date'] = time();
             $this->_user_data['session']['javascript'] = FALSE;
             $this->_user_data['session']['referer'] = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '';
             $this->_user_data['session']['user_agent'] = $_SERVER['HTTP_USER_AGENT'];
         }
     }
     statistics('nf_sessions_max_simultaneous', $this->_sessions = $this->db->select('COUNT(DISTINCT IFNULL(user_id, session_id))')->from('nf_sessions')->where('last_activity > DATE_SUB(NOW(), INTERVAL 5 MINUTE)')->where('is_crawler', FALSE)->row(), function ($a, $b) {
         return $a > $b;
     });
 }
Exemplo n.º 2
0
 public function index()
 {
     $users = $this->title($this('dashboard'))->js('jquery.knob')->js_load('$(\'.knob\').knob();')->load->library('table')->add_columns(array(array('content' => function ($data) {
         return '<a href="mailto:' . $data['email'] . '" data-toggle="tooltip" title="' . $data['email'] . '">' . icon('fa-envelope') . '</a>';
     }), array('content' => function ($data) {
         return NeoFrag::loader()->user->link($data['user_id'], $data['username']);
     }), array('content' => function ($data, $loader) {
         return '<span data-toggle="tooltip" title="' . timetostr($loader->lang('date_time_long'), $data['registration_date']) . '">' . time_span($data['registration_date']) . '</span>';
     }, 'class' => 'text-right')))->data($this->db->from('nf_users')->where('deleted', FALSE)->order_by('user_id DESC')->limit(5)->get())->display();
     return array(new Row(new Col(new Panel_box(array('label' => $this('news', $count = $this->db->select('COUNT(*)')->from('nf_news')->where('published', TRUE)->row()), 'icon' => 'fa-newspaper-o', 'color' => 'bg-aqua', 'count' => $count, 'url' => 'admin/news.html', 'footer' => $this('manage_news') . ' ' . icon('fa-arrow-circle-right'), 'size' => 'col-md-4 col-lg-2'))), new Col(new Panel_box(array('label' => $this('members', $count = $this->db->select('COUNT(*)')->from('nf_users')->where('deleted', FALSE)->row()), 'icon' => 'fa-users', 'color' => 'bg-green', 'count' => $count, 'url' => 'admin/members.html', 'footer' => $this('manage_members') . ' ' . icon('fa-arrow-circle-right'), 'size' => 'col-md-4 col-lg-2'))), new Col(new Panel_box(array('label' => $this('events', $count = 0, $count), 'icon' => 'fa-calendar', 'color' => 'bg-blue', 'count' => $count, 'url' => 'admin/events.html', 'footer' => $this('manage_events') . ' ' . icon('fa-arrow-circle-right'), 'size' => 'col-md-4 col-lg-2'))), new Col(new Panel_box(array('label' => $this('teams', $count = $this->db->select('COUNT(*)')->from('nf_teams')->row(), $count), 'icon' => 'fa-gamepad', 'color' => 'bg-red', 'count' => $count, 'url' => 'admin/teams.html', 'footer' => $this('manage_teams') . ' ' . icon('fa-arrow-circle-right'), 'size' => 'col-md-4 col-lg-2'))), new Col(new Panel_box(array('label' => $this('messages', $count = $this->db->select('COUNT(*)')->from('nf_forum_messages')->row()), 'icon' => 'fa-comments', 'color' => 'bg-teal', 'count' => $count, 'url' => 'admin/forum.html', 'footer' => $this('manage_forum') . ' ' . icon('fa-arrow-circle-right'), 'size' => 'col-md-4 col-lg-2'))), new Col(new Panel_box(array('label' => $this('comments', $count = $this->db->select('COUNT(*)')->from('nf_comments')->row()), 'icon' => 'fa-comments-o', 'color' => 'bg-maroon', 'count' => $count, 'url' => 'admin/comments.html', 'footer' => $this('manage_comments') . ' ' . icon('fa-arrow-circle-right'), 'size' => 'col-md-4 col-lg-2')))), new Row(new Col(new Widget_view(array('widget_id' => 1)), new Panel(array('title' => '<a href="//www.neofrag.com">' . $this('nf_news') . '</a>', 'icon' => 'fa-newspaper-o', 'content' => $this->load->view('nf_news'), 'size' => 'col-md-8'))), new Col(new Panel(array('title' => $this('connected_users'), 'icon' => 'fa-globe', 'content' => $this->load->view('users_online', array('currently' => $this->db->select('COUNT(*)')->from('nf_sessions')->where('last_activity > DATE_SUB(NOW(), INTERVAL 5 MINUTE)')->where('is_crawler', FALSE)->row(), 'max' => statistics('nf_sessions_max_simultaneous'))), 'footer' => '<a href="' . url('admin/members/sessions.html') . '">' . $this('view_all_sessions') . '</a>', 'size' => 'col-md-4')), new Panel(array('title' => $this('last_registrations'), 'icon' => 'fa-users', 'content' => $users, 'size' => 'col-md-4')))));
 }
Exemplo n.º 3
0
 public function do_register()
 {
     //查询用户是否存在
     $aqj_id = trim($_POST['reg_aqjid']);
     $aqj_mobile = trim($_POST['reg_m']);
     $xlc_user = $GLOBALS['db']->getRow("select id,mobile,user_pwd from " . DB_PREFIX . "user where mobile='" . $aqj_mobile . "'");
     if ($xlc_user) {
         $aqj_user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "ap_partner_user where user_id=" . $xlc_user['id']);
         if (!$aqj_user) {
             $user_ap_partner = array();
             $user_ap_partner['user_id'] = $xlc_user['id'];
             $user_ap_partner['partner_id'] = 2;
             $user_ap_partner['partner_user_id'] = $aqj_id;
             $user_ap_partner['create_time'] = time();
             $GLOBALS['db']->autoExecute(DB_PREFIX . "ap_partner_user", $user_ap_partner);
         } else {
             $GLOBALS['db']->query("update " . DB_PREFIX . "ap_partner_user set partner_user_id = '" . $aqj_id . "' where user_id = " . $xlc_user['id']);
         }
         require_once APP_ROOT_PATH . "system/libs/user.php";
         auto_do_login_user($xlc_user['mobile'], $xlc_user['user_pwd']);
         app_redirect(url("aps"));
     } else {
         require_once APP_ROOT_PATH . "system/libs/user.php";
         $user_data = array();
         $user_data['user_name'] = $aqj_mobile;
         $user_data['mobile'] = $aqj_mobile;
         $user_data['user_pwd'] = rand(100000, 999999);
         //开启邮箱验证
         if (app_conf("USER_VERIFY") == 0 || app_conf("USER_VERIFY") == 2) {
             $user_data['is_effect'] = 1;
         } else {
             $user_data['is_effect'] = 0;
         }
         $res = save_user($user_data);
         statistics('register');
         $user_ap_partner = array();
         $user_ap_partner['user_id'] = $res['data'];
         $user_ap_partner['partner_id'] = 2;
         $user_ap_partner['partner_user_id'] = $aqj_id;
         $user_ap_partner['create_time'] = time();
         $GLOBALS['db']->autoExecute(DB_PREFIX . "ap_partner_user", $user_ap_partner);
         $result = do_login_user($user_data['mobile'], $user_data['user_pwd']);
         send_auto_register_pwd($aqj_mobile, $user_data['user_pwd']);
         app_redirect(url("aps"));
     }
 }
Exemplo n.º 4
0
        }
    } else {
        show_error('Ошибка! Неверный идентификатор сессии, повторите действие!');
    }
    ############################################################################################
    ##                                    Добавление от гостей                                ##
    ############################################################################################
} elseif ($config['bookadds'] == 1) {
    $provkod = (int) $_POST['provkod'];
    if ($uid == $_SESSION['token']) {
        if (utf_strlen(trim($msg)) >= 5 && utf_strlen($msg) < 1000) {
            if ($provkod == $_SESSION['protect']) {
                $_SESSION['protect'] = "";
                unset($_SESSION['protect']);
                antiflood("Location: index.php?isset=antiflood&" . SID);
                statistics(0);
                $msg = no_br($msg, '<br />');
                $msg = antimat($msg);
                $msg = smiles($msg);
                $text = no_br($msg . '|' . $config['guestsuser'] . '||' . SITETIME . '|' . $brow . '|' . $ip . '|||');
                write_files(DATADIR . "book.dat", "{$text}\r\n");
                $countstr = counter_string(DATADIR . "book.dat");
                if ($countstr >= $config['maxpostbook']) {
                    delete_lines(DATADIR . "book.dat", array(0, 1));
                }
                $_SESSION['note'] = 'Сообщение успешно добавлено!';
                header("Location: index.php?" . SID);
                exit;
            } else {
                show_error('Ошибка! Проверочное число не совпало с данными на картинке!');
            }
Exemplo n.º 5
0
}
if (!function_exists('sefRelToAbs')) {
    @(include_once $GLOBALS['mosConfig_absolute_path'] . '/includes/sef.php');
}
switch ($action) {
    case 'list':
        lists($action, $task, $listId, $listType);
        break;
    case 'subscribers':
        subscribers($action, $task, $userid, $listId, $cid);
        break;
    case 'mailing':
        mailing($action, $task, $listId, $listType, $mailingId, $message);
        break;
    case 'statistics':
        statistics($listId, $listType, $mailingId, $message, $task, $action);
        break;
    case 'configuration':
        if ($GLOBALS[ACA . 'integration'] == '0' or $GLOBALS[ACA . 'cb_integration'] == '0') {
            $xf = new xonfig();
            if (acajoom::checkCB()) {
                $xf->loadConfig();
            }
        }
        configuration($action, $task);
        break;
    case 'update':
        update($action, $task);
        break;
    case 'about':
        about($message, $task, $action);
Exemplo n.º 6
0
     } elseif ($p == "about") {
         include "about.php";
         $embedcode = about($wavephoto, $wavephoto2);
     } elseif ($p == "learnmore") {
         include "learnmore.php";
         $embedcode = learnmore($wavephoto);
     } elseif ($p == "signup") {
         header("Location: signup.php");
     } elseif ($p == "signin") {
         header("Location: signin.php");
     } elseif ($p == "forgotpassword") {
         include "forgotpassword.php";
         $embedcode = forgotpassword($wavephoto);
     } elseif ($p == "statistics") {
         include "statistics.php";
         $embedcode = statistics($wavephoto);
     } elseif ($p == "faq") {
         include "faq.php";
         $embedcode = faq($wavephoto);
     } elseif ($p == "invite") {
         include "invite.php";
         $embedcode = invite($wavephoto, $myid);
     } elseif ($p == "random") {
         include "random.php";
         $p = randomsite();
         $pagetype = "project";
         include "autoembed.php";
         $embedcode = autoembed($p);
     }
 } elseif ($pagetype == "profile") {
     include "profile.php";
Exemplo n.º 7
0
function PageMain()
{
    global $TMPL, $LNG, $CONF, $db, $settings;
    if (isset($_POST['login'])) {
        $logInAdmin = new logInAdmin();
        $logInAdmin->db = $db;
        $logInAdmin->url = $CONF['url'];
        $logInAdmin->username = $_POST['username'];
        $logInAdmin->password = $_POST['password'];
        $TMPL['message'] = $logInAdmin->in();
    }
    if (isset($_SESSION['usernameAdmin']) && isset($_SESSION['passwordAdmin'])) {
        $loggedInAdmin = new loggedInAdmin();
        $loggedInAdmin->db = $db;
        $loggedInAdmin->url = $CONF['url'];
        $loggedInAdmin->username = $_SESSION['usernameAdmin'];
        $loggedInAdmin->password = $_SESSION['passwordAdmin'];
        $loggedIn = $loggedInAdmin->verify();
        if ($loggedIn['username']) {
            // Set the content to true, change the $skin to content
            $content = true;
            $TMPL_old = $TMPL;
            $TMPL = array();
            $TMPL['url'] = $CONF['url'];
            if ($_GET['b'] == 'security') {
                // Security Admin Tab
                $skin = new skin('admin/security');
                $page = '';
                if (!empty($_POST)) {
                    $updateSettings = new updateSettings();
                    $updateSettings->db = $db;
                    $updated = $updateSettings->query_array('admin', $_POST);
                    if ($updated == 1) {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=security&m=s");
                    } else {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=security&m=i");
                    }
                }
                if ($_GET['m'] == 's') {
                    $TMPL['message'] = notificationBox('success', $LNG['password_changed']);
                } elseif ($_GET['m'] == 'i') {
                    $TMPL['message'] = notificationBox('info', $LNG['password_not_changed']);
                }
            } elseif ($_GET['b'] == 'social') {
                // Security Admin Tab
                $skin = new skin('admin/social');
                $page = '';
                if (!extension_loaded('openssl')) {
                    $TMPL['message'] .= notificationBox('error', $LNG['openssl_error']);
                }
                if (!function_exists('curl_exec')) {
                    $TMPL['message'] .= notificationBox('info', $LNG['curl_error']);
                }
                $TMPL['fbappid'] = $settings['fbappid'];
                $TMPL['fbappsecret'] = $settings['fbappsecret'];
                if (empty($settings['fbapp'])) {
                    $TMPL['fbappoff'] = ' selected="selected"';
                } else {
                    $TMPL['fbappon'] = ' selected="selected"';
                }
                if (!empty($_POST)) {
                    $updateSettings = new updateSettings();
                    $updateSettings->db = $db;
                    $updated = $updateSettings->query_array('settings', $_POST);
                    if ($updated == 1) {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=social&m=s");
                    } else {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=social&m=i");
                    }
                }
                if ($_GET['m'] == 's') {
                    $TMPL['message'] .= notificationBox('success', $LNG['settings_saved']);
                } elseif ($_GET['m'] == 'i') {
                    $TMPL['message'] .= notificationBox('info', $LNG['nothing_changed']);
                }
            } elseif ($_GET['b'] == 'payments') {
                $managePayments = new managePayments();
                $managePayments->db = $db;
                $managePayments->url = $CONF['url'];
                $managePayments->per_page = $settings['rperpage'];
                if (isset($_GET['id'])) {
                    $skin = new skin('admin/payment');
                    $page = '';
                    if (isset($_GET['type'])) {
                        $managePayments->updatePayment($_GET['id'], $_GET['type']);
                    }
                    $TMPL['content'] = $managePayments->getPayment($_GET['id']);
                    // If the payment doens't exist
                    if (empty($TMPL['content'])) {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=payments&m=i");
                    }
                } else {
                    $skin = new skin('admin/manage_payments');
                    $page = '';
                    $TMPL['payments'] = $managePayments->getPayments(0);
                }
                if ($_GET['m'] == 'i') {
                    $TMPL['message'] = notificationBox('error', $LNG['payment_not_exist']);
                }
            } elseif ($_GET['b'] == 'pro') {
                // Security Admin Tab
                $skin = new skin('admin/pro');
                $page = '';
                if (!extension_loaded('openssl')) {
                    $TMPL['message'] .= notificationBox('error', $LNG['openssl_error']);
                }
                if (!function_exists('curl_exec')) {
                    $TMPL['message'] .= notificationBox('info', $LNG['curl_error']);
                }
                $TMPL['ppuser'] = $settings['paypaluser'];
                $TMPL['pppass'] = $settings['paypalpass'];
                $TMPL['ppsign'] = $settings['paypalsign'];
                $TMPL['currentProMonth'] = $settings['promonth'];
                $TMPL['currentProYear'] = $settings['proyear'];
                if (empty($settings['paypalapp'])) {
                    $TMPL['ppappoff'] = ' selected="selected"';
                } else {
                    $TMPL['ppappon'] = ' selected="selected"';
                }
                if (empty($settings['paypalsand'])) {
                    $TMPL['ppsandoff'] = ' selected="selected"';
                } else {
                    $TMPL['ppsandon'] = ' selected="selected"';
                }
                if ($settings['protracksize'] == '5242880') {
                    $TMPL['aprotrack'] = 'selected="selected"';
                } elseif ($settings['protracksize'] == '10485760') {
                    $TMPL['bprotrack'] = 'selected="selected"';
                } elseif ($settings['protracksize'] == '26214400') {
                    $TMPL['cprotrack'] = 'selected="selected"';
                } elseif ($settings['protracksize'] == '52428800') {
                    $TMPL['dprotrack'] = 'selected="selected"';
                } elseif ($settings['protracksize'] == '104857600') {
                    $TMPL['eprotrack'] = 'selected="selected"';
                } elseif ($settings['protracksize'] == '262144000') {
                    $TMPL['fprotrack'] = 'selected="selected"';
                } elseif ($settings['protracksize'] == '524288000') {
                    $TMPL['gprotrack'] = 'selected="selected"';
                } elseif ($settings['protracksize'] == '1073741824') {
                    $TMPL['hprotrack'] = 'selected="selected"';
                } else {
                    $TMPL['iprotrack'] = 'selected="selected"';
                }
                if ($settings['protracktotal'] == '104857600') {
                    $TMPL['aprototal'] = 'selected="selected"';
                } elseif ($settings['protracktotal'] == '209715200') {
                    $TMPL['bprototal'] = 'selected="selected"';
                } elseif ($settings['protracktotal'] == '314572800') {
                    $TMPL['cprototal'] = 'selected="selected"';
                } elseif ($settings['protracktotal'] == '524288000') {
                    $TMPL['dprototal'] = 'selected="selected"';
                } elseif ($settings['protracktotal'] == '1073741824') {
                    $TMPL['eprototal'] = 'selected="selected"';
                } elseif ($settings['protracktotal'] == '5368709120') {
                    $TMPL['fprototal'] = 'selected="selected"';
                } elseif ($settings['protracktotal'] == '10737418240') {
                    $TMPL['gprototal'] = 'selected="selected"';
                } elseif ($settings['protracktotal'] == '26843545600') {
                    $TMPL['hprototal'] = 'selected="selected"';
                } else {
                    $TMPL['iprototal'] = 'selected="selected"';
                }
                if ($settings['tracksize'] == '5242880') {
                    $TMPL['atrack'] = 'selected="selected"';
                } elseif ($settings['tracksize'] == '10485760') {
                    $TMPL['btrack'] = 'selected="selected"';
                } elseif ($settings['tracksize'] == '26214400') {
                    $TMPL['ctrack'] = 'selected="selected"';
                } elseif ($settings['tracksize'] == '52428800') {
                    $TMPL['dtrack'] = 'selected="selected"';
                } else {
                    $TMPL['etrack'] = 'selected="selected"';
                }
                if ($settings['currency'] == 'USD') {
                    $TMPL['usd_currency'] = 'selected="selected"';
                } elseif ($settings['currency'] == 'EUR') {
                    $TMPL['eur_currency'] = 'selected="selected"';
                } else {
                    $TMPL['gbp_currency'] = 'selected="selected"';
                }
                if ($settings['tracksizetotal'] == '104857600') {
                    $TMPL['atotal'] = 'selected="selected"';
                } elseif ($settings['tracksizetotal'] == '209715200') {
                    $TMPL['btotal'] = 'selected="selected"';
                } elseif ($settings['tracksizetotal'] == '314572800') {
                    $TMPL['ctotal'] = 'selected="selected"';
                } elseif ($settings['tracksizetotal'] == '524288000') {
                    $TMPL['dtotal'] = 'selected="selected"';
                } else {
                    $TMPL['etotal'] = 'selected="selected"';
                }
                if (!empty($_POST)) {
                    $updateSettings = new updateSettings();
                    $updateSettings->db = $db;
                    $updated = $updateSettings->query_array('settings', $_POST);
                    if ($updated == 1) {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=pro&m=s");
                    } else {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=pro&m=i");
                    }
                }
                if ($_GET['m'] == 's') {
                    $TMPL['message'] .= notificationBox('success', $LNG['settings_saved']);
                } elseif ($_GET['m'] == 'i') {
                    $TMPL['message'] .= notificationBox('info', $LNG['nothing_changed']);
                }
            } elseif ($_GET['b'] == 'stats') {
                // Security Admin Tab
                $skin = new skin('admin/stats');
                $page = '';
                list($TMPL['tracks_total'], $TMPL['tracks_public'], $TMPL['tracks_private'], $TMPL['comments_total'], $TMPL['users_today'], $TMPL['users_this_month'], $TMPL['users_last_30'], $TMPL['users_total'], $TMPL['total_reports'], $TMPL['pending_reports'], $TMPL['safe_reports'], $TMPL['deleted_reports'], $TMPL['total_tracks_reports'], $TMPL['pending_track_reports'], $TMPL['safe_track_reports'], $TMPL['deleted_track_reports'], $TMPL['total_comment_reports'], $TMPL['pending_comment_reports'], $TMPL['safe_comment_reports'], $TMPL['deleted_comment_reports'], $TMPL['total_likes'], $TMPL['likes_today'], $TMPL['likes_this_month'], $TMPL['likes_last_30'], $TMPL['total_plays'], $TMPL['plays_today'], $TMPL['plays_this_month'], $TMPL['plays_last_30'], $TMPL['total_downloads'], $TMPL['downloads_today'], $TMPL['downloads_this_month'], $TMPL['downloads_last_30'], $TMPL['total_playlists'], $TMPL['playlists_today'], $TMPL['playlists_this_month'], $TMPL['playlists_last_30'], $TMPL['total_payments'], $TMPL['payments_today'], $TMPL['payments_this_month'], $TMPL['payments_last_30'], $TMPL['total_earnings'], $TMPL['earnings_today'], $TMPL['earnings_this_month'], $TMPL['earnings_last_30']) = statistics($db, $settings['currency']);
                $TMPL['currency'] = $settings['currency'];
            } elseif ($_GET['b'] == 'themes') {
                $skin = new skin('admin/themes');
                $page = '';
                $updateSettings = new updateSettings();
                $updateSettings->db = $db;
                $themes = $updateSettings->getThemes();
                $TMPL['themes_list'] = $themes[0];
                if (isset($_GET['theme'])) {
                    // If theme is in array
                    if (in_array($_GET['theme'], $themes[1])) {
                        $updated = $updateSettings->query_array('settings', array('theme' => $_GET['theme']));
                        if ($updated == 1) {
                            header("Location: " . $CONF['url'] . "/index.php?a=admin&b=themes&m=s");
                        } else {
                            header("Location: " . $CONF['url'] . "/index.php?a=admin&b=themes&m=i");
                        }
                    }
                }
                if ($_GET['m'] == 's') {
                    $TMPL['message'] = notificationBox('success', $LNG['theme_changed']);
                } elseif ($_GET['m'] == 'i') {
                    $TMPL['message'] = notificationBox('error', $LNG['nothing_changed']);
                }
            } elseif ($_GET['b'] == 'reports') {
                $manageReports = new manageReports();
                $manageReports->db = $db;
                $manageReports->url = $CONF['url'];
                $manageReports->title = $settings['title'];
                $manageReports->per_page = $settings['rperpage'];
                if (ctype_digit($_GET['id'])) {
                    if (isset($_GET['type'])) {
                        // Do the manage report action
                        $manageReport = $manageReports->manageReport($_GET['id'], $_GET['type']);
                    }
                    $skin = new skin('admin/report');
                    $page = '';
                    $TMPL['content'] = $manageReports->getReport($_GET['id']);
                    // If the report doesn't exist
                    if (empty($TMPL['content'])) {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=reports&m=i");
                    }
                } else {
                    $skin = new skin('admin/manage_reports');
                    $page = '';
                    $TMPL['reports'] = $manageReports->getReports(0);
                }
                if ($_GET['m'] == 'i') {
                    $TMPL['message'] = notificationBox('error', $LNG['report_not_exist']);
                }
            } elseif ($_GET['b'] == 'users_settings') {
                $skin = new skin('admin/users_settings');
                $page = '';
                if ($settings['notificationl'] == '0') {
                    $TMPL['loff'] = 'selected="selected"';
                } else {
                    $TMPL['lon'] = 'selected="selected"';
                }
                if ($settings['notificationc'] == '0') {
                    $TMPL['coff'] = 'selected="selected"';
                } else {
                    $TMPL['con'] = 'selected="selected"';
                }
                if ($settings['email_comment'] == '0') {
                    $TMPL['ecoff'] = 'selected="selected"';
                } else {
                    $TMPL['econ'] = 'selected="selected"';
                }
                if ($settings['email_like'] == '0') {
                    $TMPL['eloff'] = 'selected="selected"';
                } else {
                    $TMPL['elon'] = 'selected="selected"';
                }
                if ($settings['email_new_friend'] == '0') {
                    $TMPL['enfoff'] = 'selected="selected"';
                } else {
                    $TMPL['enfon'] = 'selected="selected"';
                }
                if ($settings['notificationd'] == '0') {
                    $TMPL['doff'] = 'selected="selected"';
                } else {
                    $TMPL['don'] = 'selected="selected"';
                }
                if ($settings['notificationf'] == '0') {
                    $TMPL['foff'] = 'selected="selected"';
                } else {
                    $TMPL['fon'] = 'selected="selected"';
                }
                if ($settings['ronline'] == '3') {
                    $TMPL['uone'] = 'selected="selected"';
                } elseif ($settings['ronline'] == '7') {
                    $TMPL['utwo'] = 'selected="selected"';
                } else {
                    $TMPL['uthree'] = 'selected="selected"';
                }
                if ($settings['nperwidget'] == '5') {
                    $TMPL['none'] = 'selected="selected"';
                } elseif ($settings['nperwidget'] == '10') {
                    $TMPL['ntwo'] = 'selected="selected"';
                } elseif ($settings['nperwidget'] == '20') {
                    $TMPL['nthree'] = 'selected="selected"';
                } else {
                    $TMPL['nfour'] = 'selected="selected"';
                }
                if ($settings['lperpost'] == '5') {
                    $TMPL['likeson'] = 'selected="selected"';
                } else {
                    $TMPL['likesoff'] = 'selected="selected"';
                }
                if (!empty($_POST)) {
                    $updateSettings = new updateSettings();
                    $updateSettings->db = $db;
                    $updated = $updateSettings->query_array('settings', $_POST);
                    if ($updated == 1) {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=users_settings&m=s");
                    } else {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=users_settings&m=i");
                    }
                }
                if ($_GET['m'] == 's') {
                    $TMPL['message'] = notificationBox('success', $LNG['settings_saved']);
                } elseif ($_GET['m'] == 'i') {
                    $TMPL['message'] = notificationBox('info', $LNG['nothing_changed']);
                }
            } elseif ($_GET['b'] == 'users') {
                $manageUsers = new manageUsers();
                $manageUsers->db = $db;
                $manageUsers->url = $CONF['url'];
                $manageUsers->title = $settings['title'];
                $manageUsers->per_page = $settings['rperpage'];
                if (!isset($_GET['id']) && !isset($_GET['idu'])) {
                    $skin = new skin('admin/manage_users');
                    $page = '';
                    // Save the array returned into a list
                    $TMPL['users'] = $manageUsers->getUsers(0);
                } else {
                    $skin = new skin('admin/user');
                    $page = '';
                    $getUser = $manageUsers->getUser($_GET['id'], $_GET['idu']);
                    if (!$getUser) {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=users&m=un");
                    }
                    // Create the class instance
                    $updateUserSettings = new updateUserSettings();
                    $updateUserSettings->db = $db;
                    $updateUserSettings->id = $getUser['idu'];
                    if (!empty($_POST)) {
                        $TMPL['message'] = $updateUserSettings->query_array('users', array_map("strip_tags_array", $_POST));
                    }
                    $userSettings = $updateUserSettings->getSettings();
                    $TMPL['countries'] = countries(1, $userSettings['country']);
                    $TMPL['username'] = $userSettings['username'];
                    $TMPL['idu'] = $userSettings['idu'];
                    $TMPL['currentFirstName'] = $userSettings['first_name'];
                    $TMPL['currentLastName'] = $userSettings['last_name'];
                    $TMPL['currentEmail'] = $userSettings['email'];
                    $TMPL['currentCity'] = $userSettings['city'];
                    $TMPL['currentWebsite'] = $userSettings['website'];
                    $TMPL['currentDescription'] = $userSettings['description'];
                    $TMPL['currentFacebook'] = $userSettings['facebook'];
                    $TMPL['currentTwitter'] = $userSettings['twitter'];
                    $TMPL['currentGplus'] = $userSettings['gplus'];
                    $TMPL['currentYouTube'] = $userSettings['youtube'];
                    $TMPL['currentSoundCloud'] = $userSettings['soundcloud'];
                    $TMPL['currentLastfm'] = $userSettings['lastfm'];
                    $TMPL['currentMySpace'] = $userSettings['myspace'];
                    $TMPL['currentVimeo'] = $userSettings['vimeo'];
                    $TMPL['currentTumblr'] = $userSettings['tumblr'];
                    $feed = new feed();
                    $feed->db = $db;
                    $feed->id = $updateUserSettings->id;
                    $manageReports = new manageReports();
                    $manageReports->db = $db;
                    $manageReports->url = $CONF['url'];
                    $manageReports->per_page = $settings['rperpage'];
                    if (isset($_GET['suspend'])) {
                        $manageUsers->suspendUser($feed->id, $_GET['suspend']);
                    }
                    $user = $manageUsers->getUser($getUser['idu']);
                    $TMPL['username'] = '******' . $CONF['url'] . '/index.php?a=profile&u=' . $user['username'] . '" target="_blank"><img src="' . $CONF['url'] . '/thumb.php?src=' . $user['image'] . '&t=a&w=112&h=112"></a></div>
											<div class="manage-users-content"><a href="' . $CONF['url'] . '/index.php?a=profile&u=' . $user['username'] . '" target="_blank">' . $user['username'] . '</a><br>' . $user['email'] . '</div>';
                    $TMPL['reports'] = $manageReports->getReports(0, $feed->getTrackList($feed->id) ? $feed->getTrackList($feed->id) : 1);
                    if (empty($TMPL['reports'])) {
                        $TMPL['hide_r'] = ' style="display: none;"';
                    }
                    // If the user has payments history
                    $managePayments = new managePayments();
                    $managePayments->db = $db;
                    $managePayments->url = $CONF['url'];
                    $managePayments->per_page = $settings['rperpage'];
                    $TMPL['history'] = $managePayments->getPayments(0, $updateUserSettings->id);
                    if (empty($TMPL['history'])) {
                        $TMPL['hide_p'] = ' style="display: none;"';
                    }
                    // Suspend variable for the suspend url
                    $TMPL['suspend'] = $user['suspended'] ? '0' : '1';
                    $TMPL['status_desc'] = $user['suspended'] ? $LNG['restore_account'] : $LNG['suspend_account'];
                    $TMPL['status'] = $user['suspended'] ? notificationBox('error', $LNG['account_suspended']) : '';
                    if ($user['suspended']) {
                        $TMPL['suspended'] = $LNG['restore'];
                    } else {
                        $TMPL['suspended'] = $LNG['suspend'];
                    }
                }
                // If GET delete is set, delete the user
                if ($_GET['delete']) {
                    $manageUsers->deleteUser($_GET['delete']);
                    header("Location: " . $CONF['url'] . "/index.php?a=admin&b=users&m=" . $_GET['delete']);
                }
                if ($_GET['m'] == 'un') {
                    $TMPL['message'] = notificationBox('error', $LNG['user_not_exist']);
                } elseif (!empty($_GET['m'])) {
                    $TMPL['message'] = notificationBox('success', sprintf($LNG['user_has_been_deleted'], $_GET['m']));
                }
            } elseif ($_GET['b'] == 'categories') {
                $manageCategories = new manageCategories();
                $manageCategories->db = $db;
                $manageCategories->url = $CONF['url'];
                $skin = new skin('admin/manage_categories');
                $page = '';
                $TMPL['categories'] = $manageCategories->getCategories();
            } elseif ($_GET['b'] == 'ads') {
                $skin = new skin('admin/manage_ads');
                $page = '';
                $TMPL['ad1'] = $settings['ad1'];
                $TMPL['ad2'] = $settings['ad2'];
                $TMPL['ad3'] = $settings['ad3'];
                $TMPL['ad4'] = $settings['ad4'];
                $TMPL['ad5'] = $settings['ad5'];
                $TMPL['ad6'] = $settings['ad6'];
                $TMPL['ad7'] = $settings['ad7'];
                if (!empty($_POST)) {
                    // Unset the submit array element
                    $updateSettings = new updateSettings();
                    $updateSettings->db = $db;
                    $updated = $updateSettings->query_array('settings', $_POST);
                    if ($updated == 1) {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=ads&m=s");
                    } else {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&b=ads&m=i");
                    }
                }
                if ($_GET['m'] == 's') {
                    $TMPL['message'] = notificationBox('success', $LNG['settings_saved']);
                } elseif ($_GET['m'] == 'i') {
                    $TMPL['message'] = notificationBox('info', $LNG['nothing_changed']);
                }
            } else {
                $skin = new skin('admin/general');
                $page = '';
                $TMPL['currentTitle'] = $settings['title'];
                $TMPL['currentFormat'] = $settings['format'];
                $TMPL['currentArtFormat'] = $settings['artformat'];
                $TMPL['currentTrackFormat'] = $settings['trackformat'];
                if ($settings['captcha'] == '1') {
                    $TMPL['on'] = 'selected="selected"';
                } else {
                    $TMPL['off'] = 'selected="selected"';
                }
                if ($settings['time'] == '0') {
                    $TMPL['one'] = 'selected="selected"';
                } elseif ($settings['time'] == '1') {
                    $TMPL['two'] = 'selected="selected"';
                } elseif ($settings['time'] == '2') {
                    $TMPL['three'] = 'selected="selected"';
                } else {
                    $TMPL['four'] = 'selected="selected"';
                }
                if ($settings['volume'] == '0.20') {
                    $TMPL['vtwenty'] = 'selected="selected"';
                } elseif ($settings['volume'] == '0.40') {
                    $TMPL['vfourty'] = 'selected="selected"';
                } elseif ($settings['volume'] == '0.60') {
                    $TMPL['vsixty'] = 'selected="selected"';
                } elseif ($settings['volume'] == '0.80') {
                    $TMPL['veighty'] = 'selected="selected"';
                } elseif ($settings['volume'] == '1') {
                    $TMPL['vhundred'] = 'selected="selected"';
                }
                if ($settings['conline'] == '60') {
                    $TMPL['conone'] = 'selected="selected"';
                } elseif ($settings['conline'] == '300') {
                    $TMPL['contwo'] = 'selected="selected"';
                } else {
                    $TMPL['conthree'] = 'selected="selected"';
                }
                if ($settings['perpage'] == '10') {
                    $TMPL['ten'] = 'selected="selected"';
                } elseif ($settings['perpage'] == '20') {
                    $TMPL['twenty'] = 'selected="selected"';
                } elseif ($settings['perpage'] == '35') {
                    $TMPL['thirtyfive'] = 'selected="selected"';
                } else {
                    $TMPL['fifty'] = 'selected="selected"';
                }
                if ($settings['nperpage'] == '10') {
                    $TMPL['nten'] = 'selected="selected"';
                } elseif ($settings['nperpage'] == '25') {
                    $TMPL['ntwentyfive'] = 'selected="selected"';
                } elseif ($settings['nperpage'] == '50') {
                    $TMPL['nfifty'] = 'selected="selected"';
                } else {
                    $TMPL['nonehundred'] = 'selected="selected"';
                }
                if ($settings['mperpage'] == '5') {
                    $TMPL['mone'] = 'selected="selected"';
                } elseif ($settings['mperpage'] == '10') {
                    $TMPL['mtwo'] = 'selected="selected"';
                } elseif ($settings['mperpage'] == '25') {
                    $TMPL['mthree'] = 'selected="selected"';
                } else {
                    $TMPL['mfour'] = 'selected="selected"';
                }
                if ($settings['mlimit'] == '500') {
                    $TMPL['cone'] = 'selected="selected"';
                } elseif ($settings['mlimit'] == '1000') {
                    $TMPL['ctwo'] = 'selected="selected"';
                } elseif ($settings['mlimit'] == '2500') {
                    $TMPL['cthree'] = 'selected="selected"';
                } else {
                    $TMPL['cfour'] = 'selected="selected"';
                }
                if ($settings['chatr'] == '1') {
                    $TMPL['crone'] = 'selected="selected"';
                } elseif ($settings['chatr'] == '2') {
                    $TMPL['crtwo'] = 'selected="selected"';
                } elseif ($settings['chatr'] == '3') {
                    $TMPL['crthree'] = 'selected="selected"';
                } elseif ($settings['chatr'] == '5') {
                    $TMPL['crfive'] = 'selected="selected"';
                } elseif ($settings['chatr'] == '10') {
                    $TMPL['crten'] = 'selected="selected"';
                } elseif ($settings['chatr'] == '30') {
                    $TMPL['crthirty'] = 'selected="selected"';
                } else {
                    $TMPL['croff'] = 'selected="selected"';
                }
                if ($settings['qperpage'] == '10') {
                    $TMPL['qten'] = 'selected="selected"';
                } elseif ($settings['qperpage'] == '20') {
                    $TMPL['qtwenty'] = 'selected="selected"';
                } elseif ($settings['qperpage'] == '35') {
                    $TMPL['qthirtyfive'] = 'selected="selected"';
                } else {
                    $TMPL['qfifty'] = 'selected="selected"';
                }
                if ($settings['cperpage'] == '5') {
                    $TMPL['cfive'] = 'selected="selected"';
                } elseif ($settings['cperpage'] == '10') {
                    $TMPL['cten'] = 'selected="selected"';
                } elseif ($settings['cperpage'] == '25') {
                    $TMPL['ctwentyfive'] = 'selected="selected"';
                } else {
                    $TMPL['cfifty'] = 'selected="selected"';
                }
                if ($settings['size'] == '1048576') {
                    $TMPL['onemb'] = 'selected="selected"';
                } elseif ($settings['size'] == '2097152') {
                    $TMPL['twomb'] = 'selected="selected"';
                } elseif ($settings['size'] == '3145728') {
                    $TMPL['threemb'] = 'selected="selected"';
                } else {
                    $TMPL['tenmb'] = 'selected="selected"';
                }
                if ($settings['mail'] == '1') {
                    $TMPL['mailon'] = 'selected="selected"';
                } else {
                    $TMPL['mailoff'] = 'selected="selected"';
                }
                if ($settings['intervaln'] == '10000') {
                    $TMPL['intonen'] = 'selected="selected"';
                } elseif ($settings['intervaln'] == '30000') {
                    $TMPL['inttwon'] = 'selected="selected"';
                } elseif ($settings['intervaln'] == '60000') {
                    $TMPL['intthreen'] = 'selected="selected"';
                } elseif ($settings['intervaln'] == '120000') {
                    $TMPL['intfourn'] = 'selected="selected"';
                } elseif ($settings['intervaln'] == '300000') {
                    $TMPL['intfiven'] = 'selected="selected"';
                } elseif ($settings['intervaln'] == '600000') {
                    $TMPL['intsixn'] = 'selected="selected"';
                } else {
                    $TMPL['intsevenn'] = 'selected="selected"';
                }
                if ($settings['artsize'] == '1048576') {
                    $TMPL['aart'] = 'selected="selected"';
                } elseif ($settings['artsize'] == '2097152') {
                    $TMPL['bart'] = 'selected="selected"';
                } elseif ($settings['artsize'] == '3145728') {
                    $TMPL['cart'] = 'selected="selected"';
                } else {
                    $TMPL['dart'] = 'selected="selected"';
                }
                if ($settings['rperpage'] == '10') {
                    $TMPL['rpone'] = 'selected="selected"';
                } elseif ($settings['rperpage'] == '20') {
                    $TMPL['rptwo'] = 'selected="selected"';
                } elseif ($settings['rperpage'] == '50') {
                    $TMPL['rpthree'] = 'selected="selected"';
                } else {
                    $TMPL['rpfour'] = 'selected="selected"';
                }
                if ($settings['sperpage'] == '10') {
                    $TMPL['sone'] = 'selected="selected"';
                } elseif ($settings['sperpage'] == '20') {
                    $TMPL['stwo'] = 'selected="selected"';
                } elseif ($settings['sperpage'] == '35') {
                    $TMPL['sthree'] = 'selected="selected"';
                } else {
                    $TMPL['sfour'] = 'selected="selected"';
                }
                if ($settings['aperip'] == '1') {
                    $TMPL['ipone'] = 'selected="selected"';
                } elseif ($settings['aperip'] == '3') {
                    $TMPL['iptwo'] = 'selected="selected"';
                } elseif ($settings['aperip'] == '5') {
                    $TMPL['ipthree'] = 'selected="selected"';
                } elseif ($settings['aperip'] == '10') {
                    $TMPL['ipfour'] = 'selected="selected"';
                } else {
                    $TMPL['ipoff'] = 'selected="selected"';
                }
                if (isset($_POST['submit'])) {
                    // Unset the submit array element
                    unset($_POST['submit']);
                    $updateSettings = new updateSettings();
                    $updateSettings->db = $db;
                    $updated = $updateSettings->query_array('settings', $_POST);
                    if ($updated == 1) {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&m=s");
                    } else {
                        header("Location: " . $CONF['url'] . "/index.php?a=admin&m=i");
                    }
                }
                if ($_GET['m'] == 's') {
                    $TMPL['message'] = notificationBox('success', $LNG['settings_saved']);
                } elseif ($_GET['m'] == 'i') {
                    $TMPL['message'] = notificationBox('info', $LNG['nothing_changed']);
                }
            }
            $page .= $skin->make();
            $TMPL = $TMPL_old;
            unset($TMPL_old);
            $TMPL['settings'] = $page;
            if (isset($_GET['logout']) == 1) {
                $loggedInAdmin->logOut();
                header("Location: " . $CONF['url'] . "/index.php?a=admin");
            }
        } else {
            // Set the content to false, change the $skin to log-in.
            $content = false;
        }
    }
    // Bold the current link
    if (isset($_GET['b'])) {
        $LNG["admin_menu_{$_GET['b']}"] = $LNG["admin_menu_{$_GET['b']}"];
        $TMPL['welcome'] = $LNG["admin_ttl_{$_GET['b']}"];
    } else {
        $LNG["admin_menu_general"] = $LNG["admin_menu_general"];
        $TMPL['welcome'] = $LNG["admin_ttl_general"];
    }
    function adminMenuCounts($db, $type)
    {
        // Type 0: Return the reports number
        if ($type == 0) {
            $query = $db->query('SELECT COUNT(`id`) as `count` FROM `reports` WHERE `state` = 0');
        }
        $result = $query->fetch_assoc();
        return $result['count'];
    }
    $adminMenu = array('' => array('admin_menu_general', ''), '&b=users_settings' => array('admin_menu_users_settings', ''), '&b=pro' => array('admin_menu_pro', ''), '&b=social' => array('admin_menu_social', ''), '&b=themes' => array('admin_menu_themes', ''), '&b=stats' => array('admin_menu_stats', ''), '&b=security' => array('admin_menu_security', ''), '&b=users' => array('admin_menu_manage_users', ''), '&b=payments' => array('admin_menu_manage_payments', ''), '&b=reports' => array('admin_menu_manage_reports', adminMenuCounts($db, 0)), '&b=categories' => array('admin_menu_manage_categories', ''), '&b=ads' => array('admin_menu_manage_ads', ''), '&logout=1' => array('admin_menu_logout', ''));
    foreach ($adminMenu as $link => $title) {
        if ($link == '&b=' . $_GET['b'] || $link == $_GET['b']) {
            $TMPL['admin_menu'] .= '<strong>';
            $ttl = $LNG[$title[0]];
        }
        $TMPL['admin_menu'] .= '<a href="' . $CONF['url'] . '/index.php?a=admin' . $link . '" ' . ($title[0] == 'admin_menu_logout' ? '' : 'rel="loadpage"') . '>' . $LNG[$title[0]] . ' ' . ($title[1] ? '<span class="admin-notifications-number">' . $title[1] . '</span>' : '') . '</a>';
        if ($link == '&b=' . $_GET['b'] || $link == $_GET['b']) {
            $TMPL['admin_menu'] .= '</strong>';
        }
    }
    $TMPL['url'] = $CONF['url'];
    $TMPL['title'] = $LNG['title_admin'] . ' - ' . ($loggedIn['username'] ? $ttl : $LNG['login']) . ' - ' . $settings['title'];
    if ($content) {
        $skin = new skin('admin/content');
    } else {
        $skin = new skin('admin/login');
    }
    return $skin->make();
}
Exemplo n.º 8
0
     followUp($myPdo);
     break;
 case 'processing':
     processing($myPdo);
     break;
 case 'statAdvanced':
     statAdvanced($myPdo);
     break;
 case 'statBasic':
     statBasic($myPdo);
     break;
 case 'home':
     home($myPdo);
     break;
 case 'statistics':
     statistics($myPdo);
     break;
 case 'performanceAttitude':
     performanceAttitude($myPdo);
     break;
 case 'performancePE':
     performancePE($myPdo);
     break;
 case 'performanceSales':
     performanceSales($myPdo);
     break;
 case 'statssource':
     statssource($myPdo);
     break;
 case 'statsculture':
     statsculture($myPdo);
Exemplo n.º 9
0
        app_redirect($wx_url);
    }
}
if ($m_config['wx_appid'] && $m_config['wx_secrit']) {
    require_once APP_ROOT_PATH . "system/utils/jssdk.php";
    $jssdk = new JSSDK($m_config['wx_appid'], $m_config['wx_secrit']);
    $signPackage = $jssdk->GetSignPackage();
    $GLOBALS['tmpl']->assign("signPackage", $signPackage);
    $weixin_1 = new weixin($m_config['wx_appid'], $m_config['wx_secrit'], get_domain() . $_SERVER["REQUEST_URI"]);
    //$weixin_1->redirect_url=get_domain().$_SERVER["REQUEST_URI"];
    $wx_url = $weixin_1->scope_get_code();
    $GLOBALS['tmpl']->assign("wx_desc", "新乐筹众筹平台 - 新乐筹");
    $GLOBALS['tmpl']->assign("wx_image", "http://www.xinlechou.cn/public/attachment/201507/17/17/55a8c54dec3a1.png");
    $GLOBALS['tmpl']->assign("wx_url", $wx_url);
}
statistics();
//监测
//if(!empty($_GET['code'])&&$_GET['state']=='STATE'&&$_GET['id']>0){
//	 $class='cart';
//	 $act2='wx_jspay';
// }
//公共初始化
if (file_exists("./lib/" . $class . ".action.php")) {
    require_once "./lib/" . $class . ".action.php";
    //if($class=='index'){
    $class = $class . 'Module';
    //}
    if (class_exists($class)) {
        $obj = new $class();
        if (method_exists($obj, $act2)) {
            $obj->{$act2}();
Exemplo n.º 10
0
                echo '<img src="../images/img/error.gif" alt="image" /> <b>Ошибка! Неверный идентификатор сессии, повторите действие!</b><br />';
            }
        } else {
            echo '<img src="../images/img/error.gif" alt="image" /> <b>Ошибка! Очищать гостевую могут только суперадмины!</b><br />';
        }
        echo '<br /><img src="../images/img/back.gif" alt="image" /> <a href="book.php?start=' . $start . '&amp;' . SID . '">Вернуться</a>';
    }
    ############################################################################################
    ##                                  Пересчет гостевой                                     ##
    ############################################################################################
    if ($action == "restatement") {
        $uid = check($_GET['uid']);
        if (is_admin(array(101))) {
            if ($uid == $_SESSION['token']) {
                $count = counter_string(DATADIR . "book.dat");
                statistics(0, $count);
                header("Location: book.php?isset=mp_bookrestatement&" . SID);
                exit;
            } else {
                echo '<b>Ошибка! Неверный идентификатор сессии, повторите действие!</b><br />';
            }
        } else {
            echo '<b>Ошибка! Пересчитывать сообщения могут только суперадмины!</b><br />';
        }
        echo '<br /><img src="../images/img/back.gif" alt="image" /> <a href="book.php?' . SID . '">Вернуться</a>';
    }
    echo '<br /><img src="../images/img/panel.gif" alt="image" /> <a href="index.php?' . SID . '">В админку</a><br />';
    echo '<img src="../images/img/homepage.gif" alt="image" /> <a href="../index.php?' . SID . '">На главную</a>';
} else {
    header("Location: ../index.php?isset=404&" . SID);
    exit;
Exemplo n.º 11
0
 public static function statisticsFE($action, $task, $listId, $listType = '', $mailingId, $message, $Itemid)
 {
     $my = JFactory::getUser();
     if (empty($my->id)) {
         return true;
     }
     $linkForm = 'option=' . JNEWS_OPTION;
     $linkForm = jNews_Tools::completeLink($linkForm, false);
     $mainLink = JRoute::_('index.php?option=' . JNEWS_OPTION);
     $forms['main'] = "<form action='{$mainLink}' method='post' name='adminForm' enctype='multipart/form-data' onsubmit='submitbutton();return false;' id=\"adminForm\">";
     // menu cpanel
     $menuCpanel = new stdClass();
     $menuCpanel->popup = new stdClass();
     $menuCpanel->popup->isPop = false;
     $menuCpanel->popup->isPop = false;
     $menuCpanel->link = $linkForm;
     $menuCpanel->action = 'cpanel';
     $menuCpanel->onclick = new stdClass();
     $menuCpanel->onclick->custom = true;
     $menuCpanel->onclick->js = "javascript: submitbutton('cpanel')";
     $menuCpanel->title = _JNEWS_MENU_CPANEL;
     $menuGenerate = new stdClass();
     $menuGenerate->popup = new stdClass();
     $menuGenerate->popup->isPop = false;
     $menuGenerate->link = '#';
     $menuGenerate->action = 'generate';
     $menuGenerate->onclick = new stdClass();
     $menuGenerate->onclick->custom = true;
     $menuGenerate->onclick->js = "javascript: submitbutton('generate')";
     $menuGenerate->title = _JNEWS_BUTTON_GENERATE;
     $menuRefresh = new stdClass();
     $menuRefresh->popup = new stdClass();
     $menuRefresh->popup->isPop = false;
     $menuRefresh->link = '#';
     $menuRefresh->action = 'refresh';
     $menuRefresh->onclick = new stdClass();
     $menuRefresh->onclick->custom = true;
     $menuRefresh->onclick->js = "javascript: submitbutton('refresh')";
     $menuRefresh->title = _JNEWS_BUTTON_REFRESH;
     $menuA = array();
     $menuA['refresh'] = $menuRefresh;
     $menuA['generate'] = $menuGenerate;
     $menuA['cpanel'] = $menuCpanel;
     frontHTML::formStart(_JNEWS_MENU_STATS_REPORTS, 0, '', $menuA);
     $go[] = jnews::makeObj('list_id', $listId);
     $go[] = jnews::makeObj('act', $action);
     $go[] = jnews::makeObj('task', '');
     //save
     frontHTML::FEmenu();
     require_once JNEWSPATH_ADMIN . 'controllers' . DS . 'statistics.jnews.php';
     statistics($listId, '', $mailingId, $message, $task, $action);
     frontHTML::formEndFN(null, $go);
     return true;
 }
Exemplo n.º 12
0
		echo "alert('". $tpl->javascript_parse_text("{ERROR_NO_PRIVS}")."');";
		die();exit();
	}	
	if(isset($_POST["StreamCacheBindHTTP"])){save_parameters();exit;}
	if(isset($_GET["status"])){status();exit;}
	if(isset($_GET["services-videocache-status"])){status_videocache();exit;}
	if(isset($_GET["videocache-graph1"])){status_videocache_graph1();exit;}
	if(isset($_GET["videocache-graph2"])){status_videocache_graph2();exit;}
	if(isset($_GET["videocache-graph3"])){status_videocache_graph3();exit;}
	if(isset($_GET["websites"])){websites();exit;}
	if(isset($_POST["reinstall"])){reinstall();exit;}
	
	
	if(isset($_POST["EnableStreamCache"])){EnableStreamCache();exit;}
	if(isset($_GET["parameters"])){parameters();exit;}
	if(isset($_GET["stats"])){statistics();exit;}
	if(isset($_GET["reinstall-js"])){reinstall_js();exit;}
	
	tabs();
	
function tabs(){
	$tpl=new templates();
	$q=new mysql_squid_builder();
	$sock=new sockets();
	
	$status=trim($sock->getFrameWork("squid.php?videocache-streamsquidcache=yes"));
	
	if($status<>"TRUE"){
		echo $tpl->_ENGINE_parse_body(FATAL_WARNING_SHOW_128("{module_in_squid_not_installed}<hr>{EnableStreamCache_text}"));
		return;
	}
Exemplo n.º 13
0
    if (isset($_POST['project']) && isset($_POST['language'])) {
        if (in_array($_POST['project'], array('wikipedia', 'wikinews', 'wikibooks', 'wiktionary', 'wikiquote', 'wikivoyage', 'wikidata', 'wikimedia', 'wikiversity', 'wikisource', 'mediawiki'))) {
            $settings['wikiroot'] = "http://" . $_POST['language'] . "." . $_POST['project'] . ".org/";
        }
    }
    switch ($_POST['type']) {
        case 'rc':
            $limit = isset($_POST['limit']) ? $_POST['limit'] : '';
            $from = isset($_POST['from']) ? $_POST['from'] : '';
            $to = isset($_POST['to']) ? $_POST['to'] : '';
            $rc = recent_changes($limit, $from, $to);
            echo json_encode($rc['query']['recentchanges']);
            break;
        case 'log':
            // None yet
            throw new Exception("Feature not implemented");
            break;
        case 'user':
            $user_list = user_list($_POST['group']);
            $user_list = $user_list['query']['allusers'];
            echo json_encode($user_list);
            break;
        case 'stat':
            $statistics = statistics();
            $statistics = $statistics['query']['statistics'];
            echo json_encode($statistics);
            break;
    }
} catch (Exception $e) {
    die("FAILED: " . $e->getMessage());
}
Exemplo n.º 14
0
    echo '<br /><br /><img src="../images/img/back.gif" alt="image" /> <a href="index.php?' . SID . '">Вернуться</a>';
}
############################################################################################
##                                   Запись комментариев                                  ##
############################################################################################
if ($action == "addkomm") {
    $gid = check($_GET['gid']);
    $msg = check($_POST['msg']);
    show_title('partners.gif', 'Добавление комментария');
    if (is_user()) {
        if (preg_match('|^[a-z0-9_\\.\\-]+$|i', $gid)) {
            if (utf_strlen(trim($msg)) > 5 && utf_strlen($msg) < 1000) {
                if (file_exists(DATADIR . "datagallery/{$gid}")) {
                    antiflood("Location: index.php?action=komm&gid={$gid}&isset=antiflood&" . SID);
                    karantin($udata[6], "Location: index.php?action=komm&gid={$gid}&isset=karantin&" . SID);
                    statistics(7);
                    $msg = no_br($msg, '<br />');
                    $msg = antimat($msg);
                    $msg = smiles($msg);
                    $text = no_br($msg . '||' . SITETIME . '|' . $log . '|');
                    write_files(DATADIR . "datagallery/{$gid}.dat", "{$text}\r\n", 0, 0666);
                    //---------------------------------------------------------//
                    $countstr = counter_string(DATADIR . "datagallery/{$gid}.dat");
                    if ($countstr >= $config['maxpostgallery']) {
                        delete_lines(DATADIR . "datagallery/{$gid}.dat", array(0, 1));
                    }
                    change_profil($log, array(14 => $ip, 33 => $udata[33] + 1, 36 => $udata[36] + 1, 41 => $udata[41] + 1));
                    header("location: index.php?action=komm&gid={$gid}&isset=addkomm&" . SID);
                    exit;
                } else {
                    show_error('Ошибка, такой фотографии не существует!');
Exemplo n.º 15
0
                echo '<b>Ошибка! Неверный идентификатор сессии, повторите действие!</b><br />';
            }
        } else {
            echo '<b>Ошибка! Очищать админ-чат могут только суперадмины!</b><br />';
        }
        echo '<br /><img src="../images/img/back.gif" alt="image" /> <a href="adminchat.php?' . SID . '">Вернуться</a>';
    }
    ############################################################################################
    ##                                  Пересчет мини-чата                                    ##
    ############################################################################################
    if ($action == "restatement") {
        $uid = check($_GET['uid']);
        if (is_admin(array(101))) {
            if ($uid == $_SESSION['token']) {
                $count = counter_string(DATADIR . "adminchat.dat");
                statistics(4, $count);
                header("Location: adminchat.php?isset=mp_adminrestatement&" . SID);
                exit;
            } else {
                echo '<b>Ошибка! Неверный идентификатор сессии, повторите действие!</b><br />';
            }
        } else {
            echo '<b>Ошибка! Пересчитывать сообщения могут только суперадмины!</b><br />';
        }
        echo '<br /><img src="../images/img/back.gif" alt="image" /> <a href="adminchat.php?' . SID . '">Вернуться</a>';
    }
    echo '<br /><img src="../images/img/panel.gif" alt="image" /> <a href="index.php?' . SID . '">В админку</a><br />';
    echo '<img src="../images/img/homepage.gif" alt="image" /> <a href="../index.php?' . SID . '">На главную</a><br />';
} else {
    header("Location: ../index.php?isset=404&" . SID);
    exit;
Exemplo n.º 16
0
/**
 * 取得销售明细数据信息
 * @param   bool  $is_pagination  是否分页
 * @return  array   销售明细数据
 */
function get_sale_list($is_pagination = true)
{
    /* 时间参数 */
    $filter['start_date'] = empty($_REQUEST['start_date']) ? local_strtotime('-7 days') : local_strtotime($_REQUEST['start_date']);
    $filter['end_date'] = empty($_REQUEST['end_date']) ? local_strtotime('today') : local_strtotime($_REQUEST['end_date']);
    /*add by hg for date 2014-04-23 获取代理商信息 begin*/
    $filter['admin_agency_id'] = !empty($_REQUEST['admin_agency_id']) ? $_REQUEST['admin_agency_id'] : '0';
    /*add by ccx for date 2014-11-12 获取支付类型payment_method*/
    $filter['payment_method'] = empty($_REQUEST['payment_method']) ? '' : trim($_REQUEST['payment_method']);
    /*end*/
    $res = agency_list();
    $agency_list = array('-' => '全站');
    foreach ($res as $re_k => $res_v) {
        $agency_list[$re_k] = $res_v;
    }
    $GLOBALS['smarty']->assign('agency_list', $agency_list);
    $GLOBALS['smarty']->assign('admin_agency_id', $filter['admin_agency_id']);
    $action_list = if_agency() ? 'all' : '';
    $GLOBALS['smarty']->assign('all', $action_list);
    /*end*/
    /*add by hg for date 2014-04-22		加入代理商条件*/
    $agency_where = agency_where();
    if (!empty($agency_where)) {
        $whereArr = explode(' ', $agency_where);
        $sale_where = $whereArr[0] . $whereArr[1] . ' oi.' . $whereArr[2] . $whereArr[3] . $whereArr[4];
    }
    /*end*/
    /* 查询数据的条件 */
    $where = " WHERE og.order_id = oi.order_id" . order_query_sql('finished', 'oi.') . " AND oi.add_time >= '" . $filter['start_date'] . "' \r\n               AND oi.add_time < '" . ($filter['end_date'] + 86400) . "'{$sale_where}";
    /*add by hg for date 2014-04-23 根据代理商筛选  begin*/
    if (!empty($filter['admin_agency_id']) && if_agency()) {
        if ($filter['admin_agency_id'] != '-') {
            $where .= " AND oi.admin_agency_id = " . $filter['admin_agency_id'];
        }
    } elseif (if_agency()) {
        $where .= " AND admin_agency_id = '0' ";
    }
    /*en
    	/*end*/
    /*add by ccx for date 2014-11-12  根据选择支付类型(余额支付,货到付款,在线支付三种)筛选  begin*/
    if ($filter['payment_method']) {
        //$where .= " AND o.pay_id  = '$filter[payment_method]'";
        if ($filter['payment_method'] == 3) {
            $where .= " AND ( oi.pay_id !=1 AND oi.pay_id !=2 AND oi.pay_id !=0)";
        } elseif ($filter['payment_method'] == 1) {
            $where .= " AND oi.pay_id  = 1";
        } elseif ($filter['payment_method'] == 2) {
            $where .= " AND oi.pay_id  = 2";
        }
    }
    /*end*/
    $sql = "SELECT COUNT(og.goods_id) FROM " . $GLOBALS['ecs']->table('order_info') . ' AS oi,' . $GLOBALS['ecs']->table('order_goods') . ' AS og ' . $where;
    $filter['record_count'] = $GLOBALS['db']->getOne($sql);
    /* 分页大小 */
    $filter = page_and_size($filter);
    /* modify by SouthBear 2014-12-04 16:13:04
     * 增加 oi.order_amount, oi.goods_amount order_amount 字段用途不明,TABLE中无数据
     */
    $sql = 'SELECT og.goods_id, og.costing_price,og.goods_sn, og.goods_name, og.goods_number AS goods_num, 
    		og.goods_price AS sales_price, oi.add_time AS sales_time, oi.order_id, oi.order_sn,oi.order_amount,
    		oi.goods_amount , og.stock_costing_price ' . "FROM " . $GLOBALS['ecs']->table('order_goods') . " AS og, " . $GLOBALS['ecs']->table('order_info') . " AS oi " . $where . " ORDER BY sales_time DESC, goods_num DESC";
    $statistics_sql = $sql;
    if ($is_pagination) {
        $sql .= " LIMIT " . $filter['start'] . ', ' . $filter['page_size'];
    }
    $sale_list_data = $GLOBALS['db']->getAll($sql);
    /* modify by SouthBear 2014-12-04 16:13:04
     * 将订单成本和订单金额重新计算
     */
    //if (count($sale_list_data) > 0) {
    foreach ($sale_list_data as $key => $item) {
        //$sale_list_data[$key]['profit_total'] = price_format(($sale_list_data[$key]['sales_price'] - $sale_list_data[$key]['costing_price'])*$sale_list_data[$key]['goods_num']); //利润
        /*ccx 2014-12-10 订单商品的利润*/
        $sale_list_data[$key]['profit_total'] = price_format($sale_list_data[$key]['sales_price'] * $sale_list_data[$key]['goods_num'] - $sale_list_data[$key]['stock_costing_price']);
        //利润
        $sale_list_data[$key]['unit_sales_price'] = price_format($sale_list_data[$key]['sales_price']);
        //订单单价
        //成本
        $sale_list_data[$key]['unit_costing_price'] = price_format($sale_list_data[$key]['costing_price']);
        //成本单价
        //$sale_list_data[$key]['order_costing_price'] = price_format($sale_list_data[$key]['costing_price'] * $sale_list_data[$key]['goods_num']); //订单成本
        /*ccx 2014-12-10 ccx 读取订单商品表新建的库存商品成本总价*/
        $sale_list_data[$key]['order_costing_price'] = $sale_list_data[$key]['stock_costing_price'];
        //订单成本总价
        //订单总金额
        $sale_list_data[$key]['goods_amount'] = price_format($sale_list_data[$key]['sales_price'] * $sale_list_data[$key]['goods_num']);
        $sale_list_data[$key]['sales_time'] = local_date($GLOBALS['_CFG']['time_format'], $sale_list_data[$key]['sales_time']);
    }
    $statistics = statistics($statistics_sql);
    $arr = array('sale_list_data' => $sale_list_data, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count'], 'statistics' => $statistics);
    //} else {
    //	$arr = false;
    //}
    return $arr;
}
Exemplo n.º 17
0
}
############################################################################################
##                                  Добавление комментариев                               ##
############################################################################################
if ($action == "add") {
    $uid = check($_GET['uid']);
    $id = (int) $_GET['id'];
    $msg = check($_POST['msg']);
    if (is_user()) {
        if ($uid == $_SESSION['token']) {
            if (utf_strlen(trim($msg)) >= 5 && utf_strlen($msg) < 1000) {
                $string = search_string(DATADIR . "news.dat", $id, 5);
                if ($string) {
                    antiflood("Location: komm.php?id={$id}&isset=antiflood&" . SID);
                    karantin($udata[6], "Location: komm.php?id={$id}&isset=karantin&" . SID);
                    statistics(3);
                    $msg = no_br($msg, '<br />');
                    $msg = antimat($msg);
                    $msg = smiles($msg);
                    $lastid = 0;
                    if (file_exists(DATADIR . "datakomm/{$id}.dat")) {
                        $file = file(DATADIR . "datakomm/{$id}.dat");
                        $lastkomm = explode("|", end($file));
                        $lastid = $lastkomm[5] + 1;
                    }
                    $text = no_br($brow . ', ' . $ip . '|' . $msg . '||' . SITETIME . '|' . $log . '|' . $lastid . '|');
                    write_files(DATADIR . "datakomm/{$id}.dat", "{$text}\r\n", 0, 0666);
                    $countstr = counter_string(DATADIR . "datakomm/{$id}.dat");
                    if ($countstr >= $config['maxkommnews']) {
                        delete_lines(DATADIR . "datakomm/{$id}.dat", array(0, 1));
                    }
Exemplo n.º 18
0
//
// mails dump back
/*
 * published under the GPL Licence
 *
 * (c) Mar 2010
 *     by Karsten Hinz
 */
require_once "./config.php";
require_once "./formmail.lib.php";
require_once './Template.php';
//testing
extract_csv(0);
$daten_org = recive_formular();
$daten_no_html = $daten_org;
//ka ob das nur die addresse rüber kopiert ist hier aber auch egal
//löscht die zeilenumbrüche
clean_array($daten_no_html, 0);
//ersetzt alle sonderzeichen durch html
clean_array($daten_org, 1);
$stat = statistics($daten_org, $preise);
if (!empty($daten_org["bemerkung"])) {
    sends_info($daten_org, $stat);
}
//die nicht escapte version, damit man die datei einfacher wo anders importieren kann
save_data($daten_no_html);
//erzeugt eine Rechnung aus einen Template
$rechnung = generate_bill($daten_org, $preise);
$fehler = generate_mail($daten_org, $rechnung);
//und auch noch was anzeigen
print_page($daten_org, $rechnung, $fehler);
    if (!is_file($opts->contribute)) {
        echo "Archive file '" . $opts->contribute . "' could not be found! \n";
        exit;
    }
    contributorsMerge($opts->v, $opts->language, $opts->contribute);
    echo "merging completed :-) \n";
}
if ($opts->mo) {
    msgfmt($opts->v);
}
if ($opts->c || $opts->package) {
    // remove translation backups of msgmerge
    `cd "{$tine20path}"\n    find . -type f -iname "*.po~" -exec rm {} \\;`;
}
if ($opts->statistics) {
    statistics($opts->v);
}
if ($opts->package) {
    buildpackage($opts->v, $opts->{'package'} ?: NULL);
}
/**
 * returns list of existing langugages
 * (those, having a correspoinding Tinebase po file)
 *
 * @return array 
 */
function getExistingLanguages($_verbose)
{
    global $tine20path;
    $langs = array();
    foreach (scandir("{$tine20path}/Tinebase/translations") as $poFile) {
Exemplo n.º 20
0
 case 'create':
     $config['newtitle'] = 'Создание новой темы';
     $uid = check($_GET['uid']);
     $fid = abs(intval($_POST['fid']));
     $forum = search_string(DATADIR . "dataforum/mainforum.dat", $fid, 0);
     if ($forum) {
         if (is_user()) {
             if ($uid == $_SESSION['token']) {
                 $title = check($_POST['title']);
                 $msg = check($_POST['msg']);
                 if (is_flood($log)) {
                     if (is_quarantine($log)) {
                         if (utf_strlen(trim($title)) >= 5 && utf_strlen($title) <= 50) {
                             if (utf_strlen(trim($msg)) >= 5 && utf_strlen($msg) <= 3000) {
                                 statistics(1);
                                 statistics(2);
                                 $title = no_br($title);
                                 $title = antimat($title);
                                 $msg = no_br($msg, '<br />');
                                 $msg = antimat($msg);
                                 $msg = smiles($msg);
                                 $id = unifile(DATADIR . "dataforum/topic{$fid}.dat", 0);
                                 // Создание темы в списке тем
                                 $text = $id . '|' . $fid . '|' . $log . '|' . $title . '|' . SITETIME . '|0|0|';
                                 write_files(DATADIR . "dataforum/topic{$fid}.dat", "{$text}\r\n", 0, 0666);
                                 // Создание файла темы и запись сообщения
                                 $topictext = $id . '|' . $fid . '|' . $log . '|' . $msg . '|' . $brow . ', ' . $ip . '|' . SITETIME . '|';
                                 write_files(DATADIR . 'dataforum/' . $fid . '-' . $id . '.dat', "{$topictext}\r\n", 1, 0666);
                                 // Обновление mainforum
                                 $maintext = $forum[0] . '|' . $forum[1] . '|' . ($forum[2] + 1) . '|' . ($forum[3] + 1) . '|';
                                 replace_lines(DATADIR . "dataforum/mainforum.dat", $forum['line'], $maintext);
Exemplo n.º 21
0
 public function aqj_do_register()
 {
     //查询用户是否存在
     $aqj_id = trim($_POST['reg_aqjid']);
     $aqj_mobile = trim($_POST['reg_m']);
     $result = array();
     $xlc_user = $GLOBALS['db']->getRow("select id,mobile,user_pwd from " . DB_PREFIX . "user where mobile='" . $aqj_mobile . "'");
     //        print_r($xlc_user);
     if ($xlc_user) {
         //存在新乐筹用户
         $aqj_user = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "ap_partner_user where user_id=" . $xlc_user['id']);
         if (!$aqj_user) {
             //未绑定:与爱钱进帐号绑定
             $user_ap_partner = array();
             $user_ap_partner['user_id'] = $xlc_user['id'];
             $user_ap_partner['partner_id'] = 2;
             $user_ap_partner['partner_user_id'] = $aqj_id;
             $user_ap_partner['create_time'] = time();
             $GLOBALS['db']->autoExecute(DB_PREFIX . "ap_partner_user", $user_ap_partner);
             require_once APP_ROOT_PATH . "system/libs/user.php";
             $result['status'] = 1;
             $result['data'] = "授权成功,正在为您登录...";
         } else {
             //存在爱前进用户,更新绑定
             $user_ap_partner = array();
             $user_ap_partner['partner_user_id'] = $aqj_id;
             $user_ap_partner['edit_time'] = time();
             $GLOBALS['db']->autoExecute(DB_PREFIX . "ap_partner_user", $user_ap_partner, "UPDATE", "id=" . intval($aqj_user['id']));
             $result['status'] = 2;
             $result['data'] = "已授权,正在为您登录...";
         }
         $result['jump'] = url_wap("deals", array('aqjid' => $aqj_id, 'm' => $aqj_mobile, 'isap' => 1));
         ajax_return($result);
     } else {
         //不存在新乐筹用户,自动注册帐号
         require_once APP_ROOT_PATH . "system/libs/user.php";
         $user_data = array();
         $user_data['user_name'] = $aqj_mobile;
         $user_data['mobile'] = $aqj_mobile;
         $user_data['user_pwd'] = rand(100000, 999999);
         //自动生成六位密码
         if (app_conf("USER_VERIFY") == 0 || app_conf("USER_VERIFY") == 2) {
             $user_data['is_effect'] = 1;
         } else {
             $user_data['is_effect'] = 0;
         }
         $res = save_user($user_data);
         statistics('register');
         $user_ap_partner = array();
         $user_ap_partner['user_id'] = $res['data'];
         $user_ap_partner['partner_id'] = 2;
         $user_ap_partner['partner_user_id'] = $aqj_id;
         $user_ap_partner['create_time'] = time();
         $GLOBALS['db']->autoExecute(DB_PREFIX . "ap_partner_user", $user_ap_partner);
         $result = do_login_user($user_data['mobile'], $user_data['user_pwd']);
         $result['data'] = "授权成功,正在为您登录...";
         $result['jump'] = url_wap("deals", array('aqjid' => $aqj_id, 'm' => $aqj_mobile, 'isap' => 1));
         send_auto_register_pwd($aqj_mobile, $user_data['user_pwd']);
         //send pwd message
         ajax_return($result);
     }
 }
Exemplo n.º 22
0
#             WAP-Site  :  http://visavi.net          #
#                  ICQ  :  36-44-66                   #
#  Вы не имеете право вносить изменения в код скрипта #
#        для его дальнейшего распространения          #
#-----------------------------------------------------#
require_once "../includes/start.php";
require_once "../includes/functions.php";
require_once "../includes/header.php";
include_once "../themes/" . $config['themes'] . "/index.php";
$msg = check($_POST['msg']);
show_title('partners.gif', 'Добавление сообщения');
if (is_user()) {
    if (utf_strlen(trim($msg)) > 3 && utf_strlen($msg) < 1000) {
        antiflood("Location: index.php?isset=antiflood&" . SID);
        karantin($udata[6], "Location: index.php?isset=karantin&" . SID);
        statistics(8);
        $msg = no_br($msg, '<br />');
        $msg = antimat($msg);
        $msg = smiles($msg);
        $file = file(DATADIR . "chat.dat");
        $data = explode("|", end($file));
        $text = no_br($msg . '|' . $log . '||' . SITETIME . '|' . $brow . '|' . $ip . '|0|' . $data[7] . '|' . $data[8] . '|');
        write_files(DATADIR . "chat.dat", "{$text}\r\n");
        $countstr = counter_string(DATADIR . "chat.dat");
        if ($countstr >= $config['maxpostchat']) {
            delete_lines(DATADIR . "chat.dat", array(0, 1, 2, 3, 4));
        }
        change_profil($log, array(14 => $ip, 12 => $udata[12] + 1, 36 => $udata[36] + 1, 41 => $udata[41] + 1));
        //--------------------------------------------------------------------------//
        if ($config['botnik'] == 1) {
            include_once BASEDIR . "includes/chat_bot.php";
Exemplo n.º 23
0
     $last_total_every = statistics($before_last_day, $last_day, 'admin_id');
     // 个人
     $sum['last'] = calc_times($last_total);
     $sum_every['last'] = calc_times($last_total_every);
 }
 // 获取近7天的销量
 $days_7_total = statistics($days_7, $before_last_day, 'platform');
 // 团队
 $days_7_total_every = statistics($days_7, $before_last_day, 'admin_id');
 // 个人
 $sum['days_7'] = calc_times($days_7_total);
 $sum_every['days_7'] = calc_times($days_7_total_every);
 // 获取当月的销量
 $month_total = statistics($month1st, $monthlast, 'platform');
 // 团队
 $month_total_every = statistics($month1st, $monthlast, 'admin_id');
 // 个人
 $sum['month'] = calc_times($month_total);
 $sum_every['month'] = calc_times($month_total_every);
 /* 查看时间划分
    echo date('Y-m-d H:i:s', $today),'- ', $today, '<br>';
    echo date('Y-m-d H:i:s', $last_day),'- ', $last_day, '<br>';
    echo date('Y-m-d H:i:s', $before_last_day), '- ',$before_last_day, '<br>';
    echo date('Y-m-d H:i:s', $days_7), '- ',$days_7, '<br>';
    echo date('Y-m-d H:i:s', $month1st), '- ',$month1st, '<br>';
    echo date('Y-m-d H:i:s', $monthlast), '- ',$monthlast, '<br>';
     */
 $platform_total = array();
 foreach ($platform as $val) {
     if (isset($month_total[$val['role_id']])) {
         $platform_total[$val['role_id']] = $month_total[$val['role_id']]['amount'];
Exemplo n.º 24
0
 public function do_register()
 {
     $email = strim($_REQUEST['email']);
     require_once APP_ROOT_PATH . "system/libs/user.php";
     $return = $this->register_check_all();
     if ($return['status'] == 0) {
         ajax_return($return);
     }
     $user_data = $_POST;
     foreach ($_POST as $k => $v) {
         $user_data[$k] = strim($v);
     }
     //开启邮箱验证
     if (app_conf("USER_VERIFY") == 0 || app_conf("USER_VERIFY") == 2) {
         $user_data['is_effect'] = 1;
     } else {
         $user_data['is_effect'] = 0;
     }
     $res = save_user($user_data);
     statistics('register');
     if ($res['status'] == 1) {
         if (!check_ipop_limit(get_client_ip(), "user_do_register", 5)) {
             showErr("提交太快", 1);
         }
         $user_id = intval($res['data']);
         $user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id);
         if ($user_info['is_effect'] == 1) {
             //在此自动登录
             //send_register_success(0,$user_data);
             $result = do_login_user($user_data['user_name'], $user_data['user_pwd']);
             //	ajax_return(array("status"=>1,"jump"=>get_gopreview()));
             ajax_return(array("status" => 1, "data" => $result['msg'], "jump" => get_gopreview()));
         } else {
             if (app_conf("USER_VERIFY") == 1) {
                 ajax_return(array("status" => 1, "jump" => url("user#mail_check", array('uid' => $user_id))));
             } else {
                 if (app_conf("USER_VERIFY") == 3) {
                     ajax_return(array("status" => 0, "info" => "请等待管理员审核"));
                 }
             }
         }
     } else {
         $error = $res['data'];
         if ($error['field_name'] == "user_name") {
             $data[] = array("type" => "form_success", "field" => "email", "info" => "");
             $field_name = "会员帐号";
         }
         if ($error['field_name'] == "email") {
             $data[] = array("type" => "form_success", "field" => "user_name", "info" => "");
             $field_name = "电子邮箱";
         }
         if ($error['field_name'] == "mobile") {
             $data[] = array("type" => "form_success", "field" => "mobile", "info" => "");
             $field_name = "手机号码";
         }
         if ($error['field_name'] == "verify_code") {
             $data[] = array("type" => "form_success", "field" => "verify_code", "info" => "");
             $field_name = "验证码";
         }
         if ($error['error'] == EMPTY_ERROR) {
             $error_info = "不能为空";
             $type = "form_tip";
         }
         if ($error['error'] == FORMAT_ERROR) {
             $error_info = "错误";
             $type = "form_error";
         }
         if ($error['error'] == EXIST_ERROR) {
             $error_info = "已存在";
             $type = "form_error";
         }
         $data[] = array("type" => $type, "field" => $error['field_name'], "info" => $field_name . $error_info);
         ajax_return(array("status" => 0, "data" => $data, "info" => ""));
     }
 }
Exemplo n.º 25
0
 public function wx_do_register()
 {
     $user_info = array();
     $referer = $_REQUEST['referer'];
     $user_info['mobile'] = strim($_REQUEST['mobile']);
     //$user_info['verify_coder']=strim($_REQUEST['code']);
     $user_info['wx_openid'] = strim($_REQUEST['wx_openid']);
     $user_info['user_name'] = strim($_REQUEST['user_name']);
     $user_info['province'] = strim($_REQUEST['province']);
     $user_info['email'] = strim($_REQUEST['email']);
     $user_info['city'] = strim($_REQUEST['city']);
     $user_info['sex'] = strim($_REQUEST['sex']);
     $user_pwd = $_REQUEST['password'];
     $user_new_pwd = $_REQUEST['new_password'];
     if (!$user_info['mobile']) {
         $data['status'] = 0;
         $data['info'] = "手机号码为空";
         ajax_return($data);
     }
     /*
     if($user_info['verify_coder']==""){
     	$data['status'] = 0;
     	$data['info'] = "手机验证码为空";
     	ajax_return($data);
     }
     */
     if ($user_pwd == "") {
         $data['status'] = 0;
         $data['info'] = "密码为空";
         ajax_return($data);
     }
     if (strlen($user_pwd) < 4 || strlen($user_pwd) > 12) {
         $data['status'] = 0;
         $data['info'] = "密码请输入4~12个字符";
         ajax_return($data);
     }
     if ($user_pwd != $user_new_pwd) {
         $data['status'] = 0;
         $data['info'] = "确认密码与密码不符";
         ajax_return($data);
     }
     /*
     //判断验证码是否正确=============================
     if($GLOBALS['db']->getOne("SELECT count(*) FROM ".DB_PREFIX."mobile_verify_code WHERE mobile=".$user_info['mobile']." AND verify_code='".$user_info['verify_coder']."'")==0){
      			$data['status'] = 0;
     	$data['info'] = "手机验证码错误";
     	ajax_return($data);
     }
     */
     $user = get_user_has('mobile', $user_info['mobile']);
     require_once APP_ROOT_PATH . "system/libs/user.php";
     if ($user) {
         $GLOBALS['db']->query("update " . DB_PREFIX . "user set wx_openid='" . $user_info['wx_openid'] . "' where id=" . $user['id']);
         $user_id = $user['id'];
     } else {
         /*
          			if(!$user_info['email'])
         {
         	$data['status'] = 0;
         	$data['info'] = "邮箱为空";
         	ajax_return($data);
         }
         if(!check_email($user_info['email'])){
         	$data['status'] = 0;
         	$data['info'] = "邮箱格式错误";
         	ajax_return($data);
         }
         
         $has_email=get_user_has('email',$user_info['email']);
         if($has_email){
         	$data['status'] = 0;
         	$data['info'] = "邮箱已存在,请重新填写";
         	ajax_return($data);
         }
         */
         $has_user_name = get_user_has('user_name', $user_info['user_name']);
         if ($has_user_name) {
             $user_info['user_name'] = $user_info['user_name'] . rand(10000, 99999);
         }
         if ($user_info['sex'] == 0) {
             $user_info['sex'] = -1;
         } elseif ($user_info['sex'] == 1) {
             $user_info['sex'] = 1;
         } else {
             $user_info['sex'] = 0;
         }
         //开启邮箱验证
         if (app_conf("USER_VERIFY") == 0 || app_conf("USER_VERIFY") == 2) {
             $user_info['is_effect'] = 1;
         } else {
             $user_info['is_effect'] = 0;
         }
         $user_info['create_time'] = get_gmtime();
         $user_info['update_time'] = get_gmtime();
         //新建用户 使用验证码作为密码
         $user_info['user_pwd'] = $user_pwd;
         //$GLOBALS['db']->autoExecute(DB_PREFIX."user",$user_info,"INSERT");
         $res = save_user($user_info);
         statistics('register');
         $user_id = intval($res['data']);
     }
     $user_info_new = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id);
     if ($user_info_new['is_effect'] == 1) {
         $result = do_login_user($user_info_new['mobile'], $user_info_new['user_pwd']);
         ajax_return(array("status" => 1, "info" => $result['msg'], "jump" => $referer));
     } else {
         if (app_conf("USER_VERIFY") == 1) {
             ajax_return(array("status" => 1, "jump" => url_wap("user#mail_check", array('uid' => $user_id))));
         } else {
             if (app_conf("USER_VERIFY") == 3) {
                 ajax_return(array("status" => 0, "info" => "请等待管理员审核"));
             }
         }
     }
 }
Exemplo n.º 26
0
             echo '<b>Ошибка! Неверный идентификатор сессии, повторите действие!</b><br />';
         }
     } else {
         echo '<b>Ошибка! Очищать мини-чат могут только суперадмины!</b><br />';
     }
     echo '<br /><img src="../images/img/back.gif" alt="image" /> <a href="chat.php?' . SID . '">Вернуться</a>';
 }
 ############################################################################################
 ##                                  Пересчет мини-чата                                    ##
 ############################################################################################
 if ($action == "restatement") {
     $uid = check($_GET['uid']);
     if (is_admin(array(101))) {
         if ($uid == $_SESSION['token']) {
             $count = counter_string(DATADIR . "chat.dat");
             statistics(8, $count);
             header("Location: chat.php?isset=mp_chatrestatement&" . SID);
             exit;
         } else {
             echo '<b>Ошибка! Неверный идентификатор сессии, повторите действие!</b><br />';
         }
     } else {
         echo '<b>Ошибка! Пересчитывать сообщения могут только суперадмины!</b><br />';
     }
     echo '<br /><img src="../images/img/back.gif" alt="image" /> <a href="chat.php?' . SID . '">Вернуться</a>';
 }
 ############################################################################################
 ##                                 Удаление сообщений                                     ##
 ############################################################################################
 if ($action == "del") {
     $uid = check($_GET['uid']);
Exemplo n.º 27
0
function en($method, $s)
{
    switch ($method) {
        case 'snd':
            $s = soundex($s);
            break;
        case 'bin':
            $s = bin_en($s);
            break;
        case 'dec':
            $s = dec_en($s);
            break;
        case 'oct':
            $s = oct_en($s);
            break;
        case 'hex':
            $s = hex_en($s);
            break;
        case 'bsd':
            $s = bsdconv(bsdconv_create($_POST['bsdconv']), $s) or addmsg(ERR, bsdconv_error());
            break;
        case 'rot':
            $s = rotate($s, $_POST['rot'], $_POST['nrot']);
            break;
        case 'url':
            $s = $_POST['url_raw'] == 'on' ? rawurlencode($s) : urlencode($s);
            break;
        case 'raw':
            break;
        case 'stmwth':
            $s = strimwidth($s);
            break;
        case 'rpt':
            $s = str_repeat($s, $_POST['rpt']);
            break;
        case 'rev':
            $s = str_rev($s);
            break;
        case 'crv':
            $s = case_rev($s);
            break;
        case 'nbase':
            $s = base_conv($s, 0);
            break;
        case 'base':
            $s = base_en($s);
            break;
        case 'rep':
            $s = gen_rep($s);
            break;
        case 'pcr':
            $s = pcre_rep($s);
            break;
        case 'pcm':
            $s = pcre_mat($s);
            break;
        case 'spe':
            $s = htmlspecialchars($s);
            break;
        case 'hen':
            $s = mbs() ? mb_convert_encoding($s, 'HTML-ENTITIES') : htmlentities($s);
            break;
        case 'md5':
            $s = md5($s);
            break;
        case 'crypt':
            $s = crypt($s, $_POST['crypt_salt']);
            break;
        case 'sha1':
            $s = sha1($s);
            break;
        case 'crc16':
            $s = sprintf("%x", crc32($s));
            break;
        case 'crc32':
            $s = sprintf("%x", crc32($s));
            break;
        case 'srt':
            $s = mysort($s, 0);
            break;
        case 'stu':
            $s = mbs() ? mb_strtoupper($s) : strtoupper($s);
            break;
        case 'bbs':
            $s = bbs2html($s);
            break;
        case 'unq':
            $s = uniq($s, 0);
            break;
        case 'mut':
            $s = str_mutate($s);
            break;
        case 'ttb':
            $s = totable($s);
            break;
        case 'acc':
            $s = accumulation($s, 0);
            break;
        case 'stl':
            $s = mbs() ? mb_strtolower($s) : strtolower($s);
            break;
        case 'ucw':
            $s = ucwords($s);
            break;
        case 'ctr':
            $s = counter($s);
            break;
        case 'swd':
            $s = strwidth($s);
            break;
        case 'cor':
            $s = correct($s);
            break;
        case 'det':
            $s = determinant($s);
            break;
        case 'uue':
            $s = convert_uuencode($s);
            break;
        case 'msk':
            $s = network($s);
            break;
        case 'ref':
            $s = sqr_reflect($s);
            break;
        case 'che':
            $s = chewing($s);
            break;
        case 'rf':
            $s = sqr($s, 0);
            break;
        case 'cac':
            $s = cac_pre($s);
            break;
        case 'mmtp':
            $s = matrix_multiply($s);
            break;
        case 'mro':
            $s = matrix_rotate($s, 0);
            break;
        case 'miv':
            $s = matrix_inverse($s);
            break;
        case 'mtr':
            $s = matrix_transpose($s);
            break;
        case 'ascii':
            $s = ASCIIFilter($s);
            break;
        case 'key':
            $s = key_xor($_POST['key'], $s);
            break;
        case 'bre':
            $s = bit_rev($s);
            break;
        case 'bod':
            $s = bitorder_en($_POST['order'], $s);
            break;
        case 'tra':
            $s = tran($_POST['transpose'], $s, 2);
            break;
        case 'sta':
            $s = statistics($s);
            break;
        case 'quot':
            $s = quoted_printable_decode($s);
            break;
        default:
            addmsg(WARN, 'Undefined Method: ' . $method);
    }
    return $s;
}