function password_get_complexity_rules
Search API
| 7.x password.inc | password_get_complexity_rules($bool_return_array = FALSE) |
Returns a list of complexity rules as either HTML (default) or an array.
Parameters
boolean $bool_return_array:
2 calls to password_get_complexity_rules()
- user.module in modules/
user/ user.module - user_user_settings_form in modules/
user/ user.module - This is the main settings form for a user.
File
- includes/
password.inc, line 372 - Secure password hashing functions for user authentication.
Code
function password_get_complexity_rules($bool_return_array = FALSE) {
$html = "";
$arr = array();
$arr [] = t("Must be at least 12 characters long");
$arr [] = t("Must contain at least one number");
$arr [] = t("Must contain at least one letter or symbol");
$arr [] = t("Cannot contain the same character more than twice in a row");
$html .= "<ul class='password-complexity-rules'>";
foreach ($arr as $r) {
$html .= "<li>$r</li>";
}
$html .= "</ul>";
if ($bool_return_array) {
return $arr;
}
return $html;
}
