本文整理匯總了PHP中Piwik\SettingsPiwik::isUserCredentialsSanityCheckEnabled方法的典型用法代碼示例。如果您正苦於以下問題:PHP SettingsPiwik::isUserCredentialsSanityCheckEnabled方法的具體用法?PHP SettingsPiwik::isUserCredentialsSanityCheckEnabled怎麽用?PHP SettingsPiwik::isUserCredentialsSanityCheckEnabled使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\SettingsPiwik
的用法示例。
在下文中一共展示了SettingsPiwik::isUserCredentialsSanityCheckEnabled方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: isValidPasswordString
/**
* Returns true if the password is complex enough (at least 6 characters and max 26 characters)
*
* @param $input string
* @return bool
*/
public static function isValidPasswordString($input)
{
if (!SettingsPiwik::isUserCredentialsSanityCheckEnabled() && !empty($input)) {
return true;
}
$l = strlen($input);
return $l >= self::PASSWORD_MIN_LENGTH;
}
示例2: checkValidLoginString
/**
* Returns `true` if the login is valid.
*
* _Warning: does not check if the login already exists! You must use UsersManager_API->userExists as well._
*
* @param string $userLogin
* @throws Exception
* @return bool
*/
public static function checkValidLoginString($userLogin)
{
if (!SettingsPiwik::isUserCredentialsSanityCheckEnabled() && !empty($userLogin)) {
return;
}
$loginMinimumLength = 2;
$loginMaximumLength = 100;
$l = strlen($userLogin);
if (!($l >= $loginMinimumLength && $l <= $loginMaximumLength && preg_match('/^[A-Za-z0-9_.@+-]*$/D', $userLogin) > 0)) {
throw new Exception(Piwik::translate('UsersManager_ExceptionInvalidLoginFormat', array($loginMinimumLength, $loginMaximumLength)));
}
}