protected function getData($field, $order, $limit, $offset)
 {
     Wind::import('SRV:forum.vo.PwForumSo');
     $so = new PwForumSo();
     //if ($field['fids']) {//if (count($field['fids']) > $limit) $field['fids'] = array_slice($field['fids'], 0, $limit);
     if ($field['fids'] && $field['fids'][0]) {
         $so->setFid($field['fids']);
     }
     switch ($order) {
         case '1':
             $so->orderbyThreads(false);
             break;
         case '2':
             $so->orderbyTodaythreads(false);
             break;
         case '3':
             $so->orderbyArticle(false);
             break;
         case '4':
             $so->orderbyLastPostTime(false);
             break;
     }
     $list = Wekit::load('forum.PwForum')->searchDesignForum($so, $limit, $offset);
     return $this->_buildSignKey($list);
 }
示例#2
0
 public function addlikeAction()
 {
     $this->getRequest()->isPost() || $this->showError('operate.fail');
     $fromid = (int) $this->getInput('fromid', 'post');
     $fromApp = $this->getInput('app', 'post');
     $subject = $this->getInput('subject', 'post');
     $url = $this->getInput('url', 'post');
     if ($fromid < 1 || empty($fromApp)) {
         $this->showError('BBS:like.fail');
     }
     $source = $this->_getLikeSourceDs()->getSourceByAppAndFromid($fromApp, $fromid);
     $newId = isset($source['sid']) ? (int) $source['sid'] : 0;
     Wind::import('SRV:like.dm.PwLikeSourceDm');
     if ($newId < 1) {
         $dm = new PwLikeSourceDm();
         $dm->setSubject($subject)->setSourceUrl($url)->setFromApp($fromApp)->setFromid($fromid)->setLikeCount(0);
         $newId = $this->_getLikeSourceDs()->addSource($dm);
     } else {
         $dm = new PwLikeSourceDm($source['sid']);
         $dm->setLikeCount($source['like_count']);
         $this->_getLikeSourceDs()->updateSource($dm);
     }
     $resource = $this->_getLikeService()->addLike($this->loginUser, 9, $newId);
     if ($resource instanceof PwError) {
         $this->showError($resource->getError());
     }
     $this->setOutput($resource, 'data');
     $this->showMessage('BBS:like.success');
 }
 public function doeditAction()
 {
     $tpl = $this->getInput('tpl', 'post');
     $compid = (int) $this->getInput('compid', 'post');
     $tpl = $this->_getDesignService()->filterTemplate($tpl);
     if (!$this->_getDesignService()->checkTemplate($tpl)) {
         $this->showError("DESIGN:template.error");
     }
     $property = $this->bo->getProperty();
     $limit = $this->compileFor($tpl);
     $property['limit'] = $limit ? $limit : $property['limit'];
     Wind::import('SRV:design.dm.PwDesignModuleDm');
     $dm = new PwDesignModuleDm($this->bo->moduleid);
     $dm->setModuleTpl($tpl)->setCompid($compid)->setProperty($property);
     $resource = $this->_getModuleDs()->updateModule($dm);
     if ($resource instanceof PwError) {
         $this->showError($resource->getError());
     }
     $module = $this->bo->getModule();
     Wekit::load('design.srv.PwSegmentService')->updateSegmentByPageId($module['page_id']);
     Wind::import('SRV:design.srv.data.PwAutoData');
     $srv = new PwAutoData($this->bo->moduleid);
     $srv->addAutoData();
     $this->_getDesignService()->clearCompile();
     if ($module['module_type'] == PwDesignModule::TYPE_SCRIPT) {
         $this->showMessage("operate.success", "design/module/run?type=api", true);
     } else {
         $this->showMessage("operate.success");
     }
 }
示例#4
0
 public function __construct($forum)
 {
     Wind::import('SRV:forum.vo.PwThreadSo');
     $this->forum = $forum;
     $this->so = new PwThreadSo();
     $this->so->setFid($forum->fid)->setDisabled(0);
 }
 private function _initInfo()
 {
     $this->uid = wekit::getLoginUser()->info['uid'];
     // dump($this->uid);
     $this->username = wekit::getLoginUser()->info['username'];
     $this->onlinetime = intval(intval(wekit::getLoginUser()->info['onlinetime']) / 3600);
     // $this->ip= wekit::getLoginUser()->info['lastloginip'];
     // $this->ip=$_SERVER["REMOTE_ADDR"];
     $this->ip = $this->GetIP();
     Wind::import('SRV:credit.bo.PwCreditBo');
     $userBelongSrv = Wekit::load('SRV:user.PwUserBelong');
     // dump($userBelongSrv->getUserBelongs(7));
     $this->gid = wekit::getLoginUser()->info['groupid'];
     //$this->gid=8;//0 NULL 1会员2游客3管理员4总版主5论坛版主6禁止发言7未验证会员
     if (($group = Wekit::cache()->get('group', $this->gid)) === false) {
         $group = Wekit::cache()->get('group', 1);
     }
     // dump(Wekit::$_app);
     // dump($this->gid);
     //2015.1.17关闭group
     if ($group) {
         $this->groupInfo = array('name' => $group['name'], 'type' => $group['type'], 'image' => $group['image'], 'points' => $group['points']);
         $this->permission = $group['permission'];
     }
     // dump($this->groupInfo);
     $this->avatarPath = str_replace('_middle', '', Pw::getAvatar($this->uid));
     //获取头像 √
 }
示例#6
0
 /**
  * 发送动作页面,一般是ajax提交的数据
  */
 public function sendAction()
 {
     $act = $this->getInput('act', 'post');
     $uid = $this->getInput('uid', 'post');
     if (!$act) {
         $this->showError('请选择动作');
     }
     if (!$uid) {
         $this->showError('请选择用户');
     }
     !is_array($uid) && ($uid = array($uid));
     Wind::import('EXT:dongta.service.dm.App_Dongta_Dm');
     $service = Wekit::load('EXT:dongta.service.App_Dongta');
     $users = Wekit::load('user.PwUser')->fetchUserByUid($uid);
     $actMap = (include Wind::getRealPath('EXT:dongta.conf.dongta.php', true));
     $title = '<a href="' . WindUrlHelper::createUrl('space/index/run', array('uid' => $this->loginUser->uid)) . '">' . $this->loginUser->username . '</a> ' . str_replace('{Ta}', '你', $actMap[$act][1]);
     $content = $title . ' <br>[来自应用 <a href="' . WindUrlHelper::createUrl('app/dongta/index/run') . '">动他一下</a>]';
     foreach ($users as $key => $value) {
         $dm = new App_Dongta_Dm();
         $dm->setAct($act)->setTouid($value['uid'])->setCreatedUser($this->loginUser->uid, $this->loginUser->username)->setCreatedTime(Pw::getTime());
         $service->add($dm);
         Wekit::load('message.srv.PwNoticeService')->sendNotice($value['uid'], 'app', 0, array('title' => $title, 'content' => $content));
     }
     $this->showMessage('operate.success');
 }
示例#7
0
 public function run()
 {
     $order = Wekit::load('pay.PwOrder')->getOrderByOrderNo($this->_var['out_trade_no']);
     if (empty($order)) {
         $this->paymsg('onlinepay.order.exists.not');
     }
     $fee = $order['number'] * $order['price'];
     if ($fee != $this->_var['total_fee'] || $this->_var['seller_email'] != $this->_conf['alipay']) {
         $this->paymsg('onlinepay.fail');
     }
     if (!in_array($this->_var['trade_status'], array('TRADE_FINISHED', 'TRADE_SUCCESS', 'WAIT_SELLER_SEND_GOODS'))) {
         $this->paymsg('onlinepay.success');
     }
     if ($order['state'] == 2) {
         $this->paymsg('onlinepay.order.paid');
     }
     $className = Wind::import('SRV:pay.srv.action.PwPayAction' . $order['paytype']);
     if (class_exists($className)) {
         $class = new $className($order);
         $class->run();
     }
     Wind::import('SRV:pay.dm.PwOrderDm');
     $dm = new PwOrderDm($order['id']);
     $dm->setPayemail($this->_var['buyer_email'])->setState(2)->setPaymethod(1);
     Wekit::load('pay.PwOrder')->updateOrder($dm);
     $this->paymsg('onlinepay.success');
 }
示例#8
0
 protected function postUpload($tmp_name, $filename)
 {
     if (strpos($filename, '..') !== false || strpos($filename, '.php.') !== false || preg_match('/\\.php$/', $filename)) {
         exit('illegal file type!');
     }
     WindFolder::mkRecur(dirname($filename));
     if (function_exists("move_uploaded_file") && @move_uploaded_file($tmp_name, $filename)) {
         @unlink($tmp_name);
         @chmod($filename, 0777);
         return filesize($filename);
     } elseif (@copy($tmp_name, $filename)) {
         @unlink($tmp_name);
         @chmod($filename, 0777);
         return filesize($filename);
     } elseif (is_readable($tmp_name)) {
         Wind::import('WIND:utility.WindFile');
         WindFile::write($filename, WindFile::read($tmp_name));
         @unlink($tmp_name);
         if (file_exists($filename)) {
             @chmod($filename, 0777);
             return filesize($filename);
         }
     }
     return false;
 }
示例#9
0
 public function run()
 {
     $permissionService = new PwPermissionService();
     $categorys = $permissionService->getPermissionPoint($this->_getShowPoint(), array('basic', 'bbs'));
     $compare = $this->getInput('gid');
     if ($compare && $compare != $this->loginUser->gid) {
         $this->setOutput(true, 'compare');
         $compareGroup = $permissionService->getPermissionConfigByGid($compare, $this->_getShowPoint());
         $this->setOutput($compareGroup, 'compareGroupPermission');
         $this->setOutput($compare, 'comparegid');
     }
     $myGroup = $permissionService->getPermissionConfigByGid($this->loginUser->gid, $this->_getShowPoint());
     $this->listGroups();
     $attach = array('allow_upload', 'allow_download', 'uploads_perday');
     foreach ($categorys['bbs']['sub'] as $_k => $_v) {
         if (!in_array($_v, $attach)) {
             continue;
         }
         unset($categorys['bbs']['sub'][$_k]);
     }
     $totalCredit = Wekit::load('usergroup.srv.PwUserGroupsService')->getCredit($this->loginUser->info);
     $categorys['attach'] = array('name' => '附件权限', 'sub' => $attach);
     $this->setOutput($categorys, 'categorys');
     $this->setOutput($myGroup, 'myGroupPermission');
     $this->setOutput($totalCredit, 'myCredit');
     $this->_appendBread('权限查看', WindUrlHelper::createUrl('profile/right/run'));
     $this->setTemplate('profile_right');
     // seo设置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $seoBo = PwSeoBo::getInstance();
     $lang = Wind::getComponent('i18n');
     $seoBo->setCustomSeo($lang->getMessage('SEO:profile.right.run.title'), '', '');
     Wekit::setV('seo', $seoBo);
 }
示例#10
0
 /**
  * 我关注的人发起的投票
  *
  */
 public function createAction()
 {
     $page = $this->getInput('page');
     $page = $page < 1 ? 1 : intval($page);
     list($start, $limit) = Pw::page2limit($page, $this->perpage);
     $followUids = $this->getFollowUids($this->loginUser->uid);
     $total = $this->_getPwPollDs()->countPollByUids($followUids);
     $pollInfo = array();
     if ($total) {
         Wind::import('SRV:poll.srv.dataSource.PwFetchPollByUids');
         $pollDisplay = new PwPollDisplay(new PwFetchPollByUids($followUids, $limit, $start));
         $pollInfo = $this->_buildPoll($pollDisplay->gather());
     }
     $latestPollDisplay = new PwPollDisplay(new PwFetchPollByOrder(10, 0, array('created_time' => '0')));
     $latestPoll = $latestPollDisplay->gather();
     $this->setOutput($total, 'total');
     $this->setOutput($pollInfo, 'pollInfo');
     $this->setOutput($latestPoll, 'latestPoll');
     $this->setOutput($page, 'page');
     $this->setOutput($this->perpage, 'perpage');
     $this->setOutput(array('allowview' => $this->loginUser->getPermission('allow_view_vote'), 'allowvote' => $this->loginUser->getPermission('allow_participate_vote')), 'pollGroup');
     if (!$total) {
         $num = 20;
         $uids = $this->_getRecommendService()->getRecommendAttention($this->loginUser->uid, $num);
         $recommend = $this->_getRecommendService()->buildUserInfo($this->loginUser->uid, $uids, $num);
         $this->setOutput($recommend, 'recommend');
     }
 }
示例#11
0
 public function run()
 {
     $order = Wekit::load('pay.PwOrder')->getOrderByOrderNo($this->_var['invoice']);
     if (empty($order)) {
         $this->paymsg('onlinepay.order.exists.not');
     }
     $fee = $order['number'] * $order['price'];
     if ($fee != $this->_var['mc_gross']) {
         $this->paymsg('onlinepay.fail');
     }
     if ($this->_var['payment_status'] != 'Completed') {
         $this->paymsg('onlinepay.success');
     }
     if ($order['state'] == 2) {
         $this->paymsg('onlinepay.order.paid');
     }
     $className = Wind::import('SRV:pay.srv.action.PwPayAction' . $order['paytype']);
     if (class_exists($className)) {
         $class = new $className($order);
         $class->run();
     }
     Wind::import('SRV:pay.dm.PwOrderDm');
     $dm = new PwOrderDm($order['id']);
     $dm->setState(2)->setPaymethod(3);
     Wekit::load('pay.PwOrder')->updateOrder($dm);
     $this->paymsg('onlinepay.success');
 }
示例#12
0
 protected function sendErrorMessage($errorMessage, $errorcode)
 {
     if (!is_object($errorMessage)) {
         $_tmp = $errorMessage;
         /* @var $errorMessage WindErrorMessage */
         $errorMessage = Wind::getComponent('errorMessage');
         $errorMessage->addError($_tmp);
     }
     /* @var $router WindRouter */
     $moduleName = $this->handlerAdapter->getModule();
     if ($moduleName === 'error') {
         throw new WindFinalException($errorMessage->getError(0));
     }
     if (!($_errorAction = $errorMessage->getErrorAction())) {
         $module = $this->getModules($moduleName);
         $_errorClass = Wind::import(@$module['error-handler']);
         $_errorAction = 'error/' . $_errorClass . '/run/';
         $this->setModules('error', array('controller-path' => array_search($_errorClass, Wind::$_imports), 'controller-suffix' => '', 'error-handler' => ''));
     }
     /* @var $forward WindForward */
     $forward = Wind::getComponent('forward');
     $error = array('message' => $errorMessage->getError(), 'code' => $errorcode);
     $forward->forwardAction($_errorAction, array('__error' => $error, '__errorDir' => $this->getConfig('error-dir')), false, false);
     $this->doDispatch($forward);
 }
示例#13
0
 /**
  * 从A版块复制主题分类至B版块
  * 
  * @param int $fromFid
  * @param int $toFid
  */
 public function copyTopicType($fromFid, $toFid)
 {
     $this->_getTopictypeDs()->deleteTopicTypeByFid($toFid);
     $topicTypes = $this->_getTopictypeDs()->getTypesByFid($fromFid);
     $idMap = $subTopicTypes = array();
     Wind::import('SRV:forum.dm.PwTopicTypeDm');
     foreach ($topicTypes as $k => $v) {
         if ($v['parentid']) {
             $subTopicTypes[$k] = $v;
             continue;
         }
         $dm = new PwTopicTypeDm();
         $dm->setFid($toFid)->setIsSystem($v['issys'])->setVieworder($v['vieworder'])->setLogo($v['logo'])->setName($v['name']);
         $id = $this->_getTopictypeDs()->addTopicType($dm);
         $idMap[$v['id']] = $id;
     }
     if ($subTopicTypes) {
         foreach ($subTopicTypes as $k => $v) {
             $dm = new PwTopicTypeDm();
             $dm->setFid($toFid)->setIsSystem($v['issys'])->setVieworder($v['vieworder'])->setLogo($v['logo'])->setName($v['name'])->setParentId($idMap[$v['parentid']]);
             $this->_getTopictypeDs()->addTopicType($dm);
         }
     }
     return true;
 }
示例#14
0
 /**
  * 导出当前页设计数据  已无用
  * Enter description here ...
  */
 protected function doTxt($pageInfo, $charset = 'utf-8')
 {
     Wind::import('SRV:design.srv.PwDesignExportTxt');
     $srv = new PwDesignExportTxt($pageInfo);
     $msg = $srv->txt($charset);
     $this->forceDownload($msg['content'], $msg['filename'] . '_' . $charset, $msg['ext'], $charset);
 }
示例#15
0
 public function dorunAction()
 {
     Wind::import('WINDID:service.config.srv.WindidConfigSet');
     $config = new WindidConfigSet('site');
     $config->set('timezone', intval($this->getInput('timeTimezone', 'post')))->set('timecv', intval($this->getInput('timecv', 'post')))->flush();
     $this->showMessage('ADMIN:success');
 }
 public function checkVerify($inputCode)
 {
     Wind::import('WINDID:service.verify.srv.PwVerifyService');
     $srv = new PwVerifyService('PwVerifyService_getVerifyType');
     $config = Wekit::C('verify');
     return $srv->checkVerify($config['type'], $inputCode);
 }
示例#17
0
 public function run($ids)
 {
     Wind::import('SRV:forum.dm.PwTopicDm');
     Wind::import('SRV:forum.dm.PwReplyDm');
     $threadDs = Wekit::load('forum.PwThread');
     $forumSrv = Wekit::load('forum.srv.PwForumService');
     foreach ($this->tids as $tid => $value) {
         $dm1 = new PwReplyDm(true);
         $dm1->setTid($tid);
         $value['disabled'] != 2 && $dm1->setDisabled(0);
         $threadDs->batchUpdatePost($value['ids'], $dm1);
         $post = current(Wekit::load('forum.PwThread')->getPostByTid($tid, 1, 0, false));
         $dm = new PwTopicDm($tid);
         $dm->addReplies($value['replies']);
         $post && $dm->setLastpost($post['created_userid'], $post['created_username'], $post['created_time']);
         $threadDs->updateThread($dm, PwThread::FETCH_MAIN);
     }
     foreach ($this->fids as $fid => $value) {
         $forumSrv->updateStatistics($fid, 0, $value);
     }
     foreach ($this->rpids as $rpid => $value) {
         $dm = new PwReplyDm($rpid);
         $dm->addReplies($value);
         $threadDs->updatePost($dm);
     }
     Wekit::load('recycle.PwReplyRecycle')->batchDelete($ids);
 }
示例#18
0
 /**
  * 后台设置-ftp设置
  */
 public function doftpAction()
 {
     Wind::import('WINDID:service.config.srv.WindidConfigSet');
     $config = new WindidConfigSet('attachment');
     $config->set('ftp.url', $this->getInput('ftpUrl', 'post'))->set('ftp.server', $this->getInput('ftpServer', 'post'))->set('ftp.port', $this->getInput('ftpPort', 'post'))->set('ftp.dir', $this->getInput('ftpDir', 'post'))->set('ftp.user', $this->getInput('ftpUser', 'post'))->set('ftp.pwd', $this->getInput('ftpPwd', 'post'))->set('ftp.timeout', abs(intval($this->getInput('ftpTimeout', 'post'))))->flush();
     $this->showMessage('WINDID:success');
 }
 public function domodify()
 {
     $verifiedWord = $this->getInput('verifiedWord');
     $tagnames = $this->getInput('tagnames');
     Wind::import('SRV:forum.srv.post.do.PwPostDoWord');
     return new PwPostDoWord($this->bp, $verifiedWord, $tagnames);
 }
示例#20
0
 public function setStore($key, $storage)
 {
     Wind::import('WINDID:service.config.srv.WindidConfigSet');
     $config = new WindidConfigSet('storage');
     $config->set($key, serialize($storage))->flush();
     return true;
 }
示例#21
0
 public function run()
 {
     $this->setCurrentLeft('avatar');
     $isAvatarBan = false;
     if (Pw::getstatus($this->loginUser->info['status'], PwUser::STATUS_BAN_AVATAR)) {
         Wind::import('SRV:user.srv.PwBanBp');
         $banBp = new PwBanBp($this->loginUser->uid);
         if (false === $banBp->checkIfBanAvatar()) {
             $banBp->recoveryBanAvatarError();
         } elseif ($banBp->endDateTimeBanAvatar()) {
             $this->loginUser->info['status'] = $banBp->callEndDateTimeBanAvatar();
         } else {
             $isAvatarBan = true;
             $info = $banBp->getBanAvatarInfo();
             if ($info['created_userid'] == 0) {
                 $info['operator'] = 'system';
             } else {
                 $operatorInfo = Wekit::load('user.PwUser')->getUserByUid($info['created_userid']);
                 $info['operator'] = $operatorInfo['username'];
             }
             $this->setOutput($info, 'banInfo');
         }
     }
     $windidApi = $this->_getWindid();
     $this->setOutput($windidApi->showFlash($this->loginUser->uid), 'avatarFlash');
     $this->setOutput($windidApi->showFlash($this->loginUser->uid, 0), 'avatarArr');
     $this->setOutput($isAvatarBan, 'isAvatarBan');
     $this->setOutput($this->getInput('type'), 'type');
     $this->setLayout('');
     $this->setTemplate('profile_avatar');
     // seo设置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $lang = Wind::getComponent('i18n');
     PwSeoBo::setCustomSeo($lang->getMessage('SEO:profile.avatar.run.title'), '', '');
 }
示例#22
0
 public function run()
 {
     $this->_setNavType('schoolarea');
     $allArea = $this->_getAreaDs()->getAreaByParentid(0);
     $allArea = array_values($allArea);
     //check if has province id or not, if has, then school list need to based on that
     //get province from url
     $choosenProvinceid = $this->getInput('choosenProvinceid');
     if (!isset($choosenProvinceid) || $choosenProvinceid <= 0) {
         $choosenProvinceid = $allArea[0]['areaid'];
     }
     $allSchool = $this->_getSchoolDs()->getSchoolByAreaidAndTypeid($choosenProvinceid, 3);
     $allSchool = array_values($allSchool);
     $this->setOutput($allSchool, 'allSchool');
     $choosenSchoolid = $this->getInput('choosenSchoolid');
     if (!isset($choosenSchoolid) || $choosenSchoolid <= 0) {
         $choosenSchoolid = $allSchool[0]['schoolid'];
     }
     //check if it is from search, if from search, then search by selected university
     if ($this->getInput('search', 'post') === 'search') {
         $choosenSchoolid = $this->getInput('choosenSchoolid', 'post');
         $areaList = $this->_getSchoolAreaDs()->getBySchoolid($choosenSchoolid);
         $choosenProvinceid = $this->getInput('choosenProvinceid', 'post');
     } else {
         //get first school and show its area
         Wind::import('EXT:4tschool.service.dm.App_SchoolArea_Dm');
         $areaList = $this->_getSchoolAreaDs()->getBySchoolid($choosenSchoolid);
         //print_r($areaList);die;
     }
     $this->setOutput($choosenProvinceid, 'choosenProvinceid');
     $this->setOutput($choosenSchoolid, 'choosenSchoolid');
     $this->setOutput($areaList, 'areaList');
     $this->setOutput($allArea, 'allArea');
 }
示例#23
0
 protected function install($pack)
 {
     $manifest = $pack . '/Manifest.xml';
     if (!is_file($manifest)) {
         return false;
     }
     /* @var $install PwInstallApplication */
     Wind::import('APPS:appcenter.service.srv.PwInstallApplication');
     $install = new PwInstallApplication();
     /* @var $_install PwStyleInstall */
     $_install = Wekit::load('APPS:appcenter.service.srv.do.PwStyleInstall');
     $conf = $install->getConfig('install-type', 'style');
     $r = $install->initInstall($manifest);
     if ($r instanceof PwError) {
         return false;
     }
     $r = $_install->install($install);
     if ($r instanceof PwError) {
         return false;
     }
     $r = $_install->registeApplication($install);
     if ($r instanceof PwError) {
         return false;
     }
     $install->addInstallLog('packs', $pack);
     $install->addInstallLog('service', $conf);
     $fields = array();
     foreach ($install->getInstallLog() as $key => $value) {
         $_tmp = array('app_id' => $install->getAppId(), 'log_type' => $key, 'data' => $value, 'created_time' => time(), 'modified_time' => time());
         $fields[] = $_tmp;
     }
     Wekit::load('APPS:appcenter.service.PwApplicationLog')->batchAdd($fields);
     return $install->getAppId();
 }
示例#24
0
 public function run()
 {
     $page = $this->getInput('page');
     $this->page = $page < 1 ? 1 : intval($page);
     list($start, $limit) = Pw::page2limit($this->page, $this->perpage);
     $total = $this->_getPollVoterDs()->countByUid(Wekit::getLoginUser()->uid);
     $poll = $total ? $this->_getPollVoterDs()->getPollByUid(Wekit::getLoginUser()->uid, $limit, $start) : array();
     $pollInfo = array();
     if ($poll) {
         $pollid = array();
         foreach ($poll as $value) {
             $pollid[] = $value['poll_id'];
         }
         Wind::import('SRV:poll.srv.dataSource.PwFetchPollByPollid');
         $pollDisplay = new PwPollDisplay(new PwFetchPollByPollid($pollid, count($pollid)));
         $pollInfo = $this->_buildPoll($pollDisplay->gather(), 'my');
     }
     $latestPollDisplay = new PwPollDisplay(new PwFetchPollByOrder(10, 0, array('created_time' => '0')));
     $latestPoll = $latestPollDisplay->gather();
     $this->setOutput($total, 'total');
     $this->setOutput($pollInfo, 'pollInfo');
     $this->setOutput($latestPoll, 'latestPoll');
     $this->setOutput($this->page, 'page');
     $this->setOutput($this->perpage, 'perpage');
     $this->setOutput(array('allowview' => $this->loginUser->getPermission('allow_view_vote'), 'allowvote' => $this->loginUser->getPermission('allow_participate_vote')), 'pollGroup');
     // seo设置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $seoBo = PwSeoBo::getInstance();
     $lang = Wind::getComponent('i18n');
     $seoBo->setCustomSeo($lang->getMessage('SEO:vote.my.run.title'), '', '');
     Wekit::setV('seo', $seoBo);
 }
示例#25
0
 public function run()
 {
     /* @var $userGroup PwUserGroups */
     $userGroup = Wekit::load('usergroup.PwUserGroups');
     $groups = $userGroup->getAllGroups();
     $groupTypes = $userGroup->getTypeNames();
     Wind::import('SRV:credit.bo.PwCreditBo');
     /* @var $pwCreditBo PwCreditBo */
     $pwCreditBo = PwCreditBo::getInstance();
     $config = Wekit::C()->getValues('register');
     if (!$config['active.field']) {
         $config['active.field'] = array();
     }
     $wconfig = WindidApi::C('reg');
     $config['security.username.min'] = $wconfig['security.username.min'];
     $config['security.username.max'] = $wconfig['security.username.max'];
     $config['security.password.min'] = $wconfig['security.password.min'];
     $config['security.password.max'] = $wconfig['security.password.max'];
     $config['security.password'] = $wconfig['security.password'];
     $config['security.ban.username'] = $wconfig['security.ban.username'];
     $this->setOutput($config, 'config');
     $this->setOutput($pwCreditBo->cType, 'credits');
     $this->setOutput($groups, 'groups');
     $this->setOutput($groupTypes, 'groupTypes');
 }
示例#26
0
 /** 
  * 电子邮件用户激活
  */
 public function emailAction()
 {
     list($page, $perpage) = $this->getInput(array('page', 'perpage'));
     $page = $page ? $page : 1;
     $perpage = $perpage ? $perpage : $this->perpage;
     $count = $this->_getDs()->countUnActived();
     $list = array();
     if ($count > 0) {
         $totalPage = ceil($count / $perpage);
         $page > $totalPage && ($page = $totalPage);
         $result = $this->_getDs()->getUnActivedList($perpage, intval(($page - 1) * $perpage));
         /* @var $userDs PwUser */
         $userDs = Wekit::load('user.PwUser');
         $list = $userDs->fetchUserByUid(array_keys($result), PwUser::FETCH_MAIN);
         $list = WindUtility::mergeArray($result, $list);
     }
     $this->setOutput($count, 'count');
     $this->setOutput($page, 'page');
     $this->setOutput($perpage, 'perpage');
     $this->setOutput(array('perpage' => $perpage), 'args');
     $this->setOutput($list, 'list');
     // seo设置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $seoBo = PwSeoBo::getInstance();
     $lang = Wind::getComponent('i18n');
     $seoBo->setCustomSeo($lang->getMessage('SEO:manage.user.email.title'), '', '');
     Wekit::setV('seo', $seoBo);
 }
示例#27
0
 /**
  * 淘宝推广图片 
  * 
  * @access public
  * @return void
  */
 public function dotaoAction()
 {
     if (!($user = $this->_getUser())) {
         $this->showError('login.not');
     }
     $fid = $this->getInput('fid', 'post');
     //
     $this->_accpetUploadForH5();
     //
     Wind::import('SRV:upload.action.PwTaoUpload');
     Wind::import('LIB:upload.PwUpload');
     $bhv = new PwTaoUpload();
     $bhv->filename = date('YmdHis');
     //
     $upload = new PwUpload($bhv);
     if (($result = $upload->check()) === true) {
         $result = $upload->execute();
     }
     if ($result !== true) {
         $this->showError($result->getError());
     }
     if (!($data = $bhv->getAttachInfo())) {
         $this->showError('upload.fail');
     }
     $data['path'] = Pw::getPath($data['path'] . $data['filename']);
     //
     $this->setOutput($data, 'data');
     $this->showMessage('upload.success');
 }
示例#28
0
 /**
  * 获取语音验证码
  */
 public function getAudioAction()
 {
     Wind::import('LIB:utility.PwVerifyCode');
     $srv = new PwVerifyCode();
     $srv->getAudioVerify();
     exit;
 }
示例#29
0
 /**
  * 回复列表
  */
 public function replyAction()
 {
     list($page, $perpage) = $this->getInput(array('page', 'perpage'));
     $page = $page ? $page : 1;
     $perpage = $perpage ? $perpage : $this->perpage;
     list($start, $limit) = Pw::page2limit($page, $perpage);
     $count = $this->_getThreadExpandDs()->countDisabledPostByUid($this->loginUser->uid);
     if ($count) {
         $tmpPosts = $this->_getThreadExpandDs()->getDisabledPostByUid($this->loginUser->uid, $limit, $start);
         $posts = $tids = array();
         foreach ($tmpPosts as $v) {
             $tids[] = $v['tid'];
         }
         $threads = $this->_getThreadDs()->fetchThread($tids);
         foreach ($tmpPosts as $v) {
             $v['threadSubject'] = Pw::substrs($threads[$v['tid']]['subject'], 30);
             $v['content'] = Pw::substrs($v['content'], 30);
             $v['created_time'] = PW::time2str($v['created_time'], 'auto');
             $posts[] = $v;
         }
     }
     $this->setOutput($count, 'count');
     $this->setOutput($page, 'page');
     $this->setOutput($perpage, 'perpage');
     $this->setOutput($posts, 'posts');
     // seo设置
     Wind::import('SRV:seo.bo.PwSeoBo');
     $seoBo = PwSeoBo::getInstance();
     $lang = Wind::getComponent('i18n');
     $seoBo->setCustomSeo($lang->getMessage('SEO:bbs.article.reply.title'), '', '');
     Wekit::setV('seo', $seoBo);
 }
示例#30
0
 public function insertFeedback($schoolid, $userid, $message)
 {
     Wind::import('EXT:4tschool.service.messageboard.dm.App_MessageBoard_Dm');
     $dm = new App_MessageBoard_Dm();
     $dm->setUserId($userid)->setSchoolId($schoolid)->setQuestion($message);
     return $this->_loadDao()->add($dm->getData());
 }