$user = array('username' => $email, 'email' => $email, 'password' => $pwd, 'salt' => $salt, 'gid' => 101, 'create_ip' => $longip, 'create_date' => $time, 'logins' => 1, 'login_date' => $time, 'login_ip' => $longip); $uid = user_create($user); $uid === FALSE and message(1, '用户注册失败。'); $user = user_read($uid); $gid = $user['gid']; $user['token'] = user_token_set($uid, $gid, $user['password'], $user['avatar'], $user['username'], 'bbs'); // 更新在线 online_list_cache_delete(); online_unset('create_email'); online_unset('create_verifycode'); message(0, $user); } // 退出 } elseif ($action == 'logout') { $user = user_guest(); user_token_clean(); $uid = 0; $gid = 0; // 更新在线 online_save(TRUE); online_list_cache_delete(); message(0, jump('退出成功', './', 1)); // 获取当前用户的信息 } elseif ($action == 'read') { $user = user_read($uid); $agreelist = myagree_find_by_uid($uid); empty($user) and $user = user_guest(); user_ajax_info($user); message(0, $user); // 用户发表的喜欢 } elseif ($action == 'agree') {
} // 设置密码,创建用户 } elseif ($action == 'setpw') { $conf['ipaccess_on'] and $conf['user_create_email_on'] and !ipaccess_check($longip, 'mails') and message(-1, '您的 IP 今日发送邮件数达到上限,请明天再来。'); $conf['ipaccess_on'] and !ipaccess_check($longip, 'users') and message(-1, '您的 IP 今日注册用户数达到上限,请明天再来。'); $email = online_get('create_email'); $verifycode = online_get('create_verifycode'); empty($email) || $conf['user_create_email_on'] && empty($verifycode) and message(-1, '请返回填写数据'); $user = user_read_by_email($email); $user and message(1, 'EMAIL 已经注册。'); if ($method == 'GET') { include './mobile/view/user_setpw.htm'; } } elseif ($action == 'logout') { $user = user_guest(); user_token_clean('/', '', 'bbs'); $uid = 0; $gid = 0; // 更新在线 online_save(TRUE); online_list_cache_delete(); header('Location: ./'); // 获取当前用户的信息 } elseif ($action == 'read') { $user = user_read($uid); $agreelist = myagree_find_by_uid($uid); empty($user) and $user = user_guest(); user_ajax_message($user); } elseif ($action == 'agree') { $_uid = param(2, 0); $_user = user_read($_uid);