/** * 执行搜索 * @return array */ public function search() { $result = array(); //$resource = Wind::getComponent('i18n'); $parser = Wekit::load('ADMIN:service.srv.AdminSearchLangParserService'); $texts = $parser->parseSearchLang(); foreach ($this->_menus as $k1 => $v1) { list($s1, $t1) = $this->_check($v1['name']); if ($s1) { $v1['name'] = $t1; $result[$k1] = $v1; } //$desc = $resource->getMessage("ADMIN:search.{$k}"); $desc = $texts[$k1]; if ($desc) { $subItems = array(); $matchMain = false; if (is_array($desc['items'])) { foreach ($desc['items'] as $v) { list($s, $t) = $this->_check($v); if ($s) { $result[$k1]['items'][] = $t; $matchMain = true; } } } if (count($desc) > 1) { //二级 foreach ($desc as $k2 => $v2) { if ($k2 == 'items') { continue; } $tmp = array(); if ($v2['items']) { foreach ($v2['items'] as $v3) { list($s, $t) = $this->_check($v3); $s && ($tmp['items'][] = $t); } if ($tmp['items']) { $tmp['name'] = $k2; $tmp['url'] = $v2['url']; } } $tmp && ($subItems[] = $tmp); } } if ($matchMain || $subItems) { $tmp = null; if (!$s1) { $result[$k1]['items'] && ($tmp = $result[$k1]['items']); $v1['name'] = $t1; $result[$k1] = $v1; } $result[$k1]['sub'] = $subItems; $tmp && ($result[$k1]['items'] = $tmp); } } } return $result; }
/** * 获取全站url信息 * * @return obj */ public function getUrl() { $_consts = Wekit::S('publish'); foreach ($_consts as $const => $value) { if (defined($const)) { continue; } if ($const === 'PUBLIC_URL' && !$value) { $value = Wind::getComponent('request')->getBaseUrl(true); if (defined('BOOT_PATH') && 0 === strpos(BOOT_PATH, PUBLIC_PATH)) { $path = substr(BOOT_PATH, strlen(PUBLIC_PATH)); !empty($path) && ($value = substr($value, 0, -strlen($path))); } } define($const, $value); } $url = new stdClass(); $url->base = PUBLIC_URL; $url->res = WindUrlHelper::checkUrl(PUBLIC_RES, $url->base); $url->css = WindUrlHelper::checkUrl(PUBLIC_RES . '/css/', $url->base); $url->images = WindUrlHelper::checkUrl(PUBLIC_RES . '/images/', $url->base); $url->js = WindUrlHelper::checkUrl(PUBLIC_RES . '/js/dev/', $url->base); $url->attach = WindUrlHelper::checkUrl(PUBLIC_ATTACH, $url->base); $url->themes = WindUrlHelper::checkUrl(PUBLIC_THEMES, $url->base); $url->extres = WindUrlHelper::checkUrl(PUBLIC_THEMES . '/extres/', $url->base); return $url; }
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'), '', ''); }
public function afterRegister($userDm) { if ($this->bp->config['type'] != 2) { return false; } /* @var $inviteDs PwInviteCode */ $inviteDs = Wekit::load('invite.PwInviteCode'); if ($this->inviteInfo['created_userid']) { $codeDm = new PwInviteCodeDm(); $codeDm->setInvitedUid($userDm->uid)->setModifiedTime(Pw::getTime())->setIfused(1)->setCode($this->code); //别人赠送的邀请码 $inviteDs->updateCode($codeDm); $creditType = $this->bp->config['invite.reward.credit.type']; $creditNum = $this->bp->config['invite.reward.credit.num']; //邀请人获得加奖励 //[积分日志] 成功邀请好友积分奖励 /* @var $creditBo PwCreditBo */ $creditBo = PwCreditBo::getInstance(); $creditBo->addLog('invite_reward', array($creditType => $creditNum), new PwUserBo($this->inviteInfo['created_userid']), array('friend' => $userDm->getField('username'))); $creditBo->set($this->inviteInfo['created_userid'], $creditType, $creditNum); //邀请成功相互关注 被邀请者关注邀请者 /* @var $attention PwAttentionService */ $attention = Wekit::load('attention.srv.PwAttentionService'); $attention->addFollow($userDm->uid, $this->inviteInfo['created_userid']); // $attention->addFollow($this->inviteInfo['created_userid'], $userDm->uid); } else { $codeDm = new PwInviteCodeDm(); $codeDm->setInvitedUid($userDm->uid)->setIfused(1)->setModifiedTime(Pw::getTime())->setCreateUid($userDm->uid)->setCode($this->code); //自己购买的邀请码 $inviteDs->updateCode($codeDm); } return true; }
/** * 忽略 * * @param array $notice */ public function ignoreNotice($notice, $ignore = 1) { if (!$notice) { return false; } return Wekit::load('message.srv.PwNoticeService')->setIgnoreNotice($notice['typeid'], $notice['uid'], $ignore); }
/** * 设置伪静态 */ public function doModifyAction() { list($format, $isopen) = $this->getInput(array('format', 'isopen')); $bo = new PwConfigSet('rewrite'); foreach ($format as $k => $v) { if (empty($v) && isset($isopen[$k])) { $this->showError('REWRITE:format.empty'); } $bo->set("format.{$k}", $v); } $addons = Wekit::load('domain.srv.PwDomainService')->getRewriteAddOns(); $rewriteData = array(); $unique = array(); foreach ($addons as $k1 => $v1) { $open = isset($isopen[$k1]) ? 1 : 0; $bo->set("isopen.{$k1}", $open); if ($open) { $format_i = preg_replace('/\\{\\w+\\}/', '', $format[$k1]); if (in_array($format_i, $unique)) { $this->showError(array('REWRITE:format.conflict', array($format[$k1]))); } $unique[] = $format_i; if ($k1 == 'thread') { $rewriteData['cate'] = array('format' => $format[$k1], 'pattern' => $this->_compileFormat($format[$k1]), 'route' => 'bbs/cate/run'); } $rewriteData[$k1] = array('format' => $format[$k1], 'pattern' => $this->_compileFormat($format[$k1]), 'route' => $v1[2]); } } $bo->flush(); Wekit::C()->setConfig('site', 'rewrite', $rewriteData); Wekit::load('domain.srv.PwDomainService')->refreshTplCache(); Wekit::load('SRV:nav.srv.PwNavService')->updateConfig(); $this->showMessage('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); }
public function createHtmlAfterUserInfo($user, $read) { $showuserinfo = Wekit::C('site', 'app.torrent.showuserinfo'); if (is_array($showuserinfo) && !in_array('threadside', $showuserinfo)) { return; } $peers = Wekit::load('EXT:torrent.service.PwTorrentPeer')->fetchTorrentPeerByUid($user['uid']); $torrents = Wekit::load('EXT:torrent.service.PwTorrent')->fetchTorrentByUid($user['uid']); $histories = Wekit::load('EXT:torrent.service.PwTorrentHistory')->fetchTorrentHistoryByUid($user['uid']); $seeding = $leeching = 0; if (is_array($peers)) { foreach ($peers as $peer) { if ($peer['seeder'] == 'yes') { $seeding++; } else { $leeching++; } } } if (is_array($histories)) { foreach ($histories as $history) { $downloaded_total += $history['downloaded']; $uploaded_total += $history['uploaded']; } } if ($downloaded_total != 0) { $rotio = round($uploaded_total / $downloaded_total, 2); } else { $rotio = 'Inf.'; } echo '<div id="PTInfo">下载:' . $leeching . '<br>做种:' . $seeding . '<br>发布: ' . count($torrents) . '<br>分享率: ' . $rotio . '<br>下载量: ' . PwUtils::readableDataTransfer($downloaded_total) . '<br>上传量: ' . PwUtils::readableDataTransfer($uploaded_total) . '</div>'; }
public function compile($key, $content) { $content = substr($content, 8, -1); if (!$content) { return ''; } $themeBaseUrl = 'Wekit::app()->themes'; preg_match('/(\\w*.)?(\\w*.)?(css|js|images)(.\\w*)?/i', $content, $matchs); if (!$matchs) { return ''; } if (empty($matchs[3])) { return ''; } $pack = $theme = ''; if (!empty($matchs[1])) { $themeType = trim($matchs[1], '.'); $pack = Wekit::C('site', 'theme.' . $themeType . '.pack'); $theme = empty($matchs[2]) ? '\'.Wekit::C(\'site\', \'theme.' . $themeType . '.default\').\'' : trim($matchs[2], '.'); } else { list($theme, $pack) = $this->windViewerResolver->getWindView()->getTheme(0); $pack && ($pack = str_replace('THEMES:', '', $pack)); } $content = $pack ? '.\'/' . str_replace('.', '/', $pack) . '\'' : ''; $content .= $theme ? '.\'/' . $theme . '\'' : ''; $content .= '.\'/' . $matchs[3] . '\''; if ($matchs[3] === 'css') { $content .= '.Wekit::getGlobal(\'theme\',\'debug\')'; } $content = '<?php echo ' . $themeBaseUrl . $content . '; ?>'; $content = str_replace('\'.\'', '', $content); return $content; }
public function run() { $dm = new PwTopicDm(true); $dm->addLastposttime(-$this->downtime)->setDowned($this->downed); Wekit::load('forum.PwThread')->batchUpdateThread($this->tids, $dm, PwThread::FETCH_MAIN); Wekit::load('log.srv.PwLogService')->addThreadManageLog($this->srv->user, 'down', $this->srv->getData(), $this->_reason, $this->downtime); }
public function compile($key, $content) { $content = array(); $content[] = '<?php'; if (Wekit::load('APPCENTER:service.srv.PwDebugApplication')->inDevMode2()) { $_content = $this->_devHook(); $content[] = 'echo \'' . $_content . '\';'; } if (!$this->args) { $this->args = ''; } else { $this->args = preg_replace(array('/\\s*array\\s*\\(\\s*/i', '/\\s*\\)\\s*$/i'), '', $this->args); } $this->method = $this->method ? $this->method : 'runDo'; if ($this->class) { $this->args = "'" . $this->name . "'" . ($this->args ? "," . $this->args : ''); $callback = 'array(' . $this->class . ', "' . $this->method . '")'; } elseif ($this->name) { $callback = 'array(PwSimpleHook::getInstance("' . $this->name . '"), "' . $this->method . '")'; } else { $callback = '"' . $this->method . '"'; } $this->args = 'array(' . $this->args . ')'; $this->alias = trim($this->alias); $content[] = 'PwHook::display(' . $callback . ', ' . $this->args . ', "' . $this->alias . '", $__viewer);'; $content[] = '?>'; return implode("\r\n", $content); }
public function appDo($space) { if (!in_array('profile', Wekit::C('site', 'app.torrent.showuserinfo'))) { return ''; } $user = Wekit::load('EXT:torrent.service.PwTorrentUser')->getTorrentUserByUid($space->{'spaceUid'}); $torrents = Wekit::load('EXT:torrent.service.PwTorrent')->fetchTorrentByUid($space->{'spaceUid'}); $histories = Wekit::load('EXT:torrent.service.PwTorrentHistory')->fetchTorrentHistoryByUid($space->{'spaceUid'}); $passkey = $user['passkey']; $posted = count($torrents); foreach ($histories as $history) { $downloaded_total += $history['downloaded']; $uploaded_total += $history['uploaded']; } $downloaded_total = floor($downloaded_total / 1048567); $uploaded_total = floor($uploaded_total / 1048567); if ($downloaded_total != 0) { $rotio = round($uploaded_total / $downloaded_total, 2); } else { $rotio = 'Inf.'; } echo '<div class="space_profile"><h3><strong>PT个人信息</strong></h3>'; if ($space->{'visitUid'} == $space->{'spaceUid'}) { echo '<dl class="cc"><dt>Passkey:</dt><dd><span id="passkey" style="background-color:rgb(51,51,51); color:rgb(51,51,51);">' . $passkey . '</span> <button class="btn" id="btnToggle" onclick="if ($(\'#btnToggle\').text() == \'显示\') {$(\'#passkey\').css(\'background\', \'white\'); $(\'#btnToggle\').text(\'隐藏\');} else {$(\'#passkey\').css(\'background\', \'rgb(51,51,51)\');$(\'#btnToggle\').text(\'显示\');}">显示</button></dd></dl>'; echo '<dl class="cc"><dt>订阅地址:</dt><dd><a href="' . WindUrlHelper::createUrl('/app/torrent/index/rss?uid=' . $space->{'spaceUid'} . '&passkey=' . $passkey) . '">RSS 链接(请勿泄露)</a><a href="' . WindUrlHelper::createUrl('/app/torrent/index/my') . '" class="btn">管理</a></dd></dl>'; } echo '<dl class="cc"><dt>下载:</dt><dd>' . $downloaded_total . ' M</dd></dl>'; echo '<dl class="cc"><dt>上传:</dt><dd>' . $uploaded_total . ' M</dd></dl>'; echo '<dl class="cc"><dt>分享率:</dt><dd>' . $rotio . '</dd></dl>'; echo '<dl class="cc"><dt>发布:</dt><dd>' . $posted . '</dd></dl>'; echo '</div>'; }
public function run($uid) { /* @var $srv PwMessageService */ $srv = Wekit::load('SRV:message.srv.PwMessageService'); $srv->deleteUserMessages($uid, true, true); return true; }
public function gainReward($uid, $reward, $taskname) { $userBo = Wekit::getLoginUser(); list($id) = explode('-', $reward['value'], 2); $time = abs(intval($reward['time'])); /* @var $userBelongDs PwUserBelong */ $userBelongDs = Wekit::load('user.PwUserBelong'); $info = $userBelongDs->getUserBelongs($uid); $_groups = array(); foreach ($info as $_item) { $_groups[$_item['gid']] = $_item['endtime']; } $_groups[$id] = $time ? Pw::getTime() + 24 * 3600 * $time : 0; /* @var $userService PwUserService */ $userService = Wekit::load('user.srv.PwUserService'); list($gid, $groups) = $userService->caculateUserGroupid($userBo->gid, $_groups); $dm = new PwUserInfoDm($uid); $dm->setGroupid($gid)->setGroups($groups); /* @var $userDs PwUser */ $userDs = Wekit::load('user.PwUser'); $result = $userDs->editUser($dm, PwUser::FETCH_MAIN); if ($result instanceof PwError) { return $result; } return true; }
public function addPost($pid, $tid) { if ($pid < 1 && $tid < 1) { return false; } return Wekit::load('like.PwLikeContent')->updateLastPid($this->likeid, $pid); }
public function __construct() { $config = Wekit::C('pay'); $this->tenpay = $config['tenpay']; $this->tenpay_key = $config['tenpaykey']; $this->baseurl = WindUrlHelper::createUrl('bbs/tenpay/run'); }
public function dataProcessing($postDm) { $word_version = $this->_word ? 0 : (int) Wekit::C('bbs', 'word_version'); $this->_isVerified && $postDm->setDisabled(1); $postDm->setWordVersion($word_version); return $postDm; }
public function postHandle() { //门户管理模式 编译目录切换 if ($this->getRequest()->getPost('design')) { $loginUser = Wekit::getLoginUser(); $designPermission = $loginUser->getPermission('design_allow_manage.push'); if ($designPermission > 0) { $dir = Wind::getRealDir('DATA:design.template'); if (is_dir($dir)) { WindFolder::rm($dir, true); } $this->forward->getWindView()->compileDir = 'DATA:design.template'; } } // SEO settings Wind::import('SRV:seo.bo.PwSeoBo'); $sitename = Wekit::C('site', 'info.name'); PwSeoBo::set('{sitename}', $sitename); Wekit::setGlobal(NEXT_VERSION . ' ' . NEXT_RELEASE, 'version'); Wekit::setGlobal(PwSeoBo::getData(), 'seo'); $this->setOutput($this->getRequest()->getIsAjaxRequest() ? '1' : '0', '_ajax_'); /*[设置给PwGlobalFilters需要的变量]*/ $_var = array('current' => $this->forward->getWindView()->templateName, 'a' => $this->router->getAction(), 'c' => $this->router->getController(), 'm' => $this->router->getModule()); $this->getResponse()->setData($_var, '_aCloud_'); Wekit::load('APPS:appcenter.service.srv.PwDebugApplication')->compile(); }
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'); }
public function beforeAction($handlerAdapter) { parent::beforeAction($handlerAdapter); $spaceUid = (int) $this->getInput('uid', 'get'); if ($spaceUid < 1) { $userName = $this->getInput('username', 'get'); $user = Wekit::load('user.PwUser')->getUserByName($userName); $spaceUid = isset($user['uid']) ? $user['uid'] : 0; } if ($spaceUid < 1) { $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run/')); } $this->space = new PwSpaceBo($spaceUid); if (!$this->space->space['uid']) { $user = Wekit::load('user.PwUser')->getUserByUid($spaceUid); if ($user) { Wekit::load('space.dm.PwSpaceDm'); $dm = new PwSpaceDm($spaceUid); $dm->setVisitCount(0); Wekit::load('space.PwSpace')->addInfo($dm); $this->space = new PwSpaceBo($spaceUid); } else { $this->forwardRedirect(WindUrlHelper::createUrl('u/login/run/')); } } $this->space->setTome($spaceUid, $this->loginUser->uid); $this->space->setVisitUid($this->loginUser->uid); $this->setTheme('space', null); if ($this->space->allowView('space')) { $this->forwardRedirect(WindUrlHelper::createUrl('space/index/run', array('uid' => $spaceUid))); } }
public function run($ids) { $srv = Wekit::load('forum.srv.PwForumService'); foreach ($this->record as $fid => $value) { $srv->updateStatistics($fid, 0, -$value); } }
protected function run() { $forum = new PwForumBo($this->fid, true); if (!$forum->isForum(true)) { return new PwError('BBS:forum.unite.error.fid.exists.not'); } if ($forum->foruminfo['type'] == 'category') { return new PwError('BBS:forum.unite.error.fid.category'); } if ($forum->getSubForums()) { return new PwError('BBS:forum.unite.error.hassub'); } $toforum = new PwForumBo($this->tofid); if (!$toforum->isForum(true)) { return new PwError('BBS:forum.unite.error.tofid.exists.not'); } if ($toforum->foruminfo['type'] == 'category') { return new PwError('BBS:forum.unite.error.tofid.category'); } if ($this->fid == $this->tofid) { return new PwError('BBS:forum.unite.error.same'); } Wekit::load('forum.PwForum')->deleteForum($this->fid); Wind::import('SRV:forum.dm.PwForumDm'); $dm = new PwForumDm($this->tofid); $dm->addThreads($forum->foruminfo['threads'])->addPosts($forum->foruminfo['posts']); Wekit::load('forum.PwForum')->updateForum($dm, PwForum::FETCH_STATISTICS); Wekit::load('forum.srv.PwForumService')->updateForumStatistics($forum->foruminfo['parentid']); Wekit::load('forum.srv.PwForumService')->updateForumStatistics($this->tofid); return true; }
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); }
public function __get($name) { $data = Wekit::load('config.PwConfig')->getValues($name); $config = new PwConfigIniBo($data); $this->{$name} = $config; return $config; }
protected function _getActiveUser($fid, $day, $num) { $time = Pw::getTime() - $day * 86400; $array = array(); $thread = Wekit::load('forum.PwThreadExpand')->countUserThreadByFidAndTime($fid, $time, $num); $post = Wekit::load('forum.PwThreadExpand')->countUserPostByFidAndTime($fid, $time, $num); foreach ($thread as $key => $value) { if (!$key) { continue; } $array[$key] = $value['count']; } foreach ($post as $key => $value) { if (!$key) { continue; } if (isset($array[$key])) { $array[$key] += $value['count']; } else { $array[$key] = $value['count']; } } arsort($array); return array_slice($array, 0, $num, true); }
public function run() { // type表示哪一种第三方平台 $type = $this->getInput('type', 'get') ? $this->getInput('type', 'get') : 'qq'; // 管理界面显示的名称 $lab = $this->_displayText($type); // 在数据库中存储的字段名称 $status = $type . '.status'; $appId = $type . '.appid'; $appKey = $type . '.appkey'; $displayOrder = $type . '.displayOrder'; // $config = Wekit::C()->getValues('webThirdLogin'); $info = array('status' => $config[$status], 'appId' => $config[$appId], 'appKey' => $config[$appKey], 'displayOrder' => $config[$displayOrder]); // 回调地址 $config = Wekit::C()->getConfigByName('site', 'info.url'); if ($type == 'qq') { // QQ的回调地址填写比较诡异,提示和文档都是错的 $redirecturl = $config['value'] . '/index.php'; } else { $redirecturl = $config['value'] . '/index.php?m=u&c=login&a=thirdlogincallback&platform=' . $type; } // $this->setOutput($redirecturl, 'redirecturl'); $this->setOutput($type, 'type'); $this->setOutput($lab, 'lab'); $this->setOutput($info, 'info'); // $typeClasses[$type] = 'class="current"'; $this->setOutput($typeClasses, 'typeClasses'); }
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'); }
public function __construct() { $this->logfile = Wind::getRealPath(Wekit::app()->logFile, true); if (!WindFile::isFile($this->logfile)) { WindFile::write($this->logfile, "<?php die;?>\n"); } }
public function run() { $config = Wekit::C()->getValues('reg'); is_array($config['security.password']) || ($config['security.password'] = array()); //$config['security.ban.username'] = implode(',', $config['security.ban.username']); $this->setOutput($config, 'config'); }
public function unInstall($install) { /* @var $ds PwConfig */ $ds = Wekit::load('config.PwConfig'); $ds->deleteConfig('app_majia'); return true; }