當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DataValidator::validate_testername方法代碼示例

本文整理匯總了PHP中DataValidator::validate_testername方法的典型用法代碼示例。如果您正苦於以下問題:PHP DataValidator::validate_testername方法的具體用法?PHP DataValidator::validate_testername怎麽用?PHP DataValidator::validate_testername使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DataValidator的用法示例。


在下文中一共展示了DataValidator::validate_testername方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getTesterTimeZone

 /**
  *
  * @param string $tester
  * @return string dsn or null
  */
 public static function getTesterTimeZone($tester)
 {
     if (DataValidator::validate_testername($tester, MULTIPROVIDER) === FALSE) {
         return NULL;
     }
     // FIXME:usare require_once?
     include_once ROOT_DIR . '/clients/' . $tester . '/client_conf.inc.php';
     $tester_in_uppercase = strtoupper($tester);
     $tester_timezone = $tester_in_uppercase . '_TIMEZONE';
     if (defined($tester_timezone)) {
         return constant($tester_timezone);
     }
     return null;
 }
開發者ID:eguicciardi,項目名稱:ada,代碼行數:19,代碼來源:multiport.inc.php

示例2: addTester

 public function addTester($tester)
 {
     $tester = DataValidator::validate_testername($tester, MULTIPROVIDER);
     if ($tester !== FALSE) {
         array_push($this->testers, $tester);
         return TRUE;
     }
     return FALSE;
 }
開發者ID:eguicciardi,項目名稱:ada,代碼行數:9,代碼來源:user_class.inc.php

示例3: unset

 if (DataValidator::validate_not_empty_string($_POST['tester_country']) === FALSE) {
     $errorsAr['tester_country'] = true;
 }
 if (DataValidator::validate_phone($_POST['tester_phone']) === FALSE) {
     $errorsAr['tester_phone'] = true;
 }
 if (DataValidator::validate_email($_POST['tester_email']) === FALSE) {
     $errorsAr['tester_email'] = true;
 }
 if (DataValidator::validate_string($_POST['tester_desc']) === FALSE) {
     $errorsAr['tester_desc'] = true;
 }
 if (DataValidator::validate_string($_POST['tester_resp']) === FALSE) {
     $errorsAr['tester_resp'] = true;
 }
 if (DataValidator::validate_testername($_POST['tester_pointer'], MULTIPROVIDER) === FALSE) {
     $errorsAr['tester_pointer'] = true;
 }
 if (count($errorsAr) > 0) {
     $tester_dataAr = $_POST;
     $form = AdminModuleHtmlLib::getEditTesterForm($testersAr, $tester_dataAr, $errorsAr);
 } else {
     unset($_POST['submit']);
     $tester_dataAr = $_POST;
     $result = $common_dh->set_tester($tester_dataAr['tester_id'], $tester_dataAr);
     if (AMA_Common_DataHandler::isError($result)) {
         $errObj = new ADA_Error($result);
         $form = new CText('');
     } else {
         header('Location: ' . HTTP_ROOT_DIR . '/admin/tester_profile.php?id_tester=' . $tester_dataAr['tester_id']);
         exit;
開發者ID:eguicciardi,項目名稱:ada,代碼行數:31,代碼來源:edit_tester.php

示例4: getDefaultTester

 /**
  * getDefaultTester implementation:
  * - if it's not a multiprovider environment, return the user selected provider
  * - else return parent's method
  *
  * @see ADAAbstractUser::getDefaultTester()
  */
 public function getDefaultTester()
 {
     if (!MULTIPROVIDER) {
         $candidate = null;
         /**
          * the default tester is the only one in which the user is listed
          * that is NOT the public tester. So let's take the list of all
          * providers the user is registered into, remove the public one and
          * if what is left has only one element, this is the default tester.
          * Else we cannot tell for certain the default testers and return null.
          */
         $testersArr = $this->getTesters();
         if (!empty($testersArr)) {
             $testersArr = array_values(array_diff($testersArr, array(ADA_PUBLIC_TESTER)));
             if (count($testersArr) === 1) {
                 $candidate = $testersArr[0];
             }
         }
         $tester = DataValidator::validate_testername($candidate, MULTIPROVIDER);
         if ($tester !== false) {
             return $tester;
         } else {
             return NULL;
         }
     } else {
         return parent::getDefaultTester();
     }
 }
開發者ID:eguicciardi,項目名稱:ada,代碼行數:35,代碼來源:ADAUser.inc.php


注:本文中的DataValidator::validate_testername方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。