[vhffs-dev] [887] code cleaning

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


Revision: 887
Author:   gradator
Date:     2007-09-09 04:35:50 +0000 (Sun, 09 Sep 2007)

Log Message:
-----------
code cleaning

Modified Paths:
--------------
    trunk/vhffs-jabber/vhffspipe.pl


Modified: trunk/vhffs-jabber/vhffspipe.pl
===================================================================
--- trunk/vhffs-jabber/vhffspipe.pl	2007-09-09 04:26:04 UTC (rev 886)
+++ trunk/vhffs-jabber/vhffspipe.pl	2007-09-09 04:35:50 UTC (rev 887)
@@ -4,12 +4,7 @@
 use lib '%VHFFS_LIB_DIR%';
 use Vhffs::Main;
 use Vhffs::User;
-use Vhffs::Group;
-use Vhffs::Functions;
-use Crypt::PasswdMD5;
-use Vhffs::Misc::Salt;
 use MIME::Base64;
-#use Data::Dumper;
 
 # Flush output immediately.
 $| = 1;
@@ -38,11 +33,11 @@
 {
 	my $username = shift;
 
-	$vhffs = init Vhffs::Main if ( ! defined $vhffs );
-	return undef if ( ! defined $vhffs );
+	$vhffs = init Vhffs::Main unless defined $vhffs;
+	return undef unless defined $vhffs;
 
-    # DB connection lost !
-    $vhffs->reconnect() if( !$vhffs->is_valid() );
+	# DB connection lost !
+	$vhffs->reconnect() unless $vhffs->is_valid;
 	my $user = Vhffs::User::get_by_username( $vhffs , $username );
 	return undef unless( defined $user );
 
@@ -60,9 +55,9 @@
 
 	if ( defined $user )  {
 		undef $user;
-		return "OK";
+		return 'OK';
 	}
-	return "NO";
+	return 'NO';
 }
 
 
@@ -71,16 +66,16 @@
 {
 	my ($username, $passb64, $realm) = @_;
 
-	return "NO" if( ! defined $passb64 );
+	return 'NO' unless defined $passb64;
 
 	my $user = fetch_user( $username );
 	undef $user if( defined $user  &&  $user->check_password( decode_base64($passb64) ) == 0 );
 
-	if ( defined $user )  {
+	if( defined $user )  {
 		undef $user;
-		return "OK";
+		return 'OK';
 	}
-	return "NO";
+	return 'NO';
 }
 
 


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