|
From: <gem...@li...> - 2012-03-22 15:42:42
|
Revision: 561
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=561&view=rev
Author: matijsdejong
Date: 2012-03-22 15:42:31 +0000 (Thu, 22 Mar 2012)
Log Message:
-----------
Moved ChangePasswordForm.php to separate Form
Reset password action/button for StaffAction instead of staff in-Form password edit
new AutoLoadFormAbstract.php
Updated translations
Modified Paths:
--------------
trunk/library/classes/Gems/Default/OptionAction.php
trunk/library/classes/Gems/Default/StaffAction.php
trunk/library/classes/Gems/Form.php
trunk/library/classes/Gems/Menu/MenuAbstract.php
trunk/library/classes/Gems/Menu.php
trunk/library/classes/Gems/User/Form/LoginForm.php
trunk/library/classes/Gems/User/User.php
trunk/library/classes/Gems/User/UserLoader.php
trunk/library/languages/default-en.mo
trunk/library/languages/default-en.po
trunk/library/languages/default-nl.mo
trunk/library/languages/default-nl.po
Added Paths:
-----------
trunk/library/classes/Gems/Form/AutoLoadFormAbstract.php
trunk/library/classes/Gems/User/Form/ChangePasswordForm.php
Modified: trunk/library/classes/Gems/Default/OptionAction.php
===================================================================
--- trunk/library/classes/Gems/Default/OptionAction.php 2012-03-22 11:04:04 UTC (rev 560)
+++ trunk/library/classes/Gems/Default/OptionAction.php 2012-03-22 15:42:31 UTC (rev 561)
@@ -75,6 +75,8 @@
{
$user = $this->loader->getCurrentUser();
+ $this->html->h3($this->_('Change password'));
+
if (! $user->canSetPassword()) {
$this->addMessage($this->_('You are not allowed to change your password.'));
return;
@@ -83,59 +85,27 @@
/*************
* Make form *
*************/
- $form = $user->getPasswordChangeForm();
+ $form = $user->getChangePasswordForm(array('showReport' => false));
- // Show password info
- if ($info = $user->reportPasswordWeakness()) {
- $element = new MUtil_Form_Element_Html('rules');
- $element->setLabel($this->_('Password rules'));
-
- if (1 == count($info)) {
- $element->div(sprintf($this->_('A password %s.'), reset($info)));
- } else {
- foreach ($info as &$line) {
- $line .= ',';
- }
- $line[strlen($line) - 1] = '.';
-
- $element->div($this->_('A password:'))->ul($info);
- }
- $form->addElement($element);
- }
-
/****************
* Process form *
****************/
if ($this->_request->isPost() && $form->isValid($_POST, false)) {
- $user->setPassword($_POST['new_password']);
-
$this->addMessage($this->_('New password is active.'));
$this->_reroute(array($this->getRequest()->getActionKey() => 'edit'));
-
} else {
- if (isset($_POST['old_password'])) {
- if ($_POST['old_password'] === strtoupper($_POST['old_password'])) {
- $this->addMessage($this->_('Caps Lock seems to be on!'));
- }
- }
- $form->populate($_POST);
+ $this->addMessage($form->getErrorMessages());
}
/****************
* Display form *
****************/
- $table = new MUtil_Html_TableElement(array('class' => 'formTable'));
- $table->setAsFormLayout($form, true, true);
- $table['tbody'][0][0]->class = 'label'; // Is only one row with formLayout, so all in output fields get class.
-
if ($user->isPasswordResetRequired()) {
$this->menu->setVisible(false);
- } elseif ($links = $this->createMenuLinks()) {
- $table->tf(); // Add empty cell, no label
- $linksCell = $table->tf($links);
+ } else {
+ $form->addButtons($this->createMenuLinks());
}
- $this->html->h3($this->_('Change password'));
$this->html[] = $form;
}
Modified: trunk/library/classes/Gems/Default/StaffAction.php
===================================================================
--- trunk/library/classes/Gems/Default/StaffAction.php 2012-03-22 11:04:04 UTC (rev 560)
+++ trunk/library/classes/Gems/Default/StaffAction.php 2012-03-22 15:42:31 UTC (rev 561)
@@ -1,4 +1,5 @@
<?php
+
/**
* Copyright (c) 2011, Erasmus MC
* All rights reserved.
@@ -103,22 +104,9 @@
}
$dbLookup = $this->util->getDbLookup();
- $passwordField = false;
-
- //@@TODO Like this? should work when user is not saved, but storing the password should be done when
- //we do have a user...
- $definition = $this->loader->getUserLoader()->getUserDefinition($data['gul_user_class'].'Definition');
-
- if ($definition->canSetPassword()) {
- $passwordField = 'fld_password';
- }
-
$model->set('gsf_id_primary_group', 'multiOptions', MUtil_Lazy::call($dbLookup->getAllowedStaffGroups));
if ($new) {
$model->set('gsf_id_primary_group', 'default', $dbLookup->getDefaultGroup());
- } elseif ($passwordField) {
- $model->set($passwordField, 'description', $this->_('Enter only when changing'));
- $model->setSaveWhenNotNull($passwordField);
}
$ucfirst = new Zend_Filter_Callback('ucfirst');
@@ -129,12 +117,12 @@
//@@TODO: Think of a better way to allow multiple methods per organization
if ($this->escort->hasPrivilege('pr.staff.edit.all')) {
$model->set('gul_user_class', 'label', $this->_('User Definition'));
-
+
//Make sure old or experimental userdefinitions don't have to be changed to something that is
//allowed at the moment. For example the oldStaffUser can stay when editing a user.
$options = $model->get('gul_user_class', 'multiOptions');
- if (!array_key_exists($data['gul_user_class'], $options)) {
- $options[$data['gul_user_class']] = $this->_('Unsupported UserDefinition');
+ if (! array_key_exists($data['gul_user_class'], $options)) {
+ $options[$data['gul_user_class']] = $this->_('Unsupported User Definition');
$model->set('gul_user_class', 'multiOptions', $options);
}
$bridge->add('gul_user_class');
@@ -154,19 +142,6 @@
$bridge->addExhibitor('gsf_id_organization');
}
- if ($passwordField) {
- $pwdElem = $bridge->addPassword($passwordField,
- 'label', $this->_('Password'),
- // 'renderPassword', true,
- 'repeatLabel', $this->_('Repeat password'),
- 'required', $new,
- 'size', 15
- );
-
- if ($user instanceof Gems_User_User) {
- $pwdElem->addValidator(new Gems_User_UserNewPasswordValidator($user));
- }
- }
$bridge->addRadio( 'gsf_gender', 'separator', '');
$bridge->addText( 'gsf_first_name', 'label', $this->_('First name'));
$bridge->addFilter( 'gsf_first_name', $ucfirst);
@@ -212,7 +187,7 @@
public function createAction()
{
$this->html->h3(sprintf($this->_('New %s...'), $this->getTopic()));
-
+
$confirmed = $this->getRequest()->getParam('confirmed');
$id = $this->getRequest()->getParam('id');
if (!is_null($confirmed)) {
@@ -364,7 +339,7 @@
if (!isset($filter['gsf_id_organization']) || empty($filter['gsf_id_organization'])) {
$filter['gsf_id_organization'] = $this->loader->getCurrentUser()->getCurrentOrganizationId();
}
-
+
return $filter;
}
@@ -407,7 +382,7 @@
//Make sure the menu always has the gsd_id_organization parameter
$orgId = $this->getRequest()->getParam('gsf_id_organization');
-
+
if (is_null($orgId)) {
//Get the selected gsf_id_organization used in the index
$dataIdx = $this->getCachedRequestData(true, 'index', true);
@@ -416,4 +391,46 @@
$this->menu->getParameterSource()->offsetSet('gsf_id_organization', $orgId);
}
+
+ /**
+ * Action to allow password reset
+ */
+ public function resetAction()
+ {
+ $staff_id = $this->_getIdParam();
+ $user = $this->loader->getUserLoader()->getUserByStaffId($staff_id);
+
+ $this->html->h3(sprintf($this->_('Reset password for: %s'), $user->getFullName()));
+
+ if (! $user->canSetPassword()) {
+ $this->addMessage($this->_('You are not allowed to change this password.'));
+ return;
+ }
+
+ /*************
+ * Make form *
+ *************/
+ $form = $user->getChangePasswordForm(array('askOld' => false));
+
+ /****************
+ * Process form *
+ ****************/
+ if ($this->_request->isPost() && $form->isValid($_POST, false)) {
+ $this->addMessage($this->_('New password is active.'));
+ $this->_reroute(array($this->getRequest()->getActionKey() => 'show'));
+ } else {
+ $this->addMessage($form->getErrorMessages());
+ }
+
+ /****************
+ * Display form *
+ ****************/
+ if ($user->isPasswordResetRequired()) {
+ $this->menu->setVisible(false);
+ } else {
+ $form->addButtons($this->createMenuLinks());
+ }
+
+ $this->html[] = $form;
+ }
}
Added: trunk/library/classes/Gems/Form/AutoLoadFormAbstract.php
===================================================================
--- trunk/library/classes/Gems/Form/AutoLoadFormAbstract.php (rev 0)
+++ trunk/library/classes/Gems/Form/AutoLoadFormAbstract.php 2012-03-22 15:42:31 UTC (rev 561)
@@ -0,0 +1,102 @@
+<?php
+
+/**
+ * Copyright (c) 2011, Erasmus MC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Erasmus MC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * @package Gems
+ * @subpackage Form
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @version $Id$
+ */
+
+/**
+ * Adds default element loading to standard form
+ *
+ * @package Gems
+ * @subpackage Form
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.5.3
+ */
+abstract class Gems_Form_AutoLoadFormAbstract extends Gems_Form
+{
+ /**
+ * When true all elements are loaded after initiation.
+ *
+ * @var boolean
+ */
+ protected $loadDefault = true;
+
+ /**
+ * Should be called after answering the request to allow the Target
+ * to check if all required registry values have been set correctly.
+ *
+ * @return boolean False if required values are missing.
+ */
+ public function checkRegistryRequestsAnswers()
+ {
+ if ($this->loadDefault) {
+ $this->loadDefaultElements();
+ }
+
+ return true;
+ }
+
+ /**
+ * When true all elements are loaded after initiation.
+ *
+ * @return boolean $loadDefault
+ */
+ public function getLoadDefault($loadDefault = true)
+ {
+ return $this->loadDefault;
+ }
+
+ /**
+ * The function loads the elements for this form
+ *
+ * @return Gems_Form_AutoLoadFormAbstract (continuation pattern)
+ */
+ abstract public function loadDefaultElements();
+
+ /**
+ * When true all elements are loaded after initiation.
+ *
+ * Enables loading of parameter through Zend_Form::__construct()
+ *
+ * @param boolean $loadDefault
+ * @return Gems_User_Form_LoginForm (continuation pattern)
+ */
+ public function setLoadDefault($loadDefault = true)
+ {
+ $this->loadDefault = $loadDefault;
+
+ return $this;
+ }
+}
Modified: trunk/library/classes/Gems/Form.php
===================================================================
--- trunk/library/classes/Gems/Form.php 2012-03-22 11:04:04 UTC (rev 560)
+++ trunk/library/classes/Gems/Form.php 2012-03-22 15:42:31 UTC (rev 561)
@@ -1,4 +1,5 @@
<?php
+
/**
* Copyright (c) 2011, Erasmus MC
* All rights reserved.
@@ -33,7 +34,7 @@
*/
/**
- * Base form class
+ * Base form class with extensions for correct load paths, autosubmit forms and registry use.
*
* @package Gems
* @subpackage Form
Modified: trunk/library/classes/Gems/Menu/MenuAbstract.php
===================================================================
--- trunk/library/classes/Gems/Menu/MenuAbstract.php 2012-03-22 11:04:04 UTC (rev 560)
+++ trunk/library/classes/Gems/Menu/MenuAbstract.php 2012-03-22 15:42:31 UTC (rev 561)
@@ -386,13 +386,14 @@
$page->addAutofilterAction();
$createPage = $page->addCreateAction();
$page->addShowAction();
- $editPage = $page->addEditAction();
- $delPage = $page->addDeleteAction();
+ $pages[] = $page->addEditAction();
+ $pages[] = $page->addAction($this->_('Reset password'), 'pr.staff.edit', 'reset')->setModelParameters(1);
+ $pages[] = $page->addDeleteAction();
if (! $this->escort->hasPrivilege('pr.staff.edit.all')) {
$filter = array_keys($this->escort->loader->getCurrentUser()->getAllowedOrganizations());
- $createPage->setParameterFilter('gsf_id_organization', $filter);
- $editPage->setParameterFilter('gsf_id_organization', $filter);
- $delPage->setParameterFilter('gsf_id_organization', $filter);
+ foreach ($pages as $sub_page) {
+ $sub_page->setParameterFilter('gsf_id_organization', $filter);
+ }
}
return $page;
Modified: trunk/library/classes/Gems/Menu.php
===================================================================
--- trunk/library/classes/Gems/Menu.php 2012-03-22 11:04:04 UTC (rev 560)
+++ trunk/library/classes/Gems/Menu.php 2012-03-22 15:42:31 UTC (rev 561)
@@ -203,7 +203,7 @@
$setup->addBrowsePage($this->_('Organizations'),'pr.organization', 'organization');
// STAFF CONTROLLER
- $setup->addStaffPage($this->_('Staff'));
+ $page = $setup->addStaffPage($this->_('Staff'));
// LOG CONTROLLER
$page = $setup->addPage($this->_('Logging'), 'pr.log', 'log', 'index');
Added: trunk/library/classes/Gems/User/Form/ChangePasswordForm.php
===================================================================
--- trunk/library/classes/Gems/User/Form/ChangePasswordForm.php (rev 0)
+++ trunk/library/classes/Gems/User/Form/ChangePasswordForm.php 2012-03-22 15:42:31 UTC (rev 561)
@@ -0,0 +1,414 @@
+<?php
+
+/**
+ * Copyright (c) 2012, Erasmus MC
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are met:
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * * Neither the name of Erasmus MC nor the
+ * names of its contributors may be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ *
+ * @package Gems
+ * @subpackage User
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @version $id: LoginForm.php 203 2012-01-01t 12:51:32Z matijs $
+ */
+
+/**
+ *
+ *
+ * @package Gems
+ * @subpackage User
+ * @copyright Copyright (c) 2012 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.5
+ */
+class Gems_User_Form_ChangePasswordForm extends Gems_Form_AutoLoadFormAbstract
+{
+ /**
+ * The field name for the new password element.
+ *
+ * @var string
+ */
+ protected $_newPasswordFieldName = 'new_password';
+
+ /**
+ * The field name for the old password element.
+ *
+ * @var string
+ */
+ protected $_oldPasswordFieldName = 'old_password';
+
+ /**
+ * The field name for the repeat password element.
+ *
+ * @var string
+ */
+ protected $_repeatPasswordFieldName = 'repeat_password';
+
+ /**
+ * The field name for the report rules element.
+ *
+ * @var string
+ */
+ protected $_reportRulesFieldName = 'report_rules';
+
+ /**
+ * The field name for the submit element.
+ *
+ * @var string
+ */
+ protected $_submitFieldName = 'submit';
+
+ /**
+ * Layout table
+ *
+ * @var MUtil_Html_TableElements
+ */
+ protected $_table;
+
+ /**
+ * Should the old password be requested.
+ *
+ * Calculated when null
+ *
+ * @var boolean
+ */
+ protected $askOld = null;
+
+ /**
+ * Should the password rules be reported.
+ *
+ * @var boolean
+ */
+ protected $reportRules = true;
+
+ /**
+ *
+ * @var Zend_Translate
+ */
+ protected $translate;
+
+ /**
+ *
+ * @var Gems_User_User
+ */
+ protected $user;
+
+ /**
+ * Use the default form table layout
+ *
+ * @var boolean
+ */
+ protected $useTableLayout = true;
+
+ public function addButtons($links)
+ {
+ if ($links && $this->_table) {
+ $this->_table->tf(); // Add empty cell, no label
+ $this->_table->tf($links);
+ }
+ }
+
+ /**
+ * Should the for asking for an old password
+ *
+ * @return boolean
+ */
+ public function getAskOld()
+ {
+ if (null === $this->askOld) {
+ // By default only ask for the old password if the user just entered
+ // it but is required to change it.
+ $this->askOld = (! $this->user->isPasswordResetRequired());
+ }
+
+ // Never ask for the old password if it does not exist
+ //
+ // A password does not always exist, e.g. when using embedded login in Pulse
+ // or after creating a new user.
+ return $this->askOld && $this->user->hasPassword();
+ }
+
+ /**
+ * Returns/sets a mew password element.
+ *
+ * @return Zend_Form_Element_Password
+ */
+ public function getNewPasswordElement()
+ {
+ $element = $this->getElement($this->_newPasswordFieldName);
+
+ if (! $element) {
+ // Field new password
+ $element = new Zend_Form_Element_Password($this->_newPasswordFieldName);
+ $element->setLabel($this->translate->_('New password'));
+ $element->setAttrib('size', 10);
+ $element->setAttrib('maxlength', 20);
+ $element->setRequired(true);
+ $element->setRenderPassword(true);
+ $element->addValidator(new Gems_User_UserNewPasswordValidator($this->user));
+ $element->addValidator(new MUtil_Validate_IsConfirmed($this->_repeatPasswordFieldName, $this->translate->_('Repeat password')));
+
+ $this->addElement($element);
+ }
+
+ return $element;
+ }
+
+ /**
+ * Returns/sets a check old password element.
+ *
+ * @return Zend_Form_Element_Password
+ */
+ public function getOldPasswordElement()
+ {
+ $element = $this->getElement($this->_oldPasswordFieldName);
+
+ if (! $element) {
+ // Field current password
+ $element = new Zend_Form_Element_Password($this->_oldPasswordFieldName);
+ $element->setLabel($this->translate->_('Current password'));
+ $element->setAttrib('size', 10);
+ $element->setAttrib('maxlength', 20);
+ $element->setRenderPassword(true);
+ $element->setRequired(true);
+ $element->addValidator(new Gems_User_UserPasswordValidator($this->user, $this->translate));
+
+ $this->addElement($element);
+ }
+
+ return $element;
+ }
+
+ /**
+ * Returns/sets a repeat password element.
+ *
+ * @return Zend_Form_Element_Password
+ */
+ public function getRepeatPasswordElement()
+ {
+ $element = $this->getElement($this->_repeatPasswordFieldName);
+
+ if (! $element) {
+ // Field repeat password
+ $element = new Zend_Form_Element_Password($this->_repeatPasswordFieldName);
+ $element->setLabel($this->translate->_('Repeat password'));
+ $element->setAttrib('size', 10);
+ $element->setAttrib('maxlength', 20);
+ $element->setRequired(true);
+ $element->setRenderPassword(true);
+ $element->addValidator(new MUtil_Validate_IsConfirmed($this->_newPasswordFieldName, $this->translate->_('New password')));
+
+ $this->addElement($element);
+ }
+
+ return $element;
+ }
+
+ /**
+ * Returns/sets an element showing the password rules
+ *
+ * @return MUtil_Form_Element_Html
+ */
+ public function getReportRulesElement()
+ {
+ $element = $this->getElement($this->_reportRulesFieldName);
+
+ if (! $element) {
+ // Show password info
+ if ($info = $this->user->reportPasswordWeakness()) {
+ $element = new MUtil_Form_Element_Html($this->_reportRulesFieldName);
+ $element->setLabel($this->translate->_('Password rules'));
+
+ if (1 == count($info)) {
+ $element->div(sprintf($this->translate->_('A password %s.'), reset($info)));
+ } else {
+ foreach ($info as &$line) {
+ $line .= ';';
+ }
+ $line[strlen($line) - 1] = '.';
+
+ $element->div($this->translate->_('A password:'))->ul($info);
+ }
+ $this->addElement($element);
+ }
+ }
+
+ return $element;
+ }
+
+ /**
+ * Returns/sets a submit button.
+ *
+ * @param string $label
+ * @return Zend_Form_Element_Submit
+ */
+ public function getSubmitButton($label = null)
+ {
+ $element = $this->getElement($this->_submitFieldName);
+
+ if (! $element) {
+ // Submit knop
+ $element = new Zend_Form_Element_Submit($this->_submitFieldName);
+ $element->setLabel(null === $label ? $this->translate->_('Save') : $label);
+ $element->setAttrib('class', 'button');
+
+ $this->addElement($element);
+ }
+
+ return $element;
+ }
+
+ /**
+ * Validate the form
+ *
+ * As it is better for translation utilities to set the labels etc. translated,
+ * the MUtil default is to disable translation.
+ *
+ * However, this also disables the translation of validation messages, which we
+ * cannot set translated. The MUtil form is extended so it can make this switch.
+ *
+ * @param array $data
+ * @param boolean $disableTranslateValidators Extra switch
+ * @return boolean
+ */
+ public function isValid($data, $disableTranslateValidators = null)
+ {
+ $valid = parent::isValid($data, $disableTranslateValidators);
+
+ if ($valid) {
+ $this->user->setPassword($data['new_password']);
+
+ } else {
+ if ($this ->getAskOld() && isset($data['old_password'])) {
+ if ($data['old_password'] === strtoupper($data['old_password'])) {
+ $this->addError($this->translate->_('Caps Lock seems to be on!'));
+ }
+ }
+ $this->populate($data);
+ }
+
+ return $valid;
+ }
+
+ /**
+ * The function that determines the element load order
+ *
+ * @return Gems_User_Form_LoginForm (continuation pattern)
+ */
+ public function loadDefaultElements()
+ {
+ if ($this->getAskOld()) {
+ $this->getOldPasswordElement();
+ }
+ $this->getNewPasswordElement();
+ $this->getRepeatPasswordElement();
+ $this->getSubmitButton();
+
+ if ($this->reportRules) {
+ $this->getReportRulesElement();
+ }
+ if ($this->useTableLayout) {
+ /****************
+ * Display form *
+ ****************/
+ $this->_table = new MUtil_Html_TableElement(array('class' => 'formTable'));
+ $this->_table->setAsFormLayout($this, true, true);
+ $this->_table['tbody'][0][0]->class = 'label'; // Is only one row with formLayout, so all in output fields get class.
+ }
+
+ return $this;
+ }
+
+ /**
+ * Should the form ask for an old password
+ *
+ * Enables loading of parameter through Zend_Form::__construct()
+ *
+ * @param boolean $askOld
+ * @return Gems_User_Form_ChangePasswordForm (continuation pattern)
+ */
+ public function setAskOld($askOld = true)
+ {
+ $this->askOld = $askOld;
+
+ return $this;
+ }
+
+ /**
+ * Should the form report the password rules
+ *
+ * Enables loading of parameter through Zend_Form::__construct()
+ *
+ * @param boolean $reportRules
+ * @return Gems_User_Form_ChangePasswordForm (continuation pattern)
+ */
+ public function setReportRules($reportRules = true)
+ {
+ $this->reportRules = $reportRules;
+
+ return $this;
+ }
+
+ /**
+ * The user to change the password for
+ *
+ * Enables loading of parameter through Zend_Form::__construct()
+ *
+ * @param Gems_User_User $user
+ * @return Gems_User_Form_ChangePasswordForm (continuation pattern)
+ */
+ public function setUser(Gems_User_User $user)
+ {
+ $this->user = $user;
+
+ return $this;
+ }
+
+ /**
+ * Should the form report use the default form table layout
+ *
+ * Enables loading of parameter through Zend_Form::__construct()
+ *
+ * @param boolean $useTableLayout
+ * @return Gems_User_Form_ChangePasswordForm (continuation pattern)
+ */
+ public function setUseTableLayout($useTableLayout = true)
+ {
+ $this->useTableLayout = $useTableLayout;
+
+ return $this;
+ }
+
+ /**
+ * True when this form was submitted.
+ *
+ * @return boolean
+ */
+ public function wasSubmitted()
+ {
+ return $this->getSubmitButton()->isChecked();
+ }
+}
Modified: trunk/library/classes/Gems/User/Form/LoginForm.php
===================================================================
--- trunk/library/classes/Gems/User/Form/LoginForm.php 2012-03-22 11:04:04 UTC (rev 560)
+++ trunk/library/classes/Gems/User/Form/LoginForm.php 2012-03-22 15:42:31 UTC (rev 561)
@@ -44,7 +44,7 @@
* @license New BSD License
* @since Class available since version 1.5
*/
-class Gems_User_Form_LoginForm extends Gems_Form
+class Gems_User_Form_LoginForm extends Gems_Form_AutoLoadFormAbstract
{
/**
* The field name for the lost password element.
@@ -97,14 +97,7 @@
protected $_usernameFieldName = 'userlogin';
/**
- * When true all elements are loaded after initiation.
*
- * @var boolean
- */
- protected $loadDefault = true;
-
- /**
- *
* @var Gems_Loader
*/
protected $loader;
@@ -151,21 +144,6 @@
protected $util;
/**
- * Should be called after answering the request to allow the Target
- * to check if all required registry values have been set correctly.
- *
- * @return boolean False if required values are missing.
- */
- public function checkRegistryRequestsAnswers()
- {
- if ($this->loadDefault) {
- $this->loadDefaultElements();
- }
-
- return true;
- }
-
- /**
* Returns the organization id that should currently be used for this form.
*
* @return int Returns the current organization id, if any
@@ -406,21 +384,6 @@
}
/**
- * When true all elements are loaded after initiation.
- *
- * Enables loading of parameter through Zend_Form::__construct()
- *
- * @param boolean $loadDefault
- * @return Gems_User_Form_LoginForm (continuation pattern)
- */
- public function setLoadDefault($loadDefault = true)
- {
- $this->loadDefault = $loadDefault;
-
- return $this;
- }
-
- /**
* For small numbers of organizations a multiline selectbox will be nice. This
* setting handles how many lines will display at once. Use 1 for the normal
* dropdown selectbox
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-03-22 11:04:04 UTC (rev 560)
+++ trunk/library/classes/Gems/User/User.php 2012-03-22 15:42:31 UTC (rev 561)
@@ -384,6 +384,21 @@
}
/**
+ * Returns a form to change the possword for this user.
+ *
+ * @param boolean $askOld Ask for the old password, calculated when not set.
+ * @return Gems_Form
+ */
+ public function getChangePasswordForm($args_array = null)
+ {
+ if (! $this->canSetPassword()) {
+ return;
+ }
+
+ return $this->userLoader->getChangePasswordForm($this, func_get_args());
+ }
+
+ /**
* Returns the organization that is currently used by this user.
*
* @return Gems_User_Organization
@@ -521,72 +536,6 @@
}
/**
- * Returns a form to change the possword for this user.
- *
- * @param boolean $askOld Ask for the old password, calculated when not set.
- * @return Gems_Form
- */
- public function getPasswordChangeForm($askOld = null)
- {
- if (! $this->canSetPassword()) {
- return;
- }
-
- if (null === $askOld) {
- // By default only ask for the old password if the user just entered
- // it but is required to change it.
- $askOld = (! $this->isPasswordResetRequired());
- }
-
- $form = new Gems_Form();
-
- // Never ask for the old password if it does not exist
- //
- // A password does not always exist, e.g. when using embedded login in Pulse
- // or after creating a new user.
- if ($askOld && $this->hasPassword()) {
- // Field current password
- $element = new Zend_Form_Element_Password('old_password');
- $element->setLabel($this->translate->_('Current password'));
- $element->setAttrib('size', 10);
- $element->setAttrib('maxlength', 20);
- $element->setRenderPassword(true);
- $element->setRequired(true);
- $element->addValidator(new Gems_User_UserPasswordValidator($this, $this->translate));
- $form->addElement($element);
- }
-
- // Field new password
- $element = new Zend_Form_Element_Password('new_password');
- $element->setLabel($this->translate->_('New password'));
- $element->setAttrib('size', 10);
- $element->setAttrib('maxlength', 20);
- $element->setRequired(true);
- $element->setRenderPassword(true);
- $element->addValidator(new Gems_User_UserNewPasswordValidator($this));
- $element->addValidator(new MUtil_Validate_IsConfirmed('repeat_password', $this->translate->_('Repeat password')));
- $form->addElement($element);
-
- // Field repeat password
- $element = new Zend_Form_Element_Password('repeat_password');
- $element->setLabel($this->translate->_('Repeat password'));
- $element->setAttrib('size', 10);
- $element->setAttrib('maxlength', 20);
- $element->setRequired(true);
- $element->setRenderPassword(true);
- $element->addValidator(new MUtil_Validate_IsConfirmed('new_password', $this->translate->_('New password')));
- $form->addElement($element);
-
- // Submit button
- $element = new Zend_Form_Element_Submit('submit');
- $element->setAttrib('class', 'button');
- $element->setLabel($this->translate->_('Save'));
- $form->addElement($element);
-
- return $form;
- }
-
- /**
* Return a password reset key
*
* @return string
Modified: trunk/library/classes/Gems/User/UserLoader.php
===================================================================
--- trunk/library/classes/Gems/User/UserLoader.php 2012-03-22 11:04:04 UTC (rev 560)
+++ trunk/library/classes/Gems/User/UserLoader.php 2012-03-22 15:42:31 UTC (rev 561)
@@ -200,6 +200,22 @@
}
/**
+ * Returns a change password form for this user
+ *
+ * @param Gems_user_User $user
+ * @param mixed $args_array MUtil_Ra::args array for LoginForm initiation.
+ * @return Gems_User_Form_ChangePasswordForm
+ */
+ public function getChangePasswordForm($user, $args_array = null)
+ {
+ $args = MUtil_Ra::args(func_get_args(), array('user' => 'Gems_User_User'));
+
+ $form = $this->_loadClass('Form_ChangePasswordForm', true, array($args));
+
+ return $form;
+ }
+
+ /**
* Get the currently loggin in user
*
* @return Gems_User_User
@@ -225,7 +241,7 @@
* @param mixed $args_array MUtil_Ra::args array for LoginForm initiation.
* @return Gems_User_Form_LoginForm
*/
- public function getLoginForm($args_array)
+ public function getLoginForm($args_array = null)
{
$args = MUtil_Ra::args(func_get_args());
@@ -372,7 +388,7 @@
}
/**
- * Returns a select statement to find a corresponding user.
+ * Returns a select statement to find a corresponding user.
*
* @param string $login_name
* @param int $organization
Modified: trunk/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-en.po
===================================================================
--- trunk/library/languages/default-en.po 2012-03-22 11:04:04 UTC (rev 560)
+++ trunk/library/languages/default-en.po 2012-03-22 15:42:31 UTC (rev 561)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: Pulse EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-16 16:16+0100\n"
+"POT-Creation-Date: 2012-03-22 16:35+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -1042,7 +1042,7 @@
msgstr "%s records found."
#: classes/Gems/Default/ExportAction.php:172
-#: classes/Gems/Default/IndexAction.php:203
+#: classes/Gems/Default/IndexAction.php:220
#: classes/Gems/Default/LogAction.php:197
msgid "Organization"
msgstr "Organization"
@@ -1082,84 +1082,84 @@
msgid "Enter your token..."
msgstr "Enter your token..."
-#: classes/Gems/Default/IndexAction.php:148
+#: classes/Gems/Default/IndexAction.php:157
#, php-format
msgid "Login to %s application"
msgstr "Login to %s application"
-#: classes/Gems/Default/IndexAction.php:152
+#: classes/Gems/Default/IndexAction.php:169
msgid "Login"
msgstr "Login"
-#: classes/Gems/Default/IndexAction.php:174
+#: classes/Gems/Default/IndexAction.php:191
msgid "Back to login"
msgstr "Back to login"
-#: classes/Gems/Default/IndexAction.php:227
+#: classes/Gems/Default/IndexAction.php:244
msgid "Password"
msgstr "Password"
-#: classes/Gems/Default/IndexAction.php:242
+#: classes/Gems/Default/IndexAction.php:259
#, php-format
msgid "Reset password for %s application"
msgstr "Reset password for %s application"
-#: classes/Gems/Default/IndexAction.php:246
+#: classes/Gems/Default/IndexAction.php:263
msgid "Reset password"
msgstr "Reset password"
-#: classes/Gems/Default/IndexAction.php:292
+#: classes/Gems/Default/IndexAction.php:309
msgid "Username"
msgstr "Username"
-#: classes/Gems/Default/IndexAction.php:358
+#: classes/Gems/Default/IndexAction.php:351
msgid "Your password must be changed."
msgstr "Your password must be changed."
-#: classes/Gems/Default/IndexAction.php:370
+#: classes/Gems/Default/IndexAction.php:363
#, php-format
msgid "Login successful, welcome %s."
msgstr "Login successful, welcome %s."
-#: classes/Gems/Default/IndexAction.php:410
+#: classes/Gems/Default/IndexAction.php:403
#, php-format
msgid "Good bye: %s."
msgstr "Good bye: %s."
-#: classes/Gems/Default/IndexAction.php:435
+#: classes/Gems/Default/IndexAction.php:428
msgid "Reset accepted, enter your new password."
msgstr "Reset accepted, enter your new password."
-#: classes/Gems/Default/IndexAction.php:439
+#: classes/Gems/Default/IndexAction.php:432
msgid "This key timed out or does not belong to this user."
msgstr "This key timed out or does not belong to this user."
-#: classes/Gems/Default/IndexAction.php:462
+#: classes/Gems/Default/IndexAction.php:455
msgid "Password reset requested"
msgstr "Password reset requested"
-#: classes/Gems/Default/IndexAction.php:463
+#: classes/Gems/Default/IndexAction.php:456
#, php-format
msgid "To reset your password for %s, please click this link: %s"
msgstr "To reset your password for %s, please click this link: %s"
-#: classes/Gems/Default/IndexAction.php:468
+#: classes/Gems/Default/IndexAction.php:461
msgid "We sent you an e-mail with a reset link. Click on the link in the e-mail."
msgstr "We sent you an e-mail with a reset link. Click on the link in the e-mail."
-#: classes/Gems/Default/IndexAction.php:470
+#: classes/Gems/Default/IndexAction.php:463
msgid "Unable to send e-mail."
msgstr "Unable to send e-mail."
-#: classes/Gems/Default/IndexAction.php:475
+#: classes/Gems/Default/IndexAction.php:468
msgid "No such user found or no e-mail address known or user cannot be reset."
msgstr "No such user found or no e-mail address known or user cannot be reset."
-#: classes/Gems/Default/IndexAction.php:479
+#: classes/Gems/Default/IndexAction.php:472
msgid "We received your password reset key."
msgstr "We received your password reset key."
-#: classes/Gems/Default/IndexAction.php:480
+#: classes/Gems/Default/IndexAction.php:473
msgid "Please enter the organization and username belonging to this key."
msgstr "Please enter the organization and username belonging to this key."
@@ -1440,13 +1440,11 @@
#: classes/Gems/Default/MailServerAction.php:90
#: classes/Gems/Default/SourceAction.php:95
-#: classes/Gems/Default/StaffAction.php:161
msgid "Repeat password"
msgstr "Repeat password"
#: classes/Gems/Default/MailServerAction.php:91
#: classes/Gems/Default/SourceAction.php:74
-#: classes/Gems/Default/StaffAction.php:120
msgid "Enter only when changing"
msgstr "Enter only when changing the password"
@@ -1461,8 +1459,8 @@
msgstr "Email servers"
#: classes/Gems/Default/MailTemplateAction.php:76
-#: classes/Gems/Default/StaffAction.php:303
-#: classes/Gems/Default/StaffAction.php:336
+#: classes/Gems/Default/StaffAction.php:278
+#: classes/Gems/Default/StaffAction.php:311
msgid "(all organizations)"
msgstr "(all organizations)"
@@ -1476,56 +1474,40 @@
msgid "Email templates"
msgstr "Email templates"
-#: classes/Gems/Default/OptionAction.php:79
+#: classes/Gems/Default/OptionAction.php:81
msgid "You are not allowed to change your password."
msgstr "You are not allowed to change your password."
-#: classes/Gems/Default/OptionAction.php:91
-msgid "Password rules"
-msgstr "Password rules"
-
#: classes/Gems/Default/OptionAction.php:94
-#, php-format
-msgid "A password %s."
-msgstr "A password %s."
-
-#: classes/Gems/Default/OptionAction.php:101
-msgid "A password:"
-msgstr "A password:"
-
-#: classes/Gems/Default/OptionAction.php:112
+#: classes/Gems/Default/StaffAction.php:419
msgid "New password is active."
msgstr "New password is active."
-#: classes/Gems/Default/OptionAction.php:118
-msgid "Caps Lock seems to be on!"
-msgstr "Caps Lock seems to be on!"
-
-#: classes/Gems/Default/OptionAction.php:158
+#: classes/Gems/Default/OptionAction.php:128
msgid "Login Name"
msgstr "Login Name"
-#: classes/Gems/Default/OptionAction.php:165
+#: classes/Gems/Default/OptionAction.php:135
#: classes/Gems/Default/OrganizationAction.php:129
#: classes/Gems/Default/RespondentAction.php:175
-#: classes/Gems/Default/StaffAction.php:319
+#: classes/Gems/Default/StaffAction.php:294
msgid "Language"
msgstr "Language"
-#: classes/Gems/Default/OptionAction.php:175
+#: classes/Gems/Default/OptionAction.php:145
#, php-format
msgid "Options"
msgstr "Options"
-#: classes/Gems/Default/OptionAction.php:184
+#: classes/Gems/Default/OptionAction.php:154
msgid "This overview provides information about the last login activity on your account."
msgstr "This overview provides information about the last login activity on your account."
-#: classes/Gems/Default/OptionAction.php:204
+#: classes/Gems/Default/OptionAction.php:174
msgid "Date / time"
msgstr "Date / time"
-#: classes/Gems/Default/OptionAction.php:215
+#: classes/Gems/Default/OptionAction.php:185
msgid "Item"
msgstr "Item"
@@ -1624,7 +1606,7 @@
msgstr "This can not be changed yet"
#: classes/Gems/Default/OrganizationAction.php:166
-#: classes/Gems/Default/StaffAction.php:131
+#: classes/Gems/Default/StaffAction.php:119
msgid "User Definition"
msgstr "User Definition"
@@ -2135,45 +2117,54 @@
msgid "Synchronize all sources."
msgstr "Synchronize all sources."
-#: classes/Gems/Default/StaffAction.php:137
-msgid "Unsupported UserDefinition"
-msgstr "Unsupported UserDefinition"
+#: classes/Gems/Default/StaffAction.php:125
+msgid "Unsupported User Definition"
+msgstr "Unsupported User Definition"
-#: classes/Gems/Default/StaffAction.php:179
+#: classes/Gems/Default/StaffAction.php:154
msgid "Users can only login when this box is checked."
msgstr "Users can only login when this box is checked."
-#: classes/Gems/Default/StaffAction.php:180
+#: classes/Gems/Default/StaffAction.php:155
msgid "If checked the user will logoff when answering a survey."
msgstr "If checked the user will logoff when answering a survey."
-#: classes/Gems/Default/StaffAction.php:197
+#: classes/Gems/Default/StaffAction.php:172
msgid "You are not allowed to edit this staff member."
msgstr "You are not allowed to edit this staff member."
-#: classes/Gems/Default/StaffAction.php:254
+#: classes/Gems/Default/StaffAction.php:229
#, php-format
msgid "User with id %s already exists but is deleted, do you want to reactivate the account?"
msgstr "User with id %s already exists but is deleted, do you want to reactivate the account?"
-#: classes/Gems/Default/StaffAction.php:310
+#: classes/Gems/Default/StaffAction.php:285
msgid "Primary function"
msgstr "Primary function"
-#: classes/Gems/Default/StaffAction.php:320
+#: classes/Gems/Default/StaffAction.php:295
msgid "Can login"
msgstr "Can login"
-#: classes/Gems/Default/StaffAction.php:321
+#: classes/Gems/Default/StaffAction.php:296
msgid "Logout on survey"
msgstr "Logout on survey"
-#: classes/Gems/Default/StaffAction.php:396
+#: classes/Gems/Default/StaffAction.php:371
msgid "staff member"
msgid_plural "staff members"
msgstr[0] "staff member"
msgstr[1] "staff members"
+#: classes/Gems/Default/StaffAction.php:403
+#, php-format
+msgid "Reset password for: %s"
+msgstr "Reset password for: %s"
+
+#: classes/Gems/Default/StaffAction.php:406
+msgid "You are not allowed to change this password."
+msgstr "You are not allowed to change this password."
+
#: classes/Gems/Default/SurveyAction.php:64
msgid "Add survey"
msgstr "Add survey"
@@ -2866,41 +2857,41 @@
msgid "Clean cache"
msgstr "Clean cache"
-#: classes/Gems/Menu/MenuAbstract.php:415
+#: classes/Gems/Menu/MenuAbstract.php:416
msgid "Check status"
msgstr "Check status"
-#: classes/Gems/Menu/MenuAbstract.php:416
+#: classes/Gems/Menu/MenuAbstract.php:417
msgid "Synchronize surveys"
msgstr "Synchronize surveys"
-#: classes/Gems/Menu/MenuAbstract.php:417
-#: classes/Gems/Menu/MenuAbstract.php:429
+#: classes/Gems/Menu/MenuAbstract.php:418
+#: classes/Gems/Menu/MenuAbstract.php:430
msgid "Check answers"
msgstr "Check answers"
-#: classes/Gems/Menu/MenuAbstract.php:418
+#: classes/Gems/Menu/MenuAbstract.php:419
msgid "Check attributes"
msgstr "Check attributes"
-#: classes/Gems/Menu/MenuAbstract.php:419
+#: classes/Gems/Menu/MenuAbstract.php:420
msgid "Synchronize all surveys"
msgstr "Synchronize all surveys"
-#: classes/Gems/Menu/MenuAbstract.php:420
-#: classes/Gems/Menu/MenuAbstract.php:430
+#: classes/Gems/Menu/MenuAbstract.php:421
+#: classes/Gems/Menu/MenuAbstract.php:431
msgid "Check all answers"
msgstr "Check all answers"
-#: classes/Gems/Menu/MenuAbstract.php:426
+#: classes/Gems/Menu/MenuAbstract.php:427
msgid "PDF"
msgstr "PDF"
-#: classes/Gems/Menu/MenuAbstract.php:460
+#: classes/Gems/Menu/MenuAbstract.php:461
msgid "Check assignments"
msgstr "Check assignments"
-#: classes/Gems/Menu/MenuAbstract.php:463
+#: classes/Gems/Menu/MenuAbstract.php:464
msgid "Check all assignments"
msgstr "Check all assignments"
@@ -3106,11 +3097,13 @@
msgstr "Checked %d tokens."
#: classes/Gems/Task/Tracker/CheckTrackTokens.php:64
+#: classes/Gems/Tracker/ChangeTracker.php:81
#, php-format
msgid "%2$d token date changes in %1$d tracks."
msgstr "%2$d token date changes in %1$d tracks."
#: classes/Gems/Task/Tracker/CheckTrackTokens.php:67
+#: classes/Gems/Tracker/ChangeTracker.php:64
#, php-format
msgid "Checked %d tracks."
msgstr "Checked %d tracks."
@@ -3617,29 +3610,20 @@
msgid "may not contain numbers"
msgstr "may not contain numbers"
-#: classes/Gems/User/RadiusUserDefinition.php:175
+#: classes/Gems/User/RadiusUserDefinition.php:178
msgid "Shared secret"
msgstr "Shared secret"
-#: classes/Gems/User/User.php:538
-msgid "Current password"
-msgstr "Current password"
-
-#: classes/Gems/User/User.php:549
-#: classes/Gems/User/User.php:565
-msgid "New password"
-msgstr "New password"
-
-#: classes/Gems/User/User.php:893
+#: classes/Gems/User/User.php:843
msgid "Cookies must be enabled for this site."
msgstr "Cookies must be enabled for this site."
-#: classes/Gems/User/UserLoader.php:169
-#: classes/Gems/User/UserLoader.php:183
+#: classes/Gems/User/UserLoader.php:181
+#: classes/Gems/User/UserLoader.php:195
msgid "Db storage"
msgstr "Db storage"
-#: classes/Gems/User/UserLoader.php:184
+#: classes/Gems/User/UserLoader.php:196
msgid "Radius storage"
msgstr "Radius storage"
@@ -3647,6 +3631,32 @@
msgid "Wrong password."
msgstr "Wrong password."
+#: classes/Gems/User/Form/ChangePasswordForm.php:166
+#: classes/Gems/User/Form/ChangePasswordForm.php:222
+msgid "New password"
+msgstr "New password"
+
+#: classes/Gems/User/Form/ChangePasswordForm.php:192
+msgid "Current password"
+msgstr "Current password"
+
+#: classes/Gems/User/Form/ChangePasswordForm.php:243
+msgid "Password rules"
+msgstr "Password rules"
+
+#: classes/Gems/User/Form/ChangePasswordForm.php:246
+#, php-format
+msgid "A password %s."
+msgstr "A password %s."
+
+#: classes/Gems/User/Form/ChangePasswordForm.php:253
+msgid "A password:"
+msgstr "A password:"
+
+#: classes/Gems/User/Form/ChangePasswordForm.php:307
+msgid "Caps Lock seems to be on!"
+msgstr "Caps Lock seems to be on!"
+
#: classes/Gems/Util/ReceptionCodeLibrary.php:100
msgid "Yes (forget answers)"
msgstr "Yes (forget answers)"
Modified: trunk/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-nl.po
===================================================================
--- trunk/library/languages/default-nl.po 2012-03-22 11:04:04 UTC (rev 560)
+++ trunk/library/languages/default-nl.po 2012-03-22 15:42:31 UTC (rev 561)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: Pulse NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-03-16 16:15+0100\n"
+"POT-Creation-Date: 2012-03-22 16:35+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -1042,7 +1042,7 @@
msgstr "%s records gevonden."
#: classes/Gems/Default/ExportAction.php:172
-#: classes/Gems/Default/IndexAction.php:203
+#: classes/Gems/Default/IndexAction.php:220
#: classes/Gems/Default/LogAction.php:197
msgid "Organization"
msgstr "Organisatie"
@@ -1082,84 +1082,84 @@
msgid "Enter your token..."
msgstr "Voer uw kenmerk in..."
-#: classes/Gems/Default/IndexAction.php:148
+#: classes/Gems/Default/IndexAction.php:157
#, php-format
msgid "Login to %s application"
msgstr "%s login"
-#: classes/Gems/Default/IndexAction.php:152
+#: classes/Gems/Default/IndexAction.php:169
msgid "Login"
msgstr "Inloggen"
-#: classes/Gems/Default/IndexAction.php:174
+#: classes/Gems/Default/IndexAction.php:191
msgid "Back to login"
msgstr "Terug naar de login"
-#: classes/Gems/Default/IndexAction.php:227
+#: classes/Gems/Default/IndexAction.php:244
msgid "Password"
msgstr "Wachtwoord"
-#: classes/Gems/Default/IndexAction.php:242
+#: classes/Gems/Default/IndexAction.php:259
#, php-format
msgid "Reset password for %s application"
msgstr "Reset wachtwoord voor %s"
-#: classes/Gems/Default/IndexAction.php:246
+#: classes/Gems/Default/IndexAction.php:263
msgid "Reset password"
msgstr "Reset wachtwoord"
-#: classes/Gems/Default/IndexAction.php:292
+#: classes/Gems/Default/IndexAction.php:309
msgid "Username"
msgstr "Gebruikersnaam"
-#: classes/Gems/Default/IndexAction.php:358
+#: classes/Gems/Default/IndexAction.php:351
msgid "Your password must be changed."
msgstr "Uw wachtwoord moet veranderd worden."
-#: classes/Gems/Default/IndexAction.php:370
+#: classes/Gems/Default/IndexAction.php:363
#, php-format
msgid "Login successful, welcome %s."
msgstr "Login in orde, welkom %s."
-#: classes/Gems/Default/IndexAction.php:410
+#: classes/Gems/Default/IndexAction.php:403
#, php-format
msgid "Good bye: %s."
msgstr "Tot ziens: %s."
-#: classes/Gems/Default/IndexAction.php:435
+#: classes/Gems/Default/IndexAction.php:428
msgid "Reset accepted, enter your new password."
msgstr "Reset geaccepteerd, voer uw nieuwe wachtwoord in."
-#: classes/Gems/Default/IndexAction.php:439
+#: classes/Gems/Default/IndexAction.php:432
msgid "This key timed out or does not belong to this user."
msgstr "Te oude sleutel of sleutel hoort niet bij gebruiker."
-#: classes/Gems/Default/IndexAction.php:462
+#: classes/Gems/Default/IndexAction.php:455
msgid "Password reset requested"
msgstr "Wachtwoord reset aangevraagd"
-#: classes/Gems/Default/IndexAction.php:463
+#: classes/Gems/Default/IndexAction.php:456
#, php-format
msgid "To reset your password for %s, please click this link: %s"
msgstr "Om uw wachtwoord voor %s te resetten, klik op deze link: %s"
-#: classes/Gems/Default/IndexAction.php:468
+#: classes/Gems/Default/IndexAction.php:461
msgid "We sent you an e-mail with a reset link. Click on the link in the e-mail."
msgstr "We hebben u een email met reset link gestuurd. Klik op de link in de email."
-#: classes/Gems/Default/IndexAction.php:470
+#: classes/Gems/Default/IndexAction.php:463
msgid "Unable to send e-mail."
msgstr "Verzenden e-mail mislukt."
-#: classes/Gems/Default/IndexAction.php:475
+#: classes/Gems/Default/IndexAction.php:468
msgid "No such user found or no e-mail address known or user cannot be reset."
msgstr "Gebruiker niet gevonden of e-mail adres onbekend of gebruiker kan niet gereset worden."
-#: classes/Gems/Default/IndexAction.php:479
+#: classes/Gems/Default/IndexAction.php:472
msgid "We received your password reset key."
msgstr "Wachtwoord resetsleutel ontvangen."
-#: classes/Gems/Default/IndexAction.php:480
+#: classes/Gems/Default/IndexAction.php:473
msgid "Please enter the organization and username belonging to this key."
msgstr "Geef de organisatie en gebruikersnaam die bij deze sleutel horen op."
@@ -1440,13 +1440,11 @@
#: classes/Gems/Default/MailServerAction.php:90
#: classes/Gems/Default/SourceAction.php:95
-#: classes/Gems/Default/StaffAction.php:161
msgid "Repeat password"
msgstr "Herhaal wachtwoord"
#: classes/Gems/Default/MailServerAction.php:91
#: classes/Gems/Default/SourceAction.php:74
-#: classes/Gems/Default/StaffAction.php:120
msgid "Enter only when changing"
msgstr "Alleen invoeren om het wachtwoord te wijzigen"
@@ -1461,8 +1459,8 @@
msgstr "Email servers"
#: classes/Gems/Default/MailTemplateAction.php:76
-#: classes/Gems/Default/StaffAction.php:303
-#: classes/Gems/Default/StaffAction.php:336
+#: classes/Gems/Default/StaffAction.php:278
+#: classes/Gems/Default/StaffAction.php:311
msgid "(all organizations)"
msgstr "(alle organisaties)"
@@ -1476,56 +1474,40 @@
msgid "Email templates"
msgstr "Email sjabloon"
-#: classes/Gems/Default/OptionAction.php:79
+#: classes/Gems/Default/OptionAction.php:81
msgid "You are not allowed to change your password."
msgstr "U mag uw wachtwoord niet wijzigen."
-#: classes/Gems/Default/OptionAction.php:91
-msgid "Password rules"
-msgstr "Wachtwoord regels"
-
#: classes/Gems/Default/OptionAction.php:94
-#, php-format
-msgid "A password %s."
-msgstr "Een wachtwoord %s."
-
-#: classes/Gems/Default/OptionAction.php:101
-msgid "A password:"
-msgstr "Een wachtwoord:"
-
-#: classes/Gems/Default/OptionAction.php:112
+#: classes/Gems/Default/StaffAction.php:419
msgid "New password is active."
msgstr "Nieuwe wachtwoord geactiveerd."
-#: classes/Gems/Default/OptionAction.php:118
-msgid "Caps Lock seems to be on!"
-msgstr "De Caps Lock toets lijkt aan te staan!"
-
-#: classes/Gems/Default/OptionAction.php:158
+#: classes/Gems/Default/OptionAction.php:128
msgid "Login Name"
msgstr "Login Naam"
-#: classes/Gems/Default/OptionAction.php:165
+#: classes/Gems/Default/OptionAction.php:135
#: classes/Gems/Default/OrganizationAction.php:129
#: classes/Gems/Default/RespondentAction.php:175
-#: classes/Gems/Default/StaffAction.php:319
+#: classes/Gems/Default/StaffAction.php:294
msgid "Language"
msgstr "Taal"
-#: classes/Gems/Default/OptionAction.php:175
+#: classes/Gems/Default/OptionAction.php:145
#, php-format
msgid "Options"
msgstr "Instellingen"
-#: classes/Gems/Default/OptionAction.php:184
+#: classes/Gems/Default/OptionAction.php:154
msgid "This overview provides information about the last login activity on your account."
msgstr "Dit overzicht geeft informatie over de recente inlog activiteit op uw account."
-#: classes/Gems/Default/OptionAction.php:204
+#: classes/Gems/Default/OptionAction.php:174
msgid "Date / time"
msgstr "Datum / tijd"
-#: classes/Gems/Default/OptionAction.php:215
+#: classes/Gems/Default/OptionAction.php:185
msgid "Item"
msgstr "Item"
@@ -1624,7 +1606,7 @@
msgstr "Dit kan nog niet gewijzigd worden"
#: classes/Gems/Default/OrganizationAction.php:166
-#: classes/Gems/Default/StaffAction.php:131
+#: classes/Gems/Default/StaffAction.php:119
msgid "User Definition"
msgstr "User Definition"
@@ -2135,45 +2117,54 @@
msgid "Synchronize all sources."
msgstr "Synchroniseer alle bronnen."
-#: classes/Gems/Default/StaffAction.php:137
-msgid "Unsupported UserDefinition"
-msgstr "Onebekende UserDefinition"
+#: classes/Gems/Default/StaffAction.php:125
+msgid "Unsupported User Definition"
+msgstr "Onbekende User Definition"
-#: classes/Gems/Default/StaffAction.php:179
+#: classes/Gems/Default/StaffAction.php:154
msgid "Users can only login when this box is checked."
msgstr "Gebruikers kunnen alleen inloggen als dit is aangevinkt."
-#: classes/Gems/Default/StaffAction.php:180
+#: classes/Gems/Default/StaffAction.php:155
msgid "If checked the user will logoff when answering a survey."
msgstr "Indien actief, dan logt de gebruiker uit voor het beantwoorden van een vragenlijst."
-#: classes/Gems/Default/StaffAction.php:197
+#: classes/Gems/Default/StaffAction.php:172
msgid "You are not allowed to edit this staff member."
msgstr "U mag deze medewerker niet wijzigen."
-#: classes/Gems/Default/StaffAction.php:254
+#: classes/Gems/Default/StaffAction.php:229
#, php-format
msgid "User with id %s already exists but is deleted, do you want to reactivate the account?"
msgstr "Gebruiker met inlognaam %s bestaat al maar is verwijderd, wilt u het account opnieuw activeren?"
-#: classes/Gems/Default/StaffAction.php:310
+#: classes/Gems/Default/StaffAction.php:285
msgid "Primary function"
msgstr "Primaire functie"
-#: classes/Gems/Default/StaffAction.php:320
+#: classes/Gems/Default/StaffAction.php:295
msgid "Can login"
msgstr "Kan inloggen"
-#: classes/Gems/Default/StaffAction.php:321
+#: classes/Gems/Default/StaffAction.php:296
msgid "Logout on survey"
msgstr "Logout bij beantwoorden vragenlijst"
-#: classes/Gems/Default/StaffAction.php:396
+#: classes/Gems/Default/StaffAction.php:371
msgid "staff member"
msgid_plural "staff members"
msgstr[0] "medewerker"
msgstr[1] "medewerkers"
+#: classes/Gems/Default/StaffAction.php:403
+#, php-format
+msgid "Reset password for: %s"
+msgstr "Verander het wachtwoord voor: %s"
+
+#: classes/Gems/Default/StaffAction.php:406
+msgid "You are not allowed to change this password."
+msgstr "U mag dit wachtwoord niet wijzigen."
+
#: classes/Gems/Default/SurveyAction.php:64
msgid "Add survey"
msgstr "Vragenlijst toevoegen"
@@ -2866,41 +2857,41 @@
msgid "Clean cache"
msgstr "Cache opruimen"
-#: classes/Gems/Menu/MenuAbstract.php:415
+#: classes/Gems/Menu/MenuAbstract.php:416
msgid "Check status"
msgstr "Status controle"
-#: classes/Gems/Menu/MenuAbstract.php:416
+#: classes/Gems/Menu/MenuAbstract.php:417
msgid "Synchronize surveys"
msgstr "Synchroniseer vragenlijsten"
-#: classes/Gems/Menu/MenuAbstract.php:417
-#: classes/Gems/Menu/MenuAbstract.php:429
+#: classes/Gems/Menu/MenuAbstract.php:418
+#: classes/Gems/Menu/MenuAbstract.php:430
msgid "Check answers"
msgstr "Antwoord controle...
[truncated message content] |