[Bps-public-commit] r10294 - in commitbit: . trunk/lib/CommitBit trunk/lib/CommitBit/Action trunk/lib/CommitBit/Model

jesse at bestpractical.com jesse at bestpractical.com
Sat Jan 12 16:49:29 EST 2008


Author: jesse
Date: Sat Jan 12 16:49:29 2008
New Revision: 10294

Added:
   commitbit/trunk/lib/CommitBit/Action/ResetSvnPassword.pm
Modified:
   commitbit/   (props changed)
   commitbit/trunk/etc/config.yml
   commitbit/trunk/lib/CommitBit/Dispatcher.pm
   commitbit/trunk/lib/CommitBit/Model/User.pm
   commitbit/trunk/lib/CommitBit/View.pm

Log:
 r74891 at pinglin:  jesse | 2008-01-12 14:51:35 -0600
 we can now reset subversion passwords. hurrah.


Modified: commitbit/trunk/etc/config.yml
==============================================================================
--- commitbit/trunk/etc/config.yml	(original)
+++ commitbit/trunk/etc/config.yml	Sat Jan 12 16:49:29 2008
@@ -11,7 +11,7 @@
     RecordBaseClass: Jifty::DBI::Record::Cachable
     User: ''
     Version: 0.0.15
-  DevelMode: 1
+  DevelMode: 0
   L10N: 
     PoDir: share/po
   LogLevel: DEBUG
@@ -20,6 +20,9 @@
   Plugins: 
      - Authentication::Password: {}
      - LetMe: {}
+     - CompressedCSSandJS:
+        - css: 1
+        - js: 1
   Web: 
     BaseURL: http://localhost
     DataDir: var/mason

Added: commitbit/trunk/lib/CommitBit/Action/ResetSvnPassword.pm
==============================================================================
--- (empty file)
+++ commitbit/trunk/lib/CommitBit/Action/ResetSvnPassword.pm	Sat Jan 12 16:49:29 2008
@@ -0,0 +1,22 @@
+use warnings;
+use strict;
+
+package CommitBit::Action::ResetSvnPassword;
+
+use base qw/CommitBit::Action::UpdateUser/;
+
+sub take_action {
+    my $self = shift;
+    warn "HERE!!!";
+    my ($val, $msg) =    $self->record->set_svn_password();
+    if ($val) {
+        $self->result->message(_('Your Subversion password has been changed.'));
+        return 1;
+        
+    } else {
+        $self->result->error(_($msg));
+        return 0;
+    }
+}
+
+1;

Modified: commitbit/trunk/lib/CommitBit/Dispatcher.pm
==============================================================================
--- commitbit/trunk/lib/CommitBit/Dispatcher.pm	(original)
+++ commitbit/trunk/lib/CommitBit/Dispatcher.pm	Sat Jan 12 16:49:29 2008
@@ -46,10 +46,6 @@
         record => Jifty->web->current_user->user_object
 	);
 
-    set 'next' => Jifty->web->request->continuation
-        || Jifty::Continuation->new(
-        request => Jifty::Request->new( path => "/" ) );
-
 };
 
 before qr'^/admin' => run {

Modified: commitbit/trunk/lib/CommitBit/Model/User.pm
==============================================================================
--- commitbit/trunk/lib/CommitBit/Model/User.pm	(original)
+++ commitbit/trunk/lib/CommitBit/Model/User.pm	Sat Jan 12 16:49:29 2008
@@ -3,6 +3,9 @@
 
 package CommitBit::Model::User;
 use Text::Password::Pronounceable;
+our $PASSWORD_GEN = Text::Password::Pronounceable->new(8,10);
+
+
 use Jifty::DBI::Schema;
 
 use CommitBit::Record schema {
@@ -19,10 +22,9 @@
         svn_password => is mandatory,
         since '0.0.10', label is _('Subversion Password'), type is 'varchar',
         default is
-        defer { Text::Password::Pronounceable->generate( 6 => 10 ) },
+        defer { $PASSWORD_GEN->generate() },
         hints is _('This password should be at least six characters'),
-        render as 'password';
-
+        render as 'text';
 };
 
 use Jifty::Plugin::User::Mixin::Model::User;
@@ -37,7 +39,15 @@
 }
 
 
-our $PASSWORD_GEN = Text::Password::Pronounceable->new(8,10);
+sub before_set_svn_password {
+    my $self = shift;
+    my $args_ref = shift;
+
+    $args_ref->{'value'} = $PASSWORD_GEN->generate();
+
+
+
+}
 
 sub create {
     my $self = shift;

Modified: commitbit/trunk/lib/CommitBit/View.pm
==============================================================================
--- commitbit/trunk/lib/CommitBit/View.pm	(original)
+++ commitbit/trunk/lib/CommitBit/View.pm	Sat Jan 12 16:49:29 2008
@@ -384,7 +384,6 @@
 
     p {
         _('Please set a password and nickname.')
-            . _("(For now, you can't touch your email address)");
     };
     with( call => $next, name => "prefbox" ), form {
         render_param( $action => 'email', render_mode => 'read' );
@@ -397,35 +396,33 @@
 };
 
 template prefs => page { title => 'Preferences' } content {
-    my ( $action, $next ) = get( 'action', 'next' );
+    my  $action = get 'action';
 
     div {
         { class is "svn_password" };
         h2 {'Subversion Password'};
         my $reset_svn_pw = Jifty->web->new_action(
-            class  => 'UpdateUser',
+            class  => 'ResetSvnPassword',
+            moniker => 'svnpass',
             record => $action->record
         );
         span {
             { class is "svn_password" };
-            $action->record->svn_password();
+            $reset_svn_pw->record->svn_password();
         };
-        with( call => $next, name => "resetpw" ), form {
+        form {
             form_submit(
                 label  => 'Reset SVN Password',
-                submit => $reset_svn_pw
+                submit => { action => $reset_svn_pw, arguments => { svn_password => 'nonce'}},
             );
         };
     };
     h2 {'Preferences'};
-    p {
-        _(  "Update your password or name. (For now, you can't touch your email address)"
-        );
-    };
+    p { _(  "Update your password or name.") };
     form {
-        render_param( $action => 'email', render_mode => 'read' );
+        render_param( $action => 'email');
         render_param( $action => 'name' );
-        render_param( $action => 'password' );
+        render_param( $action => 'password');
         render_param( $action => 'password_confirm' );
         form_submit( label => 'Save', submit => $action );
     }



More information about the Bps-public-commit mailing list