Esempio n. 1
0
 public function dorunAction()
 {
     list($ifopen, $readifopen, $spaceifopen) = $this->getInput(array('ifopen', 'readifopen', 'spaceifopen'), 'post');
     $config = new PwConfigSet('site');
     $config->set('app.dongta.ifopen', intval($ifopen))->set('app.dongta.read.ifopen', intval($readifopen))->set('app.dongta.space.ifopen', intval($spaceifopen))->flush();
     $this->showMessage('operate.success');
 }
Esempio n. 2
0
 /**
  * 设置伪静态
  */
 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');
 }
Esempio n. 3
0
 public function updateConfig()
 {
     $config = new PwConfigSet('nav');
     $navBo = Wekit::load('SRV:nav.bo.PwNavBo');
     $navTypes = $this->getNavType();
     $ds = $this->_getNavDs();
     foreach ($navTypes as $type => $name) {
         $_list = array();
         $list = $ds->getNavByType($type);
         foreach ($list as $key => $value) {
             if (!$value['name']) {
                 continue;
             }
             $_list[$key]['name'] = $navBo->bindHtml($value);
             $_list[$key]['sign'] = $value['sign'];
             foreach ((array) $value['child'] as $ckey => $cvalue) {
                 if (!$cvalue['name']) {
                     continue;
                 }
                 $_list[$key]['child'][$ckey]['name'] = $navBo->bindHtml($cvalue);
                 $_list[$key]['child'][$ckey]['sign'] = $cvalue['sign'];
             }
         }
         $config->set($type, $_list)->flush();
     }
     return true;
 }
Esempio n. 4
0
 /**
  * 全局配置增加表单处理器
  *
  * @return void
  */
 public function dosetAction()
 {
     $config = new PwConfigSet('verify');
     $verify = $this->getInput('showverify', 'post');
     $config->set('showverify', $verify ? $verify : array())->flush();
     $this->showMessage('ADMIN:success');
 }
Esempio n. 5
0
 public function dorunAction()
 {
     $windid = $this->getInput('windid', 'post');
     /*$array = array(
     			'serverUrl', 'clientId','clientKey','clientDb','clientCharser'
     		);
     		$client = $this->getInput($array, 'post');
     		$client = array_combine($array, $client);
     		
     		if ($windid == 'client' && (!$client['serverUrl'] || !$client['clientId'])) $this->showError('ADMIN:fail');
     		
     		$array = array(
     			'dbhost', 'dbuser','dbpwd','dbname','dbprefix','engine'
     		);
     		$mysql = $this->getInput($array, 'post');
     		$mysql = array_combine($array, $mysql);
     		list($mysql['dbhost'], $mysql['dbport']) = explode(':', $mysql['dbhost']);
     		$mysql['dbport'] = !empty($mysql['dbport']) ? intval($mysql['dbport']) : 3306;
     		if (!empty($mysql['engine'])) {
     			$mysql['engine'] = strtoupper($mysql['engine']);
     			!in_array($mysql['engine'], array('MyISAM', 'InnoDB')) && $mysql['engine'] = 'MyISAM';
     		} else {
     			$mysql['engine'] = 'MyISAM';
     		}*/
     $config = new PwConfigSet('site');
     $config->set('windid', $windid)->flush();
     //$this->_getWindid()->setConfig('windid', 'windid', $windid);
     /*$charset = Wind::getApp()->getResponse()->getCharset();
     		$charset = str_replace('-', '', strtolower($charset));
     		if (!in_array($charset, array('gbk', 'utf8', 'big5'))) $charset = 'utf8';
     		$clientCharser = $client['clientCharser'] ? $client['clientCharser'] : $charset;
     		$configfile = Wind::getRealPath('CONF:windidConfig.php', true);
     		if ($windid != 'client') {
     			$baseUrl = Wind::getApp()->getRequest()->getBaseUrl(true);
     			$client['clientDb'] = 'mysql';
     			$client['serverUrl'] = $baseUrl;
     			$client['clientId'] = 0;
     			$client['clientKey'] = '';
     		}
     		$config = array(
     			'windid'  => $windid,
     			'serverUrl' => $client['serverUrl'],
     			'clientId'  => $client['clientId'],
     			'clientKey'  => $client['clientKey'],
     			'clientDb'  => $client['clientDb'],
     			'clientCharser'  => $clientCharser,
     		);
     		WindFile::savePhpData($configfile,$config);*/
     /*$datafile = Wind::getRealPath('WINDID:conf.database.php', true);
     		$database = array(
     			'dsn' => 'mysql:host=' . $mysql['dbhost'] . ';dbname=' . $mysql['dbname'] . ';port=' . $mysql['dbport'],
     			'user' => $mysql['dbuser'],
     			'pwd' => $mysqll['dbpw'],
     			'charset' => $charset,
     			'tableprefix' => $mysql['dbprefix'],
     			//'engine' => $mysql['engine'],
     		);
     		WindFile::savePhpData($datafile,$database);*/
     $this->showMessage('ADMIN:success');
 }
Esempio n. 6
0
 public function addAction()
 {
     list($status, $code) = $this->getInput(array('ad_status', 'ad_code'));
     $config = new PwConfigSet('native');
     $config->set('ad.status', $status)->set('ad.code', $code)->flush();
     $this->showMessage('ADMIN:success');
 }
Esempio n. 7
0
 /**
  * 后台设置-ftp设置
  */
 public function doftpAction()
 {
     $this->getRequest()->isPost() || $this->showError('operate.fail');
     $config = new PwConfigSet('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('ADMIN:success');
 }
Esempio n. 8
0
 public function addAction()
 {
     $status = $this->getInput('startup_status');
     //
     $config = new PwConfigSet('native');
     if (count($_FILES)) {
         Wind::import('SRV:upload.action.PwStartUpUpload');
         Wind::import('LIB:upload.PwUpload');
         $bhv = new PwStartUpUpload();
         $bhv->filename = 'startup';
         //
         $upload = new PwUpload($bhv);
         if ($upload->check() === true) {
             $result = $upload->execute();
         }
         if ($result !== true) {
             $this->showError($result->getError());
         }
         if (!($data = $bhv->getAttachInfo())) {
             $this->showError('upload.fail');
         }
         //
         $filepath = $upload->getStore()->getAbsolutePath($data['filename'], $data['path']);
         $filecontent = file_get_contents($filepath);
         //
         $config->set('startup.imgmd5', md5($filecontent));
         $config->set('startup.img', $data['path'] . $data['filename']);
     }
     $config->set('startup.status', $status)->flush();
     $this->showMessage('ADMIN:success');
 }
Esempio n. 9
0
 public function doRunAction()
 {
     list($type, $money, $isopen, $groups) = $this->getInput(array('moneytype', 'money', 'isopen', 'groups'), 'post');
     $bo = new PwConfigSet('site');
     $bo->set('app.signature.moneytype', $type)->set('app.signature.money', intval($money))->set('app.signature.isopen', $isopen)->set('app.signature.groups', $groups ? ',' . implode(',', $groups) . ',' : '')->flush();
     $this->showMessage('success');
 }
Esempio n. 10
0
 public function dorunAction()
 {
     list($ifopen, $reason, $alipay, $alipaypartnerID, $alipaykey, $alipayinterface, $tenpay, $tenpaykey, $paypal, $paypalkey, $_99bill, $_99billkey) = $this->getInput(array('ifopen', 'reason', 'alipay', 'alipaypartnerID', 'alipaykey', 'alipayinterface', 'tenpay', 'tenpaykey', 'paypal', 'paypalkey', '99bill', '99billkey'));
     $config = new PwConfigSet('pay');
     $config->set('ifopen', $ifopen)->set('reason', $reason)->set('alipay', $alipay)->set('alipaypartnerID', $alipaypartnerID)->set('alipaykey', $alipaykey)->set('alipayinterface', $alipayinterface)->set('tenpay', $tenpay)->set('tenpaykey', $tenpaykey)->set('paypal', $paypal)->set('paypalkey', $paypalkey)->set('99bill', $_99bill)->set('99billkey', $_99billkey)->flush();
     $this->showMessage('success');
 }
Esempio n. 11
0
 /**
  * 设置论坛设置
  */
 public function dorunAction()
 {
     list($bbsname, $title_length_max, $content_length_min, $content_length_max, $check) = $this->getInput(array('bbsname', 'title_length_max', 'content_length_min', 'content_length_max', 'check'));
     $config = new PwConfigSet('bbs');
     $config->set('bbsname', $bbsname)->set('title.length.max', abs(intval($title_length_max)))->set('content.length.min', abs(intval($content_length_min)))->set('content.length.max', abs(intval($content_length_max)))->set('post.check.open', intval($check));
     /*
     list($start_hour, $start_min, $end_hour, $end_min) = $this->getInput(array('start_hour', 'start_min', 'end_hour', 'end_min'), 'post');
     $start_hour = intval($start_hour);
     $start_min = intval($start_min);
     $end_hour = intval($end_hour);
     $end_min = intval($end_min);
     $config->set('post.timing.start_hour', max(0, min(24, $start_hour)))
     	->set('post.timing.start_min', max(0, min(60, $start_min)))
     	->set('post.timing.end_hour', max(0, min(24, $end_hour)))
     	->set('post.timing.end_min', max(0, min(60, $end_min)))
     	->set('post.timing.groups', $this->getInput('timing_groups', 'post'));
     */
     list($check_start_hour, $check_start_min, $check_end_hour, $check_end_min) = $this->getInput(array('check_start_hour', 'check_start_min', 'check_end_hour', 'check_end_min'), 'post');
     $check_start_hour = intval($check_start_hour);
     $check_start_min = intval($check_start_min);
     $check_end_hour = intval($check_end_hour);
     $check_end_min = intval($check_end_min);
     $config->set('post.check.start_hour', max(0, min(24, $check_start_hour)))->set('post.check.start_min', max(0, min(24, $check_start_min)))->set('post.check.end_hour', max(0, min(24, $check_end_hour)))->set('post.check.end_min', max(0, min(24, $check_end_min)))->set('post.check.groups', $this->getInput('check_groups', 'post'));
     $config->flush();
     $this->showMessage('config.setting.success');
 }
Esempio n. 12
0
 /**
  * 保存搜索设置
  *
  */
 public function doRunAction()
 {
     $conf = $this->getInput('conf', 'post');
     $config = new PwConfigSet('site');
     $config->set('search.isopen', $conf['isopen'])->flush();
     $this->showMessage('success');
 }
Esempio n. 13
0
 /**
  * 后台设置-编辑器设置
  */
 public function dorunAction()
 {
     list($style, $contentDuplicate, $cvtimes, $imgOpen, $imgWidth, $imgHeight, $sizeMax, $flashOpen, $mediaOpen, $iframeOpen) = $this->getInput(array('style', 'content_duplicate', 'cvtimes', 'img_open', 'img_width', 'img_height', 'size_max', 'flash_open', 'media_open', 'iframe_open'), 'post');
     $config = new PwConfigSet('bbs');
     $config->set('editor.style', $style ? 1 : 0)->set('content.duplicate', $contentDuplicate ? 1 : 0)->set('ubb.cvtimes', abs(intval($cvtimes)))->set('ubb.img.open', $imgOpen ? 1 : 0)->set('ubb.img.width', abs(intval($imgWidth)))->set('ubb.img.height', abs(intval($imgHeight)))->set('ubb.size.max', abs(intval($sizeMax)))->set('ubb.flash.open', $flashOpen ? 1 : 0)->set('ubb.media.open', $mediaOpen ? 1 : 0)->set('ubb.iframe.open', $iframeOpen ? 1 : 0)->flush();
     $this->showMessage('ADMIN:success');
 }
Esempio n. 14
0
 /**
  * 保存设置
  *
  */
 public function doRunAction()
 {
     $conf = $this->getInput('conf', 'post');
     $config = new PwConfigSet('app_mark');
     $config->set('mark.isopen', $conf['isopen'])->set('mark.mark_reasons', $conf['mark_reasons'])->flush();
     $this->showMessage('success');
 }
 /**
  * 设置回帖奖励可用积分类型
  */
 public function setReplyRewardCreditType($type)
 {
     if (!is_array($type)) {
         return false;
     }
     $config = new PwConfigSet('credit');
     $config->set($this->creditTypeKey, $type)->flush();
 }
Esempio n. 16
0
 /**
  * 注册主导航
  */
 public function install($install)
 {
     $emailTitle = '来自{sitename}的认证邮件';
     $emailContent = '尊敬的{username},这是来自{sitename}认证邮件。 <br/>请点击下面的链接进行认证:<br/> {url} <br/>如果不能点击链接,请复制到浏览器地址输入框访问。 <br/> <br/> {sitename} <br/> {time}';
     $config = new PwConfigSet('app_verify');
     $config->set('verify.email.title', $emailTitle)->set('verify.email.content', $emailContent)->flush();
     return true;
 }
Esempio n. 17
0
 public function dorunAction()
 {
     list($doubankey, $omdbkey) = $this->getInput(array('doubankey', 'omdbkey'), 'post');
     $config = new PwConfigSet('site');
     $config->set('app.dimdb.doubankey', $doubankey)->set('app.dimdb.omdbkey', $omdbkey);
     $config->flush();
     $this->showMessage('ADMIN:success');
 }
Esempio n. 18
0
 /**
  * 后台设置-email设置
  */
 public function dorunAction()
 {
     $password = $this->getInput('mailPassword', 'post');
     $config = $this->_getConfig();
     $t = Pw::strlen($config['mail.password']);
     $passwordO = Pw::substrs($config['mail.password'], 1, 0, false) . '********' . Pw::substrs($config['mail.password'], 1, $t - 1, false);
     $password = $password == $passwordO ? $config['mail.password'] : $password;
     $config = new PwConfigSet('email');
     $config->set('mailOpen', $this->getInput('mailOpen', 'post'))->set('mailMethod', 'smtp')->set('mail.host', $this->getInput('mailHost', 'post'))->set('mail.port', $this->getInput('mailPort', 'post'))->set('mail.from', $this->getInput('mailFrom', 'post'))->set('mail.auth', $this->getInput('mailAuth', 'post'))->set('mail.user', $this->getInput('mailUser', 'post'))->set('mail.password', $password)->flush();
     $this->showMessage('ADMIN:success');
 }
Esempio n. 19
0
 /**
  * 增加一个门户页面类型
  * Enter description here ...
  * @param string $m
  * @param string $c
  * @param string $a
  * @param string $name
  * @param string $unique  页面唯一标识,如果不需要单独设置,请留空
  */
 public function set($m, $c, $a, $name = '', $unique = '')
 {
     if (!$name || !$unique) {
         return false;
     }
     $router = Wekit::C('site', 'design.router');
     $router[$m . '/' . $c . '/' . $a] = array($name, $unique);
     $config = new PwConfigSet('site');
     $config->set('design.router', $router)->flush();
     return true;
 }
Esempio n. 20
0
 /**
  * 设置全局TPL配置
  *
  * @param array $style        	
  * @return boolean
  */
 private function _setConfigBo($style)
 {
     $configBo = new PwConfigSet('site');
     $config = Wekit::load('APPCENTER:service.srv.PwInstallApplication')->getConfig('style-type');
     foreach ($config as $k => $v) {
         $configBo->set("theme.{$k}.pack", $v[1]);
     }
     $configBo->set("theme.{$style['style_type']}.default", $style['alias']);
     $configBo->flush();
     return true;
 }
Esempio n. 21
0
 /**
  *
  * @access public
  * @return
  * @example
  *
  */
 public function dosetAction()
 {
     /*
     $vd = function() {
         foreach(func_get_args() as $arg) {
             error_log(var_export($arg, true));
         }
     };
     */
     $config = new PwConfigSet('notifier');
     /*
      * 如果form的class是J_ajaxForm,可以只按照count($_FILES)来判断;
      * 如果不是,需要判断具体的tmp_name是否为空来判断是否选择了文件。
      *
      */
     if (count($_FILES) && !empty($_FILES['avatar']['tmp_name'])) {
         Wind::import('SRV:upload.action.PwStartUpUpload');
         Wind::import('LIB:upload.PwUpload');
         $bhv = new PwStartUpUpload();
         $bhv->filename = 'avatar';
         $upload = new PwUpload($bhv);
         if ($upload->check() === true) {
             $result = $upload->execute();
         }
         if ($result !== true) {
             $this->showError($result->getError());
         }
         if (!($data = $bhv->getAttachInfo())) {
             $this->showError('upload.fail');
         }
         // 添加进设置项
         $config->set('avatar', $data['path'] . $data['filename']);
     }
     $nickname = $this->getInput('nickname');
     if (empty($nickname)) {
         $nickname = PwLaiWangSerivce::$defaultNotifier['nickname'];
     }
     $usertype = intval($this->getInput('usertype'));
     if ($usertype != PwLaiWangSerivce::USERTYPE_NAME && $usertype != PwLaiWangSerivce::USERTYPE_ID) {
         $usertype = PwLaiWangSerivce::USERTYPE_NAME;
     }
     $user = $this->getInput('user');
     if ($usertype == PwLaiWangSerivce::USERTYPE_NAME) {
         $userinfo = Wekit::load('user.PwUser')->getUserByName($user, PwUser::FETCH_MAIN);
     } else {
         $userinfo = Wekit::load('user.PwUser')->getUserByUid($user, PwUser::FETCH_MAIN);
     }
     if (empty($userinfo)) {
         $this->showError('NATIVE:user.notfound');
     }
     $config->set('nickname', $nickname)->set('usertype', $usertype)->set('username', $userinfo['username'])->set('userid', $userinfo['uid'])->flush();
     $this->showMessage('ADMIN:success', 'native/notifier/run/', true);
 }
Esempio n. 22
0
 /**
  * 后台设置-水印策略设置
  */
 public function dosetAction()
 {
     $ext = $this->getInput('ext', 'post');
     $extConfig = array();
     foreach ($ext as $key => $value) {
         if ($value == 1) {
             $extConfig[] = $key;
         }
     }
     $config = new PwConfigSet('attachment');
     $config->set('mark.markset', $extConfig)->flush();
     $this->showMessage('ADMIN:success');
 }
 /**
  * 保存设置 
  * 
  * @access public
  * @return void
  */
 public function dosetAction()
 {
     $type = $this->getInput('type');
     //
     $status = $type . '_status';
     $appId = $type . '_appId';
     $appKey = $type . '_appKey';
     $displayOrder = $type . '_displayOrder';
     list(${$status}, ${$appId}, ${$appKey}, ${$displayOrder}) = $this->getInput(array($status, $appId, $appKey, $displayOrder));
     $config = new PwConfigSet('webThirdLogin');
     $config->set($type . '.status', (int) ${$status})->set($type . '.appid', ${$appId})->set($type . '.appkey', ${$appKey})->set($type . '.displayOrder', (int) ${$displayOrder})->flush();
     $this->showMessage('ADMIN:success');
 }
Esempio n. 24
0
 /**
  * 全局配置增加表单处理器
  *
  * @return void
  */
 public function dositeAction()
 {
     $configSet = new PwConfigSet('site');
     $configSet->set('time.cv', (int) $this->getInput('timeCv', 'post'))->set('time.timezone', $this->getInput('timeTimezone', 'post'))->set('refreshtime', (int) $this->getInput('refreshtime', 'post'))->set('onlinetime', (int) $this->getInput('onlinetime', 'post'))->set('debug', $this->getInput('debug', 'post'))->set('managereasons', $this->getInput('managereasons', 'post'))->set('cookie.path', $this->getInput('cookiePath'), 'post')->set('cookie.domain', $this->getInput('cookieDomain', 'post'))->set('cookie.pre', $this->getInput('cookiePre', 'pre'))->flush();
     Wekit::load('domain.srv.PwDomainService')->refreshTplCache();
     $service = $this->_loadConfigService();
     $config = $service->getValues('site');
     if ($config['windid'] != 'client') {
         $windid = $this->_getWindid();
         $windid->setConfig('site', 'timezone', $this->getInput('timeTimezone', 'post'));
         $windid->setConfig('site', 'timecv', (int) $this->getInput('timeCv', 'post'));
     }
     $this->showMessage('ADMIN:success');
 }
Esempio n. 25
0
 /**
  * 后台设置-手机设置
  */
 public function dosetAction()
 {
     $config = new PwConfigSet('register');
     $config->set('active.phone', $this->getInput('activePhone', 'post'))->set('mobile.message.content', $this->getInput('mobileMessageContent', 'post'))->flush();
     $loginConfig = Wekit::C()->getValues('login');
     $ways = $this->getInput('ways', 'post');
     $loginConfigWays = array_flip($loginConfig['ways']);
     unset($loginConfigWays[4]);
     $loginConfigWays = array_flip($loginConfigWays);
     $ways && ($loginConfigWays[] = 4);
     $config = new PwConfigSet('login');
     $config->set('ways', $loginConfigWays);
     $config->set('mobieFindPasswd', $this->getInput('mobieFindPasswd', 'post'))->flush();
     $this->showMessage('ADMIN:success');
 }
Esempio n. 26
0
 public function setStoragesAction()
 {
     $storage = $this->getInput('storage', 'post');
     $attService = Wekit::load('LIB:storage.PwStorage');
     $_r = $attService->setStoragesComponents($storage);
     if ($_r !== true) {
         $this->output(0);
     }
     $config = new PwConfigSet('attachment');
     $config->set('storage.type', $storage)->flush();
     $components = Wekit::C()->get('components')->toArray();
     Wind::getApp()->getFactory()->loadClassDefinitions($components);
     Wekit::C()->setConfig('site', 'avatarUrl', substr(Pw::getPath('1.gpg'), 0, -6));
     $this->_getNotifyService()->send('alterAvatarUrl', array(), $this->appid);
     $this->output(1);
 }
Esempio n. 27
0
 public function docreditAction()
 {
     list($creditifopen, $credits) = $this->getInput(array('creditifopen', 'credits'), 'post');
     $_credits = array();
     if (is_array($credits)) {
         foreach ($credits as $key => $credit) {
             if (!$credit['enabled'] || empty($credit['exp'])) {
                 continue;
             }
             $_credits[$key] = $credit;
         }
     }
     $config = new PwConfigSet('site');
     $config->set('app.torrent.creditifopen', intval($creditifopen))->set('app.torrent.credits', $_credits)->flush();
     $this->showMessage('ADMIN:success');
 }
Esempio n. 28
0
 /**
  * 设置storage存储方案到系统
  * 
  * @param string $storageType
  * @return true|pwError
  */
 public function setStoragesComponents($storageType)
 {
     $storages = $this->getStorages();
     if (!array_key_exists($storageType, $storages)) {
         return new PwError('ADMIN:att.storage.type.not.exit');
     }
     $storage = $storages[$storageType];
     if (!isset($storage['components']['path'])) {
         return new PwError('ADMIN:att.storage.config.fail');
     }
     /* @var $componentService PwComponentsService */
     $componentService = Wekit::load('hook.srv.PwComponentsService');
     $componentService->setComponent('storage', $storage['components'], $storage['description']);
     $config = new PwConfigSet('attachment');
     $config->set('storage.type', $storageType)->flush();
     return true;
 }
Esempio n. 29
0
 /**
  * 设置storage存储方案到系统
  * 
  * @param string $storageType
  * @return true|pwError
  */
 public function setPlatComponents($platType)
 {
     $plats = $this->getPlats();
     if (!array_key_exists($platType, $plats)) {
         return new PwError('USER:mobile.plat.type.not.exit');
     }
     $plat = $plats[$platType];
     if (!isset($plat['components']['path'])) {
         return new PwError('USER:mobile.plat.config.fail');
     }
     /* @var $componentService PwComponentsService */
     $componentService = Wekit::load('hook.srv.PwComponentsService');
     $componentService->setComponent('mobileplat', $plat['components'], $plat['description']);
     $config = new PwConfigSet('mobile');
     $config->set('plat.type', $platType)->flush();
     return true;
 }
Esempio n. 30
0
 /**
  * 附件存储方式设置列表页
  */
 public function dostroageAction()
 {
     $att_storage = $this->getInput('att_storage', 'post');
     $avatarurl = $this->getInput('avatarurl', 'post');
     $attService = Wekit::load('LIB:storage.PwStorage');
     $_r = $attService->setStoragesComponents($att_storage);
     if ($_r !== true) {
         $this->showError($_r->getError());
     }
     $config = new PwConfigSet('attachment');
     $config->set('storage.type', $att_storage)->flush();
     $components = Wekit::C()->get('components')->toArray();
     Wind::getApp()->getFactory()->loadClassDefinitions($components);
     Wekit::C()->setConfig('site', 'avatarUrl', substr(Pw::getPath('1.gpg'), 0, -6));
     Wekit::load('WSRV:notify.srv.WindidNotifyService')->send('alterAvatarUrl', array());
     $this->showMessage('WINDID:success');
 }