[Rt-commit] r2782 - in rt/branches/3.4-RELEASE: . lib/RT

jesse at bestpractical.com jesse at bestpractical.com
Tue Apr 19 14:19:29 EDT 2005


Author: jesse
Date: Tue Apr 19 14:19:29 2005
New Revision: 2782

Modified:
   rt/branches/3.4-RELEASE/   (props changed)
   rt/branches/3.4-RELEASE/lib/RT/User_Overlay.pm
Log:
 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/3.4-RELEASE/lib/RT/User_Overlay.pm
==============================================================================
--- rt/branches/3.4-RELEASE/lib/RT/User_Overlay.pm	(original)
+++ rt/branches/3.4-RELEASE/lib/RT/User_Overlay.pm	Tue Apr 19 14:19:29 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