Beispiel #1
0
function plugins_set_mine($id, $is_del = 0)
{
    $id = intval($id);
    $is_del = intval($is_del);
    $val = '';
    $uid = get_sess_userid();
    global $tablePreStr;
    $t_users = $tablePreStr . "users";
    $t_plugins = $tablePreStr . "plugins";
    $result_rs = array();
    $dbo = new dbex();
    dbplugin('r');
    $u_apps = get_sess_apps();
    if ($is_del == 0) {
        if ($u_apps == '') {
            $val = $id;
        } else {
            $val = $u_apps . "," . $id;
        }
    } else {
        $val = str_replace(",{$id},", "", ",{$u_apps},");
    }
    $sql = " update {$t_users} set use_apps = '{$val}' where user_id = {$uid} ";
    if ($dbo->exeUpdate($sql)) {
        set_sess_apps($val);
        if ($is_del == 0) {
            $sql = " update {$t_plugins} set use_num=use_num+1 where id={$id} ";
        } else {
            $sql = " update {$t_plugins} set use_num=use_num-1 where id={$id} ";
        }
        return $dbo->exeUpdate($sql);
    } else {
        return 0;
    }
}
Beispiel #2
0
if ($user_info['is_pass'] == 0) {
    echo 'emailmsg|' . $l_langpackage->l_lock_u;
    exit;
}
$mypals = getMypals($dbo, $user_info['user_id'], $t_mypals);
set_sess_mypals($mypals);
set_sess_username($user_info['user_name']);
set_sess_userid($user_info['user_id']);
set_sess_usersex($user_info['user_sex']);
set_sess_cgroup($user_info['creat_group']);
set_sess_jgroup($user_info['join_group']);
set_sess_userico($user_info['user_ico']);
set_session('hidden_pals', $user_info['hidden_pals_id']);
set_session('hidden_type', $user_info['hidden_type_id']);
set_sess_plugins($user_info['use_plugins']);
set_sess_apps($user_info['use_apps']);
set_sess_online($hidden);
set_session($user_info['user_id'] . "_dressup", $user_info['dressup']);
$sql = "select * from {$t_frontgroup} where gid='{$user_info['user_group']}'";
$rights = $dbo->getRow($sql);
if ($rights) {
    set_sess_rights($rights['rights']);
} else {
    set_sess_rights("");
}
//定义写操作
dbtarget('w', $dbServs);
$now_time = time();
$last_data = date("Y-m-d", strtotime($user_info['lastlogin_datetime']));
$now_data = date("Y-m-d", $now_time);
if ($last_data != $now_data) {