[Rt-commit] r10052 - in rt/branches/3.999-DANGEROUS: . docs/design_docs etc etc/upgrade/3.1.17 lib/RT lib/RT/Action lib/RT/Model lib/RT/ScripAction lib/RT/Test

jesse at bestpractical.com jesse at bestpractical.com
Mon Dec 24 00:27:47 EST 2007


Author: jesse
Date: Mon Dec 24 00:27:46 2007
New Revision: 10052

Added:
   rt/branches/3.999-DANGEROUS/lib/RT/Action/
   rt/branches/3.999-DANGEROUS/lib/RT/Action/Login.pm
Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/docs/design_docs/subscription-definitions.txt
   rt/branches/3.999-DANGEROUS/etc/initialdata
   rt/branches/3.999-DANGEROUS/etc/upgrade/3.1.17/content
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Attribute.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/User.pm
   rt/branches/3.999-DANGEROUS/lib/RT/SavedSearch.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/NotifyAsComment.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Test/Web.pm
   rt/branches/3.999-DANGEROUS/t/web/basic.t
   rt/branches/3.999-DANGEROUS/t/web/custom_frontpage.t

Log:
 r74083 at pinglin:  jesse | 2007-12-23 15:22:51 -0500
 Login with username works again


Modified: rt/branches/3.999-DANGEROUS/docs/design_docs/subscription-definitions.txt
==============================================================================
--- rt/branches/3.999-DANGEROUS/docs/design_docs/subscription-definitions.txt	(original)
+++ rt/branches/3.999-DANGEROUS/docs/design_docs/subscription-definitions.txt	Mon Dec 24 00:27:46 2007
@@ -4,14 +4,14 @@
 RT Actions:
 
 
-   EmailOwnerAscomment
+   EmailOwnerAsComment
 	Send mail to the ticket owner from the queue's comment address
 	
-   EmailOwnerOrAdminWatchersAscomment
+   EmailOwnerOrAdminWatchersAsComment
 	Send mail to the ticket owner, or if there is no owner, the ticket's admin watchers
 	from the queue's comment addresses
 
-   EmailAdminWatchersAscomment
+   EmailAdminWatchersAsComment
 	Send mail to the ticket's adminstrative watchers from the queue's comment address
 
 

Modified: rt/branches/3.999-DANGEROUS/etc/initialdata
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/initialdata	(original)
+++ rt/branches/3.999-DANGEROUS/etc/initialdata	Mon Dec 24 00:27:46 2007
@@ -81,7 +81,7 @@
       Argument    => 'Requestor' },
     { name        => 'Notify Owner as comment',              # loc
       Description => 'Sends mail to the owner',              # loc
-      ExecModule  => 'NotifyAscomment',
+      ExecModule  => 'NotifyAsComment',
       Argument    => 'Owner' },
     { name        => 'Notify Owner',                         # loc
       Description => 'Sends mail to the owner',              # loc
@@ -89,7 +89,7 @@
       Argument    => 'Owner' },
     { name        => 'Notify Ccs as comment',              # loc
       Description => 'Sends mail to the Ccs as a comment', # loc
-      ExecModule  => 'NotifyAscomment',
+      ExecModule  => 'NotifyAsComment',
       Argument    => 'Cc' },
     { name        => 'Notify Ccs',                                   # loc
       Description => 'Sends mail to the Ccs',                        # loc
@@ -97,7 +97,7 @@
       Argument    => 'Cc' },
     { name        => 'Notify AdminCcs as comment',                        # loc
       Description => 'Sends mail to the administrative Ccs as a comment', # loc
-      ExecModule  => 'NotifyAscomment',
+      ExecModule  => 'NotifyAsComment',
       Argument    => 'AdminCc' },
     { name        => 'Notify AdminCcs',                                   # loc
       Description => 'Sends mail to the administrative Ccs',              # loc
@@ -106,7 +106,7 @@
 
     { name        => 'Notify Requestors and Ccs as comment',              # loc
       Description => 'Send mail to requestors and Ccs as a comment',      # loc
-      ExecModule  => 'NotifyAscomment',
+      ExecModule  => 'NotifyAsComment',
       Argument    => 'Requestor,Cc' },
 
     { name        => 'Notify Requestors and Ccs',                         # loc
@@ -116,7 +116,7 @@
 
     { name        => 'Notify Requestors, Ccs and AdminCcs as comment',    # loc
       Description => 'Send mail to all watchers as a "comment"',          # loc
-      ExecModule  => 'NotifyAscomment',
+      ExecModule  => 'NotifyAsComment',
       Argument    => 'All' },
     { name        => 'Notify Requestors, Ccs and AdminCcs',               # loc
       Description => 'Send mail to all watchers',                         # loc
@@ -124,7 +124,7 @@
       Argument    => 'All' },
     { name        => 'Notify Other Recipients as comment',                # loc
       Description => 'Sends mail to explicitly listed Ccs and Bccs',      # loc
-      ExecModule  => 'NotifyAscomment',
+      ExecModule  => 'NotifyAsComment',
       Argument    => 'OtherRecipients' },
     { name        => 'Notify Other Recipients',                           # loc
       Description => 'Sends mail to explicitly listed Ccs and Bccs',      # loc

Modified: rt/branches/3.999-DANGEROUS/etc/upgrade/3.1.17/content
==============================================================================
--- rt/branches/3.999-DANGEROUS/etc/upgrade/3.1.17/content	(original)
+++ rt/branches/3.999-DANGEROUS/etc/upgrade/3.1.17/content	Mon Dec 24 00:27:46 2007
@@ -1,7 +1,7 @@
 @ScripActions = (
     { name        => 'Notify Ccs as comment',              # loc
       Description => 'Sends mail to the Ccs as a comment', # loc
-      ExecModule  => 'NotifyAscomment',
+      ExecModule  => 'NotifyAsComment',
       Argument    => 'Cc' },
     { name        => 'Notify Ccs',                                   # loc
       Description => 'Sends mail to the Ccs',                        # loc

Added: rt/branches/3.999-DANGEROUS/lib/RT/Action/Login.pm
==============================================================================
--- (empty file)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Action/Login.pm	Mon Dec 24 00:27:46 2007
@@ -0,0 +1,15 @@
+use warnings;
+use strict;
+package RT::Action::Login;
+use base qw/Jifty::Plugin::Authentication::Password::Action::Login/;
+
+sub load_user {
+    my $self = shift;
+    my $username = shift;
+    my $user = Jifty->app_class('Model', 'User')->new(current_user => Jifty->app_class('CurrentUser')->superuser);
+    $user->load_by_cols( name => $username);
+    return $user;
+
+
+}
+1;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Attribute.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Attribute.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Attribute.pm	Mon Dec 24 00:27:46 2007
@@ -158,7 +158,7 @@
                 Object => undef,
 		  @_);
 
-    if ($args{Object} and UNIVERSAL::can($args{Object}, 'Id')) {
+    if ($args{Object} and UNIVERSAL::can($args{Object}, 'id')) {
 	    $args{object_type} = ref($args{Object});
 	    $args{object_id} = $args{Object}->id;
     } else {

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/User.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/User.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/User.pm	Mon Dec 24 00:27:46 2007
@@ -699,17 +699,7 @@
     elsif ( length($password) < RT->Config->Get('MinimumpasswordLength') ) {
         return ( 0, $self->loc("password needs to be at least %1 characters long", RT->Config->Get('MinimumpasswordLength')) );
     }
-    else {
-        my $new = !$self->has_password;
-        my ( $val, $msg ) = $self->_set(column => 'password', value=> $password);
-        if ($val) {
-            return ( 1, $self->loc("password set") ) if $new;
-            return ( 1, $self->loc("password changed") );
-        }
-        else {
-            return ( $val, $msg );
-        }
-    }
+            return ( 1, "ok");
 
 }
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/SavedSearch.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/SavedSearch.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/SavedSearch.pm	Mon Dec 24 00:27:46 2007
@@ -77,9 +77,9 @@
     my $proto = shift;
     my $class = ref($proto) || $proto;
     my $self  = {};
-    $self->{'Id'} = 0;
+    $self->{'id'} = 0;
     bless ($self, $class);
-    $self->current_user(@_);
+    $self->_get_current_user();
     return $self;
 }
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/NotifyAsComment.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/NotifyAsComment.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/NotifyAsComment.pm	Mon Dec 24 00:27:46 2007
@@ -45,7 +45,7 @@
 # those contributions and any derivatives thereof.
 # 
 # END BPS TAGGED BLOCK }}}
-package RT::ScripAction::NotifyAscomment;
+package RT::ScripAction::NotifyAsComment;
 require RT::ScripAction::Notify;
 
 use strict;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm	Mon Dec 24 00:27:46 2007
@@ -961,7 +961,7 @@
 
 =head1 SEE ALSO
 
-L<RT::ScripAction::Notify>, L<RT::ScripAction::NotifyAscomment> and L<RT::ScripAction::Autoreply>
+L<RT::ScripAction::Notify>, L<RT::ScripAction::NotifyAsComment> and L<RT::ScripAction::Autoreply>
 
 =cut
 

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Test/Web.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Test/Web.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Test/Web.pm	Mon Dec 24 00:27:46 2007
@@ -29,16 +29,15 @@
 
     my $url = $self->rt_base_url;
 
+    $self->get($url."/logout");
     $self->get($url);
-    Test::More::diag( "error: status is ". $self->status )
-        unless $self->status == 200;
-    if ( $self->content =~ qr/Logout/i ) {
-        $self->follow_link( text => 'Logout' );
-    }
 
-    $self->get($url . "?user=$user;pass=$pass");
+    my $moniker = $self->moniker_for('RT::Action::Login');
+
+    $self->fill_in_action( $moniker, email => $user, password => $pass );
+    $self->submit();
     unless ( $self->status == 200 ) {
-        Test::More::diag( "error: status is ". $self->status );
+        Test::More::diag( "error: status is " . $self->status );
         return 0;
     }
     unless ( $self->content =~ qr/Logout/i ) {

Modified: rt/branches/3.999-DANGEROUS/t/web/basic.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/basic.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/web/basic.t	Mon Dec 24 00:27:46 2007
@@ -23,7 +23,7 @@
 
 # follow the link marked "Login"
 #
-my $username = 'root at localhost';
+my $username = 'root';
 my $password = "password";
 
             my $moniker = $agent->moniker_for('RT::Action::Login');

Modified: rt/branches/3.999-DANGEROUS/t/web/custom_frontpage.t
==============================================================================
--- rt/branches/3.999-DANGEROUS/t/web/custom_frontpage.t	(original)
+++ rt/branches/3.999-DANGEROUS/t/web/custom_frontpage.t	Mon Dec 24 00:27:46 2007
@@ -18,7 +18,7 @@
 $user_obj->principal_object->GrantRight(Right => 'CreateSavedSearch');
 $user_obj->principal_object->GrantRight(Right => 'ModifySelf');
 
-ok $m->login( customer => 'customer' ), "logged in";
+ok $m->login( 'customer' => 'customer' ), "logged in";
 
 $m->get ( $url."Search/Build.html");
 


More information about the Rt-commit mailing list