当前位置: 首页>>代码示例>>PHP>>正文


PHP UserForm::UserForm方法代码示例

本文整理汇总了PHP中UserForm::UserForm方法的典型用法代码示例。如果您正苦于以下问题:PHP UserForm::UserForm方法的具体用法?PHP UserForm::UserForm怎么用?PHP UserForm::UserForm使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UserForm的用法示例。


在下文中一共展示了UserForm::UserForm方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: UserDetailsForm

 /**
  * Constructor.
  * @param $request PKPRequest
  * @param $userId int optional
  * @param $author Author optional
  */
 function UserDetailsForm($request, $userId = null, $author = null)
 {
     parent::UserForm('controllers/grid/settings/user/form/userDetailsForm.tpl', $userId);
     if (isset($author)) {
         $this->author =& $author;
     } else {
         $this->author = null;
     }
     $site = $request->getSite();
     // Validation checks for this form
     if ($userId == null) {
         $this->addCheck(new FormValidator($this, 'username', 'required', 'user.profile.form.usernameRequired'));
         $this->addCheck(new FormValidatorCustom($this, 'username', 'required', 'user.register.form.usernameExists', array(DAORegistry::getDAO('UserDAO'), 'userExistsByUsername'), array($this->userId, true), true));
         $this->addCheck(new FormValidatorAlphaNum($this, 'username', 'required', 'user.register.form.usernameAlphaNumeric'));
         if (!Config::getVar('security', 'implicit_auth')) {
             $this->addCheck(new FormValidator($this, 'password', 'required', 'user.profile.form.passwordRequired'));
             $this->addCheck(new FormValidatorLength($this, 'password', 'required', 'user.register.form.passwordLengthRestriction', '>=', $site->getMinPasswordLength()));
             $this->addCheck(new FormValidatorCustom($this, 'password', 'required', 'user.register.form.passwordsDoNotMatch', create_function('$password,$form', 'return $password == $form->getData(\'password2\');'), array($this)));
         }
     } else {
         $this->addCheck(new FormValidatorLength($this, 'password', 'optional', 'user.register.form.passwordLengthRestriction', '>=', $site->getMinPasswordLength()));
         $this->addCheck(new FormValidatorCustom($this, 'password', 'optional', 'user.register.form.passwordsDoNotMatch', create_function('$password,$form', 'return $password == $form->getData(\'password2\');'), array($this)));
     }
     $this->addCheck(new FormValidator($this, 'firstName', 'required', 'user.profile.form.firstNameRequired'));
     $this->addCheck(new FormValidator($this, 'lastName', 'required', 'user.profile.form.lastNameRequired'));
     $this->addCheck(new FormValidatorUrl($this, 'userUrl', 'optional', 'user.profile.form.urlInvalid'));
     $this->addCheck(new FormValidatorEmail($this, 'email', 'required', 'user.profile.form.emailRequired'));
     $this->addCheck(new FormValidatorCustom($this, 'email', 'required', 'user.register.form.emailExists', array(DAORegistry::getDAO('UserDAO'), 'userExistsByEmail'), array($this->userId, true), true));
     $this->addCheck(new FormValidatorORCID($this, 'orcid', 'optional', 'user.orcid.orcidInvalid'));
     $this->addCheck(new FormValidatorPost($this));
 }
开发者ID:selwyntcy,项目名称:pkp-lib,代码行数:37,代码来源:UserDetailsForm.inc.php

示例2: UserRoleForm

 /**
  * Constructor.
  * @param int $userId
  * @param string $userFullName
  */
 function UserRoleForm($userId, $userFullName)
 {
     parent::UserForm('controllers/grid/settings/user/form/userRoleForm.tpl', $userId);
     $this->_userFullName = $userFullName;
     $this->addCheck(new FormValidatorPost($this));
     $this->addCheck(new FormValidatorCSRF($this));
 }
开发者ID:jprk,项目名称:pkp-lib,代码行数:12,代码来源:UserRoleForm.inc.php


注:本文中的UserForm::UserForm方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。