X-Git-Url: https://ruin.nu/git/?p=NDIRC.git;a=blobdiff_plain;f=Commands%2FChannel.pm;fp=Commands%2FChannel.pm;h=1c3a76248a4d088ee89ffe3e00e0db79a5cdc8d8;hp=62eae4f9bebd59e6eb353ad7bff927217cfcabdd;hb=468a4e3e07c0d9e6ed66a75c73f0d7ff2921b90a;hpb=cd18307dc7e3886266937935feffbb41b1df422d diff --git a/Commands/Channel.pm b/Commands/Channel.pm index 62eae4f..1c3a762 100644 --- a/Commands/Channel.pm +++ b/Commands/Channel.pm @@ -77,7 +77,7 @@ command devoice => { command invite => { help => q(Syntax: invite [channel] | If no channel is specified it invites you to all channel you have auto invite access on), - type => q(pm) + type => q(ircpm) }, class extends NDIRC::Command { method execute ($c,$msg) { my ($channel) = $msg =~ /^\s*(\S+)?\s*$/ or die 'ARGS'; @@ -114,45 +114,4 @@ command hostname => { } }; -command getpass => { - help => q(Gives new users a random password.), - type => q(pm) -}, class extends NDIRC::Command { - -########################################################### -# Written by Guy Malachi http://guymal.com -# 18 August, 2002 -########################################################### - sub generate_random_string - { - my $length_of_randomstring=shift;# the length of - # the random string to generate - - my @chars=('a'..'z','A'..'Z','0'..'9','_'); - my $random_string; - foreach (1..$length_of_randomstring) - { - # rand @chars will generate a random - # number between 0 and scalar @chars - $random_string .= $chars[rand @chars]; - } - return $random_string; - } - - method execute ($c,$msg) { - my $dbh = $c->model; - - my $password = generate_random_string 16; - my $update = $dbh->do(q{ -UPDATE users SET password = $1 -WHERE uid = $2 AND password IS NULL - },undef,$password,$c->uid); - if ($update > 0){ - $c->reply("Password set to: $password (you can change it on webbie)"); - }else{ - $c->reply("Couldn't set password. Either it has already been set or you don't have an account"); - } - } -}; - 1;