Beispiel #1
0
 public function index_action()
 {
     if (is_digits($_GET['id'])) {
         $feature_info = $this->model('feature')->get_feature_by_id($_GET['id']);
     } else {
         $feature_info = $this->model('feature')->get_feature_by_url_token($_GET['id']);
     }
     if (!$feature_info) {
         header('HTTP/1.1 404 Not Found');
         H::redirect_msg(AWS_APP::lang()->_t('专题不存在'), '/');
     }
     if (!$feature_info['enabled']) {
         H::redirect_msg(AWS_APP::lang()->_t('专题未启用'), '/');
     }
     if ($feature_info['url_token'] != $_GET['id'] and !$_GET['sort_type'] and !$_GET['is_recommend']) {
         HTTP::redirect('/feature/' . $feature_info['url_token']);
     }
     if (!($topic_list = $this->model('topic')->get_topics_by_ids($this->model('feature')->get_topics_by_feature_id($feature_info['id'])))) {
         H::redirect_msg(AWS_APP::lang()->_t('专题下必须包含一个以上话题'), '/');
     }
     if ($feature_info['seo_title']) {
         TPL::assign('page_title', $feature_info['seo_title']);
     } else {
         $this->crumb($feature_info['title'], '/feature/' . $feature_info['url_token']);
     }
     TPL::assign('sidebar_hot_topics', $topic_list);
     TPL::assign('feature_info', $feature_info);
     TPL::import_js('js/app/feature.js');
     TPL::output('feature/detail');
 }
Beispiel #2
0
 public function setup()
 {
     if (!$this->user_info['permission']['is_administortar']) {
         H::redirect_msg(AWS_APP::lang()->_t('你没有访问权限, 请重新登录'), '/');
     }
     TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(304));
 }
Beispiel #3
0
 public function alipay_action()
 {
     $result = $this->model('payment_alipay')->verifyReturn();
     $order = $this->model('payment')->get_order($_GET['out_trade_no']);
     if ($result and $_GET['total_fee'] == $order['amount']) {
         if ($_GET['extra_common_param']) {
             $params = json_decode(base64_decode(urldecode($_GET['extra_common_param'])), TRUE);
         } else {
             if ($order['extra_param']) {
                 $params = unserialize($order['extra_param']);
             }
         }
         if (!$order['terrace_id']) {
             $this->model('payment')->set_order_terrace_id($_GET['trade_no'], $order['order_id']);
             $this->model('payment')->set_payment_id('ALIPAY', $order['order_id']);
             if ($params['pay_to_project_order_id']) {
                 if (!$this->model('payment')->pay_to_project_order_id($order['order_id'], $params['pay_to_project_order_id'])) {
                     H::redirect_msg('订单处理失败,如有疑问请联系客服人员,网站订单编号:' . $params['pay_to_project_order_id']);
                 }
             }
         }
         if ($params['pay_to_project_order_id']) {
             $this->callback_url = '/project/sponsored/';
         }
         H::redirect_msg('支付成功, 交易金额: ' . $order['amount'], $this->callback_url);
     } else {
         H::redirect_msg('交易失败,如有疑问请联系客服人员,支付宝订单编号:' . $_GET['out_trade_no']);
     }
 }
Beispiel #4
0
 public function generate_sitemap_action()
 {
     $return_url = '/admin/settings/category-sitemap';
     switch ($this->model('sitemap')->generate_sitemap_all($_GET['reset'])) {
         case sitemap_class::SITEMAP_SUCCESS:
             H::redirect_msg(AWS_APP::lang()->_t('sitemap生成成功,请等待系统自动返回...'), $return_url);
             break;
         case sitemap_class::SITEMAP_DIR_NOT_EXIST:
             H::redirect_msg(AWS_APP::lang()->_t('错误:sitemap根目录不存在'), $return_url);
             break;
         case sitemap_class::SITEMAP_DIR_NOT_WRITABLE:
             H::redirect_msg(AWS_APP::lang()->_t('错误:目录%s不可写,请联系后台管理员进行设置', $sitemap_dir), $return_url);
             break;
         case sitemap_class::SITEMAP_DIR_NOT_EXIST_M:
             H::redirect_msg(AWS_APP::lang()->_t('错误:sitemap根目录(移动版)不存在'), $return_url);
             break;
         case sitemap_class::SITEMAP_DIR_NOT_WRITABLE_M:
             H::redirect_msg(AWS_APP::lang()->_t('错误:目录%s不可写,请联系后台管理员进行设置', $sitemap_dir_m), $return_url);
             break;
         case sitemap_class::SITEMAP_BASE_URL_NULL:
             H::redirect_msg(AWS_APP::lang()->_t('错误:网站根链接不能为空'), $return_url);
             break;
         case sitemap_class::SITEMAP_BASE_URL_NULL_M:
             H::redirect_msg(AWS_APP::lang()->_t('错误:网站根链接(移动版)不能为空'), $return_url);
             break;
         default:
             break;
     }
 }
Beispiel #5
0
 public function read_action()
 {
     if (!($dialog = $this->model('message')->get_dialog_by_id($_GET['id']))) {
         H::redirect_msg(AWS_APP::lang()->_t('指定的站内信不存在'), '/inbox/');
     }
     if ($dialog['recipient_uid'] != $this->user_id and $dialog['sender_uid'] != $this->user_id) {
         H::redirect_msg(AWS_APP::lang()->_t('指定的站内信不存在'), '/inbox/');
     }
     $this->model('message')->set_message_read($_GET['id'], $this->user_id);
     if ($list = $this->model('message')->get_message_by_dialog_id($_GET['id'])) {
         if ($dialog['sender_uid'] != $this->user_id) {
             $recipient_user = $this->model('account')->get_user_info_by_uid($dialog['sender_uid']);
         } else {
             $recipient_user = $this->model('account')->get_user_info_by_uid($dialog['recipient_uid']);
         }
         foreach ($list as $key => $val) {
             if ($dialog['sender_uid'] == $this->user_id and $val['sender_remove']) {
                 unset($list[$key]);
             } else {
                 if ($dialog['sender_uid'] != $this->user_id and $val['recipient_remove']) {
                     unset($list[$key]);
                 } else {
                     $list[$key]['message'] = FORMAT::parse_links($val['message']);
                     $list[$key]['user_name'] = $recipient_user['user_name'];
                     $list[$key]['url_token'] = $recipient_user['url_token'];
                     $list[$key]['profile_update_time'] = $recipient_user['profile_update_time'];
                 }
             }
         }
     }
     $this->crumb(AWS_APP::lang()->_t('私信对话') . ': ' . $recipient_user['user_name'], '/inbox/read/' . intval($_GET['id']));
     TPL::assign('list', $list);
     TPL::assign('recipient_user', $recipient_user);
     TPL::output('inbox/read');
 }
Beispiel #6
0
 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);
 }
Beispiel #7
0
 public function mail_action()
 {
     if ($task = $this->model('edm')->get_task_info($_GET['id'])) {
         echo str_replace('[EMAIL]', '*****@*****.**', $task['message']);
     } else {
         H::redirect_msg(AWS_APP::lang()->_t('您所访问的资源不存在'));
     }
 }
Beispiel #8
0
 public function index_action()
 {
     if (!$this->user_info['email']) {
         H::redirect_msg(AWS_APP::lang()->_t('当前帐号没有提供 Email, 此功能不可用'));
     }
     $this->crumb(AWS_APP::lang()->_t('邀请好友'), '/invitation/');
     TPL::output('invitation/index');
 }
Beispiel #9
0
 public function setup()
 {
     $this->crumb(AWS_APP::lang()->_t('首页精选管理'), "admin/recommend/list/");
     if (!$this->user_info['permission']['is_administortar']) {
         H::redirect_msg(AWS_APP::lang()->_t('你没有访问权限, 请重新登录'), '/');
     }
     TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(603));
 }
Beispiel #10
0
 public function rule_action()
 {
     $this->crumb(AWS_APP::lang()->_t('%s 积分规则', get_setting('site_name')));
     if (get_setting('integral_system_enabled') != 'Y') {
         H::redirect_msg(AWS_APP::lang()->_t('本站未启用积分系统'), '/');
     }
     TPL::output('integral/rule');
 }
Beispiel #11
0
 function __construct($message)
 {
     if ($_POST['_post_type'] == 'ajax') {
         H::ajax_json_output(AWS_APP::RSM(null, -1, 'SDK 异常: ' . $message));
     } else {
         H::redirect_msg('SDK 异常: ' . $message);
     }
 }
Beispiel #12
0
 public function index_action()
 {
     if (isset($_GET['notification_id'])) {
         $this->model('notify')->read_notification($_GET['notification_id'], $this->user_id);
     }
     if (is_mobile()) {
         HTTP::redirect('/m/people/' . $_GET['id']);
     }
     if (is_digits($_GET['id'])) {
         if (!($user = $this->model('account')->get_user_info_by_uid($_GET['id'], TRUE))) {
             $user = $this->model('account')->get_user_info_by_username($_GET['id'], TRUE);
         }
     } else {
         if ($user = $this->model('account')->get_user_info_by_username($_GET['id'], TRUE)) {
         } else {
             $user = $this->model('account')->get_user_info_by_url_token($_GET['id'], TRUE);
         }
     }
     if (!$user) {
         header('HTTP/1.1 404 Not Found');
         H::redirect_msg(AWS_APP::lang()->_t('用户不存在'), '/');
     }
     if ($user['forbidden'] and !$this->user_info['permission']['is_administortar'] and !$this->user_info['permission']['is_moderator']) {
         header('HTTP/1.1 404 Not Found');
         H::redirect_msg(AWS_APP::lang()->_t('该用户已被封禁'), '/');
     }
     if (urldecode($user['url_token']) != $_GET['id']) {
         HTTP::redirect('/people/' . $user['url_token']);
     }
     $this->model('people')->update_views($user['uid']);
     TPL::assign('user', $user);
     $job_info = $this->model('account')->get_jobs_by_id($user['job_id']);
     TPL::assign('job_name', $job_info['job_name']);
     if ($user['weibo_visit']) {
         if ($users_sina = $this->model('openid_weibo_oauth')->get_weibo_user_by_uid($user['uid'])) {
             TPL::assign('sina_weibo_url', 'http://www.weibo.com/' . $users_sina['id']);
         }
     }
     TPL::assign('education_experience_list', $this->model('education')->get_education_experience_list($user['uid']));
     $jobs_list = $this->model('work')->get_jobs_list();
     if ($work_experience_list = $this->model('work')->get_work_experience_list($user['uid'])) {
         foreach ($work_experience_list as $key => $val) {
             $work_experience_list[$key]['job_name'] = $jobs_list[$val['job_id']];
         }
     }
     TPL::assign('work_experience_list', $work_experience_list);
     TPL::assign('user_follow_check', $this->model('follow')->user_follow_check($this->user_id, $user['uid']));
     $this->crumb(AWS_APP::lang()->_t('%s 的个人主页', $user['user_name']), 'people/' . $user['url_token']);
     TPL::import_css('css/user.css');
     TPL::assign('reputation_topics', $this->model('people')->get_user_reputation_topic($user['uid'], $user['reputation'], 12));
     TPL::assign('fans_list', $this->model('follow')->get_user_fans($user['uid'], 5));
     TPL::assign('friends_list', $this->model('follow')->get_user_friends($user['uid'], 5));
     TPL::assign('focus_topics', $this->model('topic')->get_focus_topic_list($user['uid'], 10));
     TPL::assign('user_actions_questions', $this->model('actions')->get_user_actions($user['uid'], 5, ACTION_LOG::ADD_QUESTION, $this->user_id));
     TPL::assign('user_actions_answers', $this->model('actions')->get_user_actions($user['uid'], 5, ACTION_LOG::ANSWER_QUESTION, $this->user_id));
     TPL::assign('user_actions', $this->model('actions')->get_user_actions($user['uid'], 5, implode(',', array(ACTION_LOG::ADD_QUESTION, ACTION_LOG::ANSWER_QUESTION, ACTION_LOG::ADD_REQUESTION_FOCUS, ACTION_LOG::ADD_AGREE, ACTION_LOG::ADD_TOPIC, ACTION_LOG::ADD_TOPIC_FOCUS, ACTION_LOG::ADD_ARTICLE)), $this->user_id));
     TPL::output('people/index');
 }
Beispiel #13
0
 public function setup()
 {
     if (get_setting('project_enabled') != 'Y') {
         H::redirect_msg(AWS_APP::lang()->_t('活动系统未启用'), '/');
     }
     $this->crumb(AWS_APP::lang()->_t('活动'), '/project/');
     $this->crumb(AWS_APP::lang()->_t('我支持的活动'), '/project/sponsored/');
     TPL::import_css('css/project.css');
 }
Beispiel #14
0
 public function edit_action()
 {
     $this->crumb(AWS_APP::lang()->_t('编辑页面'), "admin/page/edit/");
     if (!($page_info = $this->model('page')->get_page_by_url_id($_GET['id']))) {
         H::redirect_msg(AWS_APP::lang()->_t('页面不存在'), '/admin/page/');
     }
     TPL::assign('page_info', $page_info);
     TPL::output('admin/page/publish');
 }
Beispiel #15
0
 public function edit_action()
 {
     if (!($category_info = $this->model('system')->get_category_info($_GET['category_id']))) {
         H::redirect_msg(AWS_APP::lang()->_t('指定分类不存在'), '/admin/category/list/');
     }
     TPL::assign('category', $category_info);
     TPL::assign('category_option', $this->model('system')->build_category_html($category_info['type'], 0, $category['parent_id'], null, false));
     TPL::output('admin/category/edit');
 }
Beispiel #16
0
 public function modify_action()
 {
     if (!($active_code_row = $this->model('active')->get_active_code($_GET['key'], 'FIND_PASSWORD'))) {
         H::redirect_msg(AWS_APP::lang()->_t('链接已失效'), '/');
     }
     if ($active_code_row['active_time'] or $active_code_row['active_ip']) {
         H::redirect_msg(AWS_APP::lang()->_t('链接已失效'), '/');
     }
     TPL::output('account/find_password/modify');
 }
Beispiel #17
0
 public function edit_action()
 {
     if ($_GET['id']) {
         $slide_info = $this->model('slide')->get_slide_by_id($_GET['id']);
         if (!$slide_info) {
             H::redirect_msg(AWS_APP::lang()->_t('指定幻灯片不存在'), '/admin/slide/list/');
         }
         TPL::assign('slide_info', $slide_info);
     }
     TPL::output('admin/slide/edit');
 }
 public function download_action()
 {
     $url = @base64_decode($_GET['url']);
     if (!$url) {
         H::redirect_msg(AWS_APP::lang()->_t('文件未找到'));
     }
     $path = get_setting('upload_dir') . '/' . str_replace(get_setting('upload_url'), '', $url);
     if (strstr($path, '..') or !file_exists($path)) {
         H::redirect_msg(AWS_APP::lang()->_t('文件未找到'));
     }
     HTTP::force_download_header(base64_decode($_GET['file_name']), filesize($path));
     readfile($path);
 }
Beispiel #19
0
 public function nav_menu_action()
 {
     $this->crumb(AWS_APP::lang()->_t('导航设置'), 'admin/nav_menu/');
     if (!$this->user_info['permission']['is_administortar']) {
         H::redirect_msg(AWS_APP::lang()->_t('你没有访问权限, 请重新登录'), '/');
     }
     TPL::assign('nav_menu_list', $this->model('menu')->get_nav_menu_list());
     TPL::assign('category_list', $this->model('system')->build_category_html('question', 0, 0, null, true));
     TPL::assign('setting', get_setting());
     TPL::import_js(array('js/fileupload.js'));
     TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(307));
     TPL::output('admin/nav_menu');
 }
Beispiel #20
0
 public function edit_action()
 {
     if ($_GET['id']) {
         $chapter_info = $this->model('help')->get_chapter_by_id($_GET['id']);
         if (!$chapter_info) {
             H::redirect_msg(AWS_APP::lang()->_t('指定章节不存在'), '/admin/help/list/');
         }
         TPL::assign('chapter_info', $chapter_info);
         $data_list = $this->model('help')->get_data_list($chapter_info['id']);
         if ($data_list) {
             TPL::assign('data_list', $data_list);
         }
     }
     TPL::output('admin/help/edit');
 }
Beispiel #21
0
 public function unsubscription_action()
 {
     if ($_GET['id']) {
         $arg = explode(',', $_GET['id']);
         $email = base64_decode($arg[0]);
         $human_verify = $arg[2];
     }
     if (md5($email . G_SECUKEY) == $arg[1]) {
         if ($human_verify == ip2long(fetch_ip())) {
             $this->model('edm')->unsubscription($email);
             H::redirect_msg(AWS_APP::lang()->_t('%s 退订邮件成功', $email));
         } else {
             $unsubscription_link = get_js_url('/account/edm/unsubscription/' . $arg[0] . ',' . $arg[1] . ',' . ip2long(fetch_ip()));
             H::redirect_msg(AWS_APP::lang()->_t('是否确认退订邮件订阅? &nbsp; ( <a href="%s">继续</a> )', $unsubscription_link));
         }
     } else {
         H::redirect_msg(AWS_APP::lang()->_t('退订链接无效'));
     }
 }
Beispiel #22
0
 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);
     }
 }
Beispiel #23
0
 public function index_action()
 {
     if ($_GET['id']) {
         $chapter_list = $this->model('help')->get_chapter_list();
         if (!$chapter_list) {
             header('HTTP/1.1 404 Not Found');
             H::redirect_msg(AWS_APP::lang()->_t('指定章节不存在'), '/');
         }
         TPL::assign('chapter_list', $chapter_list);
         foreach ($chapter_list as $chapter_info) {
             if ($chapter_info['url_token'] == $_GET['id']) {
                 $chapter = $chapter_info;
                 break;
             }
         }
         if (!$chapter) {
             $chapter = $chapter_list[$_GET['id']];
         }
         if (!$chapter) {
             header('HTTP/1.1 404 Not Found');
             H::redirect_msg(AWS_APP::lang()->_t('指定章节不存在'), '/help/');
         }
         TPL::assign('chapter_info', $chapter);
         $data_list = $this->model('help')->get_data_list($chapter['id']);
         if ($data_list) {
             TPL::assign('data_list', $data_list);
         }
         $this->crumb($chapter['title'], '/help/' . $chapter['url_token'] ? $chapter['url_token'] : $chapter['id']);
         TPL::output('help/index');
     } else {
         $chapter_list = $this->model('help')->get_chapter_list();
         if ($chapter_list) {
             TPL::assign('chapter_list', $chapter_list);
         }
         $data_list = $this->model('help')->get_data_list(null, 5);
         if ($data_list) {
             TPL::assign('data_list', $data_list);
         }
         $this->crumb(AWS_APP::lang()->_t('帮助中心'), '/help/');
         TPL::output('help/square');
     }
 }
 public function read_action()
 {
     if (!($dialog = $this->model('message')->get_dialog_by_id($_GET['id']))) {
         H::redirect_msg(AWS_APP::lang()->_t('指定的站内信不存在'), '/inbox/');
     }
     if ($dialog['recipient_uid'] != $this->user_id and $dialog['sender_uid'] != $this->user_id) {
         H::redirect_msg(AWS_APP::lang()->_t('指定的站内信不存在'), '/inbox/');
     }
     $this->model('message')->set_message_read($_GET['id'], $this->user_id);
     if ($list = $this->model('message')->get_message_by_dialog_id($_GET['id'])) {
         if ($dialog['sender_uid'] != $this->user_id) {
             $recipient_user = $this->model('account')->get_user_info_by_uid($dialog['sender_uid']);
         } else {
             $recipient_user = $this->model('account')->get_user_info_by_uid($dialog['recipient_uid']);
         }
         foreach ($list as $key => $val) {
             if ($dialog['sender_uid'] == $this->user_id and $val['sender_remove']) {
                 unset($list[$key]);
             } else {
                 if ($dialog['sender_uid'] != $this->user_id and $val['recipient_remove']) {
                     unset($list[$key]);
                 } else {
                     $list[$key]['message'] = FORMAT::parse_links($val['message']);
                     $list[$key]['user_name'] = $recipient_user['user_name'];
                     $list[$key]['url_token'] = $recipient_user['url_token'];
                 }
             }
         }
     }
     $user_key = array('uid', 'user_name', 'name', 'avatar_file', 'namecard_pic', 'signature');
     if (!empty($recipient_user)) {
         foreach ($recipient_user as $k => $v) {
             if (!in_array($k, $user_key)) {
                 unset($recipient_user[$k]);
             }
         }
     }
     $recipient_user['avatar_file'] = get_avatar_url($recipient_user['uid'], 'max');
     H::ajax_json_output(AWS_APP::RSM(array('recipient_user' => $recipient_user, 'rows' => $list), 1, null));
 }
Beispiel #25
0
 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);
     }
 }
Beispiel #26
0
 public function init_payment_action()
 {
     if (!($order_info = $this->model('project')->get_project_order_info_by_id($_GET['id']))) {
         H::redirect_msg(AWS_APP::lang()->_t('指定商品不存在'));
     }
     if ($order_info['payment_time']) {
         H::redirect_msg(AWS_APP::lang()->_t('该订单已支付'));
     }
     if (!($project_info = $this->model('project')->get_project_info_by_id($order_info['project_id']))) {
         H::redirect_msg(AWS_APP::lang()->_t('项目不存在或已被删除'));
     }
     if ($project_info['approved'] != 1) {
         H::redirect_msg(AWS_APP::lang()->_t('当前项目未通过审核'));
     }
     if ($project_info['start_time'] > time()) {
         H::redirect_msg(AWS_APP::lang()->_t('当前项目处于预热中,尚未开始'));
     }
     if ($project_info['end_time'] < time()) {
         H::redirect_msg(AWS_APP::lang()->_t('当前项目已经结束'));
     }
     TPL::assign('order_info', $order_info);
     TPL::assign('params', base64_encode(json_encode(array('pay_to_project_order_id' => $order_info['id']))));
     TPL::output('project/order/init_payment');
 }
Beispiel #27
0
 public function user_action()
 {
     $name = $_POST['name'];
     $token = $_POST['token'];
     $openid = $_POST['openid'];
     $third_info = $this->model('openid_weixin_thirdlogin')->get_third_party_login_by_name($name);
     if (!$third_info) {
         H::redirect_msg('获取接口服务失败, name: ' . htmlspecialchars($name));
     }
     if ($token != $third_info['token']) {
         H::redirect_msg('获取接口服务失败, token: ' . htmlspecialchars($token));
     }
     if ($weixin_user = $this->model('openid_weixin_weixin')->get_user_info_by_openid($openid)) {
         //已有用户
         $user_info = $this->model('account')->get_user_info_by_uid($weixin_user['uid']);
         $result = array('ret' => 0, 'userinfo' => $weixin_user);
         echo json_encode($result);
         exit;
     } else {
         $result = array('ret' => '01', 'msg' => '用户不存在 openid:' . $openid, 'userinfo' => '');
         echo json_encode($result);
         exit;
     }
 }
 public function __construct()
 {
     parent::__construct(false);
     if ($_GET['app'] != 'admin') {
         return false;
     }
     TPL::import_clean();
     if (defined('SYSTEM_LANG')) {
         TPL::import_js(base_url() . '/language/' . SYSTEM_LANG . '.js');
     }
     if (HTTP::is_browser('ie', 8)) {
         TPL::import_js('js/jquery.js');
     } else {
         TPL::import_js('js/jquery.2.js');
     }
     TPL::import_js(array('admin/js/aws_admin.js', 'admin/js/aws_admin_template.js', 'js/jquery.form.js', 'admin/js/framework.js', 'admin/js/global.js'));
     TPL::import_css(array('admin/css/common.css'));
     if (in_array($_GET['act'], array('login', 'login_process'))) {
         return true;
     }
     if ($admin_info = H::decode_hash(AWS_APP::session()->admin_login)) {
         if ($admin_info['uid'] != $this->user_id or $admin_info['UA'] != $_SERVER['HTTP_USER_AGENT'] or !AWS_APP::session()->permission['is_administortar'] and !AWS_APP::session()->permission['is_moderator']) {
             unset(AWS_APP::session()->admin_login);
             if ($_POST['_post_type'] == 'ajax') {
                 H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('会话超时, 请重新登录')));
             } else {
                 H::redirect_msg(AWS_APP::lang()->_t('会话超时, 请重新登录'), '/admin/login/url-' . base64_encode($_SERVER['REQUEST_URI']));
             }
         }
     } else {
         if ($_POST['_post_type'] == 'ajax') {
             H::ajax_json_output(AWS_APP::RSM(null, -1, AWS_APP::lang()->_t('会话超时, 请重新登录')));
         } else {
             HTTP::redirect('/admin/login/url-' . base64_encode($_SERVER['REQUEST_URI']));
         }
     }
     $this->setup();
 }
Beispiel #29
0
 public function edit_action()
 {
     $this->crumb(AWS_APP::lang()->_t('话题编辑'), 'admin/topic/edit/');
     if (!($topic_info = $this->model('topic')->get_topic_by_id($_GET['topic_id']))) {
         H::redirect_msg(AWS_APP::lang()->_t('话题不存在'), '/admin/topic/list/');
     }
     TPL::assign('topic_info', $topic_info);
     TPL::assign('parent_topics', $this->model('topic')->get_parent_topics());
     TPL::import_js('js/ajaxupload.js');
     TPL::output('admin/topic/edit');
 }
 public function edit_third_party_access_rule_action()
 {
     $this->crumb(AWS_APP::lang()->_t('接入规则编辑'), 'admin/weixin/third_party_access/');
     if ($_GET['id']) {
         $rule_info = $this->model('openid_weixin_third')->get_third_party_api_by_id($_GET['id']);
         if (!$rule_info) {
             H::redirect_msg(AWS_APP::lang()->_t('自定义回复规则不存在'), '/admin/weixin/reply/');
         }
         TPL::assign('account_id', $rule_info['account_id']);
         TPL::assign('rule_info', $rule_info);
     } else {
         if (!isset($_GET['account_id'])) {
             $_GET['account_id'] = 0;
         }
         $account_info = $this->model('weixin')->get_account_info_by_id($_GET['account_id']);
         if (!$account_info) {
             H::redirect_msg(AWS_APP::lang()->_t('公众账号不存在'), '/admin/weixin/reply/');
         }
         TPL::assign('account_id', $account_info['id']);
     }
     TPL::assign('menu_list', $this->model('admin')->fetch_menu_list(808));
     TPL::output('admin/weixin/edit_third_party_access_rule');
 }