public function save_user_info($user_info, $account, $ckb_cookie = 1, $login_type = 0, $auto_login = 0, $oauth_login = 0) { global $kekezu, $_K, $handlekey; global $_lang; $_SESSION['uid'] = $user_info['uid']; $_SESSION['username'] = $user_info['username']; $_SESSION['last_login_time'] = $user_info['last_login_time']; $this->add_login_time(0); $login_type = $this->_login_type; if ($auto_login == '1') { $c = array(); $c[0] = base64_encode($user_info['uid']); $c[1] = base64_encode($account); $c[2] = base64_encode($user_info['uid'] . '|' . $user_info['password'] . '|' . $account); setcookie('keke_auto_login', serialize($c), time() + 3600 * 24 * 30); } if ($_K['refer']) { //登录之后不同身份跳转到各自管理页面 $user_obj = new keke_user_class(); $user_type = $user_obj->get_user_type($user_info['uid']); if ($user_type['user_type'] == 2) { $r_url = '?do=user&view=wk'; } elseif ($user_type['user_type'] == 1) { $r_url = '?do=user&view=gz'; } $r = $_K['refer'] . $r_url; } else { $r = 'index.php'; } if ($login_type) { $r = 'index.php'; } if ($oauth_login) { $r = 'index.php'; } if ($this->_sys_config['user_intergration'] == 2) { $synhtml = keke_user_class::user_synlogin($user_info['uid'], $this->_password); } $synhtml = isset($synhtml) ? $synhtml : ""; $user_obj = new Keke_witkey_space_class(); $user_obj->setLast_login_time(time()); $user_obj->setWhere("uid = '{$user_info['uid']}'"); $user_obj->edit_keke_witkey_space(); $black_obj = new Keke_witkey_member_black_class(); $black_obj->setWhere("uid = '{$user_info['uid']}'"); $black_obj->del_keke_witkey_member_black(); db_factory::execute(sprintf("update %switkey_member_oltime set last_op_time=%d where uid = %d", TABLEPRE, time(), $user_info['uid'])); if (isset($_COOKIE['prom']) && $_COOKIE['prom']) { $prom_obj = keke_prom_class::get_instance(); $url_data = $prom_obj->extract_prom_cookie(); $url_data['p'] == 'reg' or $prom_obj->create_prom_relation($user_info['uid'], $user_info['username'], $url_data, '2'); } if ($login_type == 1) { if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { $this->show_msg($_lang['login_success'] . "{$synhtml}", 1, $r); } elseif (strtolower($_SERVER['REQUEST_METHOD']) == 'get') { echo "{$synhtml}<script>window.location.href='{$r}';</script>"; die; } } else { if ($login_type == 3 || $login_type == 4) { $info = $user_info; $return_info['uid'] = $info['uid']; $return_info['username'] = $info['username']; $return_info['balance'] = intval($info['balance']); $return_info['credit'] = intval($info['credit']); $return_info['pic'] = keke_user_class::get_user_pic($user_info['uid']); $return_info['syn'] = $synhtml; $user_info['uid'] == ADMIN_UID || $user_info['group_id'] > 0 and $return_info['is_admin'] = 1; $return_info['g_pic'] = unserialize($info['buyer_level']); $return_info['s_pic'] = unserialize($info['seller_level']); $this->show_msg($_lang['login_success'], 1, $return_info); die; } elseif ($login_type == 2) { return true; } else { $this->show_msg($_lang['login_success'] . "{$synhtml}", 1, $r); } } }
<?php defined('ADMIN_KEKE') or exit('Access Denied'); kekezu::admin_check_role(33); $kf_obj = keke_table_class::get_instance("witkey_space"); $member_obj = new Keke_witkey_member_class(); $space_obj = new Keke_witkey_space_class(); $url = 'index.php?do=user&view=custom_list&uid=' . $w[uid] . '&username='******'&w[page_size]=' . $w[page_size] . '&status=' . $w[status] . '&ord[uid]=' . $ord[uid]; switch ($op) { case "add": if ($is_submit) { die('1'); $m_info = db_factory::get_one(" select uid,username,group_id from " . TABLEPRE . "witkey_space where uid = '{$fds['uid']}'"); !$m_info and kekezu::admin_show_msg($_lang['user_no_exit'], $url, 3, '', 'warning'); if ($m_info) { if ($m_info[group_id] == 7) { kekezu::admin_show_msg($_lang['no_operate_again_for_user_is_kf_'], $url, 3, '', 'warning'); } else { $space_obj->setUid($fds[uid]); $space_obj->setGroup_id(7); $res = $space_obj->edit_keke_witkey_space(); if ($res) { kekezu::admin_system_log($_lang['add_new_kf'] . $m_info[username]); $v_arr = array('管理员名' => $admin_info['username'], '用户名' => $spaceinfo['username']); keke_msg_class::notify_user($fds['uid'], $m_info['username'], 'kf_set', '客服设置', $v_arr, 2); kekezu::admin_show_msg($_lang['add_kf_successfully'], $url, 3, '', 'success'); } } } } require $template_obj->template(ADMIN_DIRECTORY . '/tpl/admin_user_custom_add');
function synlogin($get, $post) { global $_G; if (!API_SYNLOGIN) { return API_RETURN_FORBIDDEN; } header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"'); $cookietime = 31536000; $_SESSION['uid'] = intval($get['uid']); $_SESSION['username'] = $get['username']; //最新登录时间 $userinfo = db_factory::get_one("select a.*,b.* from " . TABLEPRE . "witkey_space a left join " . TABLEPRE . "witkey_member b on a.uid = b.uid where a.uid = " . $_SESSION['uid'] . " and a.username='******'username'] . "'"); if ($userinfo) { db_factory::updatetable(TABLEPRE . 'witkey_space', array('last_login_time' => time()), array('uid' => $_SESSION['uid'])); $space_obj = new Keke_witkey_space_class(); $space_obj->setUid($_SESSION['uid']); $space_obj->setLast_login_time(time()); $space_obj->edit_keke_witkey_space(); } }
static function action_user_by_email($uid, $code) { $auth_obj = new Keke_witkey_auth_record_class(); $auth_obj->setWhere(" uid = " . $uid . " and auth_code= 'email' and auth_status=0 and ext_data = '{$code}'"); $count = $auth_obj->count_keke_witkey_auth_record(); if ($count > 0) { $space_obj = new Keke_witkey_space_class(); $space_obj->setStatus(1); $space_obj->setWhere("uid = {$uid}"); $space_obj->edit_keke_witkey_space(); $auth_obj->setWhere(" uid = " . $uid . " and auth_code= 'email' and auth_status=0 and ext_data = '{$code}'"); $auth_obj->del_keke_witkey_auth_record(); return true; } return false; }