[Rt-commit] r2838 - in rt/branches/QUEBEC-EXPERIMENTAL: . lib/RT

jesse at bestpractical.com jesse at bestpractical.com
Fri May 6 16:40:27 EDT 2005


Author: jesse
Date: Fri May  6 16:40:27 2005
New Revision: 2838

Modified:
   rt/branches/QUEBEC-EXPERIMENTAL/   (props changed)
   rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/User_Overlay.pm
Log:
 r15832 at hualien:  jesse | 2005-05-06 16:34:19 -0400
  r13264 at hualien:  jesse | 2005-04-19 14:15:54 -0400
  RT-Ticket: 6616
  RT-Status: resolved
  RT-Update: correspond
  
  * Added a new HasPassword method to the RT user object
  
 


Modified: rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/User_Overlay.pm
==============================================================================
--- rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/User_Overlay.pm	(original)
+++ rt/branches/QUEBEC-EXPERIMENTAL/lib/RT/User_Overlay.pm	Fri May  6 16:40:27 2005
@@ -1082,6 +1082,31 @@
 
 # }}}
 
+                                                                                
+=head2 HasPassword()                                                            
+                                                                                
+Returns true if the user has a valid password, otherwise returns false.         
+                                                                               
+=cut
+
+
+sub HasPassword {
+    my $self = shift;
+    if (   ( $self->__Value('Password') eq '' )
+        || ( $self->__Value('Password') eq undef ) )
+    {
+
+        return (undef);
+    }
+    if ( $self->__Value('Password') eq '*NO-PASSWORD*' ) {
+        return undef;
+    }
+
+    return 1;
+
+}
+
+
 # {{{ sub IsPassword 
 
 =head2 IsPassword
@@ -1108,8 +1133,7 @@
         return (undef);
     }
 
-    if ( ($self->__Value('Password') eq '') || 
-         ($self->__Value('Password') eq undef) )  {
+    unless ($self->HasPassword) {
         return(undef);
      }
 


More information about the Rt-commit mailing list