]> git.donarmstrong.com Git - infobot.git/commitdiff
- lobotomy warning now cached
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 20 Feb 2001 12:58:43 +0000 (12:58 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Tue, 20 Feb 2001 12:58:43 +0000 (12:58 +0000)
- use &mkcrypt()

git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@406 c11ca15a-4712-0410-83d8-924469b57eb5

src/Process.pl

index 72f988824656352f0edea8afd8a68fc23cb3f57a..69711c011c636e7c1c08a72b63aab37acf8203ba 100644 (file)
@@ -25,7 +25,9 @@ sub process {
     # check if we have our head intact.
     if ($lobotomized) {
        if ($addressed and IsFlag("o") eq "o") {
-           &msg($who, "give me an unlobotomy.");
+           my $delta_time      = time() - ($cache{lobotomy}{$who} || 0);
+           &msg($who, "give me an unlobotomy.") if ($delta_time > 60*60);
+           $cache{lobotomy}{$who} = time();
        }
        return 'LOBOTOMY';
     }
@@ -160,10 +162,9 @@ sub process {
            $users{$who}{HOSTS}{$mask}  = 1;
        }
 
-       my $salt = join '',('.','/',0..9,'A'..'Z','a'..'z')[rand 64, rand 64];
-       # todo: show crypt?
-       &pSReply("new pass for $who, salt $salt.");
-       $users{$who}{PASS}              = crypt($array[0], $salt);
+       $crypt                  = &mkcrypt($array[0]);
+       $users{$who}{PASS}      = $crypt;
+       &pSReply("new pass for $who, crypt $crypt.");
 
        return;
     }