Author: sevein
Date: Fri Feb  3 10:06:21 2012
New Revision: 10803

Log:
Set the right field name for the validator

Modified:
   trunk/apps/qubit/modules/user/actions/editAction.class.php
   trunk/apps/qubit/modules/user/actions/passwordEditAction.class.php
   trunk/lib/task/resetPasswordTask.class.php

Modified: trunk/apps/qubit/modules/user/actions/editAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/user/actions/editAction.class.php  Fri Feb  3 
10:00:07 2012        (r10802)
+++ trunk/apps/qubit/modules/user/actions/editAction.class.php  Fri Feb  3 
10:06:21 2012        (r10803)
@@ -93,7 +93,7 @@
         }
         else
         {
-          $this->form->setValidator('confirmPassword', new 
sfValidatorString(array('required' => !isset($this->getRoute()->resource))));
+          $this->form->setValidator('password', new 
sfValidatorString(array('required' => !isset($this->getRoute()->resource))));
         }
 
         $this->form->setWidget('password', new sfWidgetFormInputPassword);

Modified: trunk/apps/qubit/modules/user/actions/passwordEditAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/user/actions/passwordEditAction.class.php  Fri Feb 
 3 10:00:07 2012        (r10802)
+++ trunk/apps/qubit/modules/user/actions/passwordEditAction.class.php  Fri Feb 
 3 10:06:21 2012        (r10803)
@@ -66,7 +66,7 @@
         }
         else
         {
-          $this->form->setValidator('confirmPassword', new 
sfValidatorString(array('required' => !isset($this->getRoute()->resource))));
+          $this->form->setValidator('password', new 
sfValidatorString(array('required' => !isset($this->getRoute()->resource))));
         }
 
         $this->form->setWidget('password', new sfWidgetFormInputPassword);

Modified: trunk/lib/task/resetPasswordTask.class.php
==============================================================================
--- trunk/lib/task/resetPasswordTask.class.php  Fri Feb  3 10:00:07 2012        
(r10802)
+++ trunk/lib/task/resetPasswordTask.class.php  Fri Feb  3 10:06:21 2012        
(r10803)
@@ -22,7 +22,8 @@
   protected function configure()
   {
     $this->addArguments(array(
-      new sfCommandArgument('username', sfCommandArgument::REQUIRED, 
'Username/E-Mail')
+      new sfCommandArgument('username', sfCommandArgument::REQUIRED, 
'Username/E-Mail'),
+      new sfCommandArgument('password', sfCommandArgument::OPTIONAL, 
'Password')
     ));
 
     $this->addOptions(array(
@@ -33,7 +34,7 @@
 
     $this->namespace = 'tools';
     $this->name = 'reset-password';
-    $this->briefDescription = 'Generates a new password for a given username 
or e-mail address';
+    $this->briefDescription = 'Generates or set a new password for a given 
username or e-mail address';
     $this->detailedDescription = <<<EOF
 FIXME
 EOF;
@@ -53,7 +54,15 @@
     // User account exists?
     if ($user !== null)
     {
-      $password = $this->generatePassword();
+      if (isset($arguments['password']))
+      {
+        $password = $arguments['password'];
+      }
+      else
+      {
+        $password = $this->generatePassword();
+      }
+
       $user->setPassword($password);
       $user->save();
 

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/qubit-commits?hl=en.

Reply via email to