コード例 #1
0
ファイル: notify.php プロジェクト: sanzhumu/nextwind
 public function editUser($uid)
 {
     $api = WindidApi::api('user');
     $user = $api->getUser($uid);
     //你系统的   editUser($user);
     return true;
 }
コード例 #2
0
ファイル: PwCreditDm.php プロジェクト: chendong0444/phpwind
 public function getDm()
 {
     if (!is_object($this->dm)) {
         $dm = WindidApi::getDm('credit');
         $this->dm = new $dm($this->uid);
     }
     return $this->dm;
 }
コード例 #3
0
ファイル: WindidConfigApi.php プロジェクト: fanqimeng/4tweb
 /**
  * 删除配置项
  * Enter description here ...
  * @param string $spacename
  * @param array|string $keys
  */
 public function deleteConfig($spacename, $keys = '')
 {
     if (!is_array($keys)) {
         $keys = array($keys);
     }
     $params = array('spacename' => $spacename, 'keys' => implode('_', $keys));
     return WindidApi::open('config/delete', array(), $params);
 }
コード例 #4
0
ファイル: PwWindidStd.php プロジェクト: fanqimeng/4tweb
 public function __call($method, $args)
 {
     if ($this->method == $method) {
         return $this->value;
     }
     $cls = WindidApi::api($this->api);
     return call_user_func_array(array($cls, $method), $args);
 }
コード例 #5
0
ファイル: WindidAreaApi.php プロジェクト: fanqimeng/4tweb
 public function getAll()
 {
     $params = array();
     return WindidApi::open('area/getAll', $params);
     if (!is_array($result)) {
         return array();
     }
     return $result;
 }
コード例 #6
0
 /**
  * 学校获取(typeid = 1:小学,2:中学,3:大学)
  */
 public function schoolAction()
 {
     list($type, $areaid, $name, $first) = $this->getInput(array('typeid', 'areaid', 'name', 'first'));
     !$type && ($type = 3);
     Wind::import('WINDID:service.school.vo.WindidSchoolSo');
     $schoolSo = new WindidSchoolSo();
     $schoolSo->setName($name)->setTypeid($type)->setFirstChar($first)->setAreaid($areaid);
     $list = WindidApi::api('school')->searchSchoolData($schoolSo, 1000);
     exit($list ? Pw::jsonEncode($list) : '');
 }
コード例 #7
0
ファイル: WindidAvatarApi.php プロジェクト: fanqimeng/4tweb
 /**
  * 还原头像
  *
  * @param int $uid
  * @param string $type 还原类型-一种默认头像face*,一种是禁止头像ban*
  * @return boolean
  */
 public function defaultAvatar($uid, $type = 'face')
 {
     $client = Windid::client();
     if ($client->windid == 'local') {
         $srv = Windid::load('user.srv.WindidUserService');
         $result = $srv->defaultAvatar($uid, $type);
         return (int) $result;
     }
     $params = array('uid' => $uid, 'type' => $type);
     return WindidApi::open('avatar/default', array(), $params);
 }
コード例 #8
0
ファイル: windidclientBoot.php プロジェクト: ccq18/EduSoho
 protected function getConfigCacheValue()
 {
     $vkeys = array('site', 'components', 'verify', 'attachment', 'reg');
     $array = WindidApi::api('config')->fetchConfig($vkeys);
     $config = array();
     foreach ($vkeys as $key => $value) {
         $config[$value] = array();
     }
     foreach ($array as $key => $value) {
         $config[$value['namespace']][$value['name']] = $value['vtype'] != 'string' ? unserialize($value['value']) : $value['value'];
     }
     return $config;
 }
コード例 #9
0
 private function deleteThread($topic)
 {
     $tid = $topic['tid'];
     $fid = $topic['fid'];
     $subject = $topic['subject'];
     $created_userid = $topic['created_userid'];
     $dm = new PwTopicRecycleDm();
     $dm->setTid($tid)->setFid($fid)->setOperateTime(time())->setOperateUsername('system')->setReason('长期断种');
     Wekit::load('recycle.PwTopicRecycle')->add($dm);
     $dm = new PwTopicDm($tid);
     $dm->setDisabled(2)->setTopped(0)->setDigest(0);
     Wekit::load('forum.PwThread')->updateThread($dm);
     $api = WindidApi::api('message');
     $api->send($created_userid, '您的种子 ' . $subject . ' 因长期断种已被系统自动移入回收站,如有异议请尽快联系管理员,管理员将根据相关规定决定恢复或彻底删除。', 1);
 }
コード例 #10
0
ファイル: WindidSchoolApi.php プロジェクト: fanqimeng/4tweb
 public function searchSchool($search, $limit = 10, $start = 0)
 {
     if (!is_array($search)) {
         return array();
     }
     $params = array('limit' => $limit, 'start' => $start);
     $array = array('name', 'typeid', 'areaid', 'firstchar');
     foreach ($search as $k => $v) {
         if (!in_array($k, $array)) {
             continue;
         }
         $params[$k] = $v;
     }
     return WindidApi::open('school/search', $params);
 }
コード例 #11
0
 /**
  * 附件存储方式设置列表页
  */
 public function dostroageAction()
 {
     $att_storage = $this->getInput('att_storage', 'post');
     $avatar_storage = $this->getInput('avatar_storage', 'post');
     /* @var $attService PwAttacmentService */
     $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();
     $result = WindidApi::api('avatar')->setStorages($avatar_storage);
     if ($result == '1') {
         Wekit::C()->setConfig('site', 'avatarUrl', WindidApi::api('avatar')->getAvatarUrl());
     }
     $this->showMessage('ADMIN:success');
 }
コード例 #12
0
ファイル: Windid.php プロジェクト: fanqimeng/4tweb
 /**
  * 客户端获取服务端配置,服务端禁用
  * Enter description here ...
  * @param unknown_type $name
  */
 public static function C($name)
 {
     $windidApi = WindidApi::api('config');
     return $windidApi->getConfig($name);
 }
コード例 #13
0
ファイル: Pw.php プロジェクト: healthguo/PHP
	public static function windid($api) {
		if (defined('WINDID_IS_NOTIFY')) {
			$cls[$api] = PwWindidStd::getInstance($api);
		} else {
			$cls[$api] = WindidApi::api($api);
		}
		return $cls[$api];
	}
コード例 #14
0
ファイル: AvatarController.php プロジェクト: fanqimeng/4tweb
 private function _getWindid()
 {
     return WindidApi::api('avatar');
 }
コード例 #15
0
ファイル: WindidMessageApi.php プロジェクト: fanqimeng/4tweb
 public function deleteMessages($uid, $messageIds)
 {
     $params = array('uid' => $uid, 'messageIds' => $messageIds);
     return WindidApi::open('message/deleteMessages', array(), $params);
 }
コード例 #16
0
 /**
  * windid更新
  * 
  * @return boolean
  */
 private function _writeWindid()
 {
     $baseUrl = Wekit::url()->base;
     $key = md5(WindUtility::generateRandStr(10));
     $charset = Wekit::V('charset');
     $charset = str_replace('-', '', strtolower($charset));
     if (!in_array($charset, array('gbk', 'utf8', 'big5'))) {
         $charset = 'utf8';
     }
     $config = new PwConfigSet('windid');
     $config->set('windid', 'local')->set('serverUrl', $baseUrl . '/windid')->set('clientId', 1)->set('clientKey', $key)->set('connect', 'db')->flush();
     Wekit::C()->reload('windid');
     Wind::import('WINDID:service.app.dm.WindidAppDm');
     $dm = new WindidAppDm();
     $dm->setApiFile('windid.php')->setIsNotify('1')->setIsSyn('1')->setAppName('phpwind9.0')->setSecretkey($key)->setAppUrl($baseUrl)->setCharset($charset)->setAppIp('');
     $service = WindidApi::api('app');
     $result = $service->addApp($dm);
     if ($result instanceof WindidError) {
         $this->showError('INSTALL:windid.init.fail');
     }
     return true;
 }
コード例 #17
0
ファイル: PwUserBlack.php プロジェクト: chendong0444/phpwind
 /**
  * @return WindidUserBlack
  */
 protected function _getWindidUserBlack()
 {
     return WindidApi::api('user');
 }
コード例 #18
0
 protected function _getWindid()
 {
     return WindidApi::api('config');
 }
コード例 #19
0
 /**
  * 添加用户对象接口,使用前必须使用WidnidApi::getDm('user') 设置数据
  *
  * @param WindidUserDm $dm
  */
 public function addDmUser($dm)
 {
     $result = $this->_getUserDs()->addUser($dm);
     if ($result instanceof WindidError) {
         return $result->getCode();
     }
     $uid = (int) $result;
     WindidApi::api('avatar')->defaultAvatar($uid);
     $this->_getNotifyService()->send('addUser', array('uid' => $uid), WINDID_CLIENT_ID);
     return $uid;
 }
コード例 #20
0
ファイル: WindidController.php プロジェクト: healthguo/PHP
	private function _getWindid() {
		return WindidApi::api('config');
	}
コード例 #21
0
 public function logSend($logid)
 {
     $params = array('logid' => $logid);
     return WindidApi::open('notify/logSend', array(), $params);
 }
コード例 #22
0
ファイル: PwUserInfoDm.php プロジェクト: fanqimeng/4tweb
 protected function _beforeAdd()
 {
     if (!$this->dm) {
         return new PwError('USER:user.info.error');
     }
     if (($result = PwUserValidator::isUsernameHasIllegalChar($this->getField('username'))) !== false) {
         return $result;
     }
     if (($result = PwUserValidator::isPwdValid($this->_password, $this->getField('username'))) !== true) {
         return $result;
     }
     if (($result = $this->dm->beforeAdd()) !== true) {
         $errorCode = $result->getCode();
         $var = array();
         if ($errorCode == -2) {
             $windid = WindidApi::api('config');
             $config = $windid->getConfig('reg');
             $var = array('{min}' => $config['namelength.min'], '{max}' => $config['namelength.max']);
         }
         if ($errorCode == -11) {
             $windid = WindidApi::api('config');
             $config = $windid->getConfig('reg');
             $var = array('{min}' => $config['passwordlength.min'], '{max}' => $config['passwordlength.max']);
         }
         return new PwError('WINDID:code.' . $errorCode, $var);
     }
     if (true !== ($result = $this->check())) {
         return $result;
     }
     return true;
 }
コード例 #23
0
 private function createWindidApi($name)
 {
     if (!defined('WEKIT_TIMESTAMP')) {
         define('WEKIT_TIMESTAMP', time());
     }
     require_once __DIR__ . '/../../../../vendor_user/windid_client/src/windid/WindidApi.php';
     return \WindidApi::api($name);
 }
コード例 #24
0
ファイル: PwSchoolService.php プロジェクト: fanqimeng/4tweb
 /**
  * 获得学校Ds
  *
  * @return WindidSchool
  */
 private function _getSchoolDs()
 {
     return WindidApi::api('school');
 }
コード例 #25
0
 private function _getWindidUser()
 {
     return WindidApi::api('user');
 }
コード例 #26
0
 /**
  * 构建推送的地区库---获取地区库的省/市/区
  *  
  * @param int $areaid
  * @return array
  */
 private function _buildArea($areaid)
 {
     $areaSrv = WindidApi::api('area');
     $_rout = $areaSrv->getAreaRout($areaid);
     $_return = array('id' => '', 'rout' => array(array('', ''), array('', ''), array('', '')));
     if (!$_rout) {
         return $_return;
     }
     foreach ($_rout as $_k => $_r) {
         $_return['rout'][$_k] = array($_r['areaid'], $_r['name']);
     }
     $_return['id'] = $areaid;
     return $_return;
 }
コード例 #27
0
ファイル: PwWindidInform.php プロジェクト: YoursBoss/nextwind
 public function alterAvatarUrl()
 {
     Wekit::C()->setConfig('site', 'avatarUrl', WindidApi::api('avatar')->getAvatarUrl());
     return true;
 }
コード例 #28
0
 public function deleteSchool($schoolid)
 {
     $params = array('id' => $schoolid);
     return WindidApi::open('school/delete', array(), $params);
 }
コード例 #29
0
 /**
  * 
  * @return PwMessageMessages
  */
 private function _getWindid()
 {
     return WindidApi::api('message');
 }
コード例 #30
0
ファイル: WindidConfigApi.php プロジェクト: mm999/EduSoho
 public function setCredits($credits)
 {
     $params = array('credits' => $credits);
     return WindidApi::open('config/setCredits', array(), $params);
 }