[vhffs-dev] [1584] IRC nick should be checked / set only for admins / moderators.

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1584
Author:   guillaumito
Date:     2010-03-29 20:58:14 +0200 (Mon, 29 Mar 2010)
Log Message:
-----------
IRC nick should be checked / set only for admins / moderators.
Empty IRC nick should be allowed too.

Modified Paths:
--------------
    trunk/vhffs-panel/user/prefs.pl

Modified: trunk/vhffs-panel/user/prefs.pl
===================================================================
--- trunk/vhffs-panel/user/prefs.pl	2010-03-29 00:05:35 UTC (rev 1583)
+++ trunk/vhffs-panel/user/prefs.pl	2010-03-29 18:58:14 UTC (rev 1584)
@@ -155,8 +155,10 @@
 				else {
 					$shell = Vhffs::Panel::User::default_shell( $ vhffs );
 				}
-				if( $ircnick !~ /^[^<">]+$/ ) {
-					$panel->add_error( gettext( 'IRC nick is not correct !') );
+    				if($userp->is_moderator || $userp->is_admin) {
+					if( $ircnick !~ /^[^<">]*$/ ) {
+						$panel->add_error( gettext( 'IRC nick is not correct !') );
+					}
 				}
 
 				if(! $panel->has_errors) {
@@ -167,7 +169,9 @@
 					$userp->set_country( $country );
 					$userp->set_address( $address );
 					$userp->set_shell( $shell );
-					$userp->set_ircnick( $ircnick );
+    					if($userp->is_moderator || $userp->is_admin) {
+						$userp->set_ircnick( $ircnick );
+					}
 
 					if( ( length( $pass1 ) > 1 ) && ( $pass1 eq $pass2 ) ) { 
 						$pwd_change = 1;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/