X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2FUserExtra.pl;h=b139ad6a9f1d9424e3a664ff5f1f28d5436c9813;hb=507db1a6df019db154b4771f602127b24d546df7;hp=bd885ccbbc2aabe0a7484f189d060fa0e5d8c33d;hpb=3877995b6c497346f8193e32ac4323bf26c92659;p=infobot.git diff --git a/src/UserExtra.pl b/src/UserExtra.pl index bd885cc..b139ad6 100644 --- a/src/UserExtra.pl +++ b/src/UserExtra.pl @@ -442,33 +442,13 @@ sub userCommands { } # crypt. - if ($message =~ /^crypt(\s+(.*))?$/i) { - # Sorry, its messy, but it seems to work now. Added $salt and $ciphertext -- troubled - my $salt; - my $ciphertext; - ($salt, $ciphertext) = split /\s+(.*)$/, $2; - my @args = split /\s+/, $2; - - # Original was > 2 and thus only allowed 1 word to be passed to crypt. - # Although now it will crypt to random salt if only 1 param -- troubled - if (!scalar @args or scalar @args < 1) { - &help("crypt"); - return; - } - - if (scalar @args >= 2) { -# disable cause $1$ will use md5 -# if (length $args[0] != 2) { -# &msg($who, "invalid format..."); -# return; -# } - - &performStrictReply( crypt($ciphertext, $salt) ); + if ($message =~ /^crypt\s+(\S*)?\s*(.*)?$/i) { +&status("crypt: $1:$2:$3"); + if ("$2" ne '') { + &performStrictReply(crypt($2, $1)); } else { - # When does this get called now since above commented out? -- troubled - &performStrictReply( &mkcrypt($args[0]) ); + &performStrictReply(&mkcrypt($1)); } - return; }