本文整理汇总了PHP中BizSystem::ClientProxy方法的典型用法代码示例。如果您正苦于以下问题:PHP BizSystem::ClientProxy方法的具体用法?PHP BizSystem::ClientProxy怎么用?PHP BizSystem::ClientProxy使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BizSystem
的用法示例。
在下文中一共展示了BizSystem::ClientProxy方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _doCreateUser
protected function _doCreateUser()
{
$recArr = $this->readInputRecord();
$this->setActiveRecord($recArr);
if (count($recArr) == 0) {
return;
}
if ($this->_checkDupUsername()) {
$errorMessage = $this->GetMessage("USERNAME_USED");
$errors['fld_username'] = $errorMessage;
$this->processFormObjError($errors);
return;
}
if ($this->_checkDupEmail()) {
$errorMessage = $this->GetMessage("EMAIL_USED");
$errors['fld_email'] = $errorMessage;
$this->processFormObjError($errors);
return;
}
try {
$this->ValidateForm();
} catch (ValidationException $e) {
$this->processFormObjError($e->m_Errors);
return;
}
$recArr['create_by'] = "0";
$recArr['update_by'] = "0";
$password = BizSystem::ClientProxy()->GetFormInputs("fld_password");
$recArr['password'] = hash(HASH_ALG, $password);
$this->_doInsert($recArr);
//set default user role to member
$userinfo = $this->getActiveRecord();
$userRoleObj = BizSystem::getObject('system.do.UserRoleDO');
foreach (BizSystem::getObject('system.do.RoleDO')->directfetch("[default]='1'") as $roleRec) {
$roleId = $roleRec['Id'];
$uesrRoleArr = array("user_id" => $userinfo['Id'], "role_id" => $roleId);
$userRoleObj->insertRecord($uesrRoleArr);
}
//set default group to member
$userGroupObj = BizSystem::getObject('system.do.UserGroupDO');
foreach (BizSystem::getObject('system.do.GroupDO')->directfetch("[default]='1'") as $groupRec) {
$groupId = $groupRec['Id'];
$uesrGroupArr = array("user_id" => $userinfo['Id'], "group_id" => $groupId);
$userGroupObj->insertRecord($uesrGroupArr);
}
//record event log
global $g_BizSystem;
$eventlog = BizSystem::getService(EVENTLOG_SERVICE);
$logComment = array($userinfo['username'], $_SERVER['REMOTE_ADDR']);
$eventlog->log("USER_MANAGEMENT", "MSG_USER_REGISTERED", $logComment);
//send user email
$emailObj = BizSystem::getService(USER_EMAIL_SERVICE);
$emailObj->UserWelcomeEmail($userinfo['Id']);
//init profile for future use like redirect to my account view
$profile = $g_BizSystem->InituserProfile($userinfo['username']);
return $userinfo;
}
示例2: UpdateAccount
/**
* Update account with user inputs
*
* @return void
*/
public function UpdateAccount()
{
$currentRec = $this->fetchData();
$recArr = $this->readInputRecord();
$this->setActiveRecord($recArr);
try {
$this->ValidateForm();
} catch (ValidationException $e) {
$this->processFormObjError($e->m_Errors);
return;
}
if (count($recArr) == 0) {
return;
}
$password = BizSystem::ClientProxy()->GetFormInputs("fld_password");
if ($password) {
$recArr['password'] = hash(HASH_ALG, $password);
}
if ($this->_doUpdate($recArr, $currentRec) == false) {
return;
}
$this->processPostAction();
/***
$this->_doUpdate($recArr, $currentRec);
// if 'notify email' option is checked, send confirmation email to user email address
// ...
$this->m_Notices[] = $this->GetMessage("USER_DATA_UPDATED");
//run eventlog
$eventlog = BizSystem::getService(EVENTLOG_SERIVCE);
$eventlog->log("USER_MANAGEMENT", "MSG_USER_RESET_PASSWORD");
$this->rerender();
***/
}
示例3: GenerateToken
/**
* Generate an unique token for future validation
*
* @param array $userProfile user profile array
* @return mixed $token array or false
*/
protected function GenerateToken($userProfile)
{
$token = uniqid();
$recArr = array("user_id" => $userProfile['Id'], "token" => $token, "expiration" => date("Y-m-d H:i:s", time() + 86400 * 2));
$tokenObj = BizSystem::getObject('system.do.UserPassTokenDO');
try {
if ($tokenObj->insertRecord($recArr)) {
$recArr = $tokenObj->getActiveRecord();
return $recArr;
} else {
return false;
}
} catch (BDOException $e) {
$errorMsg = $e->getMessage();
BizSystem::log(LOG_ERR, "DATAOBJ", "DataObj error = " . $errorMsg);
BizSystem::ClientProxy()->showErrorMessage($errorMsg);
return false;
}
}
示例4: UpdateloginTime
/**
* Update login time
*
* @return void
*/
protected function UpdateloginTime()
{
$userObj = BizSystem::getObject('system.do.UserDO');
try {
$curRecs = $userObj->directFetch("[username]='" . $this->username . "'", 1);
$dataRec = new DataRecord($curRecs[0], $userObj);
$dataRec['lastlogin'] = date("Y-m-d H:i:s");
$ok = $dataRec->save();
if (!$ok) {
$errorMsg = $userObj->getErrorMessage();
BizSystem::log(LOG_ERR, "DATAOBJ", "DataObj error = " . $errorMsg);
BizSystem::ClientProxy()->showErrorMessage($errorMsg);
return false;
}
} catch (BDOException $e) {
$errorMsg = $e->getMessage();
BizSystem::log(LOG_ERR, "DATAOBJ", "DataObj error = " . $errorMsg);
BizSystem::ClientProxy()->showErrorMessage($errorMsg);
return false;
}
return true;
}
示例5: validateForm
public function validateForm()
{
//validate password
$password = BizSystem::ClientProxy()->GetFormInputs("fld_password");
$validateSvc = BizSystem::getService(VALIDATE_SERVICE);
if (!$validateSvc->betweenLength($password, 6, 50)) {
$errorMessage = $this->GetMessage("PASSWORD_LENGTH");
$this->m_ValidateErrors['fld_password'] = $errorMessage;
throw new ValidationException($this->m_ValidateErrors);
return false;
}
// disable password validation if they are empty
$password = BizSystem::ClientProxy()->GetFormInputs("fld_password");
$password_repeat = BizSystem::ClientProxy()->GetFormInputs("fld_password_repeat");
if (!$password_repeat) {
$this->getElement("fld_password")->m_Validator = null;
}
if (!$password) {
$this->getElement("fld_password_repeat")->m_Validator = null;
}
if ($password != "" && $password != $password_repeat) {
$passRepeatElem = $this->getElement("fld_password_repeat");
$errorMessage = $this->GetMessage("PASSOWRD_REPEAT_NOTSAME", array($passRepeatElem->m_Label));
$this->m_ValidateErrors['fld_password_repeat'] = $errorMessage;
throw new ValidationException($this->m_ValidateErrors);
return false;
}
return true;
}
示例6: _checkDupEmail
/**
* check duplication of email address
*
* @return boolean
*/
protected function _checkDupEmail()
{
$email = BizSystem::ClientProxy()->GetFormInputs("fld_email");
$userDO = $this->getDataObj();
$records = $userDO->directFetch("[email]='{$email}'", 1);
if (count($records) == 1) {
return true;
}
return false;
}