password verifier #88

Parent #5Owner #2Flags readSource QuestCore.db

Aliases: password verifier, password, verifier, pwd

13 verbs · 28 properties · 0 children

Verbs

VerbSpecFlagsDefinerLines
help_msgthis none thisrxd#8812
reject_passwordthis none thisrxd#8814
trivial_checkthis none thisrxd#8813
check_lengththis none thisrxd#883
check_namethis none thisrxd#886
check_emailthis none thisrxd#8812
check_hoststhis none thisrxd#8810
check_dictionarythis none thisrxd#8821
check_for_funky_charactersthis none thisrxd#8810
check_against_moothis none thisrxd#8813
_is_funky_casethis none thisrxd#8810
check_obscure_combinationsthis none thisrxd#886
init_for_corethis none thisrxd#884

Properties

PropertyDefinerFlagsOwnerValue
minimum_password_length#88r#20
check_against_name#88r#20
check_against_email#88r#20
check_against_hosts#88r#20
check_against_dictionary#88r#20
require_funky_characters#88r#20
help_msg#88r#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#88r#20
check_obscure_stuff#88r#20
drop_failed_msg#5rc#2<clear>
drop_succeeded_msg#5rc#2<clear>
odrop_failed_msg#5rc#2<clear>
odrop_succeeded_msg#5rc#2<clear>
otake_succeeded_msg#5rc#2<clear>
otake_failed_msg#5rc#2<clear>
take_succeeded_msg#5rc#2<clear>
take_failed_msg#5rc#2<clear>
value_base#102r#2<clear>
damage_base#102r#2<clear>
x_loc#102r#36<clear>
y_loc#102r#36<clear>
ansi_title#102r#36<clear>
obvious#102r#36<clear>
build_help#102rc#2<clear>
key#1c#20
aliases#1rc#2{"password verifier", "password", "verifier", "pwd"}
description#1rc#2"The password verifier verifies passwords."
object_size#1r#36{11005, 1539462952}

Ancestry

Ancestors (nearest first): #5 generic thing#102 subthing#1 Root Class

Children: none

Call graph

calls n88_0 #88:help_msg n20_27 #20:english_number n88_0->n20_27 n88_1 #88:reject_password n42_0 #42:controls n88_1->n42_0 n88_2 #88:trivial_check n88_1->n88_2 n88_3 #88:check_length n88_1->n88_3 n88_4 #88:check_name n88_1->n88_4 n88_5 #88:check_email n88_1->n88_5 n88_6 #88:check_hosts n88_1->n88_6 n88_7 #88:check_dictionary n88_1->n88_7 n88_8 #88:check_for_funky_characters n88_1->n88_8 n88_9 #88:check_against_moo n88_1->n88_9 n88_11 #88:check_obscure_combinations n88_1->n88_11 n88_2->n42_0 n52_5 #52:isa n88_2->n52_5 n88_3->n20_27 n37_1 #37:find_exact n88_4->n37_1 n37_0 #37:find n88_4->n37_0 n20_49 #20:reverse n88_4->n20_49 n88_5->n42_0 n88_6->n42_0 n75_5 #75:get n88_7->n75_5 n88_10 #88:_is_funky_case n88_7->n88_10 n88_8->n88_10 n88_9->n88_10 n20_14 #20:uppercase n88_10->n20_14 n88_12 #88:init_for_core n102_1 #102:init_for_core n88_12->n102_1

Source

help_msg

Spec this none thisFlags rxdOwner #36Definer #88

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

Spec this none thisFlags rxdOwner #2Definer #88

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #88

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #88

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #88

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #88

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #88

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #88

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #88

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #88

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #88

Referenced by

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

Spec this none thisFlags rxdOwner #36Definer #88

Referenced by

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

Spec this none thisFlags rxdOwner #2Definer #88

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