Registration Database #16
Aliases: Registration Database
8 verbs · 14 properties · 0 children
Verbs
| Verb | Spec | Flags | Definer | Lines |
|---|---|---|---|---|
find* _only* _every* | this none this | rxd | #16 | 1 |
add | this none this | rxd | #16 | 13 |
init_for_core | this none this | rxd | #16 | 5 |
suspicious_address | this none this | rxd | #16 | 46 |
suspicious_userid | this none this | rxd | #16 | 9 |
describe_registration | this none this | rxd | #16 | 9 |
prune | this none this | rxd | #16 | 43 |
report_prune_progress | this none this | rxd | #16 | 24 |
Properties
| Property | Definer | Flags | Owner | Value |
|---|---|---|---|---|
registrar | #16 | rc | #36 | #2 |
prune_progress | #16 | rc | #36 | "zzz" |
prune_stop | #16 | rc | #36 | "zzz" |
total_pruned_people | #16 | rc | #36 | 22967 |
total_pruned_characters | #16 | rc | #36 | 470 |
prune_task | #16 | rc | #36 | 1766597976 |
node_perms | #37 | rc | #36 | "" |
data | #37 | r | #36 | <clear> |
| #37 | | #36 | {"", "", {}, {}} |
key | #1 | c | #36 | <clear> |
aliases | #1 | rc | #36 | {"Registration Database"} |
description | #1 | rc | #36 | <clear> |
object_size | #1 | r | #36 | {8728, -1090650497} |
html | #1 | rc | #36 | <clear> |
Ancestry
Ancestors (nearest first): #37 Generic Database → #1 Root Class
Children: none
Call graph
Source
find* _only* _every*
Referenced by
none
Source
1return ((caller == this) || caller_perms().wizard) ? pass(@args) | E_PERM;
add
Referenced by
- #6:@registerme line 52:
$registration_db:add - #24:make_player line 20:
$registration_db:add - #24:do_register line 23:
$registration_db:add - #24:do_register line 25:
$registration_db:add - #100:@update-reg*istration line 40:
$registration_db:add
Source
1":add(player,email[,comment])"; 2if (!caller_perms().wizard) 3return E_PERM; 4endif 5{who, email, @comment} = args; 6l = this:find_exact(email); 7if (l == $failed_match) 8this:insert(email, {{who, @comment}}); 9elseif (i = $list_utils:iassoc(who, l)) 10this:insert(email, listset(l, {who, @comment}, i)); 11else 12this:insert(email, {@l, {who, @comment}}); 13endif
init_for_core
Referenced by
none
Source
1if (caller_perms().wizard) 2pass(); 3this:clearall(); 4this.registrar = #2; 5endif
suspicious_address
Referenced by
- #24:check_player_request line 36:
$registration_db:suspicious_address
Source
1"suspicious(address [,who])"; 2"Determine whether an address appears to be another player in disguise."; 3"returns a list of similar addresses."; 4"If second argument given, then if all similar addresses are held by that"; 5"person, let it pass---they're just switching departments at the same school"; 6"or something."; 7""; 8"at the moment,"; 9" foo@bar.baz.bing.boo"; 10"is considered 'similar' to anything matching"; 11" foo@*.bing.boo"; 12if (!caller_perms().wizard) 13return E_PERM; 14endif 15{address, ?allowed = #-1} = args; 16{userid, site} = $network:parse_address(address); 17exact = (!site) && this:find_exact(address); 18if (!site) 19site = $network.site; 20endif 21site = $network:local_domain(site); 22sitelen = length(site); 23others = this:find_all_keys(userid + "@"); 24for other in (others) 25if (other[max(1, ($ - sitelen) + 1)..$] != site) 26others = setremove(others, other); 27endif 28endfor 29if (exact) 30others = listinsert(others, address); 31endif 32for x in (others) 33allzapped = 1; 34for y in (this:find_exact(x)) 35if ((((length(y) == 2) && ((y[2] == "zapped due to inactivity") || (y[2] == "toaded due to inactivity"))) || (y[1] == allowed)) || (($object_utils:has_property($local, "second_char_registry") && (typeof(them = $local.second_char_registry:other_chars(y[1])) == LIST)) && (allowed in them))) 36"let them change to the address if it is them, or if it is a registered char of theirs."; 37"Hrm. Need typeof==LIST check because returns E_INVARG for shared characters. bleah Ho_Yan 5/8/95"; 38else 39allzapped = 0; 40endif 41endfor 42if (allzapped) 43others = setremove(others, x); 44endif 45endfor 46return others;
suspicious_userid
Referenced by
- #24:check_player_request line 43:
$registration_db:suspicious_userid
Source
1"suspicious_userid(userid)"; 2"Return yes if userid is root or postmaster or something like that."; 3if ($object_utils:has_property(#0, "local") && $object_utils:has_property($local, "suspicious_userids")) 4extra = $local.suspicious_userids; 5else 6extra = {}; 7endif 8return ((((args[1] in {@$network.suspicious_userids, @extra}) || match(args[1], "^guest")) || match(args[1], "^help")) || index(args[1], "-owner")) || index(args[1], "owner-"); 9"Thinking about ruling out hyphenated names, on the grounds that they're probably mailing lists.";
describe_registration
Referenced by
- #6:@registerme line 59:
$registration_db:describe_registration
Source
1"Returns a list of strings describing the registration data for an email address. Args[1] should be the result of this:find."; 2set_task_perms(caller_perms()); 3result = {}; 4for x in (args[1]) 5name = (valid(x[1]) && is_player(x[1])) ? x[1].name | "<recycled>"; 6email = (valid(x[1]) && is_player(x[1])) ? x[1].email_address | "<???>"; 7result = {@result, tostr(" ", name, " (", x[1], ") current email: ", email, (length(x) > 1) ? (" [" + x[2]) + "]" | "")}; 8endfor 9return result;
prune
Referenced by
- #100:@update-reg*istration line 46:
$registration_db:prune
Source
1"Carefully loop through the db and delete items associated with reaped objects. If that results in no objects remaining for a username, delete that username."; 2"Attempt to keep memory usage down by only asking for a small number of items at a time. Should probably have some arguments to control this."; 3if (!caller_perms().wizard) 4raise(E_PERM); 5endif 6this.prune_task = task_id(); 7probe = this.prune_progress; 8while (probe < this.prune_stop) 9for username in (this:find_all_keys(probe)) 10items = this:find_exact(username); 11orig = items; 12for y in (items) 13{who, @whys} = y; 14if ((!valid(who)) || (!is_player(who))) 15nuke = 1; 16for why in (whys) 17if ((why && (why != "zapped due to inactivity")) && (why != "toaded due to inactivity")) 18nuke = 0; 19endif 20endfor 21if (nuke) 22items = setremove(items, y); 23endif 24endif 25$command_utils:suspend_if_needed(0); 26endfor 27if (!items) 28this:delete(username); 29this.total_pruned_people = this.total_pruned_people + 1; 30elseif (items != orig) 31this:insert(username, items); 32this.total_pruned_characters = (this.total_pruned_characters + length(orig)) - length(items); 33endif 34$command_utils:suspend_if_needed(0); 35endfor 36probe = $string_utils:incr_alpha(probe); 37this.prune_progress = probe; 38if ($command_utils:running_out_of_time()) 39set_task_perms($wiz_utils:random_wizard()); 40suspend(0); 41endif 42endwhile 43player:tell("Prune stopped at ", toliteral(this.prune_progress));
report_prune_progress
Referenced by
none
Source
1player:tell("Prune is up to ", toliteral(this.prune_progress), "."); 2mine = 0; 3if (typeof(this.prune_progress) == STR) 4total = (26 * 26) * 26; 5for x in [1..3] 6mine = ((mine * 26) + index($string_utils.alphabet, this.prune_progress[x])) - 1; 7endfor 8else 9total = 256 * 256; 10mine = (this.prune_progress[1] * 256) + this.prune_progress[2]; 11endif 12percent = (100.0 * tofloat(mine)) / tofloat(total); 13player:tell("We have processed ", mine, " entries out of ", total, ", or ", toint(percent), ".", toint(10.0 * percent) % 10, "%."); 14player:tell("There were ", this.total_pruned_characters, " individual list entries removed, and ", this.total_pruned_people, " whole email addresses removed."); 15if ($code_utils:task_valid(this.prune_task)) 16player:tell("Prune task is ", this.prune_task, ". Stacktrace:"); 17for x in (task_stack(this.prune_task, 1)) 18if (valid(x[4])) 19player:tell(x[4], ":", x[2], " [", x[1], "] ", x[3].name, " (", x[6], ")"); 20endif 21endfor 22else 23player:tell("The recorded task_id is no longer valid."); 24endif