Ejemplo n.º 1
0
$op = getgpc('op');
$cpscript = basename($_G['PHP_SELF']);
$modsession = new AdminSession($_G['uid'], $_G['groupid'], $_G['adminid'], $_G['clientip']);
if ($modsession->cpaccess == 1) {
    if ($_G['gp_action'] == 'login' && $_G['gp_cppwd'] && submitcheck('submit')) {
        loaducenter();
        $ucresult = uc_user_login($_G['uid'], $_G['gp_cppwd'], 1);
        if ($ucresult[0] > 0) {
            $modsession->errorcount = '-1';
            $url_forward = $modsession->get('url_forward');
            $modsession->clear(true);
            $url_forward && dheader("Location: {$cpscript}?mod=modcp&{$url_forward}");
            $_G['gp_action'] = 'home';
        } else {
            $modsession->errorcount++;
            $modsession->update();
        }
    } else {
        $_G['gp_action'] = 'login';
    }
}
if ($_G['gp_action'] == 'logout') {
    $modsession->destroy();
    showmessage('modcp_logout_succeed', 'forum.php');
}
$modforums = $modsession->get('modforums');
if ($modforums === null) {
    $modforums = array('fids' => '', 'list' => array(), 'recyclebins' => array());
    $comma = '';
    if ($_G['adminid'] == 3) {
        $query = DB::query("SELECT m.fid, f.name, f.recyclebin\n\t\t\t\tFROM " . DB::table('forum_moderator') . " m\n\t\t\t\tLEFT JOIN " . DB::table('forum_forum') . " f ON f.fid=m.fid\n\t\t\t\tWHERE m.uid='{$_G['uid']}' AND f.status='1' AND f.type<>'group'");
Ejemplo n.º 2
0
    if ($radminid != $groupid) {
        $tmp = unserialize($db->result_first("SELECT disabledactions FROM {$tablepre}adminactions WHERE admingid='{$groupid}'"));
        $dactionarray = $tmp ? $tmp : array();
    }
    $adminsession->set('dactionarray', $dactionarray, true);
}
$cpaccess = $adminsession->cpaccess;
if ($cpaccess == 0 || !$discuz_secques && $admincp['forcesecques']) {
    require_once DISCUZ_ROOT . './admin/login.inc.php';
} elseif ($cpaccess == 1) {
    if ($admin_password != '') {
        require_once DISCUZ_ROOT . './uc_client/client.php';
        $ucresult = uc_user_login($discuz_uid, $admin_password, 1, 1, $admin_questionid, $admin_answer);
        if ($ucresult[0] > 0) {
            $adminsession->errorcount = -1;
            $adminsession->update();
            dheader('Location: ' . $BASESCRIPT . '?' . cpurl('url', array('sid')));
        } else {
            $adminsession->errorcount++;
            $adminsession->update();
            writelog('cplog', dhtmlspecialchars("{$timestamp}\t{$discuz_userss}\t{$adminid}\t{$onlineip}\t{$action}\tAUTHENTIFICATION(PASSWORD)"));
        }
    }
    require_once DISCUZ_ROOT . './admin/login.inc.php';
} else {
    // OpenID4Discuz
    if (!empty($action) && !empty($openid_identifier)) {
        include DISCUZ_ROOT . './openid.php';
        dexit();
    }
    $username = !empty($username) ? dhtmlspecialchars($username) : '';