$get_pws = $user_info['user_pws']; if ($get_pws != $user_pws) { echo 'pwdmsg|' . $l_langpackage->l_wrong_pass; exit; } 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(""); } //定义写操作
<?php //引入语言包 $g_langpackage = new grouplp(); require "api/base_support.php"; //变量区 $user_id = get_sess_userid(); $group_id = short_check(get_argg('group_id')); $dbo = new dbex(); //数据表定义 $t_groups = $tablePreStr . "groups"; $t_group_members = $tablePreStr . "group_members"; $t_users = $tablePreStr . "users"; //取得用户加入的群组 $join_group_array = api_proxy("user_self_by_uid", "join_group", $user_id); $user_join_group = preg_replace("/,{$group_id},/", ",", $join_group_array['join_group']); //写方式 dbtarget('w', $dbServs); //更新用户表 $sql = "update {$t_users} set join_group='{$user_join_group}' where user_id={$user_id}"; $dbo->exeUpdate($sql); //更新群组人数 $sql = "update {$t_groups} set member_count=member_count-1 where group_id={$group_id}"; $dbo->exeUpdate($sql); //删除群组关系表 $sql = "delete from {$t_group_members} where group_id={$group_id} && user_id={$user_id}"; $dbo->exeUpdate($sql); //更新session set_sess_jgroup($user_join_group); action_return(1, '', "");