You can subscribe to this list here.
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(84) |
Oct
(70) |
Nov
(164) |
Dec
(71) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2012 |
Jan
(52) |
Feb
(77) |
Mar
(70) |
Apr
(58) |
May
(81) |
Jun
(74) |
Jul
(87) |
Aug
(30) |
Sep
(45) |
Oct
(37) |
Nov
(51) |
Dec
(31) |
| 2013 |
Jan
(47) |
Feb
(29) |
Mar
(40) |
Apr
(33) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <gem...@li...> - 2012-04-23 12:08:49
|
Revision: 631
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=631&view=rev
Author: mennodekker
Date: 2012-04-23 12:08:39 +0000 (Mon, 23 Apr 2012)
Log Message:
-----------
Fixed error where invalid date (month>12) would not fire and error on the date
Modified Paths:
--------------
trunk/library/classes/MUtil/JQuery/Form/Element/DatePicker.php
Modified: trunk/library/classes/MUtil/JQuery/Form/Element/DatePicker.php
===================================================================
--- trunk/library/classes/MUtil/JQuery/Form/Element/DatePicker.php 2012-04-23 10:58:42 UTC (rev 630)
+++ trunk/library/classes/MUtil/JQuery/Form/Element/DatePicker.php 2012-04-23 12:08:39 UTC (rev 631)
@@ -146,6 +146,10 @@
} elseif (($storageFormat = $this->getStorageFormat()) && Zend_Date::isDate($value, $storageFormat)) {
$this->_dateValue = new Zend_Date($value, $storageFormat);
+ } elseif ($format || $storageFormat) {
+ //Invalid dateformat, should be handled by validator, just ignore the datevalue
+ //but set the real value so validation runs fine
+ $this->_dateValue = null;
} else {
try {
$this->_dateValue = new Zend_Date($value);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-23 10:42:05
|
Revision: 629
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=629&view=rev
Author: mennodekker
Date: 2012-04-23 10:41:59 +0000 (Mon, 23 Apr 2012)
Log Message:
-----------
Added logLevel section to project.ini
Modified Paths:
--------------
trunk/new_project/application/configs/project.ini
Modified: trunk/new_project/application/configs/project.ini
===================================================================
--- trunk/new_project/application/configs/project.ini 2012-04-23 10:33:33 UTC (rev 628)
+++ trunk/new_project/application/configs/project.ini 2012-04-23 10:41:59 UTC (rev 629)
@@ -268,6 +268,24 @@
consentTypes = 'do not use|consent given'
consentDefault = 'Unknown' ;Default setup makes this 'do not use'
+;---------------------------------------------------------
+; LOGLEVEL SECTION
+;---------------------------------------------------------
+; Use the loglevels as defined in Zend_Log to define the highest level of errors to log
+;
+; 0 Emergency: system is unusable
+; 1 Alert: action must be taken immediately
+; 2 Critical: critical conditions
+; 3 Error: error conditions
+; 4 Warning: warning conditions
+; 5 Notice: normal but significant condition
+; 6 Informational: informational messages
+; 7 Debug: debug messages
+;
+; Defaults for production are 3 (error) and 7 (debug) for testing and development, uncomment the
+; line below to use a custom setting
+;logLevel = 6;
+
[testing : production]
admin.user = superadmin
admin.pwd = superadmin
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-23 10:33:42
|
Revision: 628
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=628&view=rev
Author: mennodekker
Date: 2012-04-23 10:33:33 +0000 (Mon, 23 Apr 2012)
Log Message:
-----------
Introduction logLevels, to allow different logging for develop/test environments vs production environment
Modified Paths:
--------------
trunk/library/classes/Gems/Log.php
trunk/library/classes/Gems/Project/ProjectSettings.php
trunk/library/classes/GemsEscort.php
Modified: trunk/library/classes/Gems/Log.php
===================================================================
--- trunk/library/classes/Gems/Log.php 2012-04-20 07:26:30 UTC (rev 627)
+++ trunk/library/classes/Gems/Log.php 2012-04-23 10:33:33 UTC (rev 628)
@@ -99,6 +99,14 @@
}
} */
+ foreach ($info as $line) {
+ $this->log($line, Zend_Log::ERR);
+ }
+
+ // Now empty as we are going to log potentially sensitive debug data
+ // We log this with a Zend_Log::DEBUG level, so filter can strip it if needed
+ $info = array();
+
if (!empty($request)) {
$info[] = 'Request Parameters:';
foreach ($request->getParams() as $key => $value) {
@@ -110,7 +118,7 @@
$info[] = $exception->getTraceAsString();
foreach ($info as $line) {
- $this->log($line, Zend_Log::ERR);
+ $this->log($line, Zend_Log::DEBUG);
}
}
Modified: trunk/library/classes/Gems/Project/ProjectSettings.php
===================================================================
--- trunk/library/classes/Gems/Project/ProjectSettings.php 2012-04-20 07:26:30 UTC (rev 627)
+++ trunk/library/classes/Gems/Project/ProjectSettings.php 2012-04-23 10:33:33 UTC (rev 628)
@@ -325,6 +325,34 @@
}
/**
+ * Get the logLevel to use with the Gems_Log
+ *
+ * Default settings is for development and testing environment to use Zend_Log::DEBUG and
+ * for all other environments to use the Zend_Log::ERR level. This can be overruled by
+ * specifying a logLevel in the project.ini
+ *
+ * Using a level higher than Zend_Log::ERR will output full error messages, traces and request
+ * info to the logfile. Please be aware that this might introduce a security risk as passwords
+ * might be written to the logfile in plain text.
+ *
+ * @return int The loglevel to use
+ */
+ public function getLogLevel()
+ {
+ if (isset($this['logLevel'])) {
+ $logLevel = $this['logLevel'];
+ } else {
+ if ('development' == APPLICATION_ENV || 'testing' == APPLICATION_ENV) {
+ $logLevel = Zend_Log::DEBUG;
+ } else {
+ $logLevel = Zend_Log::ERR;
+ }
+ }
+
+ return $logLevel;
+ }
+
+ /**
* Array of field name => values for sending E-Mail
*
* @return array
Modified: trunk/library/classes/GemsEscort.php
===================================================================
--- trunk/library/classes/GemsEscort.php 2012-04-20 07:26:30 UTC (rev 627)
+++ trunk/library/classes/GemsEscort.php 2012-04-23 10:33:33 UTC (rev 628)
@@ -200,6 +200,7 @@
*/
protected function _initLogger()
{
+ $this->bootstrap('project'); // Make sure the project object is available
$logger = Gems_Log::getLogger();
$log_path = GEMS_ROOT_DIR . '/var/logs';
@@ -211,11 +212,15 @@
die(sprintf($this->translate->_('Path %s not writable'), $log_path));
}
+ $filter = new Zend_Log_Filter_Priority($project->getLogLevel());
+ $writer->addFilter($filter);
$logger->addWriter($writer);
// OPTIONAL STARTY OF FIREBUG LOGGING.
if ($this->_startFirebird) {
$logger->addWriter(new Zend_Log_Writer_Firebug());
+ //We do not add the logLevel here, as the firebug window is intended for use by
+ //developers only and it is only written to the active users' own screen.
}
Zend_Registry::set('logger', $logger);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-20 07:26:40
|
Revision: 627
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=627&view=rev
Author: mennodekker
Date: 2012-04-20 07:26:30 +0000 (Fri, 20 Apr 2012)
Log Message:
-----------
Tagging 1.5.3 for release
Added Paths:
-----------
tags/1.5.3/
Property changes on: tags/1.5.3
___________________________________________________________________
Added: svn:ignore
+ nbproject
Added: svn:mergeinfo
+ /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
/trunk:620-625
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-20 07:26:07
|
Revision: 626
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=626&view=rev
Author: mennodekker
Date: 2012-04-20 07:25:56 +0000 (Fri, 20 Apr 2012)
Log Message:
-----------
Final merge for 1.5.3 release
Merged revision(s) 620-625 from trunk:
When only one organization, the default value was not set, result was that superadmin could not even login anymore (that failure should still be fixed)
........
If you don't use it anymore, why not remove it
........
And some more cleanup
........
User gets clearer message from program after changing an item (if specified at action level)
........
Bug fix where tracks where shown multiple times if a user belonged to multiple organizations
Code commented out meant for 1.5.4
........
Prevent adding the same element multiple times, should not be a problem but this is cleaner
........
Modified Paths:
--------------
tags/1.5.3-rc2/library/classes/Gems/Controller/ModelSnippetActionAbstract.php
tags/1.5.3-rc2/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php
tags/1.5.3-rc2/library/classes/Gems/Tracker/Model/RespondentTrackModel.php
tags/1.5.3-rc2/library/classes/Gems/Tracker/Token.php
tags/1.5.3-rc2/library/classes/Gems/User/Form/OrganizationFormAbstract.php
tags/1.5.3-rc2/library/classes/Gems/User/User.php
tags/1.5.3-rc2/library/configs/db/patches.sql
tags/1.5.3-rc2/library/configs/db/tables/gems__tokens.200.sql
Removed Paths:
-------------
tags/1.5.3-rc2/library/classes/Gems/Auth.php
Property Changed:
----------------
tags/1.5.3-rc2/
tags/1.5.3-rc2/library/
Property changes on: tags/1.5.3-rc2
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
+ /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
/trunk:620-625
Property changes on: tags/1.5.3-rc2/library
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/1.5.0-pulse/library:306-344,346,467
/branches/1.5.x/library:426-455,458-472,475-481
/branches/newUser:113-150
/branches/newUser2:175-207
/branches/userloader:259-324
/tags/1.5.0beta1/library:305
/tags/1.5.1/library:485,489,509-510,534
+ /branches/1.5.0-pulse/library:306-344,346,467
/branches/1.5.x/library:426-455,458-472,475-481
/branches/newUser:113-150
/branches/newUser2:175-207
/branches/userloader:259-324
/tags/1.5.0beta1/library:305
/tags/1.5.1/library:485,489,509-510,534
/trunk/library:620-625
Deleted: tags/1.5.3-rc2/library/classes/Gems/Auth.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Auth.php 2012-04-20 07:16:35 UTC (rev 625)
+++ tags/1.5.3-rc2/library/classes/Gems/Auth.php 2012-04-20 07:25:56 UTC (rev 626)
@@ -1,251 +0,0 @@
-<?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 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.
- *
- * @version $Id$
- * @package Gems
- * @subpackage Auth
- * @copyright Copyright (c) 2011 Erasmus MC
- * @license New BSD License
- */
-
-/**
- * Extension to the Zend_Auth framework in order to plug in extra features
- *
- * It adds translation to Zend_Auth_Result and performs the failed_login check with delay
- * after a previous failed attempt.
- *
- * @author Menno Dekker
- * @filesource
- * @package Gems
- * @subpackage Auth
- */
-class Gems_Auth extends Zend_Auth
-{
- /**
- * Error constants
- *
- * These must be numeric constants smaller than zero for
- * Zend_Auth_Result to work.
- */
- const ERROR_DATABASE_NOT_INSTALLED = -11;
- const ERROR_PASSWORD_DELAY = -12;
-
- /**
- * @var array Message templates
- */
- protected $_messageTemplates = array(
- self::ERROR_DATABASE_NOT_INSTALLED => 'Installation not complete! Login is not yet possible!',
- self::ERROR_PASSWORD_DELAY => 'Your account is temporarily blocked, please wait %s seconds',
- );
-
- /**
- * Exponent to use when calculating delay
- * @var int
- */
- protected $_delayFactor = 4;
-
- /**
- * @var Zend_Db_Table_Adapter
- */
- public $db;
-
- public function __construct($db = null)
- {
- /**
- * Check for an adapter being defined. if not, fetch the default adapter.
- */
- if ($db === null) {
- $this->db = Zend_Db_Table_Abstract::getDefaultAdapter();
- if (null === $this->db) {
- require_once 'Zend/Validate/Exception.php';
- throw new Zend_Validate_Exception('No database adapter present');
- }
- } else {
- $this->db = $db;
- }
- }
-
- private function _error($code, $value1 = null, $value2 = null)
- {
- $messages = func_get_args();
- // array_splice($messages, 0, 1, $this->_messageTemplates[$code]);
- $messages[0] = $this->_messageTemplates[$code];
- return new Zend_Auth_Result($code, null, (array) $messages);
- }
-
- /**
- * Authenticates against the supplied adapter
- *
- * @param Zend_Auth_Adapter_Interface $adapter
- * @param array $formValues We need information not in the adapter.
- * @return Zend_Auth_Result
- */
- public function authenticate(Zend_Auth_Adapter_Interface $adapter, array $formValues = null)
- {
- try {
- $remaining = 0;
- $login_name = $formValues['userlogin'];
- $organization = $formValues['organization'];
- $sql = "SELECT gula_failed_logins, gula_last_failed FROM gems__user_login_attempts WHERE gula_login = ? AND gula_id_organization = ?";
- $values = $this->db->fetchRow($sql, array($login_name, $organization));
-
- if (! $values) {
- $values = array();
- $values['gula_login'] = $login_name;
- $values['gula_id_organization'] = $organization;
- $values['gula_failed_logins'] = 0;
- $values['gula_last_failed'] = null;
-
- } elseif ($values['gula_failed_logins'] > 0) {
- // Get the datetime
- $last = new MUtil_Date($values['gula_last_failed'], Zend_Date::ISO_8601);
-
- // How long to wait until we can ignore the previous failed attempt
- $delay = pow($values['gula_failed_logins'], GemsEscort::getInstance()->project->getAccountDelayFactor());
-
- if (abs($last->diffSeconds()) <= $delay) {
- // Response gets slowly slower
- $sleepTime = min($values['gula_failed_logins'], 10);
- sleep($sleepTime);
- $remaining = $delay - abs($last->diffSeconds()) - $sleepTime;
- if ($remaining>0) {
- $result = $this->_error(self::ERROR_PASSWORD_DELAY, $remaining);
- }
- }
- }
- } catch (Zend_Db_Exception $e) {
- // Fall through as this does not work if the database upgrade did not run
- // MUtil_Echo::r($e);
- }
-
- // We only forward to auth adapter when we have no timeout to prevent hammering the auth system
- if (! isset($result) ) {
- $result = parent::authenticate($adapter);
- }
-
- if ($result->isValid()) {
- $values['gula_failed_logins'] = 0;
- $values['gula_last_failed'] = null;
- } else {
- if ($values['gula_failed_logins']) {
- // Only increment when we have no password delay as the right password
- // will not be accepted when we are in the delay. Can not check on the error
- // code as it will be set to 'uncategorized' => -4
- if ($remaining>0) {
- $values['gula_failed_logins'] += 1;
- $values['gula_last_failed'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
- }
- } else {
- $values['gula_failed_logins'] = 1;
- $values['gula_last_failed'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
- }
- $values['gula_failed_logins'] = max($values['gula_failed_logins'], 1);
- }
-
- try {
- if (isset($values['gula_login'])) {
- $this->db->insert('gems__user_login_attempts', $values);
- } else {
- $where = $this->db->quoteInto('gula_login = ? AND ', $login_name);
- $where .= $this->db->quoteInto('gula_id_organization = ?', $organization);
- $this->db->update('gems__user_login_attempts', $values, $where);
- }
- } catch (Zend_Db_Exception $e) {
- // Fall through as this does not work if the database upgrade did not run
- // MUtil_Echo::r($e);
- }
-
- //Now localize
- $result = $this->localize($result);
-
- return $result;
- }
-
- /**
- * Returns an instance of Gems_Auth
- *
- * Singleton pattern implementation
- *
- * @return Gems_Auth Provides a fluent interface
- */
- public static function getInstance()
- {
- if (null === self::$_instance) {
- self::$_instance = new self();
- }
-
- return self::$_instance;
- }
-
- /**
- * Perform translation on an error message
- *
- * To make them showup in the .PO files, add the most common messages to
- * \library\Gems\languages\FakeTranslation.php
- * The first element in the message array is translated, while the following messages are
- * treated as sprintf parameters.
- *
- * @param Zend_Auth_Result $result
- * @return Zend_Auth_Result
- */
- public function localize($result)
- {
- $translate = GemsEscort::getInstance()->translate;
- $code = $result->getCode();
- $identity = $result->getIdentity();
- $messages = $result->getMessages();
-
- //Shift the first message off, this is the one to translate
- $message = $translate->_(array_shift($messages));
-
- /**
- * Now give a default message for some default error codes. This has the
- * positive side effect that we can remove some lines from FakeTranslations
- */
- switch ($code) {
- case Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID:
- // $message = $translate->_('Wrong password.');
- // break;
- case Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND:
- $message = $translate->_('Combination of organization, username and password not found.');
- break;
- }
-
- // Recombine with the others if any, they will be treated as params
- if (count($messages)) {
- $messages = array_merge((array) $message, (array) $messages);
-
- //Now do a sprintf if we have 1 or more params
- $messages = call_user_func_array('sprintf', $messages);
- } else {
- $messages = array($message);
- }
-
- return new Zend_Auth_Result($code, $identity, (array) $messages);
- }
-}
\ No newline at end of file
Modified: tags/1.5.3-rc2/library/classes/Gems/Controller/ModelSnippetActionAbstract.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-04-20 07:16:35 UTC (rev 625)
+++ tags/1.5.3-rc2/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-04-20 07:25:56 UTC (rev 626)
@@ -139,7 +139,8 @@
*/
public function createAction()
{
- $this->createEditParameters['formTitle'] = $this->getCreateTitle();
+ $this->createEditParameters['formTitle'] = $this->getCreateTitle();
+ $this->createEditParameters['topicCallable'] = array($this, 'getTopic');
parent::createAction();
}
@@ -160,7 +161,8 @@
*/
public function editAction()
{
- $this->createEditParameters['formTitle'] = $this->getEditTitle();
+ $this->createEditParameters['formTitle'] = $this->getEditTitle();
+ $this->createEditParameters['topicCallable'] = array($this, 'getTopic');
parent::editAction();
}
Modified: tags/1.5.3-rc2/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2012-04-20 07:16:35 UTC (rev 625)
+++ tags/1.5.3-rc2/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2012-04-20 07:25:56 UTC (rev 626)
@@ -71,6 +71,13 @@
protected $formTitle;
/**
+ * When set getTopic uses this function instead of parent class.
+ *
+ * @var callable
+ */
+ protected $topicCallable;
+
+ /**
* Required
*
* @var Gems_Menu
@@ -181,4 +188,19 @@
return sprintf($this->_('Edit %s'), $this->getTopic());
}
}
+
+ /**
+ * Helper function to allow generalized statements about the items in the model to used specific item names.
+ *
+ * @param int $count
+ * @return $string
+ */
+ public function getTopic($count = 1)
+ {
+ if (is_callable($this->topicCallable)) {
+ return call_user_func($this->topicCallable, $count);
+ } else {
+ return parent::getTopic($count);
+ }
+ }
}
Modified: tags/1.5.3-rc2/library/classes/Gems/Tracker/Model/RespondentTrackModel.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Tracker/Model/RespondentTrackModel.php 2012-04-20 07:16:35 UTC (rev 625)
+++ tags/1.5.3-rc2/library/classes/Gems/Tracker/Model/RespondentTrackModel.php 2012-04-20 07:25:56 UTC (rev 626)
@@ -64,7 +64,7 @@
{
parent::__construct('surveys', 'gems__respondent2track', 'gr2t');
$this->addTable('gems__respondents', array('gr2t_id_user' => 'grs_id_user'));
- $this->addTable('gems__respondent2org', array('gr2t_id_user' => 'gr2o_id_user'));
+ $this->addTable('gems__respondent2org', array('gr2t_id_user' => 'gr2o_id_user', 'gr2t_id_organization' => 'gr2o_id_organization'));
$this->addTable('gems__tracks', array('gr2t_id_track' => 'gtr_id_track'));
$this->addTable('gems__reception_codes', array('gr2t_reception_code' => 'grc_id_reception_code'));
$this->addLeftTable('gems__staff', array('gr2t_created_by' => 'gsf_id_user'));
Modified: tags/1.5.3-rc2/library/classes/Gems/Tracker/Token.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Tracker/Token.php 2012-04-20 07:16:35 UTC (rev 625)
+++ tags/1.5.3-rc2/library/classes/Gems/Tracker/Token.php 2012-04-20 07:25:56 UTC (rev 626)
@@ -888,7 +888,8 @@
$values['gto_start_time'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
$values['gto_in_source'] = 1;
}
- $values['gto_by'] = $userId;
+ $values['gto_by'] = $userId;
+ // 1.5.4 $values['gto_return_url'] = $_SERVER["HTTP_REFERER"];
$this->_updateToken($values, $userId);
Modified: tags/1.5.3-rc2/library/classes/Gems/User/Form/OrganizationFormAbstract.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/User/Form/OrganizationFormAbstract.php 2012-04-20 07:16:35 UTC (rev 625)
+++ tags/1.5.3-rc2/library/classes/Gems/User/Form/OrganizationFormAbstract.php 2012-04-20 07:25:56 UTC (rev 626)
@@ -151,8 +151,6 @@
if ($hidden) {
if (! $element instanceof Zend_Form_Element_Hidden) {
$element = new Zend_Form_Element_Hidden($this->organizationFieldName);
-
- $element->setValue($orgId);
$this->addElement($element);
}
@@ -161,6 +159,8 @@
$orgId = reset($orgIds);
}
+ $element->setValue($orgId);
+
} elseif (! $element instanceof Zend_Form_Element_Select) {
$element = new Zend_Form_Element_Select($this->organizationFieldName);
$element->setLabel($this->translate->_('Organization'));
Modified: tags/1.5.3-rc2/library/classes/Gems/User/User.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/User/User.php 2012-04-20 07:16:35 UTC (rev 625)
+++ tags/1.5.3-rc2/library/classes/Gems/User/User.php 2012-04-20 07:25:56 UTC (rev 626)
@@ -126,16 +126,7 @@
protected $userLoader;
/**
- * Use Zend_Auth for authentication
*
- * Warning: Zend_Auth contains only a partial ID of the current user, the base organization is missing
- *
- * @var boolean
- */
- protected $useZendAuth = false;
-
- /**
- *
* @var Gems_Util
*/
protected $util;
@@ -330,9 +321,6 @@
*/
public function authenticate($password)
{
- if ($this->useZendAuth) {
- $zendAuth = Zend_Auth::getInstance();
- }
$auths = $this->loadAuthorizers($password);
foreach ($auths as $result) {
@@ -341,11 +329,7 @@
}
if ($result instanceof Zend_Auth_Adapter_Interface) {
- if ($this->useZendAuth) {
- $result = $zendAuth->authenticate($result);
- } else {
- $result = $result->authenticate();
- }
+ $result = $result->authenticate();
}
if ($result instanceof Zend_Auth_Result) {
Modified: tags/1.5.3-rc2/library/configs/db/patches.sql
===================================================================
--- tags/1.5.3-rc2/library/configs/db/patches.sql 2012-04-20 07:16:35 UTC (rev 625)
+++ tags/1.5.3-rc2/library/configs/db/patches.sql 2012-04-20 07:25:56 UTC (rev 626)
@@ -393,3 +393,7 @@
-- PATCH: make reset keys unique so we now whose key it is
ALTER TABLE `gems__user_passwords` ADD UNIQUE KEY (gup_reset_key);
ALTER TABLE `gems__staff` ADD UNIQUE KEY (gsf_reset_key);
+
+-- GEMS VERSION: 47
+-- PATCH: Add return url to tokens
+-- ALTER TABLE gems__tokens ADD gto_return_url varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null AFTER gto_reception_code;
Modified: tags/1.5.3-rc2/library/configs/db/tables/gems__tokens.200.sql
===================================================================
--- tags/1.5.3-rc2/library/configs/db/tables/gems__tokens.200.sql 2012-04-20 07:16:35 UTC (rev 625)
+++ tags/1.5.3-rc2/library/configs/db/tables/gems__tokens.200.sql 2012-04-20 07:25:56 UTC (rev 626)
@@ -2,17 +2,17 @@
CREATE TABLE if not exists gems__tokens (
gto_id_token varchar(9) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null,
- gto_id_respondent_track bigint unsigned not null
+ gto_id_respondent_track bigint unsigned not null
references gems__respondent2track (gr2t_id_respondent_track),
- gto_id_round bigint unsigned not null
+ gto_id_round bigint unsigned not null
references gems__rounds (gro_id_round),
-- non-changing fields calculated from previous two:
- gto_id_respondent bigint unsigned not null
+ gto_id_respondent bigint unsigned not null
references gems__respondents (grs_id_user),
- gto_id_organization bigint unsigned not null
+ gto_id_organization bigint unsigned not null
references gems__organizations (gor_id_organization),
- gto_id_track bigint unsigned not null
+ gto_id_track bigint unsigned not null
references gems__track (gtr_id_track),
-- values initially filled from gems__rounds, but that may get different values later on
@@ -25,14 +25,14 @@
-- real data
gto_valid_from datetime,
gto_valid_until datetime,
- gto_mail_sent_date date,
- gto_next_mail_date date,
+ gto_mail_sent_date date,
+ gto_next_mail_date date,
- gto_start_time datetime,
+ gto_start_time datetime,
gto_in_source boolean not null default 0,
gto_by bigint(20) unsigned NULL,
- gto_completion_time datetime,
+ gto_completion_time datetime,
gto_duration_in_sec bigint(20) unsigned NULL,
gto_followup_date date, -- depreciated
gto_result varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci',
@@ -41,6 +41,8 @@
gto_reception_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' default 'OK' not null
references gems__reception_codes (grc_id_reception_code),
+ -- gto_return_url varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null,
+
gto_changed timestamp not null default current_timestamp on update current_timestamp,
gto_changed_by bigint unsigned not null,
gto_created timestamp not null,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-20 07:16:46
|
Revision: 625
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=625&view=rev
Author: mennodekker
Date: 2012-04-20 07:16:35 +0000 (Fri, 20 Apr 2012)
Log Message:
-----------
Prevent adding the same element multiple times, should not be a problem but this is cleaner
Modified Paths:
--------------
trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php
Modified: trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php
===================================================================
--- trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php 2012-04-19 14:24:44 UTC (rev 624)
+++ trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php 2012-04-20 07:16:35 UTC (rev 625)
@@ -151,6 +151,7 @@
if ($hidden) {
if (! $element instanceof Zend_Form_Element_Hidden) {
$element = new Zend_Form_Element_Hidden($this->organizationFieldName);
+ $this->addElement($element);
}
if (! $this->_organizationFromUrl) {
@@ -159,7 +160,6 @@
}
$element->setValue($orgId);
- $this->addElement($element);
} elseif (! $element instanceof Zend_Form_Element_Select) {
$element = new Zend_Form_Element_Select($this->organizationFieldName);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-19 14:24:54
|
Revision: 624
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=624&view=rev
Author: matijsdejong
Date: 2012-04-19 14:24:44 +0000 (Thu, 19 Apr 2012)
Log Message:
-----------
Bug fix where tracks where shown multiple times if a user belonged to multiple organizations
Code commented out meant for 1.5.4
Modified Paths:
--------------
trunk/library/classes/Gems/Tracker/Model/RespondentTrackModel.php
trunk/library/classes/Gems/Tracker/Token.php
trunk/library/configs/db/patches.sql
trunk/library/configs/db/tables/gems__tokens.200.sql
Modified: trunk/library/classes/Gems/Tracker/Model/RespondentTrackModel.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Model/RespondentTrackModel.php 2012-04-19 10:57:42 UTC (rev 623)
+++ trunk/library/classes/Gems/Tracker/Model/RespondentTrackModel.php 2012-04-19 14:24:44 UTC (rev 624)
@@ -64,7 +64,7 @@
{
parent::__construct('surveys', 'gems__respondent2track', 'gr2t');
$this->addTable('gems__respondents', array('gr2t_id_user' => 'grs_id_user'));
- $this->addTable('gems__respondent2org', array('gr2t_id_user' => 'gr2o_id_user'));
+ $this->addTable('gems__respondent2org', array('gr2t_id_user' => 'gr2o_id_user', 'gr2t_id_organization' => 'gr2o_id_organization'));
$this->addTable('gems__tracks', array('gr2t_id_track' => 'gtr_id_track'));
$this->addTable('gems__reception_codes', array('gr2t_reception_code' => 'grc_id_reception_code'));
$this->addLeftTable('gems__staff', array('gr2t_created_by' => 'gsf_id_user'));
Modified: trunk/library/classes/Gems/Tracker/Token.php
===================================================================
--- trunk/library/classes/Gems/Tracker/Token.php 2012-04-19 10:57:42 UTC (rev 623)
+++ trunk/library/classes/Gems/Tracker/Token.php 2012-04-19 14:24:44 UTC (rev 624)
@@ -888,7 +888,8 @@
$values['gto_start_time'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
$values['gto_in_source'] = 1;
}
- $values['gto_by'] = $userId;
+ $values['gto_by'] = $userId;
+ // 1.5.4 $values['gto_return_url'] = $_SERVER["HTTP_REFERER"];
$this->_updateToken($values, $userId);
Modified: trunk/library/configs/db/patches.sql
===================================================================
--- trunk/library/configs/db/patches.sql 2012-04-19 10:57:42 UTC (rev 623)
+++ trunk/library/configs/db/patches.sql 2012-04-19 14:24:44 UTC (rev 624)
@@ -393,3 +393,7 @@
-- PATCH: make reset keys unique so we now whose key it is
ALTER TABLE `gems__user_passwords` ADD UNIQUE KEY (gup_reset_key);
ALTER TABLE `gems__staff` ADD UNIQUE KEY (gsf_reset_key);
+
+-- GEMS VERSION: 47
+-- PATCH: Add return url to tokens
+-- ALTER TABLE gems__tokens ADD gto_return_url varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null AFTER gto_reception_code;
Modified: trunk/library/configs/db/tables/gems__tokens.200.sql
===================================================================
--- trunk/library/configs/db/tables/gems__tokens.200.sql 2012-04-19 10:57:42 UTC (rev 623)
+++ trunk/library/configs/db/tables/gems__tokens.200.sql 2012-04-19 14:24:44 UTC (rev 624)
@@ -2,17 +2,17 @@
CREATE TABLE if not exists gems__tokens (
gto_id_token varchar(9) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null,
- gto_id_respondent_track bigint unsigned not null
+ gto_id_respondent_track bigint unsigned not null
references gems__respondent2track (gr2t_id_respondent_track),
- gto_id_round bigint unsigned not null
+ gto_id_round bigint unsigned not null
references gems__rounds (gro_id_round),
-- non-changing fields calculated from previous two:
- gto_id_respondent bigint unsigned not null
+ gto_id_respondent bigint unsigned not null
references gems__respondents (grs_id_user),
- gto_id_organization bigint unsigned not null
+ gto_id_organization bigint unsigned not null
references gems__organizations (gor_id_organization),
- gto_id_track bigint unsigned not null
+ gto_id_track bigint unsigned not null
references gems__track (gtr_id_track),
-- values initially filled from gems__rounds, but that may get different values later on
@@ -25,14 +25,14 @@
-- real data
gto_valid_from datetime,
gto_valid_until datetime,
- gto_mail_sent_date date,
- gto_next_mail_date date,
+ gto_mail_sent_date date,
+ gto_next_mail_date date,
- gto_start_time datetime,
+ gto_start_time datetime,
gto_in_source boolean not null default 0,
gto_by bigint(20) unsigned NULL,
- gto_completion_time datetime,
+ gto_completion_time datetime,
gto_duration_in_sec bigint(20) unsigned NULL,
gto_followup_date date, -- depreciated
gto_result varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci',
@@ -41,6 +41,8 @@
gto_reception_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' default 'OK' not null
references gems__reception_codes (grc_id_reception_code),
+ -- gto_return_url varchar(250) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null default null,
+
gto_changed timestamp not null default current_timestamp on update current_timestamp,
gto_changed_by bigint unsigned not null,
gto_created timestamp not null,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-19 10:57:52
|
Revision: 623
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=623&view=rev
Author: matijsdejong
Date: 2012-04-19 10:57:42 +0000 (Thu, 19 Apr 2012)
Log Message:
-----------
User gets clearer message from program after changing an item (if specified at action level)
Modified Paths:
--------------
trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php
trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php
Modified: trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php
===================================================================
--- trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-04-18 12:53:21 UTC (rev 622)
+++ trunk/library/classes/Gems/Controller/ModelSnippetActionAbstract.php 2012-04-19 10:57:42 UTC (rev 623)
@@ -139,7 +139,8 @@
*/
public function createAction()
{
- $this->createEditParameters['formTitle'] = $this->getCreateTitle();
+ $this->createEditParameters['formTitle'] = $this->getCreateTitle();
+ $this->createEditParameters['topicCallable'] = array($this, 'getTopic');
parent::createAction();
}
@@ -160,7 +161,8 @@
*/
public function editAction()
{
- $this->createEditParameters['formTitle'] = $this->getEditTitle();
+ $this->createEditParameters['formTitle'] = $this->getEditTitle();
+ $this->createEditParameters['topicCallable'] = array($this, 'getTopic');
parent::editAction();
}
Modified: trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php
===================================================================
--- trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2012-04-18 12:53:21 UTC (rev 622)
+++ trunk/library/classes/Gems/Snippets/ModelFormSnippetAbstract.php 2012-04-19 10:57:42 UTC (rev 623)
@@ -71,6 +71,13 @@
protected $formTitle;
/**
+ * When set getTopic uses this function instead of parent class.
+ *
+ * @var callable
+ */
+ protected $topicCallable;
+
+ /**
* Required
*
* @var Gems_Menu
@@ -181,4 +188,19 @@
return sprintf($this->_('Edit %s'), $this->getTopic());
}
}
+
+ /**
+ * Helper function to allow generalized statements about the items in the model to used specific item names.
+ *
+ * @param int $count
+ * @return $string
+ */
+ public function getTopic($count = 1)
+ {
+ if (is_callable($this->topicCallable)) {
+ return call_user_func($this->topicCallable, $count);
+ } else {
+ return parent::getTopic($count);
+ }
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-18 12:53:32
|
Revision: 622
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=622&view=rev
Author: mennodekker
Date: 2012-04-18 12:53:21 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
And some more cleanup
Modified Paths:
--------------
trunk/library/classes/Gems/User/User.php
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-04-18 12:44:04 UTC (rev 621)
+++ trunk/library/classes/Gems/User/User.php 2012-04-18 12:53:21 UTC (rev 622)
@@ -126,16 +126,7 @@
protected $userLoader;
/**
- * Use Zend_Auth for authentication
*
- * Warning: Zend_Auth contains only a partial ID of the current user, the base organization is missing
- *
- * @var boolean
- */
- protected $useZendAuth = false;
-
- /**
- *
* @var Gems_Util
*/
protected $util;
@@ -330,9 +321,6 @@
*/
public function authenticate($password)
{
- if ($this->useZendAuth) {
- $zendAuth = Zend_Auth::getInstance();
- }
$auths = $this->loadAuthorizers($password);
foreach ($auths as $result) {
@@ -341,11 +329,7 @@
}
if ($result instanceof Zend_Auth_Adapter_Interface) {
- if ($this->useZendAuth) {
- $result = $zendAuth->authenticate($result);
- } else {
- $result = $result->authenticate();
- }
+ $result = $result->authenticate();
}
if ($result instanceof Zend_Auth_Result) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-18 12:44:15
|
Revision: 621
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=621&view=rev
Author: mennodekker
Date: 2012-04-18 12:44:04 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
If you don't use it anymore, why not remove it
Removed Paths:
-------------
trunk/library/classes/Gems/Auth.php
Deleted: trunk/library/classes/Gems/Auth.php
===================================================================
--- trunk/library/classes/Gems/Auth.php 2012-04-18 12:14:20 UTC (rev 620)
+++ trunk/library/classes/Gems/Auth.php 2012-04-18 12:44:04 UTC (rev 621)
@@ -1,251 +0,0 @@
-<?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 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.
- *
- * @version $Id$
- * @package Gems
- * @subpackage Auth
- * @copyright Copyright (c) 2011 Erasmus MC
- * @license New BSD License
- */
-
-/**
- * Extension to the Zend_Auth framework in order to plug in extra features
- *
- * It adds translation to Zend_Auth_Result and performs the failed_login check with delay
- * after a previous failed attempt.
- *
- * @author Menno Dekker
- * @filesource
- * @package Gems
- * @subpackage Auth
- */
-class Gems_Auth extends Zend_Auth
-{
- /**
- * Error constants
- *
- * These must be numeric constants smaller than zero for
- * Zend_Auth_Result to work.
- */
- const ERROR_DATABASE_NOT_INSTALLED = -11;
- const ERROR_PASSWORD_DELAY = -12;
-
- /**
- * @var array Message templates
- */
- protected $_messageTemplates = array(
- self::ERROR_DATABASE_NOT_INSTALLED => 'Installation not complete! Login is not yet possible!',
- self::ERROR_PASSWORD_DELAY => 'Your account is temporarily blocked, please wait %s seconds',
- );
-
- /**
- * Exponent to use when calculating delay
- * @var int
- */
- protected $_delayFactor = 4;
-
- /**
- * @var Zend_Db_Table_Adapter
- */
- public $db;
-
- public function __construct($db = null)
- {
- /**
- * Check for an adapter being defined. if not, fetch the default adapter.
- */
- if ($db === null) {
- $this->db = Zend_Db_Table_Abstract::getDefaultAdapter();
- if (null === $this->db) {
- require_once 'Zend/Validate/Exception.php';
- throw new Zend_Validate_Exception('No database adapter present');
- }
- } else {
- $this->db = $db;
- }
- }
-
- private function _error($code, $value1 = null, $value2 = null)
- {
- $messages = func_get_args();
- // array_splice($messages, 0, 1, $this->_messageTemplates[$code]);
- $messages[0] = $this->_messageTemplates[$code];
- return new Zend_Auth_Result($code, null, (array) $messages);
- }
-
- /**
- * Authenticates against the supplied adapter
- *
- * @param Zend_Auth_Adapter_Interface $adapter
- * @param array $formValues We need information not in the adapter.
- * @return Zend_Auth_Result
- */
- public function authenticate(Zend_Auth_Adapter_Interface $adapter, array $formValues = null)
- {
- try {
- $remaining = 0;
- $login_name = $formValues['userlogin'];
- $organization = $formValues['organization'];
- $sql = "SELECT gula_failed_logins, gula_last_failed FROM gems__user_login_attempts WHERE gula_login = ? AND gula_id_organization = ?";
- $values = $this->db->fetchRow($sql, array($login_name, $organization));
-
- if (! $values) {
- $values = array();
- $values['gula_login'] = $login_name;
- $values['gula_id_organization'] = $organization;
- $values['gula_failed_logins'] = 0;
- $values['gula_last_failed'] = null;
-
- } elseif ($values['gula_failed_logins'] > 0) {
- // Get the datetime
- $last = new MUtil_Date($values['gula_last_failed'], Zend_Date::ISO_8601);
-
- // How long to wait until we can ignore the previous failed attempt
- $delay = pow($values['gula_failed_logins'], GemsEscort::getInstance()->project->getAccountDelayFactor());
-
- if (abs($last->diffSeconds()) <= $delay) {
- // Response gets slowly slower
- $sleepTime = min($values['gula_failed_logins'], 10);
- sleep($sleepTime);
- $remaining = $delay - abs($last->diffSeconds()) - $sleepTime;
- if ($remaining>0) {
- $result = $this->_error(self::ERROR_PASSWORD_DELAY, $remaining);
- }
- }
- }
- } catch (Zend_Db_Exception $e) {
- // Fall through as this does not work if the database upgrade did not run
- // MUtil_Echo::r($e);
- }
-
- // We only forward to auth adapter when we have no timeout to prevent hammering the auth system
- if (! isset($result) ) {
- $result = parent::authenticate($adapter);
- }
-
- if ($result->isValid()) {
- $values['gula_failed_logins'] = 0;
- $values['gula_last_failed'] = null;
- } else {
- if ($values['gula_failed_logins']) {
- // Only increment when we have no password delay as the right password
- // will not be accepted when we are in the delay. Can not check on the error
- // code as it will be set to 'uncategorized' => -4
- if ($remaining>0) {
- $values['gula_failed_logins'] += 1;
- $values['gula_last_failed'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
- }
- } else {
- $values['gula_failed_logins'] = 1;
- $values['gula_last_failed'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
- }
- $values['gula_failed_logins'] = max($values['gula_failed_logins'], 1);
- }
-
- try {
- if (isset($values['gula_login'])) {
- $this->db->insert('gems__user_login_attempts', $values);
- } else {
- $where = $this->db->quoteInto('gula_login = ? AND ', $login_name);
- $where .= $this->db->quoteInto('gula_id_organization = ?', $organization);
- $this->db->update('gems__user_login_attempts', $values, $where);
- }
- } catch (Zend_Db_Exception $e) {
- // Fall through as this does not work if the database upgrade did not run
- // MUtil_Echo::r($e);
- }
-
- //Now localize
- $result = $this->localize($result);
-
- return $result;
- }
-
- /**
- * Returns an instance of Gems_Auth
- *
- * Singleton pattern implementation
- *
- * @return Gems_Auth Provides a fluent interface
- */
- public static function getInstance()
- {
- if (null === self::$_instance) {
- self::$_instance = new self();
- }
-
- return self::$_instance;
- }
-
- /**
- * Perform translation on an error message
- *
- * To make them showup in the .PO files, add the most common messages to
- * \library\Gems\languages\FakeTranslation.php
- * The first element in the message array is translated, while the following messages are
- * treated as sprintf parameters.
- *
- * @param Zend_Auth_Result $result
- * @return Zend_Auth_Result
- */
- public function localize($result)
- {
- $translate = GemsEscort::getInstance()->translate;
- $code = $result->getCode();
- $identity = $result->getIdentity();
- $messages = $result->getMessages();
-
- //Shift the first message off, this is the one to translate
- $message = $translate->_(array_shift($messages));
-
- /**
- * Now give a default message for some default error codes. This has the
- * positive side effect that we can remove some lines from FakeTranslations
- */
- switch ($code) {
- case Zend_Auth_Result::FAILURE_CREDENTIAL_INVALID:
- // $message = $translate->_('Wrong password.');
- // break;
- case Zend_Auth_Result::FAILURE_IDENTITY_NOT_FOUND:
- $message = $translate->_('Combination of organization, username and password not found.');
- break;
- }
-
- // Recombine with the others if any, they will be treated as params
- if (count($messages)) {
- $messages = array_merge((array) $message, (array) $messages);
-
- //Now do a sprintf if we have 1 or more params
- $messages = call_user_func_array('sprintf', $messages);
- } else {
- $messages = array($message);
- }
-
- return new Zend_Auth_Result($code, $identity, (array) $messages);
- }
-}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-18 12:14:31
|
Revision: 620
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=620&view=rev
Author: mennodekker
Date: 2012-04-18 12:14:20 +0000 (Wed, 18 Apr 2012)
Log Message:
-----------
When only one organization, the default value was not set, result was that superadmin could not even login anymore (that failure should still be fixed)
Modified Paths:
--------------
trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php
Modified: trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php
===================================================================
--- trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php 2012-04-16 11:38:07 UTC (rev 619)
+++ trunk/library/classes/Gems/User/Form/OrganizationFormAbstract.php 2012-04-18 12:14:20 UTC (rev 620)
@@ -151,9 +151,6 @@
if ($hidden) {
if (! $element instanceof Zend_Form_Element_Hidden) {
$element = new Zend_Form_Element_Hidden($this->organizationFieldName);
-
- $element->setValue($orgId);
- $this->addElement($element);
}
if (! $this->_organizationFromUrl) {
@@ -161,6 +158,9 @@
$orgId = reset($orgIds);
}
+ $element->setValue($orgId);
+ $this->addElement($element);
+
} elseif (! $element instanceof Zend_Form_Element_Select) {
$element = new Zend_Form_Element_Select($this->organizationFieldName);
$element->setLabel($this->translate->_('Organization'));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-16 11:38:18
|
Revision: 619
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=619&view=rev
Author: matijsdejong
Date: 2012-04-16 11:38:07 +0000 (Mon, 16 Apr 2012)
Log Message:
-----------
Merged revision(s) 618 from tags/1.5.3-rc2:
New staff can login by default
Some extra comment for debugging
........
Modified Paths:
--------------
trunk/library/classes/Gems/Default/StaffAction.php
trunk/library/classes/Gems/User/UserLoader.php
Property Changed:
----------------
trunk/
trunk/library/
Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
/tags/1.5.3-rc2:612,614,616
+ /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
/tags/1.5.3-rc2:612,614,616,618
Property changes on: trunk/library
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/1.5.0-pulse/library:306-344,346,467
/branches/1.5.x/library:426-455,458-472,475-481
/branches/newUser:113-150
/branches/newUser2:175-207
/branches/userloader:259-324
/tags/1.5.0beta1/library:305
/tags/1.5.1/library:485,489,509-510,534
/tags/1.5.3-rc2/library:612,614,616
+ /branches/1.5.0-pulse/library:306-344,346,467
/branches/1.5.x/library:426-455,458-472,475-481
/branches/newUser:113-150
/branches/newUser2:175-207
/branches/userloader:259-324
/tags/1.5.0beta1/library:305
/tags/1.5.1/library:485,489,509-510,534
/tags/1.5.3-rc2/library:612,614,616,618
Modified: trunk/library/classes/Gems/Default/StaffAction.php
===================================================================
--- trunk/library/classes/Gems/Default/StaffAction.php 2012-04-16 11:35:08 UTC (rev 618)
+++ trunk/library/classes/Gems/Default/StaffAction.php 2012-04-16 11:38:07 UTC (rev 619)
@@ -292,7 +292,7 @@
$orgDef = $org->get('gor_user_class', $this->defaultStaffDefinition);
$model->set('gul_user_class', 'default', $orgDef, 'multiOptions', $this->loader->getUserLoader()->getAvailableStaffDefinitions());
$model->set('gsf_iso_lang', 'label', $this->_('Language'), 'multiOptions', $this->util->getLocalized()->getLanguages());
- $model->set('gul_can_login', 'label', $this->_('Can login'), 'multiOptions', $this->util->getTranslated()->getYesNo());
+ $model->set('gul_can_login', 'label', $this->_('Can login'), 'multiOptions', $this->util->getTranslated()->getYesNo(), 'default', 1);
$model->set('gsf_logout_on_survey', 'label', $this->_('Logout on survey'), 'multiOptions', $this->util->getTranslated()->getYesNo());
}
Modified: trunk/library/classes/Gems/User/UserLoader.php
===================================================================
--- trunk/library/classes/Gems/User/UserLoader.php 2012-04-16 11:35:08 UTC (rev 618)
+++ trunk/library/classes/Gems/User/UserLoader.php 2012-04-16 11:38:07 UTC (rev 619)
@@ -503,7 +503,10 @@
// Fail over for pre 1.5 projects
//
- // No login as other organization or with e-mail possible for first login
+ // No login as other organization or with e-mail possible for first login, before running of upgrade / patches
+ //
+ // Test code voor old user, code for password 'guest' is: 084e0343a0486ff05530df6c705c8bb4,
+ // for 'test4': 86985e105f79b95d6bc918fb45ec7727
$sql = "SELECT gsf_id_user
FROM gems__staff INNER JOIN
gems__organizations ON gsf_id_organization = gor_id_organization
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-16 11:35:19
|
Revision: 618
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=618&view=rev
Author: matijsdejong
Date: 2012-04-16 11:35:08 +0000 (Mon, 16 Apr 2012)
Log Message:
-----------
New staff can login by default
Some extra comment for debugging
Modified Paths:
--------------
tags/1.5.3-rc2/library/classes/Gems/Default/StaffAction.php
tags/1.5.3-rc2/library/classes/Gems/User/UserLoader.php
Modified: tags/1.5.3-rc2/library/classes/Gems/Default/StaffAction.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Default/StaffAction.php 2012-04-12 13:50:23 UTC (rev 617)
+++ tags/1.5.3-rc2/library/classes/Gems/Default/StaffAction.php 2012-04-16 11:35:08 UTC (rev 618)
@@ -292,7 +292,7 @@
$orgDef = $org->get('gor_user_class', $this->defaultStaffDefinition);
$model->set('gul_user_class', 'default', $orgDef, 'multiOptions', $this->loader->getUserLoader()->getAvailableStaffDefinitions());
$model->set('gsf_iso_lang', 'label', $this->_('Language'), 'multiOptions', $this->util->getLocalized()->getLanguages());
- $model->set('gul_can_login', 'label', $this->_('Can login'), 'multiOptions', $this->util->getTranslated()->getYesNo());
+ $model->set('gul_can_login', 'label', $this->_('Can login'), 'multiOptions', $this->util->getTranslated()->getYesNo(), 'default', 1);
$model->set('gsf_logout_on_survey', 'label', $this->_('Logout on survey'), 'multiOptions', $this->util->getTranslated()->getYesNo());
}
Modified: tags/1.5.3-rc2/library/classes/Gems/User/UserLoader.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/User/UserLoader.php 2012-04-12 13:50:23 UTC (rev 617)
+++ tags/1.5.3-rc2/library/classes/Gems/User/UserLoader.php 2012-04-16 11:35:08 UTC (rev 618)
@@ -503,7 +503,10 @@
// Fail over for pre 1.5 projects
//
- // No login as other organization or with e-mail possible for first login
+ // No login as other organization or with e-mail possible for first login, before running of upgrade / patches
+ //
+ // Test code voor old user, code for password 'guest' is: 084e0343a0486ff05530df6c705c8bb4,
+ // for 'test4': 86985e105f79b95d6bc918fb45ec7727
$sql = "SELECT gsf_id_user
FROM gems__staff INNER JOIN
gems__organizations ON gsf_id_organization = gor_id_organization
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-12 13:50:33
|
Revision: 617
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=617&view=rev
Author: matijsdejong
Date: 2012-04-12 13:50:23 +0000 (Thu, 12 Apr 2012)
Log Message:
-----------
Merged revision(s) 616 from tags/1.5.3-rc2:
TokenPlan did not confirm to token return policy, resulted in strange behaviour
Removed familiar Dutch words (use of 'je')
........
Modified Paths:
--------------
trunk/library/classes/Gems/Default/TokenPlanAction.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
Property Changed:
----------------
trunk/
trunk/library/
Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
/tags/1.5.3-rc2:612,614
+ /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
/tags/1.5.3-rc2:612,614,616
Property changes on: trunk/library
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/1.5.0-pulse/library:306-344,346,467
/branches/1.5.x/library:426-455,458-472,475-481
/branches/newUser:113-150
/branches/newUser2:175-207
/branches/userloader:259-324
/tags/1.5.0beta1/library:305
/tags/1.5.1/library:485,489,509-510,534
/tags/1.5.3-rc2/library:612,614
+ /branches/1.5.0-pulse/library:306-344,346,467
/branches/1.5.x/library:426-455,458-472,475-481
/branches/newUser:113-150
/branches/newUser2:175-207
/branches/userloader:259-324
/tags/1.5.0beta1/library:305
/tags/1.5.1/library:485,489,509-510,534
/tags/1.5.3-rc2/library:612,614,616
Modified: trunk/library/classes/Gems/Default/TokenPlanAction.php
===================================================================
--- trunk/library/classes/Gems/Default/TokenPlanAction.php 2012-04-12 13:46:35 UTC (rev 616)
+++ trunk/library/classes/Gems/Default/TokenPlanAction.php 2012-04-12 13:50:23 UTC (rev 617)
@@ -344,7 +344,7 @@
if (($this->escort instanceof Gems_Project_Organization_MultiOrganizationInterface)) {
$availableOrganizations = $this->util->getDbLookup()->getOrganizationsWithRespondents();
$allowedOrganizations = $this->loader->getCurrentUser()->getAllowedOrganizations();
-
+
$options = array_intersect($availableOrganizations, $allowedOrganizations);
$elements[] = $this->_createSelectElement('gto_id_organization', $options);
@@ -488,6 +488,9 @@
return $this->_('Token planning');
}
+ /**
+ * Default overview action
+ */
public function indexAction()
{
// MUtil_Model::$verbose = true;
@@ -497,4 +500,19 @@
parent::indexAction();
}
+
+ /**
+ * Initialize translate and html objects
+ *
+ * Called from {@link __construct()} as final step of object instantiation.
+ *
+ * @return void
+ */
+ public function init()
+ {
+ parent::init();
+
+ // Tell the system where to return to after a survey has been taken
+ $this->loader->getCurrentUser()->setSurveyReturn($this->getRequest());
+ }
}
Modified: trunk/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-en.po
===================================================================
--- trunk/library/languages/default-en.po 2012-04-12 13:46:35 UTC (rev 616)
+++ trunk/library/languages/default-en.po 2012-04-12 13:50:23 UTC (rev 617)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-08 16:56+0100\n"
+"POT-Creation-Date: 2012-04-12 15:06+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -484,61 +484,61 @@
msgid "No %s found"
msgstr "No %s found"
-#: classes/Gems/Controller/BrowseEditAction.php:662
+#: classes/Gems/Controller/BrowseEditAction.php:673
#: classes/Gems/Default/ExportAction.php:234
#, php-format
msgid "No %s found."
msgstr "No %s found."
-#: classes/Gems/Controller/BrowseEditAction.php:780
+#: classes/Gems/Controller/BrowseEditAction.php:791
msgid "Are you sure?"
msgstr "Are you sure?"
-#: classes/Gems/Controller/BrowseEditAction.php:796
+#: classes/Gems/Controller/BrowseEditAction.php:807
#: classes/Gems/Default/DatabaseAction.php:187
#: classes/Gems/Default/DatabaseAction.php:499
msgid "Yes"
msgstr "Yes"
-#: classes/Gems/Controller/BrowseEditAction.php:797
+#: classes/Gems/Controller/BrowseEditAction.php:808
#: classes/Gems/Default/DatabaseAction.php:188
#: classes/Gems/Default/DatabaseAction.php:500
msgid "No"
msgstr "No"
-#: classes/Gems/Controller/BrowseEditAction.php:850
+#: classes/Gems/Controller/BrowseEditAction.php:861
#, php-format
msgid "Unknown %s requested"
msgstr "Unknown %s requested"
-#: classes/Gems/Controller/BrowseEditAction.php:873
+#: classes/Gems/Controller/BrowseEditAction.php:884
#, php-format
msgid "New %1$s..."
msgstr "New %1$s..."
-#: classes/Gems/Controller/BrowseEditAction.php:881
+#: classes/Gems/Controller/BrowseEditAction.php:892
msgid "Save"
msgstr "Save"
-#: classes/Gems/Controller/BrowseEditAction.php:917
+#: classes/Gems/Controller/BrowseEditAction.php:928
#, php-format
msgid "%2$u %1$s saved"
msgstr "%2$u %1$s saved"
-#: classes/Gems/Controller/BrowseEditAction.php:920
+#: classes/Gems/Controller/BrowseEditAction.php:931
msgid "No changes to save."
msgstr "No changes to save."
-#: classes/Gems/Controller/BrowseEditAction.php:929
+#: classes/Gems/Controller/BrowseEditAction.php:940
msgid "Input error! No changes saved!"
msgstr "Input error! No changes saved!"
-#: classes/Gems/Controller/BrowseEditAction.php:957
+#: classes/Gems/Controller/BrowseEditAction.php:968
#, php-format
msgid "Show %s"
msgstr "Show %s"
-#: classes/Gems/Controller/BrowseEditAction.php:964
+#: classes/Gems/Controller/BrowseEditAction.php:975
#, php-format
msgid "Unknown %s."
msgstr "Unknown %s."
@@ -616,22 +616,22 @@
msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
msgstr "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
-#: classes/Gems/Default/AskAction.php:132
+#: classes/Gems/Default/AskAction.php:131
#, php-format
msgid "Thank you for answering. At the moment we have no further surveys for you to take."
msgstr "Thank you for answering. At the moment we have no further surveys for you to take."
-#: classes/Gems/Default/AskAction.php:134
+#: classes/Gems/Default/AskAction.php:133
#, php-format
msgid "The survey for token %s has been answered and no further surveys are open."
msgstr "The survey for token %s has been answered and no further surveys are open."
-#: classes/Gems/Default/AskAction.php:141
+#: classes/Gems/Default/AskAction.php:140
#, php-format
msgid "The token %s does not exist (any more)."
msgstr "The token %s does not exist (any more)."
-#: classes/Gems/Default/AskAction.php:243
+#: classes/Gems/Default/AskAction.php:241
#, php-format
msgid "The survey for token %s is no longer active."
msgstr "The survey for token %s is no longer active."
@@ -1489,11 +1489,11 @@
msgid "Style"
msgstr "Style"
-#: classes/Gems/Default/OrganizationAction.php:123
+#: classes/Gems/Default/OrganizationAction.php:124
msgid "Default url's"
msgstr "Default url's"
-#: classes/Gems/Default/OrganizationAction.php:125
+#: classes/Gems/Default/OrganizationAction.php:126
#, php-format
msgid "Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."
msgstr "Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."
@@ -3592,9 +3592,8 @@
msgstr "should not contain non alphanumeric characters"
#: classes/Gems/User/PasswordChecker.php:188
-#, php-format
-msgid "should not contain your login name \"%s\""
-msgstr "should not contain your login name \"%s\""
+msgid "should not contain your login name"
+msgstr "should not contain your login name"
#: classes/Gems/User/PasswordChecker.php:207
#, php-format
Modified: trunk/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-nl.po
===================================================================
--- trunk/library/languages/default-nl.po 2012-04-12 13:46:35 UTC (rev 616)
+++ trunk/library/languages/default-nl.po 2012-04-12 13:50:23 UTC (rev 617)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-08 16:56+0100\n"
+"POT-Creation-Date: 2012-04-12 15:06+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -484,61 +484,61 @@
msgid "No %s found"
msgstr "Geen %s gevonden"
-#: classes/Gems/Controller/BrowseEditAction.php:662
+#: classes/Gems/Controller/BrowseEditAction.php:673
#: classes/Gems/Default/ExportAction.php:234
#, php-format
msgid "No %s found."
msgstr "Geen %s gevonden."
-#: classes/Gems/Controller/BrowseEditAction.php:780
+#: classes/Gems/Controller/BrowseEditAction.php:791
msgid "Are you sure?"
msgstr "Weet u het zeker?"
-#: classes/Gems/Controller/BrowseEditAction.php:796
+#: classes/Gems/Controller/BrowseEditAction.php:807
#: classes/Gems/Default/DatabaseAction.php:187
#: classes/Gems/Default/DatabaseAction.php:499
msgid "Yes"
msgstr "Ja"
-#: classes/Gems/Controller/BrowseEditAction.php:797
+#: classes/Gems/Controller/BrowseEditAction.php:808
#: classes/Gems/Default/DatabaseAction.php:188
#: classes/Gems/Default/DatabaseAction.php:500
msgid "No"
msgstr "Nee"
-#: classes/Gems/Controller/BrowseEditAction.php:850
+#: classes/Gems/Controller/BrowseEditAction.php:861
#, php-format
msgid "Unknown %s requested"
msgstr "Onjuist %s verzoek"
-#: classes/Gems/Controller/BrowseEditAction.php:873
+#: classes/Gems/Controller/BrowseEditAction.php:884
#, php-format
msgid "New %1$s..."
msgstr "Nieuwe %1$s..."
-#: classes/Gems/Controller/BrowseEditAction.php:881
+#: classes/Gems/Controller/BrowseEditAction.php:892
msgid "Save"
msgstr "Opslaan"
-#: classes/Gems/Controller/BrowseEditAction.php:917
+#: classes/Gems/Controller/BrowseEditAction.php:928
#, php-format
msgid "%2$u %1$s saved"
msgstr "%2$u %1$s opgeslagen"
-#: classes/Gems/Controller/BrowseEditAction.php:920
+#: classes/Gems/Controller/BrowseEditAction.php:931
msgid "No changes to save."
msgstr "Geen verandering om op te slaan."
-#: classes/Gems/Controller/BrowseEditAction.php:929
+#: classes/Gems/Controller/BrowseEditAction.php:940
msgid "Input error! No changes saved!"
msgstr "Invoer fout! Veranderingen niet opgeslagen!"
-#: classes/Gems/Controller/BrowseEditAction.php:957
+#: classes/Gems/Controller/BrowseEditAction.php:968
#, php-format
msgid "Show %s"
msgstr "Toon %s"
-#: classes/Gems/Controller/BrowseEditAction.php:964
+#: classes/Gems/Controller/BrowseEditAction.php:975
#, php-format
msgid "Unknown %s."
msgstr "%s is onbekend."
@@ -551,7 +551,7 @@
#: classes/Gems/Controller/ModelSnippetActionAbstract.php:236
#, php-format
msgid "Do you want to delete this %s?"
-msgstr "Weet je zeker dat deze %s verwijderd moet worden?"
+msgstr "Weet u zeker dat deze %s verwijderd moet worden?"
#: classes/Gems/Controller/ModelSnippetActionAbstract.php:256
#, php-format
@@ -616,22 +616,22 @@
msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
msgstr "Er wordt geen verschil gemaakt tussen het getal nul en de letter O en ook niet tussen het getal één en de letter L."
-#: classes/Gems/Default/AskAction.php:132
+#: classes/Gems/Default/AskAction.php:131
#, php-format
msgid "Thank you for answering. At the moment we have no further surveys for you to take."
msgstr "Dank u voor uw antwoorden. Op dit moment hebben we geen vragenlijsten meer voor u."
-#: classes/Gems/Default/AskAction.php:134
+#: classes/Gems/Default/AskAction.php:133
#, php-format
msgid "The survey for token %s has been answered and no further surveys are open."
msgstr "De vragenlijst met het kenmerk %s is beantwoord en er staan verder geen vragenlijsten open."
-#: classes/Gems/Default/AskAction.php:141
+#: classes/Gems/Default/AskAction.php:140
#, php-format
msgid "The token %s does not exist (any more)."
msgstr "Het kenmerk %s bestaat niet (meer)."
-#: classes/Gems/Default/AskAction.php:243
+#: classes/Gems/Default/AskAction.php:241
#, php-format
msgid "The survey for token %s is no longer active."
msgstr "De vragenlijst voor kenmerk %s is niet meer in gebruik."
@@ -931,8 +931,8 @@
#: classes/Gems/Default/DatabaseAction.php:489
msgid "Are you sure you want to create it?"
msgid_plural "Are you sure you want to create them all?"
-msgstr[0] "Weet je zeker dat je dat object wil aanmaken?"
-msgstr[1] "Weet je zeker dat je ze allemaal wil aanmaken?"
+msgstr[0] "Weet u zeker dat u dit wil aanmaken?"
+msgstr[1] "Weet u zeker dat u deze allemaal wil aanmaken?"
#: classes/Gems/Default/DatabaseAction.php:502
msgid "All database objects exist. There is nothing to create."
@@ -1489,11 +1489,11 @@
msgid "Style"
msgstr "Stijl"
-#: classes/Gems/Default/OrganizationAction.php:123
+#: classes/Gems/Default/OrganizationAction.php:124
msgid "Default url's"
msgstr "Standaard url's"
-#: classes/Gems/Default/OrganizationAction.php:125
+#: classes/Gems/Default/OrganizationAction.php:126
#, php-format
msgid "Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."
msgstr "Altijd naar deze organisatie overschakelen als %s vanaf één van deze door spatie gescheiden url's wordt aangeroepen. De eerste url wordt gebruikt voor emails."
@@ -2414,7 +2414,7 @@
#: classes/Gems/Default/TrackAction.php:410
msgid "Do you want to delete this track?"
-msgstr "Weet je zeker dat dit traject verwijderd moet worden?"
+msgstr "Weet u zeker dat dit traject verwijderd moet worden?"
#: classes/Gems/Default/TrackAction.php:412
msgid "Delete track"
@@ -3592,9 +3592,8 @@
msgstr "mag alleen letters en cijfers bevatten"
#: classes/Gems/User/PasswordChecker.php:188
-#, php-format
-msgid "should not contain your login name \"%s\""
-msgstr "mag niet je gebruikersnaam \"%s\" bevatten"
+msgid "should not contain your login name"
+msgstr "mag niet uw gebruikersnaam bevatten"
#: classes/Gems/User/PasswordChecker.php:207
#, php-format
@@ -3888,7 +3887,7 @@
#: classes/MUtil/Snippets/ModelYesNoDeleteSnippetAbstract.php:108
msgid "Do you really want to delete this item?"
-msgstr "Weet je zeker dat dit item verwijderd moet worden?"
+msgstr "Weet u zeker dat dit item verwijderd moet worden?"
#: languages/FakeTranslations.php:40
msgid "Value is required and can't be empty"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-12 13:46:46
|
Revision: 616
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=616&view=rev
Author: matijsdejong
Date: 2012-04-12 13:46:35 +0000 (Thu, 12 Apr 2012)
Log Message:
-----------
TokenPlan did not confirm to token return policy, resulted in strange behaviour
Removed familiar Dutch words (use of 'je')
Modified Paths:
--------------
tags/1.5.3-rc2/library/classes/Gems/Default/TokenPlanAction.php
tags/1.5.3-rc2/library/languages/default-en.mo
tags/1.5.3-rc2/library/languages/default-en.po
tags/1.5.3-rc2/library/languages/default-nl.mo
tags/1.5.3-rc2/library/languages/default-nl.po
Modified: tags/1.5.3-rc2/library/classes/Gems/Default/TokenPlanAction.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Default/TokenPlanAction.php 2012-04-12 12:34:32 UTC (rev 615)
+++ tags/1.5.3-rc2/library/classes/Gems/Default/TokenPlanAction.php 2012-04-12 13:46:35 UTC (rev 616)
@@ -344,7 +344,7 @@
if (($this->escort instanceof Gems_Project_Organization_MultiOrganizationInterface)) {
$availableOrganizations = $this->util->getDbLookup()->getOrganizationsWithRespondents();
$allowedOrganizations = $this->loader->getCurrentUser()->getAllowedOrganizations();
-
+
$options = array_intersect($availableOrganizations, $allowedOrganizations);
$elements[] = $this->_createSelectElement('gto_id_organization', $options);
@@ -488,6 +488,9 @@
return $this->_('Token planning');
}
+ /**
+ * Default overview action
+ */
public function indexAction()
{
// MUtil_Model::$verbose = true;
@@ -497,4 +500,19 @@
parent::indexAction();
}
+
+ /**
+ * Initialize translate and html objects
+ *
+ * Called from {@link __construct()} as final step of object instantiation.
+ *
+ * @return void
+ */
+ public function init()
+ {
+ parent::init();
+
+ // Tell the system where to return to after a survey has been taken
+ $this->loader->getCurrentUser()->setSurveyReturn($this->getRequest());
+ }
}
Modified: tags/1.5.3-rc2/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: tags/1.5.3-rc2/library/languages/default-en.po
===================================================================
--- tags/1.5.3-rc2/library/languages/default-en.po 2012-04-12 12:34:32 UTC (rev 615)
+++ tags/1.5.3-rc2/library/languages/default-en.po 2012-04-12 13:46:35 UTC (rev 616)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-08 16:56+0100\n"
+"POT-Creation-Date: 2012-04-12 15:06+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -484,61 +484,61 @@
msgid "No %s found"
msgstr "No %s found"
-#: classes/Gems/Controller/BrowseEditAction.php:662
+#: classes/Gems/Controller/BrowseEditAction.php:673
#: classes/Gems/Default/ExportAction.php:234
#, php-format
msgid "No %s found."
msgstr "No %s found."
-#: classes/Gems/Controller/BrowseEditAction.php:780
+#: classes/Gems/Controller/BrowseEditAction.php:791
msgid "Are you sure?"
msgstr "Are you sure?"
-#: classes/Gems/Controller/BrowseEditAction.php:796
+#: classes/Gems/Controller/BrowseEditAction.php:807
#: classes/Gems/Default/DatabaseAction.php:187
#: classes/Gems/Default/DatabaseAction.php:499
msgid "Yes"
msgstr "Yes"
-#: classes/Gems/Controller/BrowseEditAction.php:797
+#: classes/Gems/Controller/BrowseEditAction.php:808
#: classes/Gems/Default/DatabaseAction.php:188
#: classes/Gems/Default/DatabaseAction.php:500
msgid "No"
msgstr "No"
-#: classes/Gems/Controller/BrowseEditAction.php:850
+#: classes/Gems/Controller/BrowseEditAction.php:861
#, php-format
msgid "Unknown %s requested"
msgstr "Unknown %s requested"
-#: classes/Gems/Controller/BrowseEditAction.php:873
+#: classes/Gems/Controller/BrowseEditAction.php:884
#, php-format
msgid "New %1$s..."
msgstr "New %1$s..."
-#: classes/Gems/Controller/BrowseEditAction.php:881
+#: classes/Gems/Controller/BrowseEditAction.php:892
msgid "Save"
msgstr "Save"
-#: classes/Gems/Controller/BrowseEditAction.php:917
+#: classes/Gems/Controller/BrowseEditAction.php:928
#, php-format
msgid "%2$u %1$s saved"
msgstr "%2$u %1$s saved"
-#: classes/Gems/Controller/BrowseEditAction.php:920
+#: classes/Gems/Controller/BrowseEditAction.php:931
msgid "No changes to save."
msgstr "No changes to save."
-#: classes/Gems/Controller/BrowseEditAction.php:929
+#: classes/Gems/Controller/BrowseEditAction.php:940
msgid "Input error! No changes saved!"
msgstr "Input error! No changes saved!"
-#: classes/Gems/Controller/BrowseEditAction.php:957
+#: classes/Gems/Controller/BrowseEditAction.php:968
#, php-format
msgid "Show %s"
msgstr "Show %s"
-#: classes/Gems/Controller/BrowseEditAction.php:964
+#: classes/Gems/Controller/BrowseEditAction.php:975
#, php-format
msgid "Unknown %s."
msgstr "Unknown %s."
@@ -616,22 +616,22 @@
msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
msgstr "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
-#: classes/Gems/Default/AskAction.php:132
+#: classes/Gems/Default/AskAction.php:131
#, php-format
msgid "Thank you for answering. At the moment we have no further surveys for you to take."
msgstr "Thank you for answering. At the moment we have no further surveys for you to take."
-#: classes/Gems/Default/AskAction.php:134
+#: classes/Gems/Default/AskAction.php:133
#, php-format
msgid "The survey for token %s has been answered and no further surveys are open."
msgstr "The survey for token %s has been answered and no further surveys are open."
-#: classes/Gems/Default/AskAction.php:141
+#: classes/Gems/Default/AskAction.php:140
#, php-format
msgid "The token %s does not exist (any more)."
msgstr "The token %s does not exist (any more)."
-#: classes/Gems/Default/AskAction.php:243
+#: classes/Gems/Default/AskAction.php:241
#, php-format
msgid "The survey for token %s is no longer active."
msgstr "The survey for token %s is no longer active."
@@ -1489,11 +1489,11 @@
msgid "Style"
msgstr "Style"
-#: classes/Gems/Default/OrganizationAction.php:123
+#: classes/Gems/Default/OrganizationAction.php:124
msgid "Default url's"
msgstr "Default url's"
-#: classes/Gems/Default/OrganizationAction.php:125
+#: classes/Gems/Default/OrganizationAction.php:126
#, php-format
msgid "Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."
msgstr "Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."
@@ -3592,9 +3592,8 @@
msgstr "should not contain non alphanumeric characters"
#: classes/Gems/User/PasswordChecker.php:188
-#, php-format
-msgid "should not contain your login name \"%s\""
-msgstr "should not contain your login name \"%s\""
+msgid "should not contain your login name"
+msgstr "should not contain your login name"
#: classes/Gems/User/PasswordChecker.php:207
#, php-format
Modified: tags/1.5.3-rc2/library/languages/default-nl.mo
===================================================================
(Binary files differ)
Modified: tags/1.5.3-rc2/library/languages/default-nl.po
===================================================================
--- tags/1.5.3-rc2/library/languages/default-nl.po 2012-04-12 12:34:32 UTC (rev 615)
+++ tags/1.5.3-rc2/library/languages/default-nl.po 2012-04-12 13:46:35 UTC (rev 616)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker NL\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-08 16:56+0100\n"
+"POT-Creation-Date: 2012-04-12 15:06+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -484,61 +484,61 @@
msgid "No %s found"
msgstr "Geen %s gevonden"
-#: classes/Gems/Controller/BrowseEditAction.php:662
+#: classes/Gems/Controller/BrowseEditAction.php:673
#: classes/Gems/Default/ExportAction.php:234
#, php-format
msgid "No %s found."
msgstr "Geen %s gevonden."
-#: classes/Gems/Controller/BrowseEditAction.php:780
+#: classes/Gems/Controller/BrowseEditAction.php:791
msgid "Are you sure?"
msgstr "Weet u het zeker?"
-#: classes/Gems/Controller/BrowseEditAction.php:796
+#: classes/Gems/Controller/BrowseEditAction.php:807
#: classes/Gems/Default/DatabaseAction.php:187
#: classes/Gems/Default/DatabaseAction.php:499
msgid "Yes"
msgstr "Ja"
-#: classes/Gems/Controller/BrowseEditAction.php:797
+#: classes/Gems/Controller/BrowseEditAction.php:808
#: classes/Gems/Default/DatabaseAction.php:188
#: classes/Gems/Default/DatabaseAction.php:500
msgid "No"
msgstr "Nee"
-#: classes/Gems/Controller/BrowseEditAction.php:850
+#: classes/Gems/Controller/BrowseEditAction.php:861
#, php-format
msgid "Unknown %s requested"
msgstr "Onjuist %s verzoek"
-#: classes/Gems/Controller/BrowseEditAction.php:873
+#: classes/Gems/Controller/BrowseEditAction.php:884
#, php-format
msgid "New %1$s..."
msgstr "Nieuwe %1$s..."
-#: classes/Gems/Controller/BrowseEditAction.php:881
+#: classes/Gems/Controller/BrowseEditAction.php:892
msgid "Save"
msgstr "Opslaan"
-#: classes/Gems/Controller/BrowseEditAction.php:917
+#: classes/Gems/Controller/BrowseEditAction.php:928
#, php-format
msgid "%2$u %1$s saved"
msgstr "%2$u %1$s opgeslagen"
-#: classes/Gems/Controller/BrowseEditAction.php:920
+#: classes/Gems/Controller/BrowseEditAction.php:931
msgid "No changes to save."
msgstr "Geen verandering om op te slaan."
-#: classes/Gems/Controller/BrowseEditAction.php:929
+#: classes/Gems/Controller/BrowseEditAction.php:940
msgid "Input error! No changes saved!"
msgstr "Invoer fout! Veranderingen niet opgeslagen!"
-#: classes/Gems/Controller/BrowseEditAction.php:957
+#: classes/Gems/Controller/BrowseEditAction.php:968
#, php-format
msgid "Show %s"
msgstr "Toon %s"
-#: classes/Gems/Controller/BrowseEditAction.php:964
+#: classes/Gems/Controller/BrowseEditAction.php:975
#, php-format
msgid "Unknown %s."
msgstr "%s is onbekend."
@@ -551,7 +551,7 @@
#: classes/Gems/Controller/ModelSnippetActionAbstract.php:236
#, php-format
msgid "Do you want to delete this %s?"
-msgstr "Weet je zeker dat deze %s verwijderd moet worden?"
+msgstr "Weet u zeker dat deze %s verwijderd moet worden?"
#: classes/Gems/Controller/ModelSnippetActionAbstract.php:256
#, php-format
@@ -616,22 +616,22 @@
msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
msgstr "Er wordt geen verschil gemaakt tussen het getal nul en de letter O en ook niet tussen het getal één en de letter L."
-#: classes/Gems/Default/AskAction.php:132
+#: classes/Gems/Default/AskAction.php:131
#, php-format
msgid "Thank you for answering. At the moment we have no further surveys for you to take."
msgstr "Dank u voor uw antwoorden. Op dit moment hebben we geen vragenlijsten meer voor u."
-#: classes/Gems/Default/AskAction.php:134
+#: classes/Gems/Default/AskAction.php:133
#, php-format
msgid "The survey for token %s has been answered and no further surveys are open."
msgstr "De vragenlijst met het kenmerk %s is beantwoord en er staan verder geen vragenlijsten open."
-#: classes/Gems/Default/AskAction.php:141
+#: classes/Gems/Default/AskAction.php:140
#, php-format
msgid "The token %s does not exist (any more)."
msgstr "Het kenmerk %s bestaat niet (meer)."
-#: classes/Gems/Default/AskAction.php:243
+#: classes/Gems/Default/AskAction.php:241
#, php-format
msgid "The survey for token %s is no longer active."
msgstr "De vragenlijst voor kenmerk %s is niet meer in gebruik."
@@ -931,8 +931,8 @@
#: classes/Gems/Default/DatabaseAction.php:489
msgid "Are you sure you want to create it?"
msgid_plural "Are you sure you want to create them all?"
-msgstr[0] "Weet je zeker dat je dat object wil aanmaken?"
-msgstr[1] "Weet je zeker dat je ze allemaal wil aanmaken?"
+msgstr[0] "Weet u zeker dat u dit wil aanmaken?"
+msgstr[1] "Weet u zeker dat u deze allemaal wil aanmaken?"
#: classes/Gems/Default/DatabaseAction.php:502
msgid "All database objects exist. There is nothing to create."
@@ -1489,11 +1489,11 @@
msgid "Style"
msgstr "Stijl"
-#: classes/Gems/Default/OrganizationAction.php:123
+#: classes/Gems/Default/OrganizationAction.php:124
msgid "Default url's"
msgstr "Standaard url's"
-#: classes/Gems/Default/OrganizationAction.php:125
+#: classes/Gems/Default/OrganizationAction.php:126
#, php-format
msgid "Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."
msgstr "Altijd naar deze organisatie overschakelen als %s vanaf één van deze door spatie gescheiden url's wordt aangeroepen. De eerste url wordt gebruikt voor emails."
@@ -2414,7 +2414,7 @@
#: classes/Gems/Default/TrackAction.php:410
msgid "Do you want to delete this track?"
-msgstr "Weet je zeker dat dit traject verwijderd moet worden?"
+msgstr "Weet u zeker dat dit traject verwijderd moet worden?"
#: classes/Gems/Default/TrackAction.php:412
msgid "Delete track"
@@ -3592,9 +3592,8 @@
msgstr "mag alleen letters en cijfers bevatten"
#: classes/Gems/User/PasswordChecker.php:188
-#, php-format
-msgid "should not contain your login name \"%s\""
-msgstr "mag niet je gebruikersnaam \"%s\" bevatten"
+msgid "should not contain your login name"
+msgstr "mag niet uw gebruikersnaam bevatten"
#: classes/Gems/User/PasswordChecker.php:207
#, php-format
@@ -3888,7 +3887,7 @@
#: classes/MUtil/Snippets/ModelYesNoDeleteSnippetAbstract.php:108
msgid "Do you really want to delete this item?"
-msgstr "Weet je zeker dat dit item verwijderd moet worden?"
+msgstr "Weet u zeker dat dit item verwijderd moet worden?"
#: languages/FakeTranslations.php:40
msgid "Value is required and can't be empty"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-12 12:34:43
|
Revision: 615
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=615&view=rev
Author: matijsdejong
Date: 2012-04-12 12:34:32 +0000 (Thu, 12 Apr 2012)
Log Message:
-----------
Merged revision(s) 614 from tags/1.5.3-rc2:
At organization level Url_base was not always shown
Upgrades showed warning
Password checker had security leak in that username was show during password reset
BrowseEditAction did not pass empty parameters on correctly, so moved filter on empty values from RequestCache
........
Modified Paths:
--------------
trunk/library/classes/Gems/Controller/BrowseEditAction.php
trunk/library/classes/Gems/Default/OrganizationAction.php
trunk/library/classes/Gems/Upgrades.php
trunk/library/classes/Gems/User/PasswordChecker.php
trunk/library/classes/Gems/Util/RequestCache.php
Property Changed:
----------------
trunk/
trunk/library/
Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
/tags/1.5.3-rc2:612
+ /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
/tags/1.5.3-rc2:612,614
Property changes on: trunk/library
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/1.5.0-pulse/library:306-344,346,467
/branches/1.5.x/library:426-455,458-472,475-481
/branches/newUser:113-150
/branches/newUser2:175-207
/branches/userloader:259-324
/tags/1.5.0beta1/library:305
/tags/1.5.1/library:485,489,509-510,534
/tags/1.5.3-rc2/library:612
+ /branches/1.5.0-pulse/library:306-344,346,467
/branches/1.5.x/library:426-455,458-472,475-481
/branches/newUser:113-150
/branches/newUser2:175-207
/branches/userloader:259-324
/tags/1.5.0beta1/library:305
/tags/1.5.1/library:485,489,509-510,534
/tags/1.5.3-rc2/library:612,614
Modified: trunk/library/classes/Gems/Controller/BrowseEditAction.php
===================================================================
--- trunk/library/classes/Gems/Controller/BrowseEditAction.php 2012-04-12 12:01:29 UTC (rev 614)
+++ trunk/library/classes/Gems/Controller/BrowseEditAction.php 2012-04-12 12:34:32 UTC (rev 615)
@@ -597,9 +597,10 @@
* @param boolean $includeDefaults Include the default values (yes for filtering, no for urls
* @param string $sourceAction The action to get the cache from if not the current one.
* @param boolean $readonly Optional, tell the cache not to store any new values
+ * @param boolean $filterEmpty Optional, filter empty values from cache
* @return array
*/
- public function getCachedRequestData($includeDefaults = true, $sourceAction = null, $readonly = false)
+ public function getCachedRequestData($includeDefaults = true, $sourceAction = null, $readonly = false, $filterEmpty = true)
{
if (! $this->requestCache) {
$this->requestCache = $this->util->getRequestCache($sourceAction, $readonly);
@@ -614,6 +615,16 @@
if ($includeDefaults) {
$data = $data + $this->getDefaultSearchData();
}
+ if ($filterEmpty) {
+ // Clean up empty values
+ //
+ // We do this here because empty values can be valid filters that overrule the default
+ foreach ($data as $key => $value) {
+ if ((is_array($value) && empty($value)) || (is_string($value) && 0 === strlen($value))) {
+ unset($data[$key]);
+ }
+ }
+ }
return $data;
}
@@ -964,7 +975,7 @@
$table->setOnEmpty(sprintf($this->_('Unknown %s.'), $this->getTopic(1)));
$table->setRepeater($repeater);
$table->tfrow($this->createMenuLinks($this->menuShowIncludeLevel), array('class' => 'centerAlign'));
-
+
if ($menuItem = $this->findAllowedMenuItem('edit')) {
$table->tbody()->onclick = array('location.href=\'', $menuItem->toHRefAttribute($this->getRequest()), '\';');
}
Modified: trunk/library/classes/Gems/Default/OrganizationAction.php
===================================================================
--- trunk/library/classes/Gems/Default/OrganizationAction.php 2012-04-12 12:01:29 UTC (rev 614)
+++ trunk/library/classes/Gems/Default/OrganizationAction.php 2012-04-12 12:34:32 UTC (rev 615)
@@ -119,15 +119,15 @@
'label', $this->_('Style'),
'multiOptions', MUtil_Lazy::call(array($this->escort, 'getStyles'))
);
- $model->setIfExists('gor_url_base',
- 'label', $this->_("Default url's"),
- 'size', 50,
- 'description', sprintf($this->_("Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."), $this->project->getName())
- );
- if ($detailed) {
- $model->setIfExists('gor_url_base', 'filter', 'TrailingSlash');
- }
}
+ $model->setIfExists('gor_url_base',
+ 'label', $this->_("Default url's"),
+ 'size', 50,
+ 'description', sprintf($this->_("Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."), $this->project->getName())
+ );
+ if ($detailed) {
+ $model->setIfExists('gor_url_base', 'filter', 'TrailingSlash');
+ }
$model->set(
'gor_iso_lang', 'label', $this->_('Language'),
'multiOptions', $this->util->getLocalized()->getLanguages(), 'default', 'nl'
Modified: trunk/library/classes/Gems/Upgrades.php
===================================================================
--- trunk/library/classes/Gems/Upgrades.php 2012-04-12 12:01:29 UTC (rev 614)
+++ trunk/library/classes/Gems/Upgrades.php 2012-04-12 12:34:32 UTC (rev 615)
@@ -55,10 +55,10 @@
//Now set the context
$this->setContext('gems');
//And add our patches
- $this->register('Upgrade143to15', 'Upgrade from 1.4.3 to 1.5.0');
- $this->register('Upgrade15to151', 'Upgrade from 1.5.0 to 1.5.1');
- $this->register('Upgrade151to152', 'Upgrade from 1.5.1 to 1.5.2');
- $this->register('Upgrade152to153', 'Upgrade from 1.5.2 to 1.5.3');
+ $this->register(array($this, 'Upgrade143to150'), 'Upgrade from 1.4.3 to 1.5.0');
+ $this->register(array($this, 'Upgrade150to151'), 'Upgrade from 1.5.0 to 1.5.1');
+ $this->register(array($this, 'Upgrade151to152'), 'Upgrade from 1.5.1 to 1.5.2');
+ $this->register(array($this, 'Upgrade152to153'), 'Upgrade from 1.5.2 to 1.5.3');
}
@@ -67,7 +67,7 @@
* 1. execute db patches 42 and 43
* 2. create new tables
*/
- public function Upgrade143to15()
+ public function Upgrade143to150()
{
$this->_batch->addTask('Db_ExecutePatch', 42);
$this->_batch->addTask('Db_ExecutePatch', 43);
@@ -90,7 +90,7 @@
/**
* To upgrade to 1.5.1 just execute patchlevel 44
*/
- public function Upgrade15to151()
+ public function Upgrade150to151()
{
$this->_batch->addTask('Db_ExecutePatch', 44);
Modified: trunk/library/classes/Gems/User/PasswordChecker.php
===================================================================
--- trunk/library/classes/Gems/User/PasswordChecker.php 2012-04-12 12:01:29 UTC (rev 614)
+++ trunk/library/classes/Gems/User/PasswordChecker.php 2012-04-12 12:34:32 UTC (rev 615)
@@ -185,7 +185,7 @@
$lpwd = strtolower($password);
if ((false !== strpos($lpwd, strtolower($this->user->getLoginName()))) || (null === $password)) {
- $this->_addError(sprintf($this->translate->_('should not contain your login name "%s"'), $this->user->getLoginName()));
+ $this->_addError($this->translate->_('should not contain your login name'));
}
}
}
Modified: trunk/library/classes/Gems/Util/RequestCache.php
===================================================================
--- trunk/library/classes/Gems/Util/RequestCache.php 2012-04-12 12:01:29 UTC (rev 614)
+++ trunk/library/classes/Gems/Util/RequestCache.php 2012-04-12 12:34:32 UTC (rev 615)
@@ -270,7 +270,7 @@
unset($params[$key]);
}
}
- // MUtil_Echo::r($params);
+ // MUtil_Echo::track($params);
$this->setProgramParams($params);
@@ -290,19 +290,13 @@
}
/**
- * Ste the keys stored fot this cache
+ * Set the keys stored fot this cache
*
* @param array $programParams
* @return Gems_Util_RequestCache (continuation pattern)
*/
public function setProgramParams(array $programParams)
{
- foreach ($programParams as $key => $value) {
- if ((is_array($value) && empty($value)) || (is_string($value) && 0 === strlen($value))) {
- unset($programParams[$key]);
- }
- }
-
// Store result
$this->_programParams = $programParams;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-12 12:01:40
|
Revision: 614
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=614&view=rev
Author: matijsdejong
Date: 2012-04-12 12:01:29 +0000 (Thu, 12 Apr 2012)
Log Message:
-----------
At organization level Url_base was not always shown
Upgrades showed warning
Password checker had security leak in that username was show during password reset
BrowseEditAction did not pass empty parameters on correctly, so moved filter on empty values from RequestCache
Modified Paths:
--------------
tags/1.5.3-rc2/library/classes/Gems/Controller/BrowseEditAction.php
tags/1.5.3-rc2/library/classes/Gems/Default/OrganizationAction.php
tags/1.5.3-rc2/library/classes/Gems/Upgrades.php
tags/1.5.3-rc2/library/classes/Gems/User/PasswordChecker.php
tags/1.5.3-rc2/library/classes/Gems/Util/RequestCache.php
Modified: tags/1.5.3-rc2/library/classes/Gems/Controller/BrowseEditAction.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Controller/BrowseEditAction.php 2012-04-12 09:35:42 UTC (rev 613)
+++ tags/1.5.3-rc2/library/classes/Gems/Controller/BrowseEditAction.php 2012-04-12 12:01:29 UTC (rev 614)
@@ -597,9 +597,10 @@
* @param boolean $includeDefaults Include the default values (yes for filtering, no for urls
* @param string $sourceAction The action to get the cache from if not the current one.
* @param boolean $readonly Optional, tell the cache not to store any new values
+ * @param boolean $filterEmpty Optional, filter empty values from cache
* @return array
*/
- public function getCachedRequestData($includeDefaults = true, $sourceAction = null, $readonly = false)
+ public function getCachedRequestData($includeDefaults = true, $sourceAction = null, $readonly = false, $filterEmpty = true)
{
if (! $this->requestCache) {
$this->requestCache = $this->util->getRequestCache($sourceAction, $readonly);
@@ -614,6 +615,16 @@
if ($includeDefaults) {
$data = $data + $this->getDefaultSearchData();
}
+ if ($filterEmpty) {
+ // Clean up empty values
+ //
+ // We do this here because empty values can be valid filters that overrule the default
+ foreach ($data as $key => $value) {
+ if ((is_array($value) && empty($value)) || (is_string($value) && 0 === strlen($value))) {
+ unset($data[$key]);
+ }
+ }
+ }
return $data;
}
@@ -964,7 +975,7 @@
$table->setOnEmpty(sprintf($this->_('Unknown %s.'), $this->getTopic(1)));
$table->setRepeater($repeater);
$table->tfrow($this->createMenuLinks($this->menuShowIncludeLevel), array('class' => 'centerAlign'));
-
+
if ($menuItem = $this->findAllowedMenuItem('edit')) {
$table->tbody()->onclick = array('location.href=\'', $menuItem->toHRefAttribute($this->getRequest()), '\';');
}
Modified: tags/1.5.3-rc2/library/classes/Gems/Default/OrganizationAction.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Default/OrganizationAction.php 2012-04-12 09:35:42 UTC (rev 613)
+++ tags/1.5.3-rc2/library/classes/Gems/Default/OrganizationAction.php 2012-04-12 12:01:29 UTC (rev 614)
@@ -119,15 +119,15 @@
'label', $this->_('Style'),
'multiOptions', MUtil_Lazy::call(array($this->escort, 'getStyles'))
);
- $model->setIfExists('gor_url_base',
- 'label', $this->_("Default url's"),
- 'size', 50,
- 'description', sprintf($this->_("Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."), $this->project->getName())
- );
- if ($detailed) {
- $model->setIfExists('gor_url_base', 'filter', 'TrailingSlash');
- }
}
+ $model->setIfExists('gor_url_base',
+ 'label', $this->_("Default url's"),
+ 'size', 50,
+ 'description', sprintf($this->_("Always switch to this organization when %s is accessed from one of these space separated url's. The first is used for mails."), $this->project->getName())
+ );
+ if ($detailed) {
+ $model->setIfExists('gor_url_base', 'filter', 'TrailingSlash');
+ }
$model->set(
'gor_iso_lang', 'label', $this->_('Language'),
'multiOptions', $this->util->getLocalized()->getLanguages(), 'default', 'nl'
Modified: tags/1.5.3-rc2/library/classes/Gems/Upgrades.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Upgrades.php 2012-04-12 09:35:42 UTC (rev 613)
+++ tags/1.5.3-rc2/library/classes/Gems/Upgrades.php 2012-04-12 12:01:29 UTC (rev 614)
@@ -55,10 +55,10 @@
//Now set the context
$this->setContext('gems');
//And add our patches
- $this->register('Upgrade143to15', 'Upgrade from 1.4.3 to 1.5.0');
- $this->register('Upgrade15to151', 'Upgrade from 1.5.0 to 1.5.1');
- $this->register('Upgrade151to152', 'Upgrade from 1.5.1 to 1.5.2');
- $this->register('Upgrade152to153', 'Upgrade from 1.5.2 to 1.5.3');
+ $this->register(array($this, 'Upgrade143to150'), 'Upgrade from 1.4.3 to 1.5.0');
+ $this->register(array($this, 'Upgrade150to151'), 'Upgrade from 1.5.0 to 1.5.1');
+ $this->register(array($this, 'Upgrade151to152'), 'Upgrade from 1.5.1 to 1.5.2');
+ $this->register(array($this, 'Upgrade152to153'), 'Upgrade from 1.5.2 to 1.5.3');
}
@@ -67,7 +67,7 @@
* 1. execute db patches 42 and 43
* 2. create new tables
*/
- public function Upgrade143to15()
+ public function Upgrade143to150()
{
$this->_batch->addTask('Db_ExecutePatch', 42);
$this->_batch->addTask('Db_ExecutePatch', 43);
@@ -90,7 +90,7 @@
/**
* To upgrade to 1.5.1 just execute patchlevel 44
*/
- public function Upgrade15to151()
+ public function Upgrade150to151()
{
$this->_batch->addTask('Db_ExecutePatch', 44);
Modified: tags/1.5.3-rc2/library/classes/Gems/User/PasswordChecker.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/User/PasswordChecker.php 2012-04-12 09:35:42 UTC (rev 613)
+++ tags/1.5.3-rc2/library/classes/Gems/User/PasswordChecker.php 2012-04-12 12:01:29 UTC (rev 614)
@@ -185,7 +185,7 @@
$lpwd = strtolower($password);
if ((false !== strpos($lpwd, strtolower($this->user->getLoginName()))) || (null === $password)) {
- $this->_addError(sprintf($this->translate->_('should not contain your login name "%s"'), $this->user->getLoginName()));
+ $this->_addError($this->translate->_('should not contain your login name'));
}
}
}
Modified: tags/1.5.3-rc2/library/classes/Gems/Util/RequestCache.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Util/RequestCache.php 2012-04-12 09:35:42 UTC (rev 613)
+++ tags/1.5.3-rc2/library/classes/Gems/Util/RequestCache.php 2012-04-12 12:01:29 UTC (rev 614)
@@ -270,7 +270,7 @@
unset($params[$key]);
}
}
- // MUtil_Echo::r($params);
+ // MUtil_Echo::track($params);
$this->setProgramParams($params);
@@ -290,19 +290,13 @@
}
/**
- * Ste the keys stored fot this cache
+ * Set the keys stored fot this cache
*
* @param array $programParams
* @return Gems_Util_RequestCache (continuation pattern)
*/
public function setProgramParams(array $programParams)
{
- foreach ($programParams as $key => $value) {
- if ((is_array($value) && empty($value)) || (is_string($value) && 0 === strlen($value))) {
- unset($programParams[$key]);
- }
- }
-
// Store result
$this->_programParams = $programParams;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-12 09:35:52
|
Revision: 613
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=613&view=rev
Author: matijsdejong
Date: 2012-04-12 09:35:42 +0000 (Thu, 12 Apr 2012)
Log Message:
-----------
Merged fix 612 in 1.5.3 rc 2
Modified Paths:
--------------
trunk/library/classes/Gems/Util.php
Property Changed:
----------------
trunk/
trunk/library/
Property changes on: trunk
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
+ /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
/tags/1.5.3-rc2:612
Property changes on: trunk/library
___________________________________________________________________
Modified: svn:mergeinfo
- /branches/1.5.0-pulse/library:306-344,346,467
/branches/1.5.x/library:426-455,458-472,475-481
/branches/newUser:113-150
/branches/newUser2:175-207
/branches/userloader:259-324
/tags/1.5.0beta1/library:305
/tags/1.5.1/library:485,489,509-510,534
+ /branches/1.5.0-pulse/library:306-344,346,467
/branches/1.5.x/library:426-455,458-472,475-481
/branches/newUser:113-150
/branches/newUser2:175-207
/branches/userloader:259-324
/tags/1.5.0beta1/library:305
/tags/1.5.1/library:485,489,509-510,534
/tags/1.5.3-rc2/library:612
Modified: trunk/library/classes/Gems/Util.php
===================================================================
--- trunk/library/classes/Gems/Util.php 2012-04-12 09:29:25 UTC (rev 612)
+++ trunk/library/classes/Gems/Util.php 2012-04-12 09:35:42 UTC (rev 613)
@@ -199,7 +199,7 @@
return $this->project->consentDefault;
}
- return 'Unkown';
+ return 'Unknown';
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-12 09:29:36
|
Revision: 612
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=612&view=rev
Author: matijsdejong
Date: 2012-04-12 09:29:25 +0000 (Thu, 12 Apr 2012)
Log Message:
-----------
Bugfix: caused not filled in consent code
Modified Paths:
--------------
tags/1.5.3-rc2/library/classes/Gems/Util.php
Modified: tags/1.5.3-rc2/library/classes/Gems/Util.php
===================================================================
--- tags/1.5.3-rc2/library/classes/Gems/Util.php 2012-04-08 16:33:06 UTC (rev 611)
+++ tags/1.5.3-rc2/library/classes/Gems/Util.php 2012-04-12 09:29:25 UTC (rev 612)
@@ -199,7 +199,7 @@
return $this->project->consentDefault;
}
- return 'Unkown';
+ return 'Unknown';
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-08 16:33:12
|
Revision: 611
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=611&view=rev
Author: matijsdejong
Date: 2012-04-08 16:33:06 +0000 (Sun, 08 Apr 2012)
Log Message:
-----------
Updated version numbers
Modified Paths:
--------------
trunk/library/classes/Gems/Versions.php
trunk/library/classes/MUtil/Version.php
Modified: trunk/library/classes/Gems/Versions.php
===================================================================
--- trunk/library/classes/Gems/Versions.php 2012-04-08 16:30:28 UTC (rev 610)
+++ trunk/library/classes/Gems/Versions.php 2012-04-08 16:33:06 UTC (rev 611)
@@ -43,12 +43,12 @@
{
public final function getBuild()
{
- return 46;
+ return 47;
}
public final function getGemsVersion()
{
- return '1.5.3';
+ return '1.5.4';
}
public function getProjectVersion()
Modified: trunk/library/classes/MUtil/Version.php
===================================================================
--- trunk/library/classes/MUtil/Version.php 2012-04-08 16:30:28 UTC (rev 610)
+++ trunk/library/classes/MUtil/Version.php 2012-04-08 16:33:06 UTC (rev 611)
@@ -33,8 +33,8 @@
class MUtil_Version
{
const MAJOR = 1;
- const MINOR = 0;
- const BUILD = 32;
+ const MINOR = 1;
+ const BUILD = 33;
public static function get()
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-08 16:30:34
|
Revision: 610
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=610&view=rev
Author: matijsdejong
Date: 2012-04-08 16:30:28 +0000 (Sun, 08 Apr 2012)
Log Message:
-----------
Added upgrade and fixed some more bugs
Pulse now switches to this branch
Added Paths:
-----------
tags/1.5.3-rc2/
Property changes on: tags/1.5.3-rc2
___________________________________________________________________
Added: svn:ignore
+ nbproject
Added: svn:mergeinfo
+ /branches/1.5.0-pulse:306-430,467
/branches/1.5.x:426-455,458-472,475-481
/tags/1.5.0beta1:305
/tags/1.5.1:485,489,509-510
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-08 16:27:38
|
Revision: 609
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=609&view=rev
Author: matijsdejong
Date: 2012-04-08 16:27:31 +0000 (Sun, 08 Apr 2012)
Log Message:
-----------
Did some more testing on the forward loop and fixed some return issues
Modified Paths:
--------------
trunk/library/classes/Gems/Default/AskAction.php
trunk/library/classes/Gems/User/User.php
Modified: trunk/library/classes/Gems/Default/AskAction.php
===================================================================
--- trunk/library/classes/Gems/Default/AskAction.php 2012-04-08 15:05:02 UTC (rev 608)
+++ trunk/library/classes/Gems/Default/AskAction.php 2012-04-08 16:27:31 UTC (rev 609)
@@ -105,13 +105,12 @@
*/
public function forwardAction()
{
- $tracker = $this->loader->getTracker();
-
/**************
* Find token *
**************/
if ($tokenId = $this->_getParam(MUtil_Model::REQUEST_ID)) {
+ $tracker = $this->loader->getTracker();
$tokenId = $tracker->filterToken($tokenId);
if ($token = $tracker->getToken($tokenId)) {
@@ -129,16 +128,16 @@
// Snippet had nothing to display, because of an answer
if ($this->getRequest()->getActionName() == 'return') {
- $this->addMessage(sprintf($this->_('Thank you for answering. At the moment we have no further surveys for you to take.'), $tokenId));
+ $this->addMessage(sprintf($this->_('Thank you for answering. At the moment we have no further surveys for you to take.'), strtoupper($tokenId)));
} else {
- $this->addMessage(sprintf($this->_('The survey for token %s has been answered and no further surveys are open.'), $tokenId));
+ $this->addMessage(sprintf($this->_('The survey for token %s has been answered and no further surveys are open.'), strtoupper($tokenId)));
}
// Do not enter a loop!! Reroute!
$this->_reroute(array('controller' => 'ask', 'action' => 'index'), true);
} else {
- $this->addMessage(sprintf($this->_('The token %s does not exist (any more).'), $tokenId));
+ $this->addMessage(sprintf($this->_('The token %s does not exist (any more).'), strtoupper($tokenId)));
}
}
@@ -152,8 +151,8 @@
*/
public function indexAction()
{
- // Make sure to return to ask screen
- $this->loader->getCurrentUser()->setSurveyReturn($this->getRequest());
+ // Make sure to return to the forward screen
+ $this->loader->getCurrentUser()->setSurveyReturn();
$request = $this->getRequest();
$tracker = $this->loader->getTracker();
@@ -175,14 +174,13 @@
{
$user = $this->loader->getCurrentUser();
- if ($user->isActive()) {
+ if ($user->isActive() && ($parameters = $user->getSurveyReturn())) {
$tracker = $this->loader->getTracker();
$token = $tracker->getToken($tracker->filterToken($this->_getParam(MUtil_Model::REQUEST_ID)));
// Check for completed tokens
$this->loader->getTracker()->processCompletedTokens($token->getRespondentId(), $user->getUserId());
- $parameters = $user->getSurveyReturn();
if (! $parameters) {
// Default
$request = $this->getRequest();
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-04-08 15:05:02 UTC (rev 608)
+++ trunk/library/classes/Gems/User/User.php 2012-04-08 16:27:31 UTC (rev 609)
@@ -1343,8 +1343,13 @@
* @param mixed $return Zend_Controller_Request_Abstract, array of something that can be turned into one.
* @return Gems_User_User
*/
- public function setSurveyReturn($return)
+ public function setSurveyReturn($return = null)
{
+ if (null === $return) {
+ $this->_unsetVar('surveyReturn');
+ return $this;
+ }
+
if ($return instanceof Zend_Controller_Request_Abstract) {
$return = $return->getParams();
} elseif (! is_array($return)) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-08 15:05:11
|
Revision: 608
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=608&view=rev
Author: matijsdejong
Date: 2012-04-08 15:05:02 +0000 (Sun, 08 Apr 2012)
Log Message:
-----------
Added 1.5.3 upgrade function
Improved content of change password mail
OldStaff users can now perform resets
Cleaned up some code
Updated translations
Modified Paths:
--------------
trunk/library/classes/Gems/Default/IndexAction.php
trunk/library/classes/Gems/Upgrades.php
trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php
trunk/library/classes/Gems/User/OldStaffUserDefinition.php
trunk/library/classes/Gems/User/RadiusUserDefinition.php
trunk/library/classes/Gems/User/User.php
trunk/library/classes/Gems/User/UserDefinitionAbstract.php
trunk/library/classes/Gems/User/UserDefinitionInterface.php
trunk/library/classes/Gems/User/UserLoader.php
trunk/library/configs/db/patches.sql
trunk/library/configs/db/tables/gems__staff.20.sql
trunk/library/languages/default-en.mo
trunk/library/languages/default-en.po
trunk/library/languages/default-nl.mo
trunk/library/languages/default-nl.po
Modified: trunk/library/classes/Gems/Default/IndexAction.php
===================================================================
--- trunk/library/classes/Gems/Default/IndexAction.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/Default/IndexAction.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -312,6 +312,7 @@
$this->addMessage($this->_('We sent you an e-mail with a reset link. Click on the link in the e-mail.'));
if ($this->returnToLoginAfterReset) {
+ $this->setCurrentOrganizationTo($user);
$this->loader->getCurrentUser()->gotoStartPage($this->menu, $request);
}
}
@@ -339,17 +340,11 @@
public function sendUserResetEMail(Gems_User_User $user)
{
$subjectTemplate = $this->_('Password reset requested');
- /* CANNOT BE TESTED TODAY
- $bbBodyTemplate = $this->_("Dear {greeting},
-A new password was requested for your [b]{organization}[/b] site [b]{project}[/b], please click within {reset_in_hours} hours on [url={reset_url}]this link[/url] to enter the password of your choice.
+ // Multi line strings did not come through correctly in poEdit
+ $bbBodyTemplate = $this->_("Dear {greeting},\n\n\nA new password was requested for your [b]{organization}[/b] account on the [b]{project}[/b] site, please click within {reset_in_hours} hours on [url={reset_url}]this link[/url] to enter the password of your choice.\n\n\n{organization_signature}\n\n[url={reset_url}]{reset_url}[/url]\n"); // */
+ //$bbBodyTemplate = $this->_("To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n{reset_url}");
-{organization_signature}
-
-[url={reset_url}]{reset_url}[/url]
-"); // */
- $bbBodyTemplate = $this->_("To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n{reset_url}");
-
return $user->sendMail($subjectTemplate, $bbBodyTemplate, true);
}
Modified: trunk/library/classes/Gems/Upgrades.php
===================================================================
--- trunk/library/classes/Gems/Upgrades.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/Upgrades.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -55,9 +55,10 @@
//Now set the context
$this->setContext('gems');
//And add our patches
- $this->register('Upgrade143to15', 'Upgrade from 1.43 to 1.5');
- $this->register('Upgrade15to151', 'Upgrade from 1.5.0. to 1.5.1');
- $this->register('Upgrade151to152', 'Upgrade from 1.5.1. to 1.5.2');
+ $this->register('Upgrade143to15', 'Upgrade from 1.4.3 to 1.5.0');
+ $this->register('Upgrade15to151', 'Upgrade from 1.5.0 to 1.5.1');
+ $this->register('Upgrade151to152', 'Upgrade from 1.5.1 to 1.5.2');
+ $this->register('Upgrade152to153', 'Upgrade from 1.5.2 to 1.5.3');
}
@@ -92,7 +93,7 @@
public function Upgrade15to151()
{
$this->_batch->addTask('Db_ExecutePatch', 44);
-
+
return true;
}
@@ -105,4 +106,14 @@
return true;
}
+
+ /**
+ * To upgrade to 1.5.2 just execute patchlevel 46
+ */
+ public function Upgrade152to153()
+ {
+ $this->_batch->addTask('Db_ExecutePatch', 46);
+
+ return true;
+ }
}
\ No newline at end of file
Modified: trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php
===================================================================
--- trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -106,28 +106,6 @@
}
/**
- * Check whether a reset key is really linked to a user.
- *
- * @param Gems_User_User $user The user the key was created for (hopefully).
- * @param string The key
- * @return boolean
- */
- public function checkPasswordResetKey(Gems_User_User $user, $key)
- {
- $model = new MUtil_Model_TableModel('gems__user_passwords');
-
- $filter['gup_id_user'] = $user->getUserLoginId();
- $filter[] = 'DATE_ADD(gup_reset_requested, INTERVAL 24 HOUR) >= CURRENT_TIMESTAMP';
-
- $row = $model->loadFirst($filter);
- if ($row && $row['gup_reset_key']) {
- return $key == $row['gup_reset_key'];
- }
-
- return false;
- }
-
- /**
* Returns an initialized Zend_Auth_Adapter_Interface
*
* @param Gems_User_User $user
@@ -173,6 +151,7 @@
}
$data['gup_reset_requested'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
+ // Loop for case when hash is not unique
while (true) {
try {
$model->save($data);
Modified: trunk/library/classes/Gems/User/OldStaffUserDefinition.php
===================================================================
--- trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -54,12 +54,45 @@
protected $db;
/**
+ * The time period in hours a reset key is valid for this definition.
*
+ * @var int
+ */
+ protected $hoursResetKeyIsValid = 24;
+
+ /**
+ *
* @var Gems_Project_ProjectSettings
*/
protected $project;
/**
+ * Return true if a password reset key can be created.
+ *
+ * Returns the setting for the definition whan no user is passed, otherwise
+ * returns the answer for this specific user.
+ *
+ * @param Gems_User_User $user Optional, the user whose password might change
+ * @return boolean
+ */
+ public function canResetPassword(Gems_User_User $user = null)
+ {
+ if ($user) {
+ // Depends on the user.
+ if ($user->hasEmailAddress() && $user->canSetPassword()) {
+ $email = $user->getEmailAddress();
+ if (empty($email)) {
+ return false;
+ } else {
+ return true;
+ }
+ }
+ } else {
+ return true;
+ }
+ }
+
+ /**
* Return true if the password can be set.
*
* Returns the setting for the definition whan no user is passed, otherwise
@@ -111,6 +144,42 @@
}
/**
+ * Return a password reset key
+ *
+ * @param Gems_User_User $user The user to create a key for.
+ * @return string
+ */
+ public function getPasswordResetKey(Gems_User_User $user)
+ {
+ $model = new MUtil_Model_TableModel('gems__staff');
+ Gems_Model::setChangeFieldsByPrefix($model, 'gsf', $user->getUserId());
+
+ $data['gsf_id_user'] = $user->getUserId();
+
+ $row = $model->loadFirst($data + array('DATE_ADD(gsf_reset_req, INTERVAL ' . $this->hoursResetKeyIsValid . ' HOUR) >= CURRENT_TIMESTAMP'));
+ if ($row && $row['gup_reset_key']) {
+ // Keep using the key.
+ $data['gsf_reset_key'] = $row['gsf_reset_key'];
+ } else {
+ $data['gsf_reset_key'] = $this->hashPassword(time() . $user->getEmailAddress());
+ }
+ $data['gsf_reset_req'] = new Zend_Db_Expr('CURRENT_TIMESTAMP');
+
+ // Loop for case when hash is not unique
+ while (true) {
+ try {
+ $model->save($data);
+
+ // Old staff keys can by recognized because they start with 'os'
+ return 'os' . $data['gsf_reset_key'];
+
+ } catch (Zend_Db_Exception $zde) {
+ $data['gsf_reset_key'] = $this->hashPassword(time() . $user->getEmailAddress());
+ }
+ }
+ }
+
+ /**
* Returns a user object, that may be empty if the user is unknown.
*
* @param string $login_name
@@ -161,7 +230,8 @@
'user_group' => 'gsf_id_primary_group',
'user_locale' => 'gsf_iso_lang',
'user_logout' => 'gsf_logout_on_survey',
- 'user_base_org_id' => 'gsf_id_organization'
+ 'user_base_org_id' => 'gsf_id_organization',
+ 'user_resetkey_valid' => 'CASE WHEN DATE_ADD(gsf_reset_req, INTERVAL ' . $this->hoursResetKeyIsValid . ' HOUR) >= CURRENT_TIMESTAMP THEN 1 ELSE 0 END',
))
->join('gems__groups', 'gsf_id_primary_group = ggp_id_group', array(
'user_role' => 'ggp_role',
Modified: trunk/library/classes/Gems/User/RadiusUserDefinition.php
===================================================================
--- trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/RadiusUserDefinition.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -114,18 +114,6 @@
}
/**
- * always false as we can not reset the password
- *
- * @param Gems_User_User $user
- * @param type $key
- * @return boolean
- */
- public function checkPasswordResetKey(Gems_User_User $user, $key)
- {
- return false;
- }
-
- /**
* Returns an initialized Zend_Auth_Adapter_Interface
*
* @param Gems_User_User $user
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/User.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -486,17 +486,6 @@
}
/**
- * Check whether a reset key is really linked to this user.
- *
- * @param string The key
- * @return boolean
- */
- public function checkPasswordResetKey($key)
- {
- return $this->isActive() && $this->definition->checkPasswordResetKey($this, $key);
- }
-
- /**
* Should be called after answering the request to allow the Target
* to check if all required registry values have been set correctly.
*
@@ -1127,51 +1116,7 @@
}
/**
- * Send an e-mail to this user
*
- * @param string $subjectTemplate A subject template in which {fields} are replaced
- * @param string $bbBodyTemplate A BB Code body template in which {fields} are replaced
- * @param boolean $useResetFields When true get a reset key for this user
- * @param string $locale Optional locale
- * @return mixed String or array of warnings when something went wrong
- */
- public function sendMail($subjectTemplate, $bbBodyTemplate, $useResetFields = false, $locale = null)
- {
- if ($useResetFields && (! $this->canResetPassword())) {
- return $this->translate->_('Trying to send a password reset to a user that cannot be reset.');
- }
-
- $mail = new Gems_Mail();
- $mail->setTemplateStyle($this->getBaseOrganization()->getStyle());
- $mail->setFrom($this->getFrom());
- $mail->addTo($this->getEmailAddress(), $this->getFullName(), $this->project->getEmailBounce());
- if ($bcc = $this->project->getEmailBcc()) {
- $mail->addBcc($bcc);
- }
-
- if ($useResetFields) {
- $fields = $this->getResetPasswordMailFields($locale);
- } else {
- $fields = $this->getMailFields($locale);
- }
- $fields = MUtil_Ra::braceKeys($fields, '{', '}');
-
- $mail->setSubject(strtr($subjectTemplate, $fields));
- $mail->setBodyBBCode(strtr($bbBodyTemplate, $fields));
-
- try {
- $mail->send();
- return null;
-
- } catch (Exception $e) {
- return array(
- $this->translate->_('Unable to send e-mail.'),
- $e->getMessage());
- }
- }
-
- /**
- *
* @param string $defName Optional
* @return Gems_User_User (continuation pattern)
*/
@@ -1233,6 +1178,51 @@
}
/**
+ * Send an e-mail to this user
+ *
+ * @param string $subjectTemplate A subject template in which {fields} are replaced
+ * @param string $bbBodyTemplate A BB Code body template in which {fields} are replaced
+ * @param boolean $useResetFields When true get a reset key for this user
+ * @param string $locale Optional locale
+ * @return mixed String or array of warnings when something went wrong
+ */
+ public function sendMail($subjectTemplate, $bbBodyTemplate, $useResetFields = false, $locale = null)
+ {
+ if ($useResetFields && (! $this->canResetPassword())) {
+ return $this->translate->_('Trying to send a password reset to a user that cannot be reset.');
+ }
+
+ $mail = new Gems_Mail();
+ $mail->setTemplateStyle($this->getBaseOrganization()->getStyle());
+ $mail->setFrom($this->getFrom());
+ $mail->addTo($this->getEmailAddress(), $this->getFullName(), $this->project->getEmailBounce());
+ if ($bcc = $this->project->getEmailBcc()) {
+ $mail->addBcc($bcc);
+ }
+
+ if ($useResetFields) {
+ $fields = $this->getResetPasswordMailFields($locale);
+ } else {
+ $fields = $this->getMailFields($locale);
+ }
+ MUtil_Echo::track($fields, $bbBodyTemplate);
+ $fields = MUtil_Ra::braceKeys($fields, '{', '}');
+
+ $mail->setSubject(strtr($subjectTemplate, $fields));
+ $mail->setBodyBBCode(strtr($bbBodyTemplate, $fields));
+
+ try {
+ $mail->send();
+ return null;
+
+ } catch (Exception $e) {
+ return array(
+ $this->translate->_('Unable to send e-mail.'),
+ $e->getMessage());
+ }
+ }
+
+ /**
* Set this user as the current user.
*
* This means that the data about this user will be stored in a session.
Modified: trunk/library/classes/Gems/User/UserDefinitionAbstract.php
===================================================================
--- trunk/library/classes/Gems/User/UserDefinitionAbstract.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/UserDefinitionAbstract.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -84,18 +84,6 @@
}
/**
- * Check whether a reset key is really linked to a user.
- *
- * @param Gems_User_User $user The user the key was created for (hopefully).
- * @param string The key
- * @return string
- */
- public function checkPasswordResetKey(Gems_User_User $user, $key)
- {
- throw new Gems_Exception_Coding(sprintf('A password reset key cannot be issued for %s users.', get_class($this)));
- }
-
- /**
* Return a password reset key
*
* @param Gems_User_User $user The user to create a key for.
Modified: trunk/library/classes/Gems/User/UserDefinitionInterface.php
===================================================================
--- trunk/library/classes/Gems/User/UserDefinitionInterface.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/UserDefinitionInterface.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -69,15 +69,6 @@
public function canSetPassword(Gems_User_User $user = null);
/**
- * Check whether a reset key is really linked to a user.
- *
- * @param Gems_User_User $user The user the key was created for (hopefully).
- * @param string The key
- * @return string
- */
- public function checkPasswordResetKey(Gems_User_User $user, $key);
-
- /**
* Returns an initialized Zend_Auth_Adapter_Interface
*
* @param Gems_User_User $user
Modified: trunk/library/classes/Gems/User/UserLoader.php
===================================================================
--- trunk/library/classes/Gems/User/UserLoader.php 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/classes/Gems/User/UserLoader.php 2012-04-08 15:05:02 UTC (rev 608)
@@ -438,10 +438,15 @@
}
$select = $this->db->select();
- $select->from('gems__user_passwords', array())
- ->joinLeft('gems__user_logins', 'gup_id_user = gul_id_user', array("gul_user_class", 'gul_id_organization', 'gul_login'))
- ->where('gup_reset_key = ?', $resetKey);
-
+ if ('os' == substr($resetKey, 0, 2)) {
+ // Oldstaff reset key!
+ $select->from('gems__staff', array(new Zend_Db_Expr("'" . self::USER_OLD_STAFF . "' AS user_class"), 'gsf_id_organization', 'gsf_login'))
+ ->where('gsf_reset_key = ?', substr($resetKey, 2));
+ } else {
+ $select->from('gems__user_passwords', array())
+ ->joinLeft('gems__user_logins', 'gup_id_user = gul_id_user', array("gul_user_class", 'gul_id_organization', 'gul_login'))
+ ->where('gup_reset_key = ?', $resetKey);
+ }
if ($row = $this->db->fetchRow($select, null, Zend_Db::FETCH_NUM)) {
// MUtil_Echo::track($row);
return $this->loadUser($row[0], $row[1], $row[2]);
Modified: trunk/library/configs/db/patches.sql
===================================================================
--- trunk/library/configs/db/patches.sql 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/configs/db/patches.sql 2012-04-08 15:05:02 UTC (rev 608)
@@ -391,4 +391,5 @@
ALTER TABLE gems__user_logins CHANGE gul_can_login gul_can_login boolean not null default 0;
-- PATCH: make reset keys unique so we now whose key it is
-ALTER TABLE `gems__user_passwords` ADD UNIQUE (`gup_reset_key`);
+ALTER TABLE `gems__user_passwords` ADD UNIQUE KEY (gup_reset_key);
+ALTER TABLE `gems__staff` ADD UNIQUE KEY (gsf_reset_key);
Modified: trunk/library/configs/db/tables/gems__staff.20.sql
===================================================================
--- trunk/library/configs/db/tables/gems__staff.20.sql 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/configs/db/tables/gems__staff.20.sql 2012-04-08 15:05:02 UTC (rev 608)
@@ -46,7 +46,7 @@
-- depreciated
gsf_reset_key varchar(64) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null,
- gsf_reset_requested timestamp null,
+ gsf_reset_req timestamp null,
-- end depreciated
gsf_changed timestamp not null default current_timestamp on update current_timestamp,
@@ -55,7 +55,8 @@
gsf_created_by bigint unsigned not null,
PRIMARY KEY(gsf_id_user),
- UNIQUE KEY(gsf_login, gsf_id_organization)
+ UNIQUE KEY(gsf_login, gsf_id_organization),
+ UNIQUE KEY(gsf_reset_key)
)
ENGINE=InnoDB
AUTO_INCREMENT = 2001
Modified: trunk/library/languages/default-en.mo
===================================================================
(Binary files differ)
Modified: trunk/library/languages/default-en.po
===================================================================
--- trunk/library/languages/default-en.po 2012-04-08 13:41:19 UTC (rev 607)
+++ trunk/library/languages/default-en.po 2012-04-08 15:05:02 UTC (rev 608)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: GemsTracker EN\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2012-04-05 16:25+0100\n"
+"POT-Creation-Date: 2012-04-08 16:56+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Matijs de Jong <mj...@ma...>\n"
"Language-Team: Erasmus MGZ <mat...@ma...>\n"
@@ -29,7 +29,7 @@
msgstr "You are logged in as %s"
#: classes/GemsEscort.php:747
-#: classes/Gems/Menu.php:248
+#: classes/Gems/Menu.php:249
msgid "Logoff"
msgstr "Logoff"
@@ -131,184 +131,184 @@
msgid "of"
msgstr "of"
-#: classes/Gems/Menu.php:139
+#: classes/Gems/Menu.php:140
#, php-format
msgid "About %s"
msgstr "About %s"
-#: classes/Gems/Menu.php:143
+#: classes/Gems/Menu.php:144
msgid "Reporting bugs"
msgstr "Reporting bugs"
-#: classes/Gems/Menu.php:146
+#: classes/Gems/Menu.php:147
msgid "Support"
msgstr "Support"
-#: classes/Gems/Menu.php:166
+#: classes/Gems/Menu.php:167
msgid "Project setup"
msgstr "Project setup"
-#: classes/Gems/Menu.php:169
+#: classes/Gems/Menu.php:170
msgid "Database"
msgstr "Database"
-#: classes/Gems/Menu.php:173
+#: classes/Gems/Menu.php:174
msgid "Content"
msgstr "Content"
-#: classes/Gems/Menu.php:176
+#: classes/Gems/Menu.php:177
msgid "Execute"
msgstr "Execute"
-#: classes/Gems/Menu.php:181
+#: classes/Gems/Menu.php:182
msgid "Patches"
msgstr "Patches"
-#: classes/Gems/Menu.php:182
+#: classes/Gems/Menu.php:183
msgid "Execute new"
msgstr "Execute new"
-#: classes/Gems/Menu.php:184
+#: classes/Gems/Menu.php:185
msgid "Refresh translateables"
msgstr "Refresh translateables"
-#: classes/Gems/Menu.php:186
+#: classes/Gems/Menu.php:187
msgid "Run SQL"
msgstr "Run SQL"
-#: classes/Gems/Menu.php:189
+#: classes/Gems/Menu.php:190
msgid "Reception codes"
msgstr "Reception codes"
-#: classes/Gems/Menu.php:192
+#: classes/Gems/Menu.php:193
msgid "Consents"
msgstr "Consents"
-#: classes/Gems/Menu.php:195
+#: classes/Gems/Menu.php:196
msgid "Roles"
msgstr "Roles"
-#: classes/Gems/Menu.php:196
-#: classes/Gems/Menu.php:345
+#: classes/Gems/Menu.php:197
+#: classes/Gems/Menu.php:346
msgid "Assigned"
msgstr "Assigned"
-#: classes/Gems/Menu.php:197
+#: classes/Gems/Menu.php:198
msgid "Privileges"
msgstr "Privileges"
-#: classes/Gems/Menu.php:200
+#: classes/Gems/Menu.php:201
msgid "Groups"
msgstr "Groups"
-#: classes/Gems/Menu.php:203
+#: classes/Gems/Menu.php:204
msgid "Organizations"
msgstr "Organizations"
-#: classes/Gems/Menu.php:206
+#: classes/Gems/Menu.php:207
msgid "Staff"
msgstr "Staff"
-#: classes/Gems/Menu.php:209
+#: classes/Gems/Menu.php:210
msgid "Logging"
msgstr "Logging"
-#: classes/Gems/Menu.php:213
+#: classes/Gems/Menu.php:214
msgid "Maintenance"
msgstr "Maintenance"
-#: classes/Gems/Menu.php:218
+#: classes/Gems/Menu.php:219
msgid "Upgrade"
msgstr "Upgrade"
-#: classes/Gems/Menu.php:219
-#: classes/Gems/Menu.php:318
+#: classes/Gems/Menu.php:220
+#: classes/Gems/Menu.php:319
msgid "Show"
msgstr "Show"
-#: classes/Gems/Menu.php:220
+#: classes/Gems/Menu.php:221
msgid "Execute all"
msgstr "Execute all"
-#: classes/Gems/Menu.php:221
+#: classes/Gems/Menu.php:222
msgid "Execute this"
msgstr "Execute this"
-#: classes/Gems/Menu.php:222
+#: classes/Gems/Menu.php:223
msgid "Execute from here"
msgstr "Execute from here"
-#: classes/Gems/Menu.php:223
+#: classes/Gems/Menu.php:224
msgid "Execute to here"
msgstr "Execute to here"
-#: classes/Gems/Menu.php:235
+#: classes/Gems/Menu.php:236
#, php-format
msgid "Stand-alone privilige: %s"
msgstr "Stand-alone privilige: %s"
-#: classes/Gems/Menu.php:242
+#: classes/Gems/Menu.php:243
msgid "Logon"
msgstr "Logon"
-#: classes/Gems/Menu.php:243
+#: classes/Gems/Menu.php:244
msgid "Lost password"
msgstr "Lost password"
-#: classes/Gems/Menu.php:244
+#: classes/Gems/Menu.php:245
msgid "Your account"
msgstr "Your account"
-#: classes/Gems/Menu.php:245
+#: classes/Gems/Menu.php:246
msgid "Activity overview"
msgstr "Activity overview"
-#: classes/Gems/Menu.php:246
+#: classes/Gems/Menu.php:247
msgid "Change password"
msgstr "Change password"
-#: classes/Gems/Menu.php:247
-#: classes/Gems/Menu.php:287
-#: classes/Gems/Menu.php:322
+#: classes/Gems/Menu.php:248
+#: classes/Gems/Menu.php:288
+#: classes/Gems/Menu.php:323
msgid "Token"
msgstr "Token"
-#: classes/Gems/Menu.php:283
+#: classes/Gems/Menu.php:284
msgid "Track"
msgstr "Track"
-#: classes/Gems/Menu.php:290
-#: classes/Gems/Menu.php:310
-#: classes/Gems/Menu.php:341
+#: classes/Gems/Menu.php:291
+#: classes/Gems/Menu.php:311
+#: classes/Gems/Menu.php:342
msgid "Add"
msgstr "Add"
-#: classes/Gems/Menu.php:294
+#: classes/Gems/Menu.php:295
#: classes/Gems/Menu.php:377
msgid "Preview"
msgstr "Preview"
-#: classes/Gems/Menu.php:301
+#: classes/Gems/Menu.php:302
msgid "Tracks"
msgstr "Tracks"
-#: classes/Gems/Menu.php:314
+#: classes/Gems/Menu.php:315
msgid "Assignments"
msgstr "Assignments"
-#: classes/Gems/Menu.php:326
+#: classes/Gems/Menu.php:327
msgid "Edit"
msgstr "Edit"
-#: classes/Gems/Menu.php:330
+#: classes/Gems/Menu.php:331
msgid "Delete"
msgstr "Delete"
-#: classes/Gems/Menu.php:335
+#: classes/Gems/Menu.php:336
msgid "Surveys"
msgstr "Surveys"
-#: classes/Gems/Menu.php:367
+#: classes/Gems/Menu.php:368
msgid "Fill in"
msgstr "Fill in"
@@ -427,11 +427,11 @@
msgid " The error message is: %s"
msgstr " The error message is: %s"
-#: classes/Gems/Tracker.php:761
+#: classes/Gems/Tracker.php:771
msgid "Checks performed"
msgstr "Checks performed"
-#: classes/Gems/Upgrades.php:76
+#: classes/Gems/Upgrades.php:77
msgid "Syncing surveys for all sources"
msgstr "Syncing surveys for all sources"
@@ -495,14 +495,14 @@
msgstr "Are you sure?"
#: classes/Gems/Controller/BrowseEditAction.php:796
-#: classes/Gems/Default/DatabaseAction.php:171
-#: classes/Gems/Default/DatabaseAction.php:484
+#: classes/Gems/Default/DatabaseAction.php:187
+#: classes/Gems/Default/DatabaseAction.php:499
msgid "Yes"
msgstr "Yes"
#: classes/Gems/Controller/BrowseEditAction.php:797
-#: classes/Gems/Default/DatabaseAction.php:172
-#: classes/Gems/Default/DatabaseAction.php:485
+#: classes/Gems/Default/DatabaseAction.php:188
+#: classes/Gems/Default/DatabaseAction.php:500
msgid "No"
msgstr "No"
@@ -544,8 +544,7 @@
msgstr "Unknown %s."
#: classes/Gems/Controller/ModelActionAbstract.php:97
-#: classes/Gems/Default/AskAction.php:150
-#: classes/Gems/Default/DatabaseAction.php:488
+#: classes/Gems/Default/DatabaseAction.php:503
msgid "Cancel"
msgstr "Cancel"
@@ -592,113 +591,58 @@
msgid "Nothing to do."
msgstr "Nothing to do."
-#: classes/Gems/Default/AskAction.php:128
+#: classes/Gems/Default/AskAction.php:84
#, php-format
-msgid "Welcome %s,"
-msgstr "Welcome %s,"
+msgid "Enter your %s token"
+msgstr "Enter your %s token"
-#: classes/Gems/Default/AskAction.php:131
-#, php-format
-msgid "Thank you for answering the survey for token %s."
-msgstr "Thank you for answering the survey for token %s."
+#: classes/Gems/Default/AskAction.php:87
+msgid "Tokens identify a survey that was assigned to you personally."
+msgstr "Tokens identify a survey that was assigned to you personally."
-#: classes/Gems/Default/AskAction.php:132
-msgid "Please click the button below to answer the next survey."
-msgstr "Please click the button below to answer the next survey."
+#: classes/Gems/Default/AskAction.php:87
+msgid "Entering the token and pressing OK will open that survey."
+msgstr "Entering the token and pressing OK will open that survey."
-#: classes/Gems/Default/AskAction.php:137
-#, php-format
-msgid "Please click the button below to answer the survey for token %s."
-msgstr "Please click the button below to answer the survey for token %s."
+#: classes/Gems/Default/AskAction.php:91
+msgid "After answering the survey you will be logged off automatically."
+msgstr "After answering the survey you will be logged off automatically."
-#: classes/Gems/Default/AskAction.php:141
-#, php-format
-msgid "Wait one second to open the survey automatically or click on Cancel to stop."
-msgid_plural "Wait %d seconds to open the survey automatically or click on Cancel to stop."
-msgstr[0] "Wait one second to open the survey automatically or click on Cancel to stop."
-msgstr[1] "Wait %d seconds to open the survey automatically or click on Cancel to stop."
+#: classes/Gems/Default/AskAction.php:96
+msgid "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive."
+msgstr "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive."
-#: classes/Gems/Default/AskAction.php:156
-#, php-format
-msgid "After this survey there is one other survey we would like you to answer."
-msgid_plural "After this survey there are another %d surveys we would like you to answer."
-msgstr[0] "After this survey there is one other survey we would like you to answer."
-msgstr[1] "After this survey there are another %d surveys we would like you to answer."
+#: classes/Gems/Default/AskAction.php:97
+msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
+msgstr "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
-#: classes/Gems/Default/AskAction.php:166
+#: classes/Gems/Default/AskAction.php:132
#, php-format
-msgid "The survey for token %s is no longer active."
-msgstr "The survey for token %s is no longer active."
-
-#: classes/Gems/Default/AskAction.php:170
-#, php-format
-msgid "The token %s does not exist."
-msgstr "The token %s does not exist."
-
-#: classes/Gems/Default/AskAction.php:172
-#, php-format
msgid "Thank you for answering. At the moment we have no further surveys for you to take."
msgstr "Thank you for answering. At the moment we have no further surveys for you to take."
-#: classes/Gems/Default/AskAction.php:174
+#: classes/Gems/Default/AskAction.php:134
#, php-format
msgid "The survey for token %s has been answered and no further surveys are open."
msgstr "The survey for token %s has been answered and no further surveys are open."
-#: classes/Gems/Default/AskAction.php:181
+#: classes/Gems/Default/AskAction.php:141
#, php-format
msgid "The token %s does not exist (any more)."
msgstr "The token %s does not exist (any more)."
-#: classes/Gems/Default/AskAction.php:198
+#: classes/Gems/Default/AskAction.php:243
#, php-format
-msgid "Enter your %s token"
-msgstr "Enter your %s token"
+msgid "The survey for token %s is no longer active."
+msgstr "The survey for token %s is no longer active."
-#: classes/Gems/Default/AskAction.php:203
-#, php-format
-msgid "Enter tokens as %s."
-msgstr "Enter tokens as %s."
-
-#: classes/Gems/Default/AskAction.php:213
-msgid "OK"
-msgstr "OK"
-
-#: classes/Gems/Default/AskAction.php:233
-msgid "The server is currently busy, please wait a while and try again."
-msgstr "The server is currently busy, please wait a while and try again."
-
-#: classes/Gems/Default/AskAction.php:255
-msgid "Tokens identify a survey that was assigned to you personally."
-msgstr "Tokens identify a survey that was assigned to you personally."
-
-#: classes/Gems/Default/AskAction.php:255
-msgid "Entering the token and pressing OK will open that survey."
-msgstr "Entering the token and pressing OK will open that survey."
-
-#: classes/Gems/Default/AskAction.php:259
-msgid "After answering the survey you will be logged off automatically."
-msgstr "After answering the survey you will be logged off automatically."
-
-#: classes/Gems/Default/AskAction.php:261
-msgid "After answering the survey you will return to the respondent overview screen."
-msgstr "After answering the survey you will return to the paitent overview screen."
-
-#: classes/Gems/Default/AskAction.php:268
-msgid "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive."
-msgstr "A token consists of two groups of four letters and numbers, separated by an optional hyphen. Tokens are case insensitive."
-
-#: classes/Gems/Default/AskAction.php:269
-msgid "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
-msgstr "The number zero and the letter O are treated as the same; the same goes for the number one and the letter L."
-
#: classes/Gems/Default/ConsentAction.php:68
#: classes/Gems/Default/GroupAction.php:88
msgid "Description"
msgstr "Description"
#: classes/Gems/Default/ConsentAction.php:70
-#: classes/Gems/Default/DatabaseAction.php:123
+#: classes/Gems/Default/DatabaseAction.php:139
msgid "Order"
msgstr "Order"
@@ -764,269 +708,271 @@
msgid "On this test system all mail will be delivered to the from address."
msgstr "On this test system all mail will be delivered to the from address."
-#: classes/Gems/Default/DatabaseAction.php:89
+#: classes/Gems/Default/DatabaseAction.php:75
+msgid "Cache cleaned"
+msgstr "Cache cleaned"
+
+#: classes/Gems/Default/DatabaseAction.php:105
#, php-format
msgid "No rows in %s."
msgstr "No rows in %s."
-#: classes/Gems/Default/DatabaseAction.php:118
+#: classes/Gems/Default/DatabaseAction.php:134
msgid "Type"
msgstr "Type"
-#: classes/Gems/Default/DatabaseAction.php:122
+#: classes/Gems/Default/DatabaseAction.php:138
msgid "Group"
msgstr "Group"
-#: classes/Gems/Default/DatabaseAction.php:124
+#: classes/Gems/Default/DatabaseAction.php:140
msgid "Location"
msgstr "Location"
-#: classes/Gems/Default/DatabaseAction.php:127
+#: classes/Gems/Default/DatabaseAction.php:143
msgid "Status"
msgstr "Status"
-#: classes/Gems/Default/DatabaseAction.php:130
+#: classes/Gems/Default/DatabaseAction.php:146
msgid "Script"
msgstr "Script"
-#: classes/Gems/Default/DatabaseAction.php:132
+#: classes/Gems/Default/DatabaseAction.php:148
+#: classes/Gems/Default/DatabaseAction.php:293
+#: classes/Gems/Default/DatabaseAction.php:340
msgid "Changed on"
msgstr "Changed on"
-#: classes/Gems/Default/DatabaseAction.php:151
+#: classes/Gems/Default/DatabaseAction.php:167
msgid "This database object does not exist. You cannot delete it."
msgstr "This database object does not exist. You cannot delete it."
-#: classes/Gems/Default/DatabaseAction.php:156
+#: classes/Gems/Default/DatabaseAction.php:172
#, php-format
msgid "Drop %s"
msgstr "Drop %s"
-#: classes/Gems/Default/DatabaseAction.php:164
+#: classes/Gems/Default/DatabaseAction.php:180
#, php-format
msgid "There are %d rows in the table."
msgstr "There are %d rows in the table."
-#: classes/Gems/Default/DatabaseAction.php:166
+#: classes/Gems/Default/DatabaseAction.php:182
#, php-format
msgid "Drop table with %d rows"
msgstr "Drop table with %d rows"
-#: classes/Gems/Default/DatabaseAction.php:167
+#: classes/Gems/Default/DatabaseAction.php:183
msgid "Are you really sure?"
msgstr "Are you really sure?"
-#: classes/Gems/Default/DatabaseAction.php:183
+#: classes/Gems/Default/DatabaseAction.php:199
#, php-format
msgid "%1$s %2$s dropped"
msgstr "%1$s %2$s dropped"
-#: classes/Gems/Default/DatabaseAction.php:188
+#: classes/Gems/Default/DatabaseAction.php:205
msgid " during statement "
msgstr " during statement "
-#: classes/Gems/Default/DatabaseAction.php:199
+#: classes/Gems/Default/DatabaseAction.php:216
#, php-format
msgid "%s no longer exists in the database."
msgstr "%s no longer exists in the database."
-#: classes/Gems/Default/DatabaseAction.php:202
+#: classes/Gems/Default/DatabaseAction.php:219
#, php-format
msgid "%s does not yet exist in the database."
msgstr "%s does not yet exist in the database."
-#: classes/Gems/Default/DatabaseAction.php:205
+#: classes/Gems/Default/DatabaseAction.php:222
#, php-format
msgid "%s object does exist."
msgstr "%s object does exist."
-#: classes/Gems/Default/DatabaseAction.php:223
+#: classes/Gems/Default/DatabaseAction.php:240
msgid "Object is not a table."
msgstr "Object is not a table."
-#: classes/Gems/Default/DatabaseAction.php:247
+#: classes/Gems/Default/DatabaseAction.php:264
msgid "Structure"
msgstr "Structure"
-#: classes/Gems/Default/DatabaseAction.php:256
+#: classes/Gems/Default/DatabaseAction.php:273
msgid "database object"
msgid_plural "database objects"
msgstr[0] "database object"
msgstr[1] "database objects"
-#: classes/Gems/Default/DatabaseAction.php:261
+#: classes/Gems/Default/DatabaseAction.php:278
msgid "Database object overview"
msgstr "Database object overview"
-#: classes/Gems/Default/DatabaseAction.php:270
-#: classes/Gems/Default/DatabaseAction.php:322
+#: classes/Gems/Default/DatabaseAction.php:287
+#: classes/Gems/Default/DatabaseAction.php:333
msgid "Level"
msgstr "Level"
-#: classes/Gems/Default/DatabaseAction.php:271
-#: classes/Gems/Default/DatabaseAction.php:323
+#: classes/Gems/Default/DatabaseAction.php:288
+#: classes/Gems/Default/DatabaseAction.php:334
msgid "Subtype"
msgstr "Subtype"
-#: classes/Gems/Default/DatabaseAction.php:273
+#: classes/Gems/Default/DatabaseAction.php:290
msgid "To be executed"
msgstr "To be executed"
-#: classes/Gems/Default/DatabaseAction.php:274
-#: classes/Gems/Default/DatabaseAction.php:326
+#: classes/Gems/Default/DatabaseAction.php:291
+#: classes/Gems/Default/DatabaseAction.php:337
msgid "Executed"
msgstr "Executed"
-#: classes/Gems/Default/DatabaseAction.php:275
-#: classes/Gems/Default/DatabaseAction.php:327
+#: classes/Gems/Default/DatabaseAction.php:292
+#: classes/Gems/Default/DatabaseAction.php:338
msgid "Finished"
msgstr "Finished"
-#: classes/Gems/Default/DatabaseAction.php:278
+#: classes/Gems/Default/DatabaseAction.php:296
msgid "Create the patch table!"
msgstr "Create the patch table!"
-#: classes/Gems/Default/DatabaseAction.php:280
+#: classes/Gems/Default/DatabaseAction.php:298
#, php-format
msgid "%d new or changed patch(es)."
msgstr "%d new or changed patch(es)."
-#: classes/Gems/Default/DatabaseAction.php:285
+#: classes/Gems/Default/DatabaseAction.php:303
msgid "Gems build"
msgstr "Gems build"
-#: classes/Gems/Default/DatabaseAction.php:286
+#: classes/Gems/Default/DatabaseAction.php:304
msgid "Database build"
msgstr "Database build"
-#: classes/Gems/Default/DatabaseAction.php:288
+#: classes/Gems/Default/DatabaseAction.php:306
msgid "Execute level"
msgstr "Execute level"
-#: classes/Gems/Default/DatabaseAction.php:292
+#: classes/Gems/Default/DatabaseAction.php:310
msgid "Ignore finished"
msgstr "Ignore finished"
-#: classes/Gems/Default/DatabaseAction.php:293
+#: classes/Gems/Default/DatabaseAction.php:311
msgid "Ignore executed"
msgstr "Ignore executed"
-#: classes/Gems/Default/DatabaseAction.php:294
+#: classes/Gems/Default/DatabaseAction.php:312
msgid "Show patches"
msgstr "Show patches"
-#: classes/Gems/Default/DatabaseAction.php:308
+#: classes/Gems/Default/DatabaseAction.php:326
#, php-format
msgid "%d patch(es) executed."
msgstr "%d patch(es) executed."
-#: classes/Gems/Default/DatabaseAction.php:315
-msgid "Cache cleaned"
-msgstr "Cache cleaned"
-
-#: classes/Gems/Default/DatabaseAction.php:321
+#: classes/Gems/Default/DatabaseAction.php:332
msgid "Patch"
msgstr "Patch"
-#: classes/Gems/Default/DatabaseAction.php:325
+#: classes/Gems/Default/DatabaseAction.php:336
msgid "Query"
msgstr "Query"
-#: classes/Gems/Default/DatabaseAction.php:328
+#: classes/Gems/Default/DatabaseAction.php:339
msgid "Result"
msgstr "Result"
-#: classes/Gems/Default/DatabaseAction.php:352
+#: classes/Gems/Default/DatabaseAction.php:364
msgid "Patch maintenance"
msgstr "Patch maintenance"
-#: classes/Gems/Default/DatabaseAction.php:356
+#: classes/Gems/Default/DatabaseAction.php:368
msgid "Patch overview"
msgstr "Patch overview"
-#: classes/Gems/Default/DatabaseAction.php:418
+#: classes/Gems/Default/DatabaseAction.php:430
msgid "This database object does not exist. You cannot create it."
msgstr "This database object does not exist. You cannot create it."
-#: classes/Gems/Default/DatabaseAction.php:424
+#: classes/Gems/Default/DatabaseAction.php:436
msgid "This database object has no script. You cannot execute it."
msgstr "This database object has no script. You cannot execute it."
-#: classes/Gems/Default/DatabaseAction.php:435
+#: classes/Gems/Default/DatabaseAction.php:447
#, php-format
msgid "Run %s"
msgstr "Run %s"
-#: classes/Gems/Default/DatabaseAction.php:455
+#: classes/Gems/Default/DatabaseAction.php:468
#, php-format
msgid "Starting %d object creation scripts."
msgstr "Starting %d object creation scripts."
-#: classes/Gems/Default/DatabaseAction.php:461
+#: classes/Gems/Default/DatabaseAction.php:474
#, php-format
msgid "Finished %s creation script for object %d of %d"
msgstr "Finished %s creation script for object %d of %d"
-#: classes/Gems/Default/DatabaseAction.php:465
+#: classes/Gems/Default/DatabaseAction.php:479
msgid "All objects exist. Nothing was executed."
msgstr "All objects exist. Nothing was executed."
-#: classes/Gems/Default/DatabaseAction.php:471
+#: classes/Gems/Default/DatabaseAction.php:486
msgid "Create not-existing database objects"
msgstr "Create not-existing database objects"
-#: classes/Gems/Default/DatabaseAction.php:473
+#: classes/Gems/Default/DatabaseAction.php:488
#, php-format
msgid "One database object does not exist."
msgid_plural "These %d database objects do not exist."
msgstr[0] "One database object does not exist."
msgstr[1] "These %d database objects do not exist."
-#: classes/Gems/Default/DatabaseAction.php:474
+#: classes/Gems/Default/DatabaseAction.php:489
msgid "Are you sure you want to create it?"
msgid_plural "Are you sure you want to create them all?"
msgstr[0] "Are you sure you want to create it?"
msgstr[1] "Are you sure you want to create them all?"
-#: classes/Gems/Default/DatabaseAction.php:487
+#: classes/Gems/Default/DatabaseAction.php:502
msgid "All database objects exist. There is nothing to create."
msgstr "All database objects exist. There is nothing to create."
-#: classes/Gems/Default/DatabaseAction.php:500
+#: classes/Gems/Default/DatabaseAction.php:515
msgid "Separate multiple commands with semicolons (;)."
msgstr "Separate multiple commands with semicolons (;)."
-#: classes/Gems/Default/DatabaseAction.php:507
+#: classes/Gems/Default/DatabaseAction.php:522
msgid "Run"
msgstr "Run"
-#: classes/Gems/Default/DatabaseAction.php:516
+#: classes/Gems/Default/DatabaseAction.php:531
msgid "raw"
msgstr "raw"
-#: classes/Gems/Default/DatabaseAction.php:526
+#: classes/Gems/Default/DatabaseAction.php:541
#, php-format
msgid "Result set %s."
msgstr "Result set %s."
-#: classes/Gems/Default/DatabaseAction.php:549
+#: classes/Gems/Default/DatabaseAction.php:564
msgid "Execute raw SQL"
msgstr "Execute raw SQL"
-#: classes/Gems/Default/DatabaseAction.php:552
+#: classes/Gems/Default/DatabaseAction.php:567
msgid "Result sets"
msgstr "Result sets"
-#: classes/Gems/Default/DatabaseAction.php:577
+#: classes/Gems/Default/DatabaseAction.php:592
msgid "This database object does not exist. You cannot view it."
msgstr "This database object does not exist. You cannot view it."
-#: classes/Gems/Default/DatabaseAction.php:582
+#: classes/Gems/Default/DatabaseAction.php:597
#, php-format
msgid "The data in table %s"
msgstr "The data in table %s"
-#: classes/Gems/Default/DatabaseAction.php:583
+#: classes/Gems/Default/DatabaseAction.php:598
#, php-format
msgid "Contents of %s %s"
msgstr "Contents of %s %s"
@@ -1084,53 +1030,53 @@
msgid "Administrative groups"
msgstr "Administrative groups"
-#: classes/Gems/Default/IndexAction.php:153
+#: classes/Gems/Default/IndexAction.php:156
msgid "Request password reset"
msgstr "Request password reset"
-#: classes/Gems/Default/IndexAction.php:157
+#: classes/Gems/Default/IndexAction.php:160
msgid "Please enter your organization and your username or e-mail address. "
msgstr "Please enter your organization and your username or e-mail address. "
-#: classes/Gems/Default/IndexAction.php:159
+#: classes/Gems/Default/IndexAction.php:162
msgid "Please enter your username or e-mail address. "
msgstr "Please enter your username or e-mail address. "
-#: classes/Gems/Default/IndexAction.php:161
+#: classes/Gems/Default/IndexAction.php:164
msgid "We will then send you an e-mail with a link. The link will bring you to a page where you can set a new password of your choice."
msgstr "We will then send you an e-mail with a link. The link will bring you to a page where you can set a new password of your choice."
-#: classes/Gems/Default/IndexAction.php:166
+#: classes/Gems/Default/IndexAction.php:170
msgid "Execute password reset"
msgstr "Execute password reset"
-#: classes/Gems/Default/IndexAction.php:167
+#: classes/Gems/Default/IndexAction.php:171
msgid "We received your password reset request."
msgstr "We received your password reset request."
-#: classes/Gems/Default/IndexAction.php:170
+#: classes/Gems/Default/IndexAction.php:174
#, php-format
msgid "Welcome to %s"
msgstr "Welcome to %s"
-#: classes/Gems/Default/IndexAction.php:171
+#: classes/Gems/Default/IndexAction.php:175
msgid "Welcome to this website."
msgstr "Welcome to this website."
-#: classes/Gems/Default/IndexAction.php:174
+#: classes/Gems/Default/IndexAction.php:178
msgid "Please enter your password of choice twice."
msgstr "Please enter your password of choice twice."
-#: classes/Gems/Default/IndexAction.php:212
+#: classes/Gems/Default/IndexAction.php:216
msgid "Your password must be changed."
msgstr "Your password must be changed."
-#: classes/Gems/Default/IndexAction.php:224
+#: classes/Gems/Default/IndexAction.php:228
#, php-format
msgid "Login successful, welcome %s."
msgstr "Login successful, welcome %s."
-#: classes/Gems/Default/IndexAction.php:267
+#: classes/Gems/Default/IndexAction.php:268
#, php-format
msgid "Good bye: %s."
msgstr "Good bye: %s."
@@ -1147,21 +1093,35 @@
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:320
+#: classes/Gems/Default/IndexAction.php:321
msgid "New password is active."
msgstr "New password is active."
-#: classes/Gems/Default/IndexAction.php:340
+#: classes/Gems/Default/IndexAction.php:342
msgid "Password reset requested"
msgstr "Password reset requested"
-#: classes/Gems/Default/IndexAction.php:350
+#: classes/Gems/Default/IndexAction.php:345
msgid ""
-"To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n"
-"{reset_url}"
+"Dear {greeting},\n"
+"\n"
+"\n"
+"A new password was requested for your [b]{organization}[/b] account on the [b]{project}[/b] site, please click within {reset_in_hours} hours on [url={reset_url}]this link[/url] to enter the password of your choice.\n"
+"\n"
+"\n"
+"{organization_signature}\n"
+"\n"
+"[url={reset_url}]{reset_url}[/url]\n"
msgstr ""
-"To set a new password for the [b]{organization}[/b] site [b]{project}[/b], please click on this link:\n"
-"{reset_url}"
+"Dear {greeting},\n"
+"\n"
+"\n"
+"A new password was requested for your [b]{organization}[/b] account on the [b]{project}[/b] site, please click within {reset_in_hours} hours on [url={reset_url}]this link[/url] to enter the password of your choice.\n"
+"\n"
+"\n"
+"{organization_signature}\n"
+"\n"
+"[url={reset_url}]{reset_url}[/url]\n"
#: classes/Gems/Default/InvitationAction.php:52
msgid "Invite"
@@ -1948,7 +1908,7 @@
msgstr[0] "patient"
msgstr[1] "patients"
-#: classes/Gems/Default/RespondentAction.php:398
+#: classes/Gems/Default/RespondentAction.php:399
msgid "Please settle the informed consent form for this respondent."
msgstr "Please settle the informed consent form for this patient."
@@ -2263,6 +2223,10 @@
msgid "Checking survey results for all surveys."
msgstr "Checking survey results for all surveys."
+#: classes/Gems/Default/SurveyMaintenanceAction.php:345
+msgid "OK"
+msgstr "OK"
+
#: classes/Gems/Default/SurveyMaintenanceAction.php:352
msgid "Source"
msgstr "Source"
@@ -2517,12 +2481,12 @@
msgid "%s %s not found."
msgstr "%s %s not found."
-#: classes/Gems/Default/TrackActionAbstract.php:488
+#: classes/Gems/Default/TrackActionAbstract.php:489
#, php-format
msgid "Overview of %s track for respondent %s"
msgstr "Overview of %s track for patient %s"
-#: classes/Gems/Default/TrackActionAbstract.php:492
+#: classes/Gems/Default/TrackActionAbstract.php:493
msgid "This track is currently not assigned to this respondent."
msgstr "This track is currently not assigned to this patient."
@@ -3320,6 +3284,11 @@
msgid "After change"
msgstr "After change"
+#: classes/Gems/Tracker/Form/AskTokenForm.php:78
+#, php-format
+msgid "Enter tokens as %s."
+msgstr "Enter tokens as %s."
+
#: classes/Gems/Tracker/Model/StandardTokenModel.php:216
msgid "Measure(d) on"
msgstr "Measure(d) on"
@@ -3364,14 +3333,12 @@
#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:232
#: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:124
-#: classes/Gems/Tracker/Snippets/ShowTokenSnippetAbstract.php:164
#, php-format
msgid "Token %s not found."
msgstr "Token %s not found."
#: classes/Gems/Tracker/Snippets/AnswerModelSnippetGeneric.php:236
#: classes/Gems/Tracker/Snippets/EditTokenSnippetAbstract.php:128
-#: classes/Gems/Tracker/Snippets/ShowTokenSnippetAbstract.php:168
msgid "No token specified."
msgstr "No token specified."
@@ -3410,7 +3377,7 @@
msgstr "Next >"
#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:376
-#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1154
+#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1156
#, php-format
msgid "The '%s' survey is no longer active. The survey was removed from LimeSurvey!"
msgstr "The '%s' survey is no longer active. The survey was removed from LimeSurvey!"
@@ -3440,51 +3407,51 @@
msgstr "Required fields: %s"
#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:466
-#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1307
+#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1309
#, php-format
msgid "The status of the '%s' survey has changed."
msgstr "The status of the '%s' survey has changed."
#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:472
-#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1313
+#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1315
#, php-format
msgid "Survey '%s' IS NO LONGER ACTIVE!!!"
msgstr "Survey '%s' IS NO LONGER ACTIVE!!!"
#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:478
-#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1319
+#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1321
#, php-format
msgid "The status of the '%s' survey has changed to '%s'."
msgstr "The status of the '%s' survey has changed to '%s'."
#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:481
-#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1322
+#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1324
#, php-format
msgid "The status warning for the '%s' survey was removed."
msgstr "The status warning for the '%s' survey was removed."
#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:487
-#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1328
+#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1330
#, php-format
msgid "The name of the '%s' survey has changed to '%s'."
msgstr "The name of the '%s' survey has changed to '%s'."
#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:498
-#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1338
+#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1340
#, php-format
msgid "Imported the '%s' survey."
msgstr "Imported the '%s' survey."
-#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:722
+#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:723
msgid "Submitdate"
msgstr "Submitdate"
-#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1134
+#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1136
#, php-format
msgid "Updated %d Gems tokens to new token definition."
msgstr "Updated %d Gems tokens to new token definition."
-#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1289
+#: classes/Gems/Tracker/Source/LimeSurvey1m9Database.php:1291
#, php-format
msgid "Updated %d token to new token definition in survey '%s'."
msgid_plural "Updated %d tokens to new token definition in survey '%s'."
@@ -3557,6 +3524,28 @@
msgid "- %s"
msgstr "- %s"
+#: classes/Gems/Tracker/Token/TokenValidator.php:164
+msgid "The server is currently busy, please wait a while and try again."
+msgstr "The server is currently busy, please wait a while and try again."
+
+#: classes/Gems/Tracker/Token/TokenValidator.php:199
+#, php-format
+msgid "Not a valid token. The format for valid tokens is: %s."
+msgstr "Not a valid token. The format for valid tokens is: %s."
+
+#: classes/Gems/Tracker/Token/TokenValidator.php:217
+#: classes/Gems/Tracker/Token/TokenValidator.php:231
+msgid "This token is no longer valid."
+msgstr "This token is no longer valid."
+
+#: classes/Gems/Tracker/Token/TokenValidator.php:224
+msgid "This token cannot (yet) be used."
+msgstr "This token cannot (yet) be used."
+
+#: classes/Gems/Tracker/Token/TokenValidator.php:238
+msgid "Unknown token."
+msgstr "Unknown token."
+
#: classes/Gems/User/Organization.php:342
msgid "Cookies must be enabled for this site."
msgstr "Cookies must be enabled for this site."
@@ -3618,7 +3607,7 @@
msgid "may not contain numbers"
msgstr "may not contain numbers"
-#: classes/Gems/User/RadiusUserDefinition.php:177
+#: classes/Gems/User/RadiusUserDefinition.php:165
msgid "Shared secret"
msgstr "Shared secret"
@@ -3633,26 +3622,26 @@
msgid "You are not allowed to login from this location."
msgstr "You are not allowed to login from this location."
-#: classes/Gems/User/User.php:1074
+#: classes/Gems/User/User.php:1094
msgid "Your birthday"
msgstr "Your birthday"
-#: classes/Gems/User/User.php:1090
-#: classes/Gems/User/Form/ChangePasswordForm.php:169
+#: classes/Gems/User/User.php:1110
+#: classes/Gems/User/Form/ChangePasswordForm.php:163
#, php-format
msgid "%s is not correct."
msgstr "%s is not correct."
-#: classes/Gems/User/User.php:1095
-#: classes/Gems/User/Form/OrganizationFormAbstract.php:271
+#: classes/Gems/User/User.php:1115
+#: classes/Gems/User/Form/OrganizationFormAbstract.php:230
msgid "Username"
msgstr "Username"
-#: classes/Gems/User/User.php:1110
+#: classes/Gems/User/User.php:1192
msgid "Trying to send a password reset to a user that cannot be reset."
msgstr "Trying to send a password reset to a user that cannot be reset."
-#: classes/Gems/User/User.php:1137
+#: classes/Gems/User/User.php:1220
msgid "Unable to send e-mail."
msgstr "Unable to send e-mail."
@@ -3665,38 +3654,38 @@
msgid "Radius storage"
msgstr "Radius storage"
-#: classes/Gems/User/Form/ChangePasswordForm.php:221
-#: classes/Gems/User/Form/ChangePasswordForm.php:281
+#: classes/Gems/User/Form/ChangePasswordForm.php:235
+#: classes/Gems/User/Form/ChangePasswordForm.php:292
msgid "New password"
msgstr "New password"
-#: classes/Gems/User/Form/ChangePasswordForm.php:229
-#: classes/Gems/User/Form/ChangePasswordForm.php:282
+#: classes/Gems/User/Form/ChangePasswordForm.php:242
+#: classes/Gems/User/Form/ChangePasswordForm.php:293
msgid "Must be the same as %fieldDescription%."
msgstr "Must be the same as %fieldDescription%."
-#: classes/Gems/User/Form/ChangePasswordForm.php:250
+#: classes/Gems/User/Form/ChangePasswordForm.php:263
msgid "Current password"
msgstr "Current password"
-#: classes/Gems/User/Form/ChangePasswordForm.php:255
+#: classes/Gems/User/Form/ChangePasswordForm.php:267
msgid "Wrong password."
msgstr "Wrong password."
-#: classes/Gems/User/Form/ChangePasswordForm.php:304
+#: classes/Gems/User/Form/ChangePasswordForm.php:315
msgid "Password rules"
msgstr "Password rules"
-#: classes/Gems/User/Form/ChangePasswordForm.php:307
+#: classes/Gems/User/Form/ChangePasswordForm.php:318
#, php-format
msgid "A password %s."
msgstr "A password %s."
-#: classes/Gems/User/Form/ChangePasswordForm.php:314
+#: classes/Gems/User/Form/ChangePasswordForm.php:325
msgid "A password:"
msgstr "A password:"
-#: classes/Gems/User/Form/ChangePasswordForm.php:368
+#: classes/Gems/User/Form/ChangePasswordForm.php:377
msgid "Caps Lock seems to be on!"
msgstr "Caps Lock seems to be on!"
@@ -3906,7 +3895,7 @@
msgstr "Value is required and can't be empty"
#: languages/FakeTranslations.php:41
-#: languages/FakeTranslations.php:85
+#: languages/FakeTranslations.php:78
msgid "Invalid type given, value should be string, integer or float"
msgstr "Invalid type given, value should be string, integer or float"
@@ -3920,92 +3909,72 @@
msgstr "Your account is temporarily blocked, please wait %s minutes"
#: languages/FakeTranslations.php:50
-msgid "Not a valid token. The format for valid tokens is: %tokenFormat%."
-msgstr "Not a valid token. The format for valid tokens is: %tokenFormat%."
-
-#: languages/FakeTranslations.php:51
-msgid "Unknown token."
-msgstr "Unknown token."
-
-#: languages/FakeTranslations.php:52
-msgid "This token is no longer valid."
-msgstr "This token is no longer valid."
-
-#: languages/FakeTranslations.php:53
-msgid "This token cannot be used (any more)."
-msgstr "This token cannot be used (any more)."
-
-#: languages/FakeTranslations.php:54
-msgid "This token cannot be used (yet)."
-msgstr "This token cannot be used (yet)."
-
-#: languages/FakeTranslations.php:57
#, php-format
msgid "Date should be '%dateAfter%' or later."
msgstr "Date should be '%dateAfter%' or later."
-#: languages/FakeTranslations.php:60
+#: languages/FakeTranslations.php:53
#, php-format
msgid "Date should be '%dateBefore%' or earlier."
msgstr "Date should be '%dateBefore%' or earlier."
-#: languages/FakeTranslations.php:63
+#: languages/FakeTranslations.php:56
msgid "%value% is not a valid date."
msgstr "%value% is not a valid date."
-#: languages/FakeTranslations.php:66
+#: languages/FakeTranslations.php:59
msgid "No record matching %value% was found."
msgstr "No record matching %value% was found."
-#: languages/FakeTranslations.php:67
+#: languages/FakeTranslations.php:60
msgid "A duplicate record matching '%value%' was found."
msgstr "A duplicate record matching '%value%' was found."
-#: languages/FakeTranslations.php:70
+#: languages/FakeTranslations.php:63
msgid "This is not a valid %testDescription%."
msgstr "This is not a valid %testDescription%."
-#: languages/FakeTranslations.php:71
+#: languages/FakeTranslations.php:64
msgid "A %testDescription% cannot contain letters."
msgstr "A %testDescription% cannot contain letters."
-#: languages/FakeTranslations.php:72
+#: languages/FakeTranslations.php:65
msgid "%value% is too long for a %testDescription%. Should be %length% digits."
msgstr "%value% is too long for a %testDescription%. Should be %length% digits."
-#: languages/FakeTranslations.php:73
+#: languages/FakeTranslations.php:66
msgid "%value% is too short for a %testDescription%. Should be %length% digits."
msgstr "%value% is too short for a %testDescription%. Should be %length% digits."
-#: languages/FakeTranslations.php:79
+#: languages/FakeTranslations.php:72
msgid "'%value%' is not a phone number (e.g. +12 (0)34-567 890)."
msgstr "'%value%' is not a phone number (e.g. +12 (0)34-567 890)."
-#: languages/FakeTranslations.php:82
+#: languages/FakeTranslations.php:75
msgid "To set '%description%' you have to set '%fieldDescription%'."
msgstr "To set '%description%' you have to set '%fieldDescription%'."
-#: languages/FakeTranslations.php:86
+#: languages/FakeTranslations.php:79
msgid "'%value%' is not an email address (e.g. na...@so...)."
msgstr "'%value%' is not an email address (e.g. na...@so...)."
-#: languages/FakeTranslations.php:89
+#: languages/FakeTranslations...
[truncated message content] |
|
From: <gem...@li...> - 2012-04-08 13:41:26
|
Revision: 607
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=607&view=rev
Author: matijsdejong
Date: 2012-04-08 13:41:19 +0000 (Sun, 08 Apr 2012)
Log Message:
-----------
Adapted User object so the user can never login to an organization url of an organization where he/she has no access
ChangePasswordForm.php now uses the same default sizes for password input as the other user forms
Simplified displayResetForm parameters
Modified Paths:
--------------
trunk/library/classes/Gems/Default/IndexAction.php
trunk/library/classes/Gems/Default/OptionAction.php
trunk/library/classes/Gems/User/Form/ChangePasswordForm.php
trunk/library/classes/Gems/User/User.php
Modified: trunk/library/classes/Gems/Default/IndexAction.php
===================================================================
--- trunk/library/classes/Gems/Default/IndexAction.php 2012-04-06 18:15:38 UTC (rev 606)
+++ trunk/library/classes/Gems/Default/IndexAction.php 2012-04-08 13:41:19 UTC (rev 607)
@@ -146,11 +146,13 @@
* @param Gems_Form_AutoLoadFormAbstract $form Rset password or reset request form
* @param mixed $errors
*/
- protected function displayResetForm(Gems_Form_AutoLoadFormAbstract $form, $errors, Gems_User_User $user = null)
+ protected function displayResetForm(Gems_Form_AutoLoadFormAbstract $form, $errors)
{
- if ($form instanceof Gems_User_Form_ResetRequestForm) {
+ if ($form instanceof Gems_User_Validate_GetUserInterface) {
$user = $form->getUser();
+ }
+ if ($form instanceof Gems_User_Form_ResetRequestForm) {
$this->html->h3($this->_('Request password reset'));
$p = $this->html->pInfo();
@@ -162,7 +164,8 @@
$this->html->p($this->_('We will then send you an e-mail with a link. The link will bring you to a page where you can set a new password of your choice.'));
} elseif ($form instanceof Gems_User_Form_ChangePasswordForm) {
- $form->getUser()->getCurrentOrganization()->setAsCurrentOrganization();
+
+ $this->setCurrentOrganizationTo($user);
if ($user->hasPassword()) {
$this->html->h3($this->_('Execute password reset'));
$p = $this->html->pInfo($this->_('We received your password reset request.'));
@@ -179,7 +182,7 @@
$this->addMessage($errors);
}
- if ($user) {
+ if (isset($user)) {
$this->setCurrentOrganizationTo($user);
}
@@ -276,13 +279,12 @@
$errors = array();
$form = $this->createResetRequestForm();
$request = $this->getRequest();
- $user = null;
if ($key = $this->_getParam('key')) {
$user = $this->loader->getUserLoader()->getUserByResetKey($key);
if ($user->hasValidResetKey()) {
- $form = $user->getChangePasswordForm(array('askOld' => false, 'askCheck' => true));
+ $form = $user->getChangePasswordForm(array('askOld' => false, 'askCheck' => true, 'labelWidthFactor' => $this->labelWidthFactor));
} else {
if (! $request->isPost()) {
if ($user->hasPassword() || (! $user->isActive())) {
@@ -317,6 +319,7 @@
} elseif ($form instanceof Gems_User_Form_ChangePasswordForm) {
$this->addMessage($this->_('New password is active.'));
+ // User set before this form was initiated
$user->setAsCurrentUser();
$user->gotoStartPage($this->menu, $this->getRequest());
}
@@ -324,7 +327,7 @@
}
$form->populate($request->getParams());
- $this->displayResetForm($form, $errors, $user);
+ $this->displayResetForm($form, $errors);
}
/**
Modified: trunk/library/classes/Gems/Default/OptionAction.php
===================================================================
--- trunk/library/classes/Gems/Default/OptionAction.php 2012-04-06 18:15:38 UTC (rev 606)
+++ trunk/library/classes/Gems/Default/OptionAction.php 2012-04-08 13:41:19 UTC (rev 607)
@@ -85,7 +85,7 @@
/*************
* Make form *
*************/
- $form = $user->getChangePasswordForm(array('showReport' => false));
+ $form = $user->getChangePasswordForm(array('showReport' => false, 'useTableLayout' => true));
/****************
* Process form *
Modified: trunk/library/classes/Gems/User/Form/ChangePasswordForm.php
===================================================================
--- trunk/library/classes/Gems/User/Form/ChangePasswordForm.php 2012-04-06 18:15:38 UTC (rev 606)
+++ trunk/library/classes/Gems/User/Form/ChangePasswordForm.php 2012-04-08 13:41:19 UTC (rev 607)
@@ -44,7 +44,7 @@
* @license New BSD License
* @since Class available since version 1.5
*/
-class Gems_User_Form_ChangePasswordForm extends Gems_Form_AutoLoadFormAbstract
+class Gems_User_Form_ChangePasswordForm extends Gems_Form_AutoLoadFormAbstract implements Gems_User_Validate_GetUserInterface
{
/**
* The field name for the new password element.
@@ -132,7 +132,7 @@
*
* @var boolean
*/
- protected $useTableLayout = true;
+ protected $useTableLayout = false;
public function addButtons($links)
{
@@ -176,6 +176,21 @@
}
/**
+ * 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->translate && $this->user) {
+ return parent::checkRegistryRequestsAnswers();
+ } else {
+ return false;
+ }
+ }
+
+ /**
* Should a user specific check question be asked?
*
* @return boolean
@@ -218,8 +233,7 @@
// 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->setAttrib('size', 40);
$element->setRequired(true);
$element->setRenderPassword(true);
$element->addValidator(new Gems_User_Validate_NewPasswordValidator($this->user));
@@ -247,8 +261,7 @@
// 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->setAttrib('size', 40);
$element->setRenderPassword(true);
$element->setRequired(true);
$element->addValidator(new Gems_User_Validate_UserPasswordValidator($this->user, $this->translate->_('Wrong password.')));
@@ -272,8 +285,7 @@
// 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->setAttrib('size', 40);
$element->setRequired(true);
$element->setRenderPassword(true);
@@ -330,6 +342,16 @@
}
/**
+ * Returns a user
+ *
+ * @return Gems_User_User
+ */
+ public function getUser()
+ {
+ return $this->user;
+ }
+
+ /**
* Validate the form
*
* As it is better for translation utilities to set the labels etc. translated,
Modified: trunk/library/classes/Gems/User/User.php
===================================================================
--- trunk/library/classes/Gems/User/User.php 2012-04-06 18:15:38 UTC (rev 606)
+++ trunk/library/classes/Gems/User/User.php 2012-04-08 13:41:19 UTC (rev 607)
@@ -445,6 +445,27 @@
}
/**
+ * True when the current url is one where this user is allowed to login.
+ *
+ * If the url is a fixed organization url and the user is not allowed to
+ * access this organization, then this function returns false.
+ *
+ * @return boolean
+ */
+ public function canLoginHere()
+ {
+ if (! $this->_hasVar('can_login_here')) {
+ $this->_setVar('can_login_here', true);
+ if ($orgId = $this->userLoader->getOrganizationIdByUrl()) {
+ if (! $this->isAllowedOrganization($orgId)) {
+ $this->_setVar('can_login_here', false);;
+ }
+ }
+ }
+ return $this->_getVar('can_login_here');
+ }
+
+ /**
* Return true if a password reset key can be created.
*
* @return boolean
@@ -461,7 +482,7 @@
*/
public function canSetPassword()
{
- return $this->definition->canSetPassword();
+ return $this->isActive() && $this->definition->canSetPassword();
}
/**
@@ -472,7 +493,7 @@
*/
public function checkPasswordResetKey($key)
{
- return $this->definition->checkPasswordResetKey($this, $key);
+ return $this->isActive() && $this->definition->checkPasswordResetKey($this, $key);
}
/**
@@ -955,13 +976,13 @@
}
/**
- * True when the reset key is within it's timeframe
+ * True when the reset key is within it's timeframe and OK for the current organization
*
* @return boolean
*/
public function hasValidResetKey()
{
- return (boolean) $this->_getVar('user_resetkey_valid');
+ return (boolean) $this->isActive() && $this->_getVar('user_resetkey_valid');
}
/**
@@ -970,7 +991,7 @@
*/
public function isActive()
{
- return (boolean) $this->_getVar('user_active');
+ return (boolean) $this->canLoginHere() && $this->_getVar('user_active');
}
/**
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <gem...@li...> - 2012-04-06 18:15:44
|
Revision: 606
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=606&view=rev
Author: matijsdejong
Date: 2012-04-06 18:15:38 +0000 (Fri, 06 Apr 2012)
Log Message:
-----------
Trying to get pForm display into RC2
Modified Paths:
--------------
trunk/library/classes/MUtil/Html/Creator.php
Added Paths:
-----------
trunk/library/classes/MUtil/Html/PFormElement.php
Modified: trunk/library/classes/MUtil/Html/Creator.php
===================================================================
--- trunk/library/classes/MUtil/Html/Creator.php 2012-04-06 18:13:27 UTC (rev 605)
+++ trunk/library/classes/MUtil/Html/Creator.php 2012-04-06 18:15:38 UTC (rev 606)
@@ -111,6 +111,7 @@
'menu' => 'MUtil_Html_ListElement::menu',
'ol' => 'MUtil_Html_ListElement::ol',
'pagePanel' => 'MUtil_Html_PagePanel::pagePanel',
+ 'pForm' => 'MUtil_Html_PFormElement::pForm',
'progress' => 'MUtil_Html_ProgressPanel::progress',
'progressPanel' => 'MUtil_Html_ProgressPanel::progress',
'raw' => 'MUtil_Html_Raw::raw',
Added: trunk/library/classes/MUtil/Html/PFormElement.php
===================================================================
--- trunk/library/classes/MUtil/Html/PFormElement.php (rev 0)
+++ trunk/library/classes/MUtil/Html/PFormElement.php 2012-04-06 18:15:38 UTC (rev 606)
@@ -0,0 +1,150 @@
+<?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 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 MUtil
+ * @subpackage Html
+ * @author Matijs de Jong <mj...@ma...>
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @version $Id: TableElement.php 53 2011-09-20 16:00:47Z matijsdejong $
+ */
+
+/**
+ * Interface extensions that allows HtmlElements to define how to display
+ * form elements.
+ *
+ * @package MUtil
+ * @subpackage Html
+ * @copyright Copyright (c) 2011 Erasmus MC
+ * @license New BSD License
+ * @since Class available since version 1.5.3
+ */
+class MUtil_Html_PFormElement extends MUtil_Html_HtmlElement implements MUtil_Html_FormLayout
+{
+ /**
+ * Can process form elements
+ *
+ * @var array
+ */
+ protected $_specialTypes = array(
+ 'Zend_Form' => 'setAsFormLayout',
+ );
+
+ /**
+ * Should have content
+ *
+ * @var boolean The element is rendered even without content when true.
+ */
+ public $renderWithoutContent = false;
+
+ public function __construct($arg_array = null)
+ {
+ $args = MUtil_Ra::args(func_get_args());
+
+ parent::__construct('p', $args);
+ }
+
+ /**
+ * Static helper function for creation, used by @see MUtil_Html_Creator.
+ *
+ * @param mixed $arg_array Optional MUtil_Ra::args processed settings
+ * @return MUtil_Html_PFormElement
+ */
+ public static function pForm($arg_array = null)
+ {
+ $args = func_get_args();
+ return new self($args);
+ }
+
+ /**
+ * Apply this element to the form as the output decorator.
+ *
+ * @param Zend_Form $form
+ * @param mixed $width The style.width content for the labels
+ * @param array $order The display order of the elements
+ * @param string $errorClass Class name to display all errors in
+ * @return MUtil_Html_DlElement
+ */
+ public function setAsFormLayout(Zend_Form $form, $width = null, $order = array('label', 'element', 'description'), $errorClass = 'errors')
+ {
+ $this->_repeatTags = true;
+ $prependErrors = $errorClass;
+
+ // Make a Lazy repeater for the form elements and set it as the element repeater
+ $formrep = new MUtil_Lazy_RepeatableFormElements($form);
+ $formrep->setSplitHidden(true); // These are treated separately
+ $this->setRepeater($formrep);
+
+ if (null === $width) {
+ $attr = array();
+ } else {
+ $attr['style'] = array('display' => 'inline-block', 'width' => $width);
+ }
+
+ // Place the choosen renderers
+ foreach ($order as $renderer) {
+ switch ($renderer) {
+ case 'label':
+ $this->label($formrep->element, $attr); // Set label with optional width
+ break;
+ case 'error':
+ $prependErrors = false;
+ // Intentional fall through
+
+ default:
+ $this->append($formrep->$renderer);
+ }
+ }
+
+ // Set this element as the form decorator
+ $decorator = new MUtil_Html_ElementDecorator();
+ $decorator->setHtmlElement($this);
+ $decorator->setPrologue($formrep); // Renders hidden elements before this element
+ if ($prependErrors) {
+ $decorator->setPrependErrors(MUtil_Html_ListElement::ul(array('class' => $errorClass, 'style' => array('margin-left' => $width))));
+ }
+ $form->setDecorators(array($decorator, 'AutoFocus', 'Form'));
+
+ return $this;
+ }
+
+ /**
+ * Apply this element to the form as the output decorator with automatically calculated widths.
+ *
+ * @param Zend_Form $form
+ * @param float $factor To multiply the widest nummers of letters in the labels with to calculate the width in em at drawing time
+ * @param array $order The display order of the elements
+ * @return MUtil_Html_PFormElement
+ */
+ public function setAutoWidthFormLayout(Zend_Form $form, $factor = 1, array $order = array('label', 'element', 'description'))
+ {
+ // Lazy call becase the form might not be completed at this stage.
+ return $this->setAsFormLayout($form, MUtil_Lazy::call(array('MUtil_Html_DlElement', 'calculateAutoWidthFormLayout'), $form, $factor), $order);
+ }
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|