本文整理汇总了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;
}
示例2: addTester
public function addTester($tester)
{
$tester = DataValidator::validate_testername($tester, MULTIPROVIDER);
if ($tester !== FALSE) {
array_push($this->testers, $tester);
return TRUE;
}
return FALSE;
}
示例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;
示例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();
}
}