password verifier #88
Aliases: password verifier, password, verifier, pwd
13 verbs · 28 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
help_msg | this none this | rxd | #88 | 12 |
reject_password | this none this | rxd | #88 | 14 |
trivial_check | this none this | rxd | #88 | 13 |
check_length | this none this | rxd | #88 | 3 |
check_name | this none this | rxd | #88 | 6 |
check_email | this none this | rxd | #88 | 12 |
check_hosts | this none this | rxd | #88 | 10 |
check_dictionary | this none this | rxd | #88 | 21 |
check_for_funky_characters | this none this | rxd | #88 | 10 |
check_against_moo | this none this | rxd | #88 | 13 |
_is_funky_case | this none this | rxd | #88 | 10 |
check_obscure_combinations | this none this | rxd | #88 | 6 |
init_for_core | this none this | rxd | #88 | 4 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
minimum_password_length | #88 | r | #2 | 0 |
check_against_name | #88 | r | #2 | 0 |
check_against_email | #88 | r | #2 | 0 |
check_against_hosts | #88 | r | #2 | 0 |
check_against_dictionary | #88 | r | #2 | 0 |
require_funky_characters | #88 | r | #2 | 0 |
help_msg | #88 | r | #36 | list of 8{"Password Verifier", "==================", "", "To check for the validity of a password, use", " :reject_password( password [, for-whom? ] )", "... If it returns a true value, that value will contain the string representing the reason why the password was rejected. If it returns a false value, the password is OK.", "", "The toggle switches for this checking are:"} |
check_against_moo | #88 | r | #2 | 0 |
check_obscure_stuff | #88 | r | #2 | 0 |
drop_failed_msg | #5 | rc | #2 | <clear> |
drop_succeeded_msg | #5 | rc | #2 | <clear> |
odrop_failed_msg | #5 | rc | #2 | <clear> |
odrop_succeeded_msg | #5 | rc | #2 | <clear> |
otake_succeeded_msg | #5 | rc | #2 | <clear> |
otake_failed_msg | #5 | rc | #2 | <clear> |
take_succeeded_msg | #5 | rc | #2 | <clear> |
take_failed_msg | #5 | rc | #2 | <clear> |
value_base | #102 | r | #2 | <clear> |
damage_base | #102 | r | #2 | <clear> |
x_loc | #102 | r | #36 | <clear> |
y_loc | #102 | r | #36 | <clear> |
ansi_title | #102 | r | #36 | <clear> |
obvious | #102 | r | #36 | <clear> |
build_help | #102 | rc | #2 | <clear> |
key | #1 | c | #2 | 0 |
aliases | #1 | rc | #2 | {"password verifier", "password", "verifier", "pwd"} |
description | #1 | rc | #2 | "The password verifier verifies passwords." |
object_size | #1 | r | #36 | {11005, 1539462952} |
Ancestry
Ancestors (nearest first): #5 generic thing → #102 subthing → #1 Root Class
Children: none
Call graph
Source
help_msg
Referenced by
none
Source
1if (typeof(base = this.(verb)) == STR) 2base = {base}; 3endif 4base = {@base, "", tostr(".minimum_password_length = ", toliteral(x = this.minimum_password_length)), x ? tostr("Passwords are required to be a minimum of ", $string_utils:english_number(x), " characters in length.") | "There is no minimum length requirement for passwords."}; 5base = {@base, "", tostr(".check_against_moo = ", toliteral(x = this.check_against_moo)), tostr("Passwords ", x ? "may not" | "may", " be variants on the MOO's name (", $network.MOO_name, ").")}; 6base = {@base, "", tostr(".check_against_name = ", toliteral(x = this.check_against_name)), tostr("Passwords ", x ? "may not" | "may", " be variants on the player's MOO name and/or aliases.")}; 7base = {@base, "", tostr(".check_against_email = ", toliteral(x = this.check_against_email)), x ? "Passwords may not be variants on the player's email address." | "Passwords are not checked against the player's email address."}; 8base = {@base, "", tostr(".check_against_hosts = ", toliteral(x = this.check_against_hosts)), x ? "Passwords may not be variants on the player's hostname(s)." | "Passwords are not checked against the player's hostname(s)."}; 9base = {@base, "", tostr(".check_against_dictionary = ", toliteral(x = this.check_against_dictionary)), tostr("Passwords ", (typeof(x) in {LIST, OBJ}) ? "may not" | "may", " be dictionary words.", (x && (!$network.active)) ? " (This option is set but unavailable.)" | "")}; 10base = {@base, "", tostr(".require_funky_characters = ", toliteral(x = this.require_funky_characters)), tostr("Non-alphabetic characters are ", x ? "" | "not ", "required in passwords.")}; 11base = {@base, "", tostr(".check_obscure_stuff = ", toliteral(x = this.check_obscure_stuff)), x ? "Misc. obscure checks enabled" | "No obscure checks in use."}; 12return base;
reject_password
Referenced by
- #6:@password line 19:
$password_verifier:reject_password
Source
1":reject_password ( STR password [ , OBJ for-whom ] );"; 2"=> string value [if the password is rejected, why?]"; 3"=> false value [if the password isn't rejected]"; 4if (length(args) == 1) 5trust = 0; 6else 7if ($perm_utils:controls(caller_perms(), args[2])) 8trust = 1; 9else 10return "Permissions don't permit setting of that password."; 11endif 12endif 13"this is gonna be huge"; 14return (((((((this:trivial_check(@args) || (this.minimum_password_length && this:check_length(@args))) || ((this.check_against_name && trust) && this:check_name(@args))) || ((this.check_against_email && trust) && this:check_email(@args))) || ((this.check_against_hosts && trust) && this:check_hosts(@args))) || ((typeof(this.check_against_dictionary) in {LIST, OBJ}) && this:check_dictionary(@args))) || (this.require_funky_characters && this:check_for_funky_characters(@args))) || (this.check_against_moo && this:check_against_moo(@args))) || (this.check_obscure_stuff && this:check_obscure_combinations(@args));
trivial_check
Referenced by
- #88:reject_password line 14:
this:trivial_check
Source
1if (typeof(pwd = args[1]) != STR) 2return "Passwords must be strings."; 3elseif (index(pwd, " ")) 4return "Passwords may not contain spaces."; 5elseif (length(args) == 2) 6if (((typeof(who = args[2]) != OBJ) || (!valid(who))) || (!is_player(who))) 7return "That's not a player."; 8elseif (!$perm_utils:controls(caller_perms(), who)) 9return "You can't set the password for that player."; 10elseif ($object_utils:isa(who, $guest)) 11return "Sorry, but guest characters are not allowed to change their passwords."; 12endif 13endif
check_length
Referenced by
- #88:reject_password line 14:
this:check_length
Source
1if ((l = this.minimum_password_length) && (length(args[1]) < l)) 2return tostr("Passwords must be a minimum of ", $string_utils:english_number(l), (l == 1) ? " character " | " characters ", "long."); 3endif
check_name
Referenced by
- #88:reject_password line 14:
this:check_name
Source
1pwd = args[1]; 2if (valid($player_db:find_exact(pwd))) 3return "Passwords may not be close to a player's name/alias pair."; 4elseif (valid($player_db:find($string_utils:reverse(pwd)))) 5return "Passwords ought not be the reverse of a player's name/alias."; 6endif
check_email
Referenced by
- #88:reject_password line 14:
this:check_email
Source
1{pwd, who} = args; 2if (!$perm_utils:controls(caller_perms(), who)) 3return "Permission denied."; 4endif 5email = who.email_address; 6if (!email) 7"can't check"; 8return; 9endif 10if (index(email, pwd)) 11return "Passwords can't match your registered email address."; 12endif
check_hosts
Referenced by
- #88:reject_password line 14:
this:check_hosts
Source
1{pwd, who} = args; 2if (!$perm_utils:controls(caller_perms(), who)) 3return "Permission denied."; 4endif 5hosts = who.all_connect_places; 6for x in (hosts) 7if (index(x, pwd)) 8return "Passwords may not match hostnames."; 9endif 10endfor
check_dictionary
Referenced by
- #88:reject_password line 14:
this:check_dictionary
Source
1pwd = args[1]; 2if ((typeof(dict = this.check_against_dictionary) == LIST) && $network.active) 3"assume we're checking an on-line dictionary"; 4dict[3] = dict[3] + pwd; 5result = $gopher:get(@dict); 6if (typeof(result) == ERR) 7"we probably can't check the dictionary anyway"; 8return; 9elseif ((result[1] && (result[1][1] != "0")) && (!this:_is_funky_case(pwd))) 10return "Dictionary words are not permitted for passwords."; 11endif 12elseif (typeof(dict) == OBJ) 13"assume we're checking mr spell"; 14try 15if (dict:find_exact(pwd) && (!this:_is_funky_case(pwd))) 16return "Dictionary words are not permitted for passwords."; 17endif 18except (ANY) 19"in case this is messed up. Just let it go and return 0;"; 20endtry 21endif
check_for_funky_characters
Referenced by
- #88:reject_password line 14:
this:check_for_funky_characters
Source
1if (this:_is_funky_case(pwd = args[1])) 2return; 3endif 4alphabet = $string_utils.alphabet; 5for i in [1..length(pwd)] 6if (!index(alphabet, pwd[i])) 7return; 8endif 9endfor 10return "At least one unusual capitalization and/or numeric or punctuation character is required.";
check_against_moo
Referenced by
- #88:reject_password line 14:
this:check_against_moo
Source
1pwd = args[1]; 2moo = $network.MOO_Name; 3if (this:_is_funky_case(pwd)) 4return; 5endif 6if (pwd == moo) 7return "The MOO's name is not secure as a password."; 8endif 9if (moo[$ - 2..$] == "MOO") 10if (pwd == moo[1..$ - 3]) 11return "The MOO's name is not secure as a password."; 12endif 13endif
_is_funky_case
Referenced by
- #88:check_dictionary line 9:
this:_is_funky_case - #88:check_dictionary line 15:
this:_is_funky_case - #88:check_for_funky_characters line 1:
this:_is_funky_case - #88:check_against_moo line 3:
this:_is_funky_case
Source
1pwd = args[1]; 2if (!strcmp(pwd, u = $string_utils:uppercase(pwd))) 3return 0; 4elseif (!strcmp(pwd, l = $string_utils:lowercase(pwd))) 5return 0; 6elseif (!strcmp(pwd, tostr(u[1], l[2..$]))) 7return 0; 8else 9return 1; 10endif
check_obscure_combinations
Referenced by
- #88:reject_password line 14:
this:check_obscure_combinations
Source
1pwd = args[1]; 2if (match(pwd, "^[0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9]$")) 3return "Social security numbers are potentially insecure passwords."; 4elseif (match(pwd, "^[0-9]+/[0-9]+/[0-9]+$")) 5return "Passwords which look like dates are potentially insecure passwords."; 6endif
init_for_core
Referenced by
none
Source
1if (caller_perms().wizard) 2pass(@args); 3this.minimum_password_length = this.check_against_name = this.check_against_email = this.check_against_hosts = this.check_against_dictionary = this.require_funky_characters = this.check_against_moo = this.check_obscure_stuff = 0; 4endif