Author: sevein
Date: Tue Aug 14 15:12:53 2012
New Revision: 12109

Log:
Add --activate option

Modified:
   trunk/lib/task/resetPasswordTask.class.php

Modified: trunk/lib/task/resetPasswordTask.class.php
==============================================================================
--- trunk/lib/task/resetPasswordTask.class.php  Tue Aug 14 15:04:11 2012        
(r12108)
+++ trunk/lib/task/resetPasswordTask.class.php  Tue Aug 14 15:12:53 2012        
(r12109)
@@ -29,7 +29,8 @@
     $this->addOptions(array(
       new sfCommandOption('application', null, 
sfCommandOption::PARAMETER_OPTIONAL, 'The application name', true),
       new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 
'The environment', 'cli'),
-      new sfCommandOption('connection', null, 
sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel')
+      new sfCommandOption('connection', null, 
sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'),
+      new sfCommandOption('activate', null, 
sfCommandOption::PARAMETER_OPTIONAL, 'Activate', false),
     ));
 
     $this->namespace = 'tools';
@@ -64,9 +65,15 @@
       }
 
       $user->setPassword($password);
+
+      if (false !== $options['activate'])
+      {
+        $user->active = true;
+      }
+
       $user->save();
 
-      $this->logSection('reset-password', 'New password: ' . $password);
+      $this->logSection('reset-password', 'New password: '.$password);
     }
     else
     {

-- 
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