- if ($msgType =~ /private/ and $message =~ s/^pass//i) {
- $message =~ s/^\s+|\s+$//g;
- my @array = split ' ', $message;
-
- if ($who =~ /^_default$/i) {
- &performStrictReply("you are too eleet.");
- return;
- }
-
- if (scalar @array != 1) {
- &help("pass");
- return;
- }
-
- # TODO: use &getUser()?
- my $first = 1;
- foreach (keys %users) {
- if ($users{$_}{FLAGS} =~ /n/) {
- $first = 0;
- last;
- }
- }
-
- if (!exists $users{$who} and !$first) {
- &performStrictReply("nick $who is not in user list.");
- return;
- }
-
- if ($first) {
- &performStrictReply("First time user... adding you as Master.");
- $users{$who}{FLAGS} = "aemnorst";
- }
-
- my $crypt = $users{$who}{PASS};
- if (defined $crypt) {
- &performStrictReply("user $who already has pass set.");
- return;
- }
-
- if (!defined $host) {
- &WARN("pass: host == NULL.");
- return;
- }
-
- if (!scalar keys %{ $users{$who}{HOSTS} }) {
- my $mask = "*!$user@".&makeHostMask($host);
- &performStrictReply("Added hostmask '\002$mask\002' to $who");
- $users{$who}{HOSTS}{$mask} = 1;
- }
-
- $crypt = &mkcrypt($array[0]);
- $users{$who}{PASS} = $crypt;
- &performStrictReply("new pass for $who, crypt $crypt.");
-
- return;
+ if ( $msgType =~ /private/ and $message =~ s/^pass//i ) {
+ $message =~ s/^\s+|\s+$//g;
+ my @array = split ' ', $message;
+
+ if ( $who =~ /^_default$/i ) {
+ &performStrictReply('you are too eleet.');
+ return;
+ }
+
+ if ( scalar @array != 1 ) {
+ &help('pass');
+ return;
+ }
+
+ # TODO: use &getUser()?
+ my $first = 1;
+ foreach ( keys %users ) {
+ if ( $users{$_}{FLAGS} =~ /n/ ) {
+ $first = 0;
+ last;
+ }
+ }
+
+ if ( !exists $users{$who} and !$first ) {
+ &performStrictReply("nick $who is not in user list.");
+ return;
+ }
+
+ if ($first) {
+ &performStrictReply('First time user... adding you as Master.');
+ $users{$who}{FLAGS} = 'aemnorst';
+ }
+
+ my $crypt = $users{$who}{PASS};
+ if ( defined $crypt ) {
+ &performStrictReply("user $who already has pass set.");
+ return;
+ }
+
+ if ( !defined $host ) {
+ &WARN('pass: host == NULL.');
+ return;
+ }
+
+ if ( !scalar keys %{ $users{$who}{HOSTS} } ) {
+ my $mask = "*!$user@" . &makeHostMask($host);
+ &performStrictReply("Added hostmask '\002$mask\002' to $who");
+ $users{$who}{HOSTS}{$mask} = 1;
+ }
+
+ $crypt = &mkcrypt( $array[0] );
+ $users{$who}{PASS} = $crypt;
+ &performStrictReply("new pass for $who, crypt $crypt.");
+
+ return;