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


PHP AbstractForm::validate方法代码示例

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


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

示例1: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     if (!$this->accept) {
         throw new UserInputException('accept');
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:10,代码来源:DisclaimerForm.class.php

示例2: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     if ($this->timeframe < 1) {
         throw new UserInputException('timeframe');
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:10,代码来源:UserContentRevertChangesForm.class.php

示例3: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     // valid event ids
     $validEventIDs = array();
     foreach ($this->events as $events) {
         foreach ($events as $event) {
             $validEventIDs[] = $event->eventID;
             if (!isset($this->settings[$event->eventID]['enabled'])) {
                 $this->settings[$event->eventID]['enabled'] = 0;
             }
         }
     }
     foreach ($this->settings as $eventID => &$settings) {
         // validate event id
         if (!in_array($eventID, $validEventIDs)) {
             throw new UserInputException();
         }
         // ensure 'enabled' exists
         if (!isset($settings['enabled'])) {
             $settings['enabled'] = 0;
         }
         // ensure 'mailNotificationType' exists
         if (!isset($settings['mailNotificationType']) || !in_array($settings['mailNotificationType'], self::$validMailNotificationTypes)) {
             $settings['mailNotificationType'] = 'none';
         }
     }
     unset($settings);
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:32,代码来源:NotificationSettingsForm.class.php

示例4: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     if (!I18nHandler::getInstance()->validateValue('categoryName', true)) {
         throw new UserInputException('categoryName', 'multilingual');
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:10,代码来源:UserOptionCategoryAddForm.class.php

示例5: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     // check if file is uploaded or linked
     if (!empty($this->file['tmp_name'])) {
         $this->backup = $this->file['tmp_name'];
     } else {
         if ($this->fileLink != '') {
             //check if file is external url
             if (FileUtil::isURL($this->fileLink)) {
                 try {
                     //download file
                     $this->backup = FileUtil::downloadFileFromHttp($this->fileLink, 'cms_backup');
                 } catch (SystemException $e) {
                     //download failed
                     throw new UserInputException('fileLink', 'downloadFailed');
                 }
             } else {
                 //file not found
                 if (!file_exists($this->fileLink)) {
                     throw new UserInputException('fileLink', 'notFound');
                 } else {
                     $this->backup = $this->fileLink;
                 }
             }
         } else {
             throw new UserInputException('file', 'empty');
         }
     }
 }
开发者ID:knzo,项目名称:Fireball,代码行数:33,代码来源:CMSImportForm.class.php

示例6: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     if (WCF::getUser()->disableAvatar) {
         throw new PermissionDeniedException();
     }
     if ($this->avatarType != 'custom' && $this->avatarType != 'gravatar') {
         $this->avatarType = 'none';
     }
     switch ($this->avatarType) {
         case 'custom':
             if (!WCF::getUser()->avatarID) {
                 throw new UserInputException('custom');
             }
             break;
         case 'gravatar':
             if (!MODULE_GRAVATAR) {
                 $this->avatarType = 'none';
                 break;
             }
             // test gravatar
             if (!Gravatar::test(WCF::getUser()->email)) {
                 throw new UserInputException('gravatar', 'notFound');
             }
             break;
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:30,代码来源:AvatarEditForm.class.php

示例7: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     AbstractForm::validate();
     if (empty($this->masterPassword)) {
         throw new UserInputException('masterPassword');
     }
     // check password security
     if (mb_strlen($this->masterPassword) < 12) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // digits
     if (!Regex::compile('\\d')->match($this->masterPassword)) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // latin characters (lower-case)
     if (!Regex::compile('[a-z]')->match($this->masterPassword)) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // latin characters (upper-case)
     if (!Regex::compile('[A-Z]')->match($this->masterPassword)) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // password equals username
     if ($this->masterPassword == WCF::getUser()->username) {
         throw new UserInputException('masterPassword', 'notSecure');
     }
     // confirm master password
     if (empty($this->confirmMasterPassword)) {
         throw new UserInputException('confirmMasterPassword');
     }
     if ($this->confirmMasterPassword != $this->masterPassword) {
         throw new UserInputException('confirmMasterPassword', 'notEqual');
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:37,代码来源:MasterPasswordInitForm.class.php

示例8: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     $this->errorType = array_merge($this->optionHandler->validate(), $this->errorType);
     parent::validate();
     if (!empty($this->errorType)) {
         throw new UserInputException('options', $this->errorType);
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:11,代码来源:AbstractOptionListForm.class.php

示例9: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     $this->validateName();
     $this->validateFolderName();
     if ($this->parentTemplateGroupID && !isset($this->availableTemplateGroups[$this->parentTemplateGroupID])) {
         throw new UserInputException('parentTemplateGroupID', 'notValid');
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:12,代码来源:TemplateGroupAddForm.class.php

示例10: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     foreach ($this->points as $objectTypeID => $points) {
         if ($points < 0) {
             throw new UserInputException($objectTypeID, 'greaterThan');
         }
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:12,代码来源:UserActivityPointOptionForm.class.php

示例11: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     if (empty($this->server)) {
         throw new UserInputException('server');
     }
     if (!PackageUpdateServer::isValidServerURL($this->server)) {
         throw new UserInputException('server', 'notValid');
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:13,代码来源:LanguageServerAddForm.class.php

示例12: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     // username
     $this->validateUsername();
     // password
     $this->validatePassword();
     // email
     $this->validateEmail();
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:13,代码来源:RegisterNewActivationCodeForm.class.php

示例13: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     if (WCF::getUser()->disableSignature) {
         throw new PermissionDeniedException();
     }
     AbstractForm::validate();
     if (!empty($this->text)) {
         $this->validateText();
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:13,代码来源:SignatureEditForm.class.php

示例14: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     if (empty($this->masterPassword)) {
         throw new UserInputException('masterPassword');
     }
     // check password
     if (!PasswordUtil::secureCompare(MASTER_PASSWORD, PasswordUtil::getDoubleSaltedHash($this->masterPassword, MASTER_PASSWORD))) {
         throw new UserInputException('masterPassword', 'notValid');
     }
 }
开发者ID:nick-strohm,项目名称:WCF,代码行数:14,代码来源:MasterPasswordForm.class.php

示例15: validate

 /**
  * @see	\wcf\form\IForm::validate()
  */
 public function validate()
 {
     parent::validate();
     // validate title
     if (empty($this->title)) {
         throw new UserInputException('title');
     }
     // validate less
     if (empty($_POST['less'])) {
         throw new UserInputException('less');
     }
 }
开发者ID:knzo,项目名称:Fireball,代码行数:15,代码来源:StylesheetAddForm.class.php


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