本文整理汇总了PHP中AWS_APP::session方法的典型用法代码示例。如果您正苦于以下问题:PHP AWS_APP::session方法的具体用法?PHP AWS_APP::session怎么用?PHP AWS_APP::session使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AWS_APP
的用法示例。
在下文中一共展示了AWS_APP::session方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: binding_callback_action
function binding_callback_action()
{
$oauth = new Services_Weibo_WeiboOAuth(get_setting('sina_akey'), get_setting('sina_skey'));
if ($_GET['uid'] and $this->user_info['permission']['is_administortar']) {
$user_id = intval($_GET['uid']);
$user_info = $this->model('account')->get_user_info_by_uid($user_id);
if (empty($user_info)) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本地用户不存在,无法绑定')));
}
$sina_token = $oauth->getAccessToken('code', array('code' => $_GET['code'], 'redirect_uri' => get_js_url('/account/sina/binding_callback/uid-' . $user_id)));
} else {
$user_id = $this->user_id;
AWS_APP::session()->sina_token = $oauth->getAccessToken('code', array('code' => $_GET['code'], 'redirect_uri' => get_js_url('/account/sina/binding_callback/')));
$sina_token = AWS_APP::session()->sina_token;
$redirect = get_js_url('/account/setting/openid/');
}
$client = new Services_Weibo_WeiboClient(get_setting('sina_akey'), get_setting('sina_skey'), $sina_token['access_token']);
$uid_get = $client->get_uid();
$sina_profile = $client->show_user_by_id($uid_get['uid']);
if ($sina_profile['error']) {
H::redirect_msg(AWS_APP::lang()->_t('与微博通信出错, 错误代码: %s', $sina_profile['error']), "/account/setting/openid/");
}
if (!$this->model('integral')->fetch_log($user_id, 'BIND_OPENID')) {
$this->model('integral')->process($user_id, 'BIND_OPENID', round(get_setting('integral_system_config_profile') * 0.2), '绑定 OPEN ID');
}
//$this->model('openid_weibo')->bind_account($sina_profile, get_js_url('/account/setting/openid/'), $user_id, $last_key['oauth_token'], $last_key['oauth_token_secret'], $sina_token);
$this->model('openid_weibo')->bind_account($sina_profile, $redirect, $user_id, $sina_token);
}
示例2: set_human_valid
function set_human_valid($permission_tag)
{
if (!is_array(AWS_APP::session()->human_valid)) {
return FALSE;
}
AWS_APP::session()->human_valid[$permission_tag][time()] = TRUE;
return count(AWS_APP::session()->human_valid[$permission_tag]);
}
示例3: valid_post_hash
public function valid_post_hash($hash)
{
if (in_array($hash, AWS_APP::session()->post_hash)) {
$this->remove_post_hash($hash);
return TRUE;
}
return FALSE;
}
示例4: login_action
public function login_action()
{
if (!$this->user_info['permission']['is_administortar'] and !$this->user_info['permission']['is_moderator']) {
H::redirect_msg(AWS_APP::lang()->_t('你没有访问权限, 请重新登录'), '/');
} else {
if (AWS_APP::session()->admin_login) {
HTTP::redirect('/admin/');
}
}
TPL::import_css('admin/css/login.css');
TPL::output('admin/login');
}
示例5: get_openid
public function get_openid()
{
//-------请求参数列表
$keysArr = array("access_token" => AWS_APP::session()->QQConnect['access_token']);
$graph_url = $this->urlUtils->combineURL(self::GET_OPENID_URL, $keysArr);
$response = $this->urlUtils->get_contents($graph_url);
//--------检测错误是否发生
if (strpos($response, "callback") !== false) {
$lpos = strpos($response, "(");
$rpos = strrpos($response, ")");
$response = substr($response, $lpos + 1, $rpos - $lpos - 1);
}
$user = json_decode($response);
if (isset($user->error)) {
die($user->error . ': ' . $user->error_description);
}
return $user->openid;
}
示例6: bind_account
public function bind_account($uinfo, $redirect, $uid, $is_ajax = false)
{
if (!($openid = load_class('Services_Tencent_QQConnect_V2')->get_openid())) {
if ($is_ajax) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('与 QQ 通信出错, 请重新登录')));
} else {
H::redirect_msg(AWS_APP::lang()->_t('与 QQ 通信出错, 请重新登录'), '/account/logout/');
}
}
if ($openid_info = $this->get_user_info_by_uid($uid)) {
if ($openid_info['openid'] != $openid) {
if ($is_ajax) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('QQ 账号已经被其他账号绑定')));
} else {
H::redirect_msg(AWS_APP::lang()->_t('QQ 账号已经被其他账号绑定'), '/account/logout/');
}
}
}
if (!($users_qq = $this->get_user_info_by_open_id($openid))) {
if ($uinfo['gender'] == '男') {
$uinfo['gender'] = 'm';
} else {
if ($uinfo['gender'] == '女') {
$uinfo['gender'] = 'f';
} else {
$uinfo['gender'] = 'n';
}
}
$users_qq = $this->user_add($uid, $openid, $uinfo['nickname'], $uinfo['gender']);
} else {
if ($users_qq['uid'] != $uid) {
if ($is_ajax) {
H::ajax_json_output(AWS_APP::RSM(null, '-1', 'QQ 已经被其他账号绑定'));
} else {
H::redirect_msg(AWS_APP::lang()->_t('QQ 已经被其他账号绑定'), '/account/setting/openid/');
}
}
}
$this->update_token($openid, AWS_APP::session()->QQConnect['access_token']);
if ($redirect) {
HTTP::redirect($redirect);
}
}
示例7: callback_qq_action
public function callback_qq_action()
{
if (get_setting('qq_login_enabled') != 'Y') {
H::redirect_msg(AWS_APP::lang()->_t('QQ 帐号绑定功能已关闭'), '/');
}
if (!$_GET['code']) {
H::redirect_msg(AWS_APP::lang()->_t('与 QQ 通信出错, 请重新登录'), '/account/login/');
}
if (!AWS_APP::session()->QQConnect['access_token']) {
if (!$this->model('openid_qq')->request_access_token(get_js_url('/account/qq/callback_qq/'))) {
H::redirect_msg(AWS_APP::lang()->_t('与 QQ 通信出错, 请重新登录'), '/account/login/');
}
}
if (!AWS_APP::session()->QQConnect['access_token'] or !($uinfo = $this->model('openid_qq')->request_user_info())) {
H::redirect_msg(AWS_APP::lang()->_t('与 QQ 通信出错, 请重新登录'), '/account/login/');
} else {
if (!$this->model('integral')->fetch_log($this->user_id, 'BIND_OPENID')) {
$this->model('integral')->process($this->user_id, 'BIND_OPENID', round(get_setting('integral_system_config_profile') * 0.2), AWS_APP::lang()->_t('绑定 OPEN ID'));
}
$this->model('openid_qq')->bind_account($uinfo, get_js_url('/account/setting/openid/'), $this->user_id);
}
}
示例8: process_success_action
public function process_success_action()
{
TPL::assign('email', AWS_APP::session()->find_password);
TPL::output('account/find_password/process_success');
}
示例9: binding_action
public function binding_action()
{
if (AWS_APP::session()->WXConnect['access_token']['openid']) {
$this->model('openid_weixin_weixin')->bind_account(AWS_APP::session()->WXConnect['access_user'], AWS_APP::session()->WXConnect['access_token'], $this->user_id);
if ($_GET['redirect']) {
HTTP::redirect(base64_decode($_GET['redirect']));
} else {
H::redirect_msg(AWS_APP::lang()->_t('绑定微信成功'), '/m/');
}
} else {
H::redirect_msg('授权失败, 请返回重新操作, URI: ' . $_SERVER['REQUEST_URI']);
}
}
示例10: register_process_action
public function register_process_action()
{
if (get_setting('register_type') == 'close') {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站目前关闭注册')));
} else {
if (get_setting('register_type') == 'invite' and !$_POST['icode']) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站只能通过邀请注册')));
} else {
if (get_setting('register_type') == 'weixin') {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站只能通过微信注册')));
}
}
}
if ($_POST['icode']) {
if (!($invitation = $this->model('invitation')->check_code_available($_POST['icode'])) and $_POST['email'] == $invitation['invitation_email']) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('邀请码无效或与邀请邮箱不一致')));
}
}
if (trim($_POST['user_name']) == '') {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('请输入用户名')));
} else {
if ($this->model('account')->check_username($_POST['user_name'])) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('用户名已经存在')));
} else {
if ($check_rs = $this->model('account')->check_username_char($_POST['user_name'])) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('用户名包含无效字符')));
} else {
if ($this->model('account')->check_username_sensitive_words($_POST['user_name']) or trim($_POST['user_name']) != $_POST['user_name']) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('用户名中包含敏感词或系统保留字')));
}
}
}
}
if ($this->model('account')->check_email($_POST['email'])) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('E-Mail 已经被使用, 或格式不正确')));
}
if (strlen($_POST['password']) < 6 or strlen($_POST['password']) > 16) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('密码长度不符合规则')));
}
// if (! $_POST['agreement_chk'])
// {
// H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('你必需同意用户协议才能继续')));
// }
// 检查验证码
// if (!AWS_APP::captcha()->is_validate($_POST['seccode_verify']) AND get_setting('register_seccode') == 'Y')
// {
// H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('请填写正确的验证码')));
// }
if (get_setting('ucenter_enabled') == 'Y') {
$result = $this->model('ucenter')->register($_POST['user_name'], $_POST['password'], $_POST['email']);
if (is_array($result)) {
$uid = $result['user_info']['uid'];
} else {
H::ajax_json_output(AWS_APP::RSM(null, -1, $result));
}
} else {
$uid = $this->model('account')->user_register($_POST['user_name'], $_POST['password'], $_POST['email']);
}
if ($_POST['email'] == $invitation['invitation_email']) {
$this->model('active')->set_user_email_valid_by_uid($uid);
$this->model('active')->active_user_by_uid($uid);
}
$this->model('account')->setcookie_logout();
$this->model('account')->setsession_logout();
if ($_POST['icode']) {
$follow_users = $this->model('invitation')->get_invitation_by_code($_POST['icode']);
} else {
if (HTTP::get_cookie('fromuid')) {
$follow_users = $this->model('account')->get_user_info_by_uid(HTTP::get_cookie('fromuid'));
}
}
if ($follow_users['uid']) {
$this->model('follow')->user_follow_add($uid, $follow_users['uid']);
$this->model('follow')->user_follow_add($follow_users['uid'], $uid);
$this->model('integral')->process($follow_users['uid'], 'INVITE', get_setting('integral_system_config_invite'), '邀请注册: ' . $_POST['user_name'], $follow_users['uid']);
}
if ($_POST['icode']) {
$this->model('invitation')->invitation_code_active($_POST['icode'], time(), fetch_ip(), $uid);
}
if (get_setting('register_valid_type') == 'N' or get_setting('register_valid_type') == 'email' and get_setting('register_type') == 'invite') {
$this->model('active')->active_user_by_uid($uid);
}
$user_info = $this->model('account')->get_user_info_by_uid($uid);
if (get_setting('register_valid_type') == 'N' or $user_info['group_id'] != 3 or $_POST['email'] == $invitation['invitation_email']) {
$valid_email = 1;
} else {
AWS_APP::session()->valid_email = $user_info['email'];
$this->model('active')->new_valid_email($uid);
$valid_email = 0;
}
$this->model('account')->setcookie_login($user_info['uid'], $user_info['user_name'], $_POST['password'], $user_info['salt']);
H::ajax_json_output(AWS_APP::RSM(array('uid' => $user_info['uid'], 'user_name' => $user_info['user_name'], 'valid_email' => $valid_email), 1, null));
}
示例11: init
/**
* 系统初始化
*/
private static function init()
{
set_exception_handler(array('AWS_APP', 'exception_handle'));
self::$config = load_class('core_config');
self::$db = load_class('core_db');
self::$plugins = load_class('core_plugins');
self::$settings = self::model('setting')->get_settings();
if ((!defined('G_SESSION_SAVE') or G_SESSION_SAVE == 'db') and get_setting('db_version') > 20121123) {
Zend_Session::setSaveHandler(new Zend_Session_SaveHandler_DbTable(array('name' => get_table('sessions'), 'primary' => 'id', 'modifiedColumn' => 'modified', 'dataColumn' => 'data', 'lifetimeColumn' => 'lifetime')));
self::$session_type = 'db';
}
Zend_Session::setOptions(array('name' => G_COOKIE_PREFIX . '_Session', 'cookie_domain' => G_COOKIE_DOMAIN));
if (G_SESSION_SAVE == 'file' and G_SESSION_SAVE_PATH) {
Zend_Session::setOptions(array('save_path' => G_SESSION_SAVE_PATH));
}
Zend_Session::start();
self::$session = new Zend_Session_Namespace(G_COOKIE_PREFIX . '_Anwsion');
if ($default_timezone = get_setting('default_timezone')) {
date_default_timezone_set($default_timezone);
}
if ($img_url = get_setting('img_url')) {
define('G_STATIC_URL', $img_url);
} else {
define('G_STATIC_URL', base_url() . '/static');
}
if (self::config()->get('system')->debug) {
if ($cornd_timer = self::cache()->getGroup('crond')) {
foreach ($cornd_timer as $cornd_tag) {
if ($cornd_runtime = self::cache()->get($cornd_tag)) {
AWS_APP::debug_log('crond', 0, 'Tag: ' . str_replace('crond_timer_', '', $cornd_tag) . ', Last run time: ' . date('Y-m-d H:i:s', $cornd_runtime));
}
}
}
}
}
示例12: find_password_success_action
public function find_password_success_action()
{
TPL::assign('email', AWS_APP::session()->find_password);
$this->crumb(AWS_APP::lang()->_t('找回密码'), '/m/find_password_success/');
TPL::output('m/find_password_success');
}
示例13: valid_email_action
public function valid_email_action()
{
if (!AWS_APP::session()->valid_email) {
HTTP::redirect('/');
}
if (!($user_info = $this->model('account')->get_user_info_by_email(AWS_APP::session()->valid_email))) {
HTTP::redirect('/');
}
if ($user_info['valid_email']) {
H::redirect_msg(AWS_APP::lang()->_t('邮箱已通过验证,请返回登录'), '/account/login/');
}
$this->crumb(AWS_APP::lang()->_t('邮件验证'), '/account/valid_email/');
TPL::import_css('css/register.css');
TPL::assign('email', AWS_APP::session()->valid_email);
TPL::output("account/valid_email");
}
示例14: get_access_token
/**
* get_access_token
* 获得access_token
* @param void
* @since 5.0
* @return string 返加access_token
*/
public function get_access_token()
{
return AWS_APP::session()->QQConnect['access_token'];
}
示例15: qq_login_callback_action
public function qq_login_callback_action()
{
if ($this->is_post() and AWS_APP::session()->qq_profile and AWS_APP::session()->QQConnect) {
if (get_setting('register_type') == 'close') {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站目前关闭注册')));
} else {
if (get_setting('register_type') == 'invite') {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站只能通过邀请注册')));
} else {
if (get_setting('register_type') == 'weixin') {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('本站只能通过微信注册')));
}
}
}
if (trim($_POST['user_name']) == '') {
H::ajax_json_output(AWS_APP::RSM(array('input' => 'user_name'), -1, AWS_APP::lang()->_t('请输入真实姓名')));
} else {
if ($this->model('account')->check_username($_POST['user_name'])) {
H::ajax_json_output(AWS_APP::RSM(array('input' => 'user_name'), -1, AWS_APP::lang()->_t('真实姓名已经存在')));
} else {
if ($check_rs = $this->model('account')->check_username_char($_POST['user_name'])) {
H::ajax_json_output(AWS_APP::RSM(array('input' => 'user_name'), -1, $check_rs));
} else {
if ($this->model('account')->check_username_sensitive_words($_POST['user_name'])) {
H::ajax_json_output(AWS_APP::RSM(array('input' => 'user_name'), -1, AWS_APP::lang()->_t('真实姓名中包含敏感词或系统保留字')));
}
}
}
}
if ($this->model('account')->check_email($_POST['email'])) {
H::ajax_json_output(AWS_APP::RSM(array('input' => 'email'), -1, AWS_APP::lang()->_t('E-Mail 已经被使用, 或格式不正确')));
}
if (strlen($_POST['password']) < 6 or strlen($_POST['password']) > 16) {
H::ajax_json_output(AWS_APP::RSM(array('input' => 'userPassword'), -1, AWS_APP::lang()->_t('密码长度不符合规则')));
}
if (!$_POST['agreement_chk']) {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('你必需同意用户协议才能继续')));
}
if (get_setting('ucenter_enabled') == 'Y') {
$result = $this->model('ucenter')->register($_POST['user_name'], $_POST['password'], $_POST['email'], true);
if (is_array($result)) {
$uid = $result['user_info']['uid'];
} else {
H::ajax_json_output(AWS_APP::RSM(null, -1, $result));
}
} else {
$uid = $this->model('account')->user_register($_POST['user_name'], $_POST['password'], $_POST['email']);
if (get_setting('register_valid_type') == 'email') {
$this->model('active')->new_valid_email($uid);
}
if (get_setting('register_valid_type') != 'approval') {
$this->model('active')->active_user_by_uid($uid);
}
}
if ($uid) {
$this->model('openid_qq')->bind_account(AWS_APP::session()->qq_profile, null, $uid, true);
if (AWS_APP::session()->qq_profile['figureurl_2']) {
$this->model('account')->associate_remote_avatar($uid, AWS_APP::session()->qq_profile['figureurl_2']);
}
H::ajax_json_output(AWS_APP::RSM(null, 1, null));
} else {
H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('与 QQ 通信出错 (Register), 请重新登录')));
}
} else {
if (!$_GET['code']) {
H::redirect_msg(AWS_APP::lang()->_t('与 QQ 通信出错, 请重新登录'), "/account/login/");
}
if (!AWS_APP::session()->QQConnect['access_token']) {
if (!$this->model('openid_qq')->request_access_token(get_js_url('/account/openid/qq_login_callback/'))) {
H::redirect_msg(AWS_APP::lang()->_t('与 QQ 通信出错, 请重新登录'), "/account/login/");
}
}
if (!AWS_APP::session()->QQConnect['access_token'] or !($uinfo = $this->model('openid_qq')->request_user_info())) {
H::redirect_msg(AWS_APP::lang()->_t('与 QQ 通信出错, 请重新登录'), "/account/login/");
}
AWS_APP::session()->qq_profile = $uinfo;
if ($qq_user = $this->model('openid_qq')->get_user_info_by_open_id(load_class('Services_Tencent_QQConnect_V2')->get_openid())) {
$user_info = $this->model('account')->get_user_info_by_uid($qq_user['uid']);
HTTP::set_cookie('_user_login', get_login_cookie_hash($user_info['user_name'], $user_info['password'], $user_info['salt'], $user_info['uid'], false));
$this->model('openid_qq')->update_token($qq_user['name'], AWS_APP::session()->QQConnect['access_token']);
HTTP::redirect('/');
} else {
if ($this->user_id) {
$this->model('openid_qq')->bind_account($this->model('openid_qq')->request_user_info(), '/', $this->user_id);
} else {
if (get_setting('register_type') == 'close') {
H::redirect_msg(AWS_APP::lang()->_t('本站目前关闭注册'));
} else {
if (get_setting('register_type') == 'invite') {
H::redirect_msg(AWS_APP::lang()->_t('本站只能通过邀请注册'));
} else {
$this->crumb(AWS_APP::lang()->_t('完善资料'), '/account/login/');
TPL::assign('user_name', str_replace(' ', '_', AWS_APP::session()->qq_profile['nickname']));
TPL::import_css('css/register.css');
TPL::output('account/openid/callback');
}
}
}
}
}
//.........这里部分代码省略.........