本文整理匯總了PHP中WindidApi::C方法的典型用法代碼示例。如果您正苦於以下問題:PHP WindidApi::C方法的具體用法?PHP WindidApi::C怎麽用?PHP WindidApi::C使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WindidApi
的用法示例。
在下文中一共展示了WindidApi::C方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
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');
}
示例2: _getWindidMsg
protected function _getWindidMsg($result)
{
$errorCode = $result->getCode();
$var = array();
if ($errorCode == -2) {
$config = WindidApi::C('reg');
$var = array('{min}' => $config['security.username.min'], '{max}' => $config['security.username.max']);
}
if ($errorCode == -11) {
$config = WindidApi::C('reg');
$var = array('{min}' => $config['security.password.min'], '{max}' => $config['security.password.max']);
}
return new PwError('WINDID:code.' . $errorCode, $var);
}
示例3: buildNameShowMsg
/**
* 顯示用戶名的驗證支持信息
*
* @return array(string, args)
*/
public static function buildNameShowMsg()
{
$config = WindidApi::C('reg');
$_name = 'USER:user.error.username';
$_min = $config['security.username.min'];
$_max = $config['security.username.max'];
return array('USER:user.error.username', array('{min}' => $_min, '{max}' => $_max));
}
示例4: _writeFounder
/**
* 創建創始人
*
* @param string $manager
* @param string $manager_pwd
* @param string $manager_email
* @return PwError
*/
private function _writeFounder($manager, $manager_pwd, $manager_email)
{
Wekit::C()->reload('windid');
Wind::import('SRV:user.dm.PwUserInfoDm');
$data = array($manager => md5($manager_pwd));
WindFile::savePhpData($this->_getFounderFile(), $data);
//TODO 創始人添加:用戶的配置信息先更新。添加完之後再更新回 開始
$config = new PwConfigSet('register');
$config->set('security.username.max', 15)->set('security.ban.username', '')->set('security.username.min', 1)->set('security.password.max', 25)->set('security.password.min', 1)->flush();
Wind::import('WINDID:service.config.srv.WindidConfigSet');
$windidConfig = new WindidConfigSet('reg');
$windidConfig->set('security.ban.username', '')->set('security.password.max', 25)->set('security.password.min', 1)->set('security.username.max', 15)->set('security.username.min', 1)->flush();
Wekit::C()->reload('register');
WindidApi::C()->reload('reg');
//TODO結束
$userDm = new PwUserInfoDm();
$userDm->setUsername($manager)->setPassword($manager_pwd)->setEmail($manager_email)->setGroupid(3)->setRegdate(Pw::getTime())->setLastvisit(Pw::getTime())->setRegip(Wind::getApp()->getRequest()->getClientIp())->setGroups(array('3' => '0'));
//特殊操作 gao.wanggao
if (true !== ($result = $userDm->beforeAdd())) {
$this->showError($result->getError());
}
if (($uid = Wekit::load('WSRV:user.WindidUser')->addUser($userDm->dm)) < 1) {
$this->showError('WINDID:code.' . $uid);
}
$userDm->setUid($uid);
Wind::import('SRV:user.PwUser');
$daoMap = array();
$daoMap[PwUser::FETCH_MAIN] = 'user.dao.PwUserDao';
$daoMap[PwUser::FETCH_DATA] = 'user.dao.PwUserDataDao';
$daoMap[PwUser::FETCH_INFO] = 'user.dao.PwUserInfoDao';
Wekit::loadDaoFromMap(PwUser::FETCH_ALL, $daoMap, 'PwUser')->addUser($userDm->getSetData());
//特殊操作
//$uid = Wekit::load('user.PwUser')->addUser($userDm);
//TODO 創始人添加完成:恢複默認數據:開始
$config = new PwConfigSet('register');
$config->set('security.username.max', 15)->set('security.ban.username', '創始人,管理員,版主,斑竹,admin')->set('security.username.min', 3)->set('security.password.max', 15)->set('security.password.min', 6)->flush();
$windidConfig = new WindidConfigSet('reg');
$windidConfig->set('security.ban.username', '創始人,管理員,版主,斑竹,admin')->set('security.password.max', 15)->set('security.password.min', 6)->set('security.username.max', 15)->set('security.username.min', 3)->flush();
//TODO 結束
if ($uid instanceof PwError) {
$this->showError($uid->getError());
}
Wekit::load('user.PwUserBelong')->update($uid, array(3 => 0));
//特殊操作 gao.wanggao
$this->_defaultAvatar($uid);
$this->_defaultAvatar(0);
//特殊操作
//Wekit::load('user.srv.PwUserService')->restoreDefualtAvatar($uid);//用戶的默認頭像需要設置
//Wekit::load('user.srv.PwUserService')->restoreDefualtAvatar(0);//遊客的默認頭像需要設置
//站點統計信息
Wind::import('SRV:site.dm.PwBbsinfoDm');
$dm = new PwBbsinfoDm();
$dm->setNewmember($manager)->addTotalmember(1);
Wekit::load('site.PwBbsinfo')->updateInfo($dm);
return $uid;
}