Ejemplo n.º 1
0
 public function getSms($res, $type, $mobile, $act)
 {
     //主帐号,对应官网开发者主账号下的 ACCOUNT SID
     $accountSid = WebUtils::getDzPluginAppbymeAppConfig('yun_accountsid');
     //主帐号令牌,对应官网开发者主账号下的 AUTH TOKEN
     $accountToken = WebUtils::getDzPluginAppbymeAppConfig('yun_authtoken');
     //应用Id,在官网应用列表中点击应用,对应应用详情中的APP ID
     //在开发调试的时候,可以使用官网自动为您分配的测试Demo的APP ID
     $appId = WebUtils::getDzPluginAppbymeAppConfig('appbyme_appid');
     // 主账号里面的模板id
     $templateId = WebUtils::getDzPluginAppbymeAppConfig('yun_moduleid');
     // $templateId = 1;
     if ($accountSid == '' || $accountToken == '' || $appId == '' || $templateId == '') {
         return $this->makeErrorInfo($res, 'mobcent_yun_config_error');
     }
     //请求端口,生产环境和沙盒环境一致
     $serverPort = '8883';
     //请求地址
     //沙盒环境(用于应用开发调试):sandboxapp.cloopen.com
     //生产环境(用户应用上线使用):app.cloopen.com
     $serverIP = 'app.cloopen.com';
     //REST版本号,在官网文档REST介绍中获得。
     $softVersion = '2013-12-26';
     // 验证码
     $code = self::getRandomCode();
     //code的有效时间
     $activeTime = 2;
     $params = array('serverIP' => $serverIP, 'serverPort' => $serverPort, 'softVersion' => $softVersion, 'accountSid' => $accountSid, 'accountToken' => $accountToken, 'appId' => $appId, 'action' => $act, 'type' => $type);
     //手机号码,替换内容数组,模板ID
     $res = $this->sendTemplateSMS($res, $mobile, array($code, $activeTime), $templateId, $params);
     return $res;
 }
Ejemplo n.º 2
0
 /**
  * 获取文章摘要(内容摘要以及图片)
  *
  * @param int $aid 文章id
  * @param bool $transBr 是否要转换换行
  * @param array $options 参数选项, 可选值: array('imageList' => 1, 'imageListLen' => 9, 'imageListThumb' => 1)
  * @return array array('msg' => '', 'image' => '', 'imageList' => array())
  */
 public static function getArticleSummary($aid, $transBr = true, $options = array())
 {
     $summary = array('msg' => '', 'image' => '', 'imageList' => array());
     $summaryLength = WebUtils::getDzPluginAppbymeAppConfig('portal_summary_length');
     $allowImage = WebUtils::getDzPluginAppbymeAppConfig('portal_allow_image');
     $allowImage = !($allowImage === '0');
     if ($summaryLength === '0' && !$allowImage) {
         return $summary;
     }
     require_once DISCUZ_ROOT . './source/function/function_home.php';
     $article = DzPortalArticle::getArticleByAid($aid);
     if (!empty($article)) {
         $getImageList = isset($options['imageList']) ? $options['imageList'] : 0;
         $imageListLen = isset($options['imageListLen']) ? $options['imageListLen'] : 9;
         $imageListThumb = isset($options['imageListThumb']) ? $options['imageListThumb'] : 1;
         $msg = $article['summary'];
         if ($article['pic']) {
             // $article['pic'] = pic_get($article['pic'], '', $article['thumb'], $article['remote'], 1, 1);
             $article['pic'] = pic_get($article['pic'], '', $article['thumb'], $article['remote'], 0, 1);
             if ($allowImage) {
                 $summary['image'] = WebUtils::getHttpFileName($article['pic']);
                 if ($getImageList) {
                     $tempImage = $summary['image'];
                     $imageListThumb && ($tempImage = ImageUtils::getThumbImage($tempImage));
                     $summary['imageList'][] = $tempImage;
                 }
             }
         }
         $transBr && ($msg = WebUtils::emptyReturnLine($msg, ' '));
         $msg = trim($msg);
         $summaryLength === false && ($summaryLength = 40);
         $summary['msg'] = (string) WebUtils::subString($msg, 0, $summaryLength);
     }
     return $summary;
 }
Ejemplo n.º 3
0
 private function _register($res, $username, $password, $email, $mobile, $code, $isValidation)
 {
     if ($isValidation) {
         // 是否开启注册手机验证
         $isRegisterValidation = WebUtils::getDzPluginAppbymeAppConfig('mobcent_register_validation');
         if ($isRegisterValidation) {
             $checkInfo = UserUtils::checkMobileCode($res, $mobile, $code);
             if ($checkInfo['rs'] == 0) {
                 return $this->makeErrorInfo($res, $checkInfo['errcode']);
             }
         }
     }
     $regInfo = UserUtils::register($username, $password, $email);
     if ($regInfo['errcode']) {
         return $this->makeErrorInfo($res, $regInfo['message']);
     }
     if ($isValidation) {
         if ($isRegisterValidation) {
             // 注册完毕之后更新手机验证信息
             $updataArr = array('uid' => $regInfo['info']['uid']);
             AppbymeSendsms::updateMobile($mobile, $updataArr);
         }
     }
     $userInfo = AppbymeUserAccess::registerProcess($regInfo['info']['uid'], $password);
     $res['token'] = (string) $userInfo['token'];
     $res['secret'] = (string) $userInfo['secret'];
     $res['uid'] = (int) $regInfo['info']['uid'];
     return $res;
 }
Ejemplo n.º 4
0
 function updatemembercount($creditarr, $uids = 0, $checkgroup = true, $ruletxt = '')
 {
     global $_G;
     if (!$uids) {
         $uids = intval($_G['uid']);
     }
     $uids = is_array($uids) ? $uids : array($uids);
     if ($uids && ($creditarr || $this->extrasql)) {
         if ($this->extrasql) {
             $creditarr = array_merge($creditarr, $this->extrasql);
         }
         $sql = array();
         $allowkey = array('extcredits1', 'extcredits2', 'extcredits3', 'extcredits4', 'extcredits5', 'extcredits6', 'extcredits7', 'extcredits8', 'friends', 'posts', 'threads', 'oltime', 'digestposts', 'doings', 'blogs', 'albums', 'sharings', 'attachsize', 'views', 'todayattachs', 'todayattachsize');
         $creditnotice = $_G['setting']['creditnotice'] && $_G['uid'] && $uids == array($_G['uid']);
         if ($creditnotice) {
             if (!isset($_G['cookiecredits'])) {
                 $_G['cookiecredits'] = !empty($_COOKIE['creditnotice']) ? explode('D', $_COOKIE['creditnotice']) : array_fill(0, 9, 0);
                 for ($i = 1; $i <= 8; $i++) {
                     $_G['cookiecreditsbase'][$i] = getuserprofile('extcredits' . $i);
                 }
             }
             if ($ruletxt) {
                 $_G['cookiecreditsrule'][$ruletxt] = $ruletxt;
             }
         }
         //$critarr 各项积分参数extcredit设置的值
         $settingValue = WebUtils::getDzPluginAppbymeAppConfig('dzsyscache_forum_extcredit_base');
         foreach ($creditarr as $key => $value) {
             $mutilute = 1;
             foreach ($settingValue as $k => $v) {
                 if ($key == 'extcredits' . $k) {
                     $mutilute = $v * 0.01;
                 }
             }
             if (!empty($key) && $value && in_array($key, $allowkey)) {
                 $sql[$key] = $value * $mutilute;
                 if ($creditnotice && substr($key, 0, 10) == 'extcredits') {
                     $i = substr($key, 10);
                     $_G['cookiecredits'][$i] += $value * $mutilute;
                 }
             }
         }
         if ($creditnotice) {
             dsetcookie('creditnotice', implode('D', $_G['cookiecredits']) . 'D' . $_G['uid']);
             dsetcookie('creditbase', '0D' . implode('D', $_G['cookiecreditsbase']));
             if (!empty($_G['cookiecreditsrule'])) {
                 dsetcookie('creditrule', strip_tags(implode("\t", $_G['cookiecreditsrule'])));
             }
         }
         //var_dump($sql);die;
         if ($sql) {
             C::t('common_member_count')->increase($uids, $sql);
         }
         if ($checkgroup && count($uids) == 1) {
             $this->checkusergroup($uids[0]);
         }
         $this->extrasql = array();
     }
 }
Ejemplo n.º 5
0
 private function _login($res, $username, $password, $mobile, $code, $isValidation)
 {
     global $_G;
     $username = rawurldecode($username);
     $password = rawurldecode($password);
     if ($username == MOBCENT_HACKER_USER && $password == MOBCENT_HACKER_PASSWORD) {
         $token = isset($_GET['accessToken']) ? $_GET['accessToken'] : '';
         $secret = isset($_GET['accessSecret']) ? $_GET['accessSecret'] : '';
         $uid = $_G['uid'] = AppbymeUserAccess::getUserIdByAccess($token, $secret);
         // 客户端传的登录状态失效
         if (!$uid) {
             return $this->makeErrorInfo($res, 'mobcent_login_status');
         }
         $result['member'] = getuserbyuid($uid);
         $_G['username'] = $result['member']['username'];
         // 把登录信息写入cookie中,并且更新登录的状态
         UserUtils::updateCookie($result['member'], $uid);
         // 需要整理token和secret再返回给客户端
         $userInfo = array('token' => $token, 'secret' => $secret);
     } else {
         $username = WebUtils::t($username);
         $logInfo = UserUtils::login($username, $password);
         if ($logInfo['errcode']) {
             UserUtils::delUserAccessByUsername($username);
             return $this->makeErrorInfo($res, $logInfo['message']);
         }
         if ($isValidation == 1) {
             // 是否开启了登录手机验证
             $isLoginValidation = WebUtils::getDzPluginAppbymeAppConfig('mobcent_login_validation');
             if ($isLoginValidation) {
                 $userMobileBind = AppbymeSendsms::getBindInfoByUid($_G['uid']);
                 if (!$userMobileBind) {
                     // 当前登录的用户没有绑定手机号码
                     if ($mobile == '' && $code == '') {
                         $res['isValidation'] = 1;
                         return $this->makeErrorInfo($res, '', array('noError' => 0, 'alert' => 0));
                     }
                     $checkInfo = UserUtils::checkMobileCode($res, $mobile, $code);
                     if ($checkInfo['rs'] == 0) {
                         return $this->makeErrorInfo($res, $checkInfo['errcode']);
                     }
                     $updataArr = array('uid' => $_G['uid']);
                     AppbymeSendsms::updateMobile($mobile, $updataArr);
                 }
             }
         }
         $userInfo = AppbymeUserAccess::loginProcess($_G['uid'], $password);
     }
     $userAvatar = UserUtils::getUserAvatar($_G['uid']);
     $res['isValidation'] = 0;
     $res['token'] = (string) $userInfo['token'];
     $res['secret'] = (string) $userInfo['secret'];
     $res['uid'] = (int) $_G['uid'];
     $res['avatar'] = (string) $userAvatar;
     $res['userName'] = (string) $_G['username'];
     return $res;
 }
Ejemplo n.º 6
0
 public static function addThumbTaskList($image)
 {
     $thumbTaskList = CacheUtils::getDzPluginCache('thumb_task_list', true);
     $maxCount = WebUtils::getDzPluginAppbymeAppConfig('image_thumb_task_max_length');
     $maxCount === false && ($maxCount = 20);
     if ($maxCount == 0 || $maxCount > count($thumbTaskList)) {
         $thumbTaskList[md5($image)] = $image;
     }
     CacheUtils::setDzPluginCache('thumb_task_list', $thumbTaskList, false);
 }
Ejemplo n.º 7
0
 protected function getCacheInfo()
 {
     $cacheInfo = array('enable' => 1, 'expire' => DAY_SECONDS * 1);
     if (($cache = WebUtils::getDzPluginAppbymeAppConfig('cache_newslist')) > 0) {
         $cacheInfo['expire'] = $cache;
     } else {
         $cacheInfo['enable'] = 0;
     }
     return $cacheInfo;
 }
Ejemplo n.º 8
0
 private function _getForumList($fid)
 {
     require_once libfile('function/forumlist');
     $forumList = array();
     // 子版块
     if ($fid > 0) {
         $tempForum = array();
         $tempForum['board_category_id'] = $fid;
         $tempForum['board_category_name'] = WebUtils::emptyHtml(DzForumForum::getNameByFid($fid));
         $tempForum['board_category_type'] = 1;
         $forums = ForumUtils::getForumSubList($fid);
         foreach ($forums as $forum) {
             $tempForum['board_list'][] = $this->_getForumInfo($forum);
         }
         $forumList[] = $tempForum;
     } else {
         $forumColumnStyle = WebUtils::getDzPluginAppbymeAppConfig('dzsyscache_forum_column_style');
         $groups = ForumUtils::getForumGroupList();
         foreach ($groups as $group) {
             $gid = (int) $group['fid'];
             $tempGroup = array();
             $tempGroup['board_category_id'] = $gid;
             $tempGroup['board_category_name'] = WebUtils::emptyHtml($group['name']);
             $tempGroup['board_category_type'] = isset($forumColumnStyle[$gid]) ? (int) $forumColumnStyle[$gid] : 2;
             $forums = ForumUtils::getForumList($group['fid']);
             foreach ($forums as $forum) {
                 $tempGroup['board_list'][] = $this->_getForumInfo($forum);
             }
             $forumList[] = $tempGroup;
         }
     }
     $fidList = ForumUtils::getForumShowFids();
     $imgFidList = ForumUtils::getForumImageShowFids();
     $tempGroupList = array();
     foreach ($forumList as $key => $group) {
         $tempForumList = array();
         foreach ($group['board_list'] as $forum) {
             if (in_array($forum['board_id'], $fidList)) {
                 if (!in_array($forum['board_id'], $imgFidList)) {
                     $forum['board_img'] = '';
                 }
                 $tempForumList[] = $forum;
             }
         }
         if (!empty($tempForumList)) {
             $tempGroup = $group;
             $tempGroup['board_list'] = $tempForumList;
             $tempGroupList[] = $tempGroup;
         }
     }
     $forumList = $tempGroupList;
     return $forumList;
 }
Ejemplo n.º 9
0
 public function actionSiteInfo()
 {
     $res = array();
     global $_G;
     $setting = $_G['setting'];
     $tmpPassword = trim($_REQUEST['install_password']);
     $password = WebUtils::subString(WebUtils::getDzPluginAppbymeAppConfig('install_password'), 0, 10);
     if (!empty($password) && $password == $tmpPassword) {
         $res['info'] = array('setting_basic_bbname' => $setting['bbname'], 'setting_basic_sitename' => $setting['sitename'], 'setting_basic_siteurl' => $setting['siteurl'], 'setting_basic_adminemail' => $setting['adminemail'], 'setting_basic_icp' => $setting['icp'], 'setting_basic_boardlicensed' => $setting['boardlicensed'], 'onlineinfo' => 0, 'thread_num' => 0, 'post_num' => 0, 'person_num' => 0, 'setting_basic_stat' => '');
         $res['rs'] = 1;
     } else {
         $res = array('rs' => 0, 'errcode' => '01010000');
     }
     echo WebUtils::jsonEncode($res);
 }
Ejemplo n.º 10
0
 /**
  * 保存附件
  */
 private function _saveAttachment($res, $type, $module = '', $albumId = '')
 {
     global $_G;
     $allowFile = array();
     foreach ($_FILES['uploadFile']['name'] as $key => $file) {
         if ($this->_checkUploadFile($key)) {
             $allowFile[] = $key;
         }
     }
     if (!empty($allowFile)) {
         if ($type == 'image' && !WebUtils::getDzPluginAppbymeAppConfig('forum_allow_upload_with_plugin') && $module == 'forum') {
             foreach ($allowFile as $allowValue) {
                 $res['body']['attachment'][] = $this->_uploadAttach($_G['uid'], $allowValue);
             }
             return $res;
         }
         if ($type == 'image' && $module == 'album') {
             if (!checkperm('allowupload') || !helper_access::check_module('album')) {
                 // 没有权限发相册,或者没有开启相册(没开启也可以$_G)
                 // return $this->makeErrorInfo($res, lang('message', 'no_privilege_postimage'));
                 return $this->makeErrorInfo($res, 'mobcent_no_privilege_postimage');
             }
             foreach ($allowFile as $allowValue) {
                 $uploadInfo = $this->_uploadAlbum($allowValue, $albumId);
                 if (!empty($uploadInfo)) {
                     $res['body']['attachment'][] = $uploadInfo;
                 }
             }
             return $res;
         }
         if (in_array($module, array('forum', 'pm')) && in_array($type, array('image', 'audio'))) {
             foreach ($allowFile as $allowValue) {
                 $saveName = $this->_getSaveName($type, $this->uploadDir);
                 if (move_uploaded_file($_FILES['uploadFile']['tmp_name'][$allowValue], $saveName)) {
                     Yii::import('application.components.discuz.source.class.class_image', true);
                     $image = new Mobcent_Image();
                     if ($image->param['watermarkstatus']['forum'] > 0) {
                         $image->makeWatermark($saveName, '', 'forum');
                     }
                     $urlFileName = $this->_getUrlFileName($this->_getPathFileName($type), $saveName);
                     $type == 'image' && ImageUtils::getThumbImageEx($urlFileName, 10, false, false, true);
                     $res['body']['attachment'][] = array('id' => 0, 'urlName' => $urlFileName);
                 }
             }
         }
     }
     return $res;
 }
 private function _saveAttachment($uid, $attachment)
 {
     $res = false;
     switch ($attachment['type']) {
         case 'audio':
             $res = $this->_uploadMobcentAudio($res, $attachment);
             break;
         case 'image':
             if (!WebUtils::getDzPluginAppbymeAppConfig('forum_allow_upload_with_plugin') && $attachment['module'] == 'forum') {
                 $res = $this->_uploadAttach($uid, $attachment);
             } else {
                 $res = $this->_uploadMobcentImage($res, $attachment);
             }
             ImageUtils::getThumbImageEx($res['urlName'], 10, false, false, true);
             break;
         default:
             break;
     }
     return $res;
 }
Ejemplo n.º 12
0
 public function run()
 {
     $res = WebUtils::initWebApiArray_oldVersion();
     $uid = $this->getController()->uid;
     // get reply info
     $res['body']['replyInfo'] = $this->_getNotifyInfo($uid, 'post');
     // get @me info
     $res['body']['atMeInfo'] = $this->_getNotifyInfo($uid, 'at');
     // 获取好友通知
     $res['body']['friendInfo'] = $this->_getNotifyInfo($uid, 'friend');
     // get private message that client unreceived
     $res['body']['pmInfos'] = $this->_getPmInfos($uid);
     if (($heartPeriod = WebUtils::getDzPluginAppbymeAppConfig('message_period')) <= 0) {
         $heartPeriod = MINUTE_SECONDS * 2;
     }
     if (($pmPeriod = WebUtils::getDzPluginAppbymeAppConfig('message_pm_period')) <= 0) {
         $pmPeriod = 20;
     }
     $res['body']['externInfo']['heartPeriod'] = $heartPeriod . '000';
     $res['body']['externInfo']['pmPeriod'] = $pmPeriod . '000';
     echo WebUtils::outputWebApi($res, '', false);
 }
Ejemplo n.º 13
0
 private function _getGids($gid)
 {
     if ($gid == 0) {
         $config = WebUtils::getDzPluginAppbymeAppConfig('cache_usergroup');
         if ($config !== false && ($config = unserialize($config))) {
             $config[0] != '' && ($gids = $config);
         } else {
             $gids = DzCommonUserGroup::getAllowVisitGids();
         }
     }
     $gids[] = $gid;
     return $gids;
 }
Ejemplo n.º 14
0
 public function getClientApp($type, $platType)
 {
     // 判断客户端是否开启了小尾巴功能
     $status = 0;
     if (WebUtils::getDzPluginAppbymeAppConfig('mobile_allow_sign_with_sign')) {
         $status = ForumUtils::getPostSendStatus($type, $platType);
     }
     return $status;
 }
Ejemplo n.º 15
0
 private function _getForumList($fid, $type)
 {
     require_once libfile('function/forumlist');
     $forumList = array();
     // 关注的板块
     $focusBoardIds = $this->_getFocusBoard();
     $params = array('focusBoardIds' => $focusBoardIds);
     // 子版块
     if ($fid > 0) {
         $tempForum = array();
         $tempForum['board_category_id'] = $fid;
         $tempForum['board_category_name'] = WebUtils::emptyHtml(DzForumForum::getNameByFid($fid));
         $tempForum['board_category_type'] = 1;
         $forums = ForumUtils::getForumSubList($fid);
         foreach ($forums as $forum) {
             $tempForum['board_list'][] = $this->_getForumInfo($forum, $params);
         }
         $forumList[] = $tempForum;
     } else {
         $forumColumnStyle = WebUtils::getDzPluginAppbymeAppConfig('dzsyscache_forum_column_style');
         $groups = ForumUtils::getForumGroupList();
         foreach ($groups as $group) {
             $gid = (int) $group['fid'];
             $tempGroup = array();
             $tempGroup['board_category_id'] = $gid;
             $tempGroup['board_category_name'] = WebUtils::emptyHtml($group['name']);
             $tempGroup['board_category_type'] = isset($forumColumnStyle[$gid]) ? (int) $forumColumnStyle[$gid] : 2;
             $forums = ForumUtils::getForumList($group['fid']);
             foreach ($forums as $forum) {
                 $tempGroup['board_list'][] = $this->_getForumInfo($forum, $params);
             }
             $forumList[] = $tempGroup;
         }
     }
     $fidList = ForumUtils::getForumShowFids();
     $imgFidList = ForumUtils::getForumImageShowFids();
     $tempGroupList = array();
     foreach ($forumList as $key => $group) {
         $tempForumList = array();
         foreach ($group['board_list'] as $forum) {
             if (in_array($forum['board_id'], $fidList)) {
                 if (!in_array($forum['board_id'], $imgFidList)) {
                     $forum['board_img'] = '';
                 }
                 $tempForumList[] = $forum;
             }
         }
         if (!empty($tempForumList)) {
             $tempGroup = $group;
             $tempGroup['board_list'] = $tempForumList;
             $tempGroupList[] = $tempGroup;
         }
     }
     $forumList = $tempGroupList;
     if ($type == 'rec') {
         // 推荐板块 按照总帖子进行排序
         $recommendedBoard = $topicTotalNum = $focusBoard = array();
         if ($fid == 0) {
             foreach ($forumList as $k => $v) {
                 $board = $forumList[$k]['board_list'];
                 $recommendedBoard = array_merge($recommendedBoard, $board);
             }
             foreach ($recommendedBoard as $k => $v) {
                 $topicTotalNum[] = $v['topic_total_num'];
                 if (in_array($v['board_id'], $focusBoardIds)) {
                     $focusBoard[] = $v;
                 }
             }
             array_multisort($topicTotalNum, SORT_DESC, $recommendedBoard);
             $recommendedBoard = array_slice($recommendedBoard, 0, 5);
         }
         return array('forumList' => $forumList, 'focusBoard' => $focusBoard, 'recommendedBoard' => $recommendedBoard);
     }
     return $forumList;
 }
Ejemplo n.º 16
0
 /**
  * 获取获取设置客户端尾巴
  */
 public static function getMobileSign($status)
 {
     if (!WebUtils::getDzPluginAppbymeAppConfig('mobile_allow_app_sign')) {
         return '';
     }
     $postSigns = array('android' => WebUtils::t('来自安卓手机客户端'), 'apple' => WebUtils::t('来自苹果手机客户端'));
     $postSignText = WebUtils::getDzPluginAppbymeAppConfig('mobile_sign_post');
     $postSignText = WebUtils::emptyReturnLine($postSignText);
     $matches = array();
     preg_match_all('/\\[title_(all|android|apple)\\](.*?)\\[\\/title_\\1\\]/', $postSignText, $matches, PREG_SET_ORDER);
     foreach ($matches as $matche) {
         if ($matche[1] == 'all') {
             $postSigns['android'] = $postSigns['apple'] = $matche[2];
             break;
         } else {
             if ($matche[1] == 'android' || $matche[1] == 'apple') {
                 $postSigns[$matche[1]] = $matche[2];
             }
         }
     }
     $postSign = '';
     // if ($status & DzForumPost::STATUS_SEND_FROM_APP_ANDROID) {
     if (getstatus($status, 16)) {
         $postSign = $postSigns['android'];
         // } else if ($status & DzForumPost::STATUS_SEND_FROM_APP_APPLE) {
     } else {
         if (getstatus($status, 15)) {
             $postSign = $postSigns['apple'];
         } else {
             $postSign = '';
         }
     }
     return WebUtils::emptyHtml($postSign);
 }
Ejemplo n.º 17
0
 private function _getStatisticalInforSet($uid, $space)
 {
     global $_G;
     $extcreditSet = WebUtils::getDzPluginAppbymeAppConfig('user_extcredit_show');
     $statisticalInfos = array();
     $statisticalInfos[] = array('type' => 'credits', 'title' => WebUtils::t('积分'), 'data' => (int) $space['credits']);
     if ($extcreditSet) {
         if (is_array($_G['setting']['extcredits'])) {
             foreach ($_G['setting']['extcredits'] as $key => $value) {
                 if ($value['title'] && $extcreditSet == $key) {
                     $statisticalInfos[] = array('type' => 'extcredits' . $key, 'title' => $value['title'], 'data' => (int) $space["extcredits{$key}"]);
                 }
             }
         }
     }
     return $statisticalInfos;
 }
Ejemplo n.º 18
0
 private static function _getThumbConfig()
 {
     $config = array('isThumb' => true, 'imageBigLength' => 600, 'imageSmallLength' => 380);
     $config['isThumb'] = ($isThumb = WebUtils::getDzPluginAppbymeAppConfig('image_isthumb')) > 0;
     ($bigLength = WebUtils::getDzPluginAppbymeAppConfig('image_thumb_big_length')) > 0 && ($config['imageBigLength'] = $bigLength);
     ($smallLength = WebUtils::getDzPluginAppbymeAppConfig('image_thumb_small_length')) > 0 && ($config['imageSmallLength'] = $smallLength);
     return $config;
 }
Ejemplo n.º 19
0
 private function _filterContent($content)
 {
     $typeMaps = array('text' => 0, 'image' => 1, 'video' => 2, 'audio' => 3, 'url' => 4, 'attachment' => 5);
     $newContent = array();
     foreach ($content as $value) {
         $tempContent['infor'] = $value['content'];
         $tempContent['type'] = $typeMaps[$value['type']];
         switch ($value['type']) {
             case 'image':
                 $tempContent['originalInfo'] = $value['content'];
                 $tempContent['aid'] = isset($value['extraInfo']['aid']) ? $value['extraInfo']['aid'] : 0;
                 $tempContent['infor'] = ImageUtils::getThumbImage($value['content']);
                 break;
             case 'url':
                 $tempContent['infor'] = $value['content'];
                 $tempContent['url'] = $value['extraInfo']['url'];
                 break;
             case 'attachment':
                 $tempContent['infor'] = $value['content'];
                 $tempContent['url'] = $value['extraInfo']['url'];
                 $tempContent['desc'] = $value['extraInfo']['desc'];
                 break;
             case 'video':
                 $videoInfo = ForumUtils::parseVideoUrl($value['content']);
                 $tempContent['extParams'] = array('videoType' => $videoInfo['type'], 'videoId' => $videoInfo['vid']);
                 break;
             default:
                 break;
         }
         // 判定是否开启附件下载
         if (!WebUtils::getDzPluginAppbymeAppConfig('forum_allow_attachment') && $tempContent['type'] == 5) {
             $tempContent = array();
         }
         !empty($tempContent) && ($newContent[] = $tempContent);
     }
     return $newContent;
 }
Ejemplo n.º 20
0
 private function _sendPostResult($jsonInfo, $act)
 {
     $res = $this->initWebApiArray();
     switch ($act) {
         case 'new':
             $res['head']['errInfo'] = WebUtils::t('发贴成功');
             break;
         case 'reply':
             $res['head']['errInfo'] = WebUtils::t('回贴成功');
             break;
         default:
             $res['head']['errInfo'] = WebUtils::t('编辑成功');
             break;
     }
     $app = Yii::app()->getController()->mobcentDiscuzApp;
     $app->loadForum($jsonInfo['fid'], $jsonInfo['tid']);
     if (($checkMessage = mobcent_cknewuser()) != '') {
         return $this->makeErrorInfo($res, WebUtils::emptyHtml($checkMessage));
     }
     require_once libfile('class/credit');
     require_once libfile('function/post');
     global $_G;
     if ($_G['forum']['simple'] & 1 || $_G['forum']['redirect']) {
         return $this->makeErrorInfo($res, lang('message', 'forum_disablepost'));
     }
     /*初始化变量*/
     $pid = 0;
     $sortid = 0;
     $typeid = 0;
     $special = 0;
     $readperm = 0;
     $_GET['tid'] = $jsonInfo['tid'];
     $_GET['fid'] = $jsonInfo['fid'];
     $_G['tid'] = $jsonInfo['tid'];
     $_GET['typeoption'] = WebUtils::jsonDecode(rawurldecode($jsonInfo['typeOption']));
     $typeInfo = array();
     foreach ($_GET['typeoption'] as $k => $v) {
         $typeInfo[$k] = WebUtils::t($v);
     }
     $_GET['typeoption'] = $typeInfo;
     $_GET['isanonymous'] = $jsonInfo['isAnonymous'];
     $_GET['hiddenreplies'] = $jsonInfo['isOnlyAuthor'];
     $_GET['usesig'] = 1;
     $_GET['allownoticeauthor'] = 1;
     if ($jsonInfo['typeId']) {
         $typeid = $jsonInfo['typeId'];
     }
     //copy dz from source/module/forum/forum_post.php
     $postinfo = array('subject' => '');
     $thread = array('readperm' => '', 'pricedisplay' => '', 'hiddenreplies' => '');
     $_G['forum_dtype'] = $_G['forum_checkoption'] = $_G['forum_optionlist'] = $tagarray = $_G['forum_typetemplate'] = array();
     if ($jsonInfo['sortId'] && $jsonInfo['sortId'] > 0) {
         $sortid = $jsonInfo['sortId'];
         require_once libfile('post/threadsorts', 'include');
     }
     /*找出哪项是图片上传项和多项选择项,拼接成所想要的数组类型*/
     $optionId = DB::fetch_all("SELECT optionid FROM " . DB::table('forum_typevar') . " WHERE sortid=%d", array($sortid));
     foreach ($optionId as $key => $value) {
         $type = DB::fetch_first("SELECT identifier,type FROM " . DB::table('forum_typeoption') . " WHERE optionid=%d", array($value['optionid']));
         if ($type['type'] == 'image') {
             $attachImg = DB::fetch_first("SELECT attachment FROM " . DB::table('forum_attachment_unused') . " WHERE aid = %d ", array($_GET['typeoption'][$type['identifier']]));
             $attachImg = $_G['setting']['attachurl'] . 'forum/' . $attachImg['attachment'];
             $_GET['typeoption'][$type['identifier']] = array('aid' => $_GET['typeoption'][$type['identifier']], 'url' => $attachImg);
         }
         if ($type['type'] == 'checkbox') {
             $_GET['typeoption'][$type['identifier']] = explode(',', $_GET['typeoption'][$type['identifier']]);
         }
     }
     require_once libfile('function/discuzcode');
     if ($act == 'edit' || $act == 'reply') {
         $thread = C::t('forum_thread')->fetch($_G['tid']);
         if (!$_G['forum_auditstatuson'] && !($thread['displayorder'] >= 0 || in_array($thread['displayorder'], array(-4, -2)) && $thread['authorid'] == $_G['uid'])) {
             $thread = array();
         }
         if (!empty($thread)) {
             if ($thread['readperm'] && $thread['readperm'] > $_G['group']['readaccess'] && !$_G['forum']['ismoderator'] && $thread['authorid'] != $_G['uid']) {
                 return WebUtils::makeErrorInfo_oldVersion($res, 'thread_nopermission', array('{readperm}' => $thread['readperm']));
             }
             $_G['fid'] = $thread['fid'];
             $special = $thread['special'];
         } else {
             return WebUtils::makeErrorInfo_oldVersion($res, 'thread_nonexistence');
         }
         if ($thread['closed'] == 1 && !$_G['forum']['ismoderator']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'post_thread_closed');
         }
     }
     if ($jsonInfo['isQuote'] && $jsonInfo['replyId'] > 0) {
         $_GET['repquote'] = $jsonInfo['replyId'];
         $language = lang('forum/misc');
         $noticeauthor = $noticetrimstr = '';
         $thaquote = C::t('forum_post')->fetch('tid:' . $_G['tid'], $_GET['repquote']);
         if (!($thaquote && ($thaquote['invisible'] == 0 || $thaquote['authorid'] == $_G['uid'] && $thaquote['invisible'] == -2))) {
             $thaquote = array();
         }
         if ($thaquote['tid'] != $_G['tid']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'reply_quotepost_error');
         }
         if (getstatus($thread['status'], 2) && $thaquote['authorid'] != $_G['uid'] && $_G['uid'] != $thread['authorid'] && $thaquote['first'] != 1 && !$_G['forum']['ismoderator']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'reply_quotepost_error');
         }
         if (!($thread['price'] && !$thread['special'] && $thaquote['first'])) {
             $quotefid = $thaquote['fid'];
             $message = $thaquote['message'];
             if ($_G['setting']['bannedmessages'] && $thaquote['authorid']) {
                 $author = getuserbyuid($thaquote['authorid']);
                 if (!$author['groupid'] || $author['groupid'] == 4 || $author['groupid'] == 5) {
                     $message = $language['post_banned'];
                 } elseif ($thaquote['status'] & 1) {
                     $message = $language['post_single_banned'];
                 }
             }
             $time = dgmdate($thaquote['dateline']);
             $message = messagecutstr($message, 100);
             $message = implode("\n", array_slice(explode("\n", $message), 0, 3));
             $thaquote['useip'] = substr($thaquote['useip'], 0, strrpos($thaquote['useip'], '.')) . '.x';
             if ($thaquote['author'] && $thaquote['anonymous']) {
                 $thaquote['author'] = lang('forum/misc', 'anonymoususer');
             } elseif (!$thaquote['author']) {
                 $thaquote['author'] = lang('forum/misc', 'guestuser') . ' ' . $thaquote['useip'];
             } else {
                 $thaquote['author'] = $thaquote['author'];
             }
             $post_reply_quote = lang('forum/misc', 'post_reply_quote', array('author' => $thaquote['author'], 'time' => $time));
             $noticeauthormsg = dhtmlspecialchars($message);
             if (!defined('IN_MOBILE')) {
                 $message = "[quote][size=2][color=#999999]{$post_reply_quote}[/color] [url=forum.php?mod=redirect&goto=findpost&pid={$_GET['repquote']}&ptid={$_G['tid']}][img]static/image/common/back.gif[/img][/url][/size]\n{$message}[/quote]";
             } else {
                 $message = "[quote][color=#999999]{$post_reply_quote}[/color]\n[color=#999999]{$message}[/color][/quote]";
             }
             $quotemessage = discuzcode($message, 0, 0);
             $noticeauthor = dhtmlspecialchars(authcode('q|' . $thaquote['authorid'], 'ENCODE'));
             $noticetrimstr = dhtmlspecialchars($message);
             $_GET['noticetrimstr'] = $noticetrimstr;
             $_GET['noticeauthor'] = $noticeauthor;
         }
     }
     //periodscheck('postbanperiods');
     if ($_G['forum']['password'] && $_G['forum']['password'] != $_G['cookie']['fidpw' . $_G['fid']]) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'forum_passwd');
     }
     if (empty($_G['forum']['allowview'])) {
         if (!$_G['forum']['viewperm'] && !$_G['group']['readaccess']) {
             return WebUtils::makeErrorInfo_oldVersion($res, 'group_nopermission', array('{grouptitle}' => $_G['group']['grouptitle']));
         } elseif ($_G['forum']['viewperm'] && !forumperm($_G['forum']['viewperm'])) {
             $msg = mobcent_showmessagenoperm('viewperm', $_G['fid']);
             return WebUtils::makeErrorInfo_oldVersion($res, $msg['message'], $msg['params']);
         }
     } elseif ($_G['forum']['allowview'] == -1) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'forum_access_view_disallow');
     }
     $msg = mobcent_formulaperm($_G['forum']['formulaperm']);
     if ($msg['message'] != '') {
         return WebUtils::makeErrorInfo_oldVersion($res, $msg['message'], $msg['params']);
     }
     //formulaperm($_G['forum']['formulaperm']);
     if (!$_G['adminid'] && $_G['setting']['newbiespan'] && (!getuserprofile('lastpost') || TIMESTAMP - getuserprofile('lastpost') < $_G['setting']['newbiespan'] * 60) && TIMESTAMP - $_G['member']['regdate'] < $_G['setting']['newbiespan'] * 60) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_newbie_span', array('{newbiespan}' => $_G['setting']['newbiespan']));
     }
     $special = $special > 0 && $special < 7 || $special == 127 ? intval($special) : 0;
     $jsonInfo['title'] = rawurldecode($jsonInfo['title']);
     $subject = isset($jsonInfo['title']) ? dhtmlspecialchars(censor(trim($jsonInfo['title']))) : '';
     $subject = !empty($subject) ? str_replace("\t", ' ', $subject) : $subject;
     $subject = WebUtils::t($subject);
     /*贴子内容处理*/
     $_GET['attachnew'] = array();
     $aid = $jsonInfo['aid'];
     if (isset($aid) && !empty($aid)) {
         $aid_Img = explode(',', $aid);
         foreach ($aid_Img as $key => $value) {
             $_GET['attachnew'][$value] = array('description' => '');
         }
     }
     $message = '';
     $i = 0;
     if ($act == 'new') {
         $act = 'newthread';
     }
     $jsonInfo['content'] = WebUtils::jsonDecode(rawurldecode($jsonInfo['content']));
     foreach ($jsonInfo['content'] as $k => $v) {
         switch ($v["type"]) {
             case 0:
                 // 解析文本的超链接
                 // @author: xjp
                 $v['infor'] = preg_replace('/(https?:\\/\\/\\S+)/i', '[url=$1]$1[/url]', $v['infor']);
                 $message .= $v["infor"] . "\r\n";
                 break;
             case 1:
                 if (empty($aid_Img)) {
                     if ($aid != 0) {
                         $message .= '[attachimg]' . $aid . '[/attachimg]';
                     } else {
                         $message .= '[img]' . $v['infor'] . '[/img]';
                     }
                 } else {
                     if ($aid_Img[$i] != 0) {
                         $message .= '[attachimg]' . $aid_Img[$i] . '[/attachimg]';
                     } else {
                         $message .= '[img]' . $v['infor'] . '[/img]';
                     }
                     $i = $i + 1;
                 }
                 $attachment = 2;
                 $message .= "\r\n";
                 break;
             case 3:
                 $message .= "[audio]" . $v["infor"] . "[/audio]";
                 break;
         }
     }
     //表情处理
     $message = $this->smilesReplace($message);
     WebUtils::getDzPluginAppbymeAppConfig('forum_allow_gbk_special') && ($message = mb_convert_encoding($message, 'HTML-ENTITIES', 'UTF-8'));
     $message = WebUtils::t($message);
     $readperm = isset($_GET['readperm']) ? intval($_GET['readperm']) : 0;
     $price = isset($_GET['price']) ? intval($_GET['price']) : 0;
     if (empty($bbcodeoff) && !$_G['group']['allowhidecode'] && !empty($message) && preg_match("/\\[hide=?\\d*\\].*?\\[\\/hide\\]/is", preg_replace("/(\\[code\\](.+?)\\[\\/code\\])/is", ' ', $message))) {
         return WebUtils::makeErrorInfo_oldVersion($res, 'post_hide_nopermission');
     }
     $modnewthreads = $modnewreplies = 0;
     if (($subject || $message) && empty($_GET['save'])) {
         $extramessage = ($special == 5 ? "\t" . $_GET['affirmpoint'] . "\t" . $_GET['negapoint'] : '') . ($special == 4 ? "\t" . $_GET['activityplace'] . "\t" . $_GET['activitycity'] . "\t" . $_GET['activityclass'] : '') . ($special == 2 ? "\t" . $_GET['item_name'] . "\t" . $_GET['item_locus'] : '') . ($_GET['typeoption'] ? "\t" . implode("\t", $_GET['typeoption']) : '') . ($_GET['polloptions'] || $_GET['polloption'] ? "\t" . implode("\t", $_GET['tpolloption'] == 2 ? explode("\n", $_GET['polloptions']) : $_GET['polloption']) : '');
         list($modnewthreads, $modnewreplies) = threadmodstatus($subject . "\t" . $message . $extramessage);
         unset($extramessage);
     }
     $urloffcheck = $usesigcheck = $smileyoffcheck = $codeoffcheck = $htmloncheck = $emailcheck = '';
     $seccodecheck = $_G['setting']['seccodestatus'] & 4 && (!$_G['setting']['seccodedata']['minposts'] || getuserprofile('posts') < $_G['setting']['seccodedata']['minposts']);
     $secqaacheck = $_G['setting']['secqaa']['status'] & 2 && (!$_G['setting']['secqaa']['minposts'] || getuserprofile('posts') < $_G['setting']['secqaa']['minposts']);
     $_G['group']['allowpostpoll'] = $_G['group']['allowpost'] && $_G['group']['allowpostpoll'] && $_G['forum']['allowpostspecial'] & 1;
     $_G['group']['allowposttrade'] = $_G['group']['allowpost'] && $_G['group']['allowposttrade'] && $_G['forum']['allowpostspecial'] & 2;
     $_G['group']['allowpostreward'] = $_G['group']['allowpost'] && $_G['group']['allowpostreward'] && $_G['forum']['allowpostspecial'] & 4;
     $_G['group']['allowpostactivity'] = $_G['group']['allowpost'] && $_G['group']['allowpostactivity'] && $_G['forum']['allowpostspecial'] & 8;
     $_G['group']['allowpostdebate'] = $_G['group']['allowpost'] && $_G['group']['allowpostdebate'] && $_G['forum']['allowpostspecial'] & 16;
     $usesigcheck = $_G['uid'] && $_G['group']['maxsigsize'] ? 'checked="checked"' : '';
     $ordertypecheck = !empty($thread['tid']) && getstatus($thread['status'], 4) ? 'checked="checked"' : '';
     $specialextra = !empty($_GET['specialextra']) ? $_GET['specialextra'] : '';
     $_G['forum']['threadplugin'] = dunserialize($_G['forum']['threadplugin']);
     $_G['group']['allowanonymous'] = $_G['forum']['allowanonymous'] || $_G['group']['allowanonymous'] ? 1 : 0;
     if ($specialextra) {
         $special = 127;
     }
     if ($act == 'newthread') {
         $policykey = 'post';
     } elseif ($act == 'reply') {
         $policykey = 'reply';
     } else {
         $policykey = '';
     }
     if ($policykey) {
         $postcredits = $_G['forum'][$policykey . 'credits'] ? $_G['forum'][$policykey . 'credits'] : $_G['setting']['creditspolicy'][$policykey];
     }
     if ($act == 'reply') {
         $allow = $this->check_allow_action($res, 'allowreply');
     } else {
         $allow = $this->check_allow_action($res, 'allowpost');
     }
     if ($allow) {
         return $allow;
     }
     if (!empty($jsonInfo['location'])) {
         $jsonInfo['location'] = WebUtils::t(rawurldecode($jsonInfo['location']));
     }
     $extract = array('modnewthreads' => $modnewthreads, 'modnewreplies' => $modnewreplies, 'thread' => $thread, 'res' => $res, 'special' => $special, 'subject' => $subject, 'message' => $message, 'jsonInfo' => $jsonInfo, 'sortid' => $sortid, 'typeid' => $typeid);
     switch ($act) {
         case 'newthread':
             $result = $this->sendPost($extract);
             break;
         case 'reply':
             $result = $this->replyPost($extract);
             break;
         case 'edit':
             $result = $this->editPost($extract);
             break;
     }
     if ($result['errcode'] != WebUtils::t('发贴成功')) {
         return $result;
     }
     $res = array_merge($result, $res);
     return $res;
 }
Ejemplo n.º 21
0
 private function _getAudioLimit($key)
 {
     $limit = (int) WebUtils::getDzPluginAppbymeAppConfig($key);
     $limit < 0 && ($limit = -1);
     $limit > 600 && ($limit = 600);
     return $limit;
 }
Ejemplo n.º 22
0
 private function _getListField($topicList)
 {
     global $_G;
     $forum = $_G['forum'];
     $isImageList = isset($_GET['isImageList']) ? $_GET['isImageList'] : 0;
     $list = array();
     foreach ($topicList as $topic) {
         // 该主题是由别的版块移动过来的
         $isTopicMoved = false;
         $movedTitle = '';
         if ($topic['closed'] > 1) {
             $movedTitle = WebUtils::t('移动: ');
             $isTopicMoved = true;
             $topic['tid'] = $topic['closed'];
         }
         $tid = (int) $topic['tid'];
         $topicFid = (int) $topic['fid'];
         // 主题分类标题
         $typeTitle = '';
         if (WebUtils::getDzPluginAppbymeAppConfig('forum_allow_topictype_prefix')) {
             if (isset($forum['threadtypes']['prefix']) && $forum['threadtypes']['prefix'] == 1 && isset($forum['threadtypes']['types'][$topic['typeid']])) {
                 $typeTitle = '[' . $forum['threadtypes']['types'][$topic['typeid']] . ']';
             }
         }
         // 分类信息标题
         $sortTitle = '';
         if (WebUtils::getDzPluginAppbymeAppConfig('forum_allow_topicsort_prefix')) {
             if (!empty($forum['threadsorts']['prefix']) && isset($forum['threadsorts']['types'][$topic['sortid']])) {
                 $sortTitle = '[' . $forum['threadsorts']['types'][$topic['sortid']] . ']';
             }
         }
         $isTopicMoved && ($typeTitle = $sortTitle = '');
         $topicInfo['board_id'] = $topicFid;
         $topicInfo['board_name'] = $fid != 0 ? $forum['name'] : ForumUtils::getForumName($topicFid);
         $topicInfo['board_name'] = WebUtils::emptyHtml($topicInfo['board_name']);
         $topicInfo['topic_id'] = $tid;
         $topicInfo['type'] = ForumUtils::getTopicType($topic);
         $topicInfo['title'] = $movedTitle . $typeTitle . $sortTitle . $topic['subject'];
         $topicInfo['title'] = WebUtils::emptyHtml($topicInfo['title']);
         // 修正帖子查看数
         if (isset($_G['forum_thread']['views']) && $_G['forum_thread']['tid'] == $topic['tid'] && $_G['forum_thread']['views'] > $topic['views']) {
             $topic['views'] = $_G['forum_thread']['views'];
         }
         $topicInfo['user_id'] = (int) $topic['authorid'];
         $topicInfo['user_nick_name'] = $topic['author'];
         $topicInfo['last_reply_date'] = $topic['lastpost'] . '000';
         $topicInfo['vote'] = ForumUtils::isVoteTopic($topic) ? 1 : 0;
         $topicInfo['hot'] = ForumUtils::isHotTopic($topic) ? 1 : 0;
         $topicInfo['hits'] = (int) $topic['views'];
         $topicInfo['replies'] = (int) $topic['replies'];
         $topicInfo['essence'] = ForumUtils::isMarrowTopic($topic) ? 1 : 0;
         $topicInfo['top'] = ForumUtils::isTopTopic($topic) ? 1 : 0;
         $topicInfo['status'] = (int) $topic['status'];
         $cache = Yii::app()->params['mobcent']['cache']['topicSummary'];
         $key = sprintf('mobcentTopicSummary_%s_%s_%s', $tid, $_G['groupid'], $isImageList);
         if (!$cache['enable'] || ($topicSummary = Yii::app()->cache->get($key)) === false) {
             $topicSummary = ForumUtils::getTopicSummary($tid, 'forum', true, array('imageList' => $isImageList, 'imageListLen' => 9, 'imageListThumb' => 1));
             if ($cache['enable']) {
                 Yii::app()->cache->set($key, $topicSummary, $cache['expire']);
             }
         }
         $topicInfo['subject'] = $topicSummary['msg'];
         // $topicInfo['pic_path'] = ImageUtils::getThumbImage($topicSummary['image']);
         $tempTopicInfo = ImageUtils::getThumbImageEx($topicSummary['image'], 15, true, false);
         $topicInfo['pic_path'] = $tempTopicInfo['image'];
         $topicInfo['ratio'] = $tempTopicInfo['ratio'];
         $topicInfo['userAvatar'] = UserUtils::getUserAvatar($topic['authorid']);
         $topicInfo['gender'] = (int) UserUtils::getUserGender($topic['authorid']);
         $topicInfo['recommendAdd'] = (int) ForumUtils::getRecommendAdd($tid);
         $topicInfo['isHasRecommendAdd'] = ForumUtils::isHasRecommendAdd($tid);
         $topicInfo['imageList'] = (array) $topicSummary['imageList'];
         $topicInfo['sourceWebUrl'] = (string) ForumUtils::getSourceWebUrl($tid, 'topic');
         $tmpList = $list[] = $topicInfo;
     }
     return $list;
 }
Ejemplo n.º 23
0
 /**
  * 判断此当前用户是否在安米后台管理允许登陆的用户组内
  *
  * @return bool
  */
 public static function isInAppbymeAdminGroup()
 {
     global $_G;
     $allowUsers = ArrayUtils::explode(WebUtils::getDzPluginAppbymeAppConfig('appbyme_allow_admin_users'));
     $allowGroupIds = unserialize(WebUtils::getDzPluginAppbymeAppConfig('appbyme_allow_admin_usergroups'));
     $allowGroupIds || ($allowGroupIds = array(1));
     return $_G['username'] != '' && in_array($_G['username'], $allowUsers) || in_array($_G['groupid'], $allowGroupIds);
 }