From: <gem...@li...> - 2011-11-25 16:12:51
|
Revision: 289 http://gemstracker.svn.sourceforge.net/gemstracker/?rev=289&view=rev Author: matijsdejong Date: 2011-11-25 16:12:43 +0000 (Fri, 25 Nov 2011) Log Message: ----------- Split StaffUserDefinition into abstract DbUserDefinitionAbstract and made RespondentUserDefinition for completion of #31 respondents login. (Not on by default, but it is possible now.) Fixed bug in role usages with empty sets. Modified Paths: -------------- trunk/library/classes/Gems/Default/OrganizationAction.php trunk/library/classes/Gems/User/OldStaffUserDefinition.php trunk/library/classes/Gems/User/StaffUserDefinition.php trunk/library/classes/Gems/User/User.php trunk/library/classes/Gems/Util/DbLookup.php trunk/library/classes/GemsEscort.php trunk/library/configs/db/patches.sql trunk/library/configs/db/tables/gems__organizations.20.sql trunk/library/configs/db/tables/gems__roles.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 Added Paths: ----------- trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php trunk/library/classes/Gems/User/RespondentUserDefinition.php Modified: trunk/library/classes/Gems/Default/OrganizationAction.php =================================================================== --- trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-25 12:55:53 UTC (rev 288) +++ trunk/library/classes/Gems/Default/OrganizationAction.php 2011-11-25 16:12:43 UTC (rev 289) @@ -138,6 +138,7 @@ $model->set('gor_active', 'label', $this->_('Active'), 'description', $this->_('Can the organization be used?'), 'elementClass', 'Checkbox', 'multiOptions', $yesNo); $model->set('gor_add_respondents', 'label', $this->_('Accepting'), 'description', $this->_('Can new respondents be added to the organization?'), 'elementClass', 'CheckBox', 'multiOptions', $yesNo); $model->set('gor_has_respondents', 'label', $this->_('Respondents'), 'description', $this->_('Does the organization have respondents?'), 'elementClass', 'Exhibitor', 'multiOptions', $yesNo); + $model->set('gor_respondent_group', 'label', $this->_('Respondent group'), 'description', $this->_('Allows respondents to login.'), 'multiOptions', $this->util->getDbLookup()->getAllowedRespondentGroups()); if ($detailed) { $model->set('gor_name', 'validator', $model->createUniqueValidator('gor_name')); Added: trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php =================================================================== --- trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php (rev 0) +++ trunk/library/classes/Gems/User/DbUserDefinitionAbstract.php 2011-11-25 16:12:43 UTC (rev 289) @@ -0,0 +1,234 @@ +<?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 Gems + * @subpackage User + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * A standard, database stored user as of version 1.5. + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +abstract class Gems_User_DbUserDefinitionAbstract extends Gems_User_UserDefinitionAbstract +{ + /** + * + * @var Zend_Db_Adapter_Abstract + */ + protected $db; + + /** + * + * @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. + return $user->hasEmailAddress() && $user->canSetPassword(); + } else { + return true; + } + } + + /** + * Return true if the password can be set. + * + * 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 canSetPassword(Gems_User_User $user = null) + { + return true; + } + + /** + * 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; + } + + public function getAuthAdapter($formValues) + { + $adapter = new Zend_Auth_Adapter_DbTable($this->db, 'gems__user_passwords', 'gul_login', 'gup_password'); + + $pwd_hash = $this->hashPassword($formValues['password']); + + $select = $adapter->getDbSelect(); + $select->join('gems__user_logins', 'gup_id_user = gul_id_user', array()) + ->where('gul_can_login = 1') + ->where('gul_id_organization = ?', $formValues['organization']); + + $adapter->setIdentity($formValues['userlogin']) + ->setCredential($pwd_hash); + + return $adapter; + } + + /** + * 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__user_passwords'); + Gems_Model::setChangeFieldsByPrefix($model, 'gup', $user->getUserId()); + + $data['gup_id_user'] = $user->getUserLoginId(); + + $row = $model->loadFirst($data + array('DATE_ADD(gup_reset_requested, INTERVAL 24 HOUR) >= CURRENT_TIMESTAMP')); + if ($row && $row['gup_reset_key']) { + // Keep using the key. + $data['gup_reset_key'] = $row['gup_reset_key']; + } else { + $data['gup_reset_key'] = $this->hashPassword(time() . $user->getEmailAddress()); + } + $data['gup_reset_requested'] = new Zend_Db_Expr('CURRENT_TIMESTAMP'); + + $model->save($data); + + return $data['gup_reset_key']; + } + + /** + * Returns a user object, that may be empty if the user is unknown. + * + * @param string $login_name + * @param int $organization + * @return array Of data to fill the user with. + */ + public function getUserData($login_name, $organization) + { + $select = $this->getUserSelect($login_name, $organization); + + return $this->db->fetchRow($select, array($login_name, $organization), Zend_Db::FETCH_ASSOC); + } + + /** + * A select used by subclasses to add fields to the select. + * + * @param string $login_name + * @param int $organization + * @return Zend_Db_Select + */ + abstract protected function getUserSelect($login_name, $organization); + + /** + * Allow overruling of password hashing. + * + * @param string $password + * @return string + */ + protected function hashPassword($password) + { + return $this->project->getValueHash($password); + } + + /** + * Return true if the user has a password. + * + * @param Gems_User_User $user The user to check + * @return boolean + */ + public function hasPassword(Gems_User_User $user) + { + $sql = "SELECT CASE WHEN gup_password IS NULL THEN 0 ELSE 1 END FROM gems__user_passwords WHERE gup_id_user = ?"; + + return (boolean) $this->db->fetchOne($sql, $user->getUserLoginId()); + } + + /** + * Set the password, if allowed for this user type. + * + * @param Gems_User_User $user The user whose password to change + * @param string $password + * @return Gems_User_UserDefinitionInterface (continuation pattern) + */ + public function setPassword(Gems_User_User $user, $password) + { + $data['gup_id_user'] = $user->getUserLoginId(); + $data['gup_reset_key'] = null; + $data['gup_reset_requested'] = null; + $data['gup_reset_required'] = 0; + if (null === $password) { + // Passwords may be emptied. + $data['gup_password'] = null; + } else { + $data['gup_password'] = $this->hashPassword($password); + } + + $model = new MUtil_Model_TableModel('gems__user_passwords'); + Gems_Model::setChangeFieldsByPrefix($model, 'gup', $user->getUserId()); + + $model->save($data); + + return $this; + } +} \ No newline at end of file Modified: trunk/library/classes/Gems/User/OldStaffUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2011-11-25 12:55:53 UTC (rev 288) +++ trunk/library/classes/Gems/User/OldStaffUserDefinition.php 2011-11-25 16:12:43 UTC (rev 289) @@ -170,19 +170,26 @@ protected function getUserSelect($login_name, $organization) { /** - * Read the needed parameters from the different tables, lots of renames for backward - * compatibility + * Read the needed parameters from the different tables, lots of renames + * for compatibility accross implementations. */ $select = new Zend_Db_Select($this->db); - $select->from('gems__staff', array('user_id' => 'gsf_id_user', - 'user_login' => 'gsf_login', - 'user_email' => 'gsf_email', - 'user_group' => 'gsf_id_primary_group', - 'user_locale' => 'gsf_iso_lang', - 'user_logout' => 'gsf_logout_on_survey', - 'user_base_org_id' => 'gsf_id_organization')) - ->columns(array('user_name'=>"(concat(coalesce(concat(`gems__staff`.`gsf_first_name`,_utf8' '),_utf8''),coalesce(concat(`gems__staff`.`gsf_surname_prefix`,_utf8' '),_utf8''),coalesce(`gems__staff`.`gsf_last_name`,_utf8'')))")) - ->join('gems__groups', 'gsf_id_primary_group = ggp_id_group', array('user_role'=>'ggp_role')) + $select->from('gems__staff', array( + 'user_id' => 'gsf_id_user', + 'user_login' => 'gsf_login', + 'user_email' => 'gsf_email', + 'user_first_name' => 'gsf_first_name', + 'user_surname_prefix' => 'gsf_surname_prefix', + 'user_last_name' => 'gsf_last_name', + 'user_gender' => 'gsf_gender', + 'user_group' => 'gsf_id_primary_group', + 'user_locale' => 'gsf_iso_lang', + 'user_logout' => 'gsf_logout_on_survey', + 'user_base_org_id' => 'gsf_id_organization' + )) + ->join('gems__groups', 'gsf_id_primary_group = ggp_id_group', array( + 'user_role' => 'ggp_role', + )) ->where('ggp_group_active = 1') ->where('gsf_active = 1') ->where('gsf_login = ?') Added: trunk/library/classes/Gems/User/RespondentUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/RespondentUserDefinition.php (rev 0) +++ trunk/library/classes/Gems/User/RespondentUserDefinition.php 2011-11-25 16:12:43 UTC (rev 289) @@ -0,0 +1,94 @@ +<?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 Gems + * @subpackage User + * @author Matijs de Jong <mj...@ma...> + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @version $Id: Sample.php 203 2011-07-07 12:51:32Z matijs $ + */ + +/** + * A standard, database stored and authenticate staff user as of version 1.5. + * + * @package Gems + * @subpackage User + * @copyright Copyright (c) 2011 Erasmus MC + * @license New BSD License + * @since Class available since version 1.5 + */ +class Gems_User_RespondentUserDefinition extends Gems_User_DbUserDefinitionAbstract +{ + /** + * A select used by subclasses to add fields to the select. + * + * @param string $login_name + * @param int $organization + * @return Zend_Db_Select + */ + protected function getUserSelect($login_name, $organization) + { + // 'user_group' => 'gsf_id_primary_group', 'user_logout' => 'gsf_logout_on_survey', + $select = new Zend_Db_Select($this->db); + $select->from('gems__user_logins', array( + 'user_login_id' => 'gul_id_user', + )) + ->join('gems__respondent2org', 'gul_login = gr2o_patient_nr AND gul_id_organization = gr2o_id_organization', array( + 'user_login' => 'gr2o_patient_nr', + 'user_base_org_id' => 'gr2o_id_organization', + )) + ->join('gems__respondents', 'gr2o_id_user = grs_id_user', array( + 'user_id' => 'grs_id_user', + 'user_email' => 'grs_email', + 'user_first_name' => 'grs_first_name', + 'user_surname_prefix' => 'grs_surname_prefix', + 'user_last_name' => 'grs_last_name', + 'user_gender' => 'grs_gender', + 'user_locale' => 'grs_iso_lang', + )) + ->join('gems__organizations', 'gr2o_id_organization=gor_id_organization', array()) + ->join('gems__groups', 'gor_respondent_group=ggp_id_group', array( + 'user_role'=>'ggp_role', + 'user_allowed_ip_ranges' => 'ggp_allowed_ip_ranges', + )) + ->joinLeft('gems__user_passwords', 'gul_id_user = gup_id_user', array( + 'user_password_reset' => 'gup_reset_required', + )) + ->joinLeft('gems__reception_codes', 'gr2o_reception_code = grc_id_reception_code', array()) + ->where('ggp_group_active = 1') + ->where('grc_success = 1') + ->where('gul_can_login = 1') + ->where('gul_login = ?') + ->where('gul_id_organization = ?') + ->limit(1); + + return $select; + } +} \ No newline at end of file Modified: trunk/library/classes/Gems/User/StaffUserDefinition.php =================================================================== --- trunk/library/classes/Gems/User/StaffUserDefinition.php 2011-11-25 12:55:53 UTC (rev 288) +++ trunk/library/classes/Gems/User/StaffUserDefinition.php 2011-11-25 16:12:43 UTC (rev 289) @@ -44,156 +44,45 @@ * @license New BSD License * @since Class available since version 1.5 */ -class Gems_User_StaffUserDefinition extends Gems_User_UserDefinitionAbstract +class Gems_User_StaffUserDefinition extends Gems_User_DbUserDefinitionAbstract { /** + * A select used by subclasses to add fields to the select. * - * @var Zend_Db_Adapter_Abstract - */ - protected $db; - - /** - * - * @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. - return $user->hasEmailAddress() && $user->canSetPassword(); - } else { - return true; - } - } - - /** - * Return true if the password can be set. - * - * 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 canSetPassword(Gems_User_User $user = null) - { - return true; - } - - /** - * 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; - } - - public function getAuthAdapter($formValues) - { - $adapter = new Zend_Auth_Adapter_DbTable($this->db, 'gems__user_passwords', 'gul_login', 'gup_password'); - - $pwd_hash = $this->hashPassword($formValues['password']); - - $select = $adapter->getDbSelect(); - $select->join('gems__user_logins', 'gup_id_user = gul_id_user', array()) - ->where('gul_can_login = 1') - ->where('gul_id_organization = ?', $formValues['organization']); - - $adapter->setIdentity($formValues['userlogin']) - ->setCredential($pwd_hash); - - return $adapter; - } - - /** - * 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__user_passwords'); - Gems_Model::setChangeFieldsByPrefix($model, 'gup', $user->getUserId()); - - $data['gup_id_user'] = $user->getUserLoginId(); - - $row = $model->loadFirst($data + array('DATE_ADD(gup_reset_requested, INTERVAL 24 HOUR) >= CURRENT_TIMESTAMP')); - if ($row && $row['gup_reset_key']) { - // Keep using the key. - $data['gup_reset_key'] = $row['gup_reset_key']; - } else { - $data['gup_reset_key'] = $this->hashPassword(time() . $user->getEmailAddress()); - } - $data['gup_reset_requested'] = new Zend_Db_Expr('CURRENT_TIMESTAMP'); - - $model->save($data); - - return $data['gup_reset_key']; - } - - /** - * Returns a user object, that may be empty if the user is unknown. - * * @param string $login_name * @param int $organization - * @return array Of data to fill the user with. - */ - public function getUserData($login_name, $organization) - { - $select = $this->getUserSelect($login_name, $organization); - - return $this->db->fetchRow($select, array($login_name, $organization), Zend_Db::FETCH_ASSOC); - } - - /** - * Stub to allow subclasses to add fields to the select. - * - * @param string $login_name - * @param int $organization * @return Zend_Db_Select */ protected function getUserSelect($login_name, $organization) { + /** + * Read the needed parameters from the different tables, lots of renames + * for compatibility accross implementations. + */ $select = new Zend_Db_Select($this->db); - $select->from('gems__user_logins', array('user_login_id' => 'gul_id_user')) + $select->from('gems__user_logins', array( + 'user_login_id' => 'gul_id_user', + )) ->join('gems__staff', 'gul_login = gsf_login AND gul_id_organization = gsf_id_organization', array( - 'user_id' => 'gsf_id_user', - 'user_login' => 'gsf_login', - 'user_email' => 'gsf_email', - 'user_group' => 'gsf_id_primary_group', - 'user_locale' => 'gsf_iso_lang', - 'user_logout' => 'gsf_logout_on_survey', - 'user_base_org_id' => 'gsf_id_organization')) - ->columns(array('user_name'=>"(concat(coalesce(concat(`gems__staff`.`gsf_first_name`,_utf8' '),_utf8''),coalesce(concat(`gems__staff`.`gsf_surname_prefix`,_utf8' '),_utf8''),coalesce(`gems__staff`.`gsf_last_name`,_utf8'')))")) - ->join('gems__groups', 'gsf_id_primary_group = ggp_id_group', array('user_role'=>'ggp_role', 'user_allowed_ip_ranges' => 'ggp_allowed_ip_ranges')) - ->joinLeft('gems__user_passwords', 'gul_id_user = gup_id_user', - array('user_password_reset' => 'gup_reset_required')) + 'user_id' => 'gsf_id_user', + 'user_login' => 'gsf_login', + 'user_email' => 'gsf_email', + 'user_first_name' => 'gsf_first_name', + 'user_surname_prefix' => 'gsf_surname_prefix', + 'user_last_name' => 'gsf_last_name', + 'user_gender' => 'gsf_gender', + 'user_group' => 'gsf_id_primary_group', + 'user_locale' => 'gsf_iso_lang', + 'user_logout' => 'gsf_logout_on_survey', + 'user_base_org_id' => 'gsf_id_organization', + )) + ->join('gems__groups', 'gsf_id_primary_group = ggp_id_group', array( + 'user_role'=>'ggp_role', + 'user_allowed_ip_ranges' => 'ggp_allowed_ip_ranges', + )) + ->joinLeft('gems__user_passwords', 'gul_id_user = gup_id_user', array( + 'user_password_reset' => 'gup_reset_required', + )) ->where('ggp_group_active = 1') ->where('gsf_active = 1') ->where('gul_can_login = 1') @@ -203,56 +92,4 @@ return $select; } - - /** - * Allow overruling of password hashing. - * - * @param string $password - * @return string - */ - protected function hashPassword($password) - { - return $this->project->getValueHash($password); - } - - /** - * Return true if the user has a password. - * - * @param Gems_User_User $user The user to check - * @return boolean - */ - public function hasPassword(Gems_User_User $user) - { - $sql = "SELECT CASE WHEN gup_password IS NULL THEN 0 ELSE 1 END FROM gems__user_passwords WHERE gup_id_user = ?"; - - return (boolean) $this->db->fetchOne($sql, $user->getUserLoginId()); - } - - /** - * Set the password, if allowed for this user type. - * - * @param Gems_User_User $user The user whose password to change - * @param string $password - * @return Gems_User_UserDefinitionInterface (continuation pattern) - */ - public function setPassword(Gems_User_User $user, $password) - { - $data['gup_id_user'] = $user->getUserLoginId(); - $data['gup_reset_key'] = null; - $data['gup_reset_requested'] = null; - $data['gup_reset_required'] = 0; - if (null === $password) { - // Passwords may be emptied. - $data['gup_password'] = null; - } else { - $data['gup_password'] = $this->hashPassword($password); - } - - $model = new MUtil_Model_TableModel('gems__user_passwords'); - Gems_Model::setChangeFieldsByPrefix($model, 'gup', $user->getUserId()); - - $model->save($data); - - return $this; - } } \ No newline at end of file Modified: trunk/library/classes/Gems/User/User.php =================================================================== --- trunk/library/classes/Gems/User/User.php 2011-11-25 12:55:53 UTC (rev 288) +++ trunk/library/classes/Gems/User/User.php 2011-11-25 16:12:43 UTC (rev 289) @@ -411,6 +411,22 @@ */ public function getFullName() { + if (! $this->_getVar('user_name')) { + $name = ltrim($this->_getVar('user_first_name') . ' ') . + ltrim($this->_getVar('user_surname_prefix') . ' ') . + $this->_getVar('user_last_name'); + + if (! $name) { + // Use obfuscated login name + $name = $this->getLoginName(); + $name = subs($name, 0, 3) . str_repeat('*', strlen($name) - 2); + } + + $this->_setVar('user_name', $name); + + // MUtil_Echo::track($name); + } + return $this->_getVar('user_name'); } Modified: trunk/library/classes/Gems/Util/DbLookup.php =================================================================== --- trunk/library/classes/Gems/Util/DbLookup.php 2011-11-25 12:55:53 UTC (rev 288) +++ trunk/library/classes/Gems/Util/DbLookup.php 2011-11-25 16:12:43 UTC (rev 289) @@ -128,6 +128,18 @@ * * @return array */ + public function getAllowedRespondentGroups() + { + return $this->util->getTranslated()->getEmptyDropdownArray() + + $this->db->fetchPairs('SELECT ggp_id_group, ggp_name FROM gems__groups WHERE ggp_group_active=1 AND ggp_respondent_members=1 ORDER BY ggp_name'); + } + + /** + * Retrieve an array of groups the user is allowed to assign: his own group and all groups + * he inherits rights from + * + * @return array + */ public function getAllowedStaffGroups() { $groups = $this->getActiveStaffGroups(); Modified: trunk/library/classes/GemsEscort.php =================================================================== --- trunk/library/classes/GemsEscort.php 2011-11-25 12:55:53 UTC (rev 288) +++ trunk/library/classes/GemsEscort.php 2011-11-25 16:12:43 UTC (rev 289) @@ -884,9 +884,11 @@ */ protected function _layoutUser(array $args = null) { - if (isset($this->session->user_name)) { + $user = $this->getLoader()->getCurrentUser(); + + if ($user->isActive()) { return MUtil_Html::create()->div( - sprintf($this->_('User: %s'), $this->session->user_name), + sprintf($this->_('User: %s'), $user->getFullName()), $args, array('id' => 'username') ); Modified: trunk/library/configs/db/patches.sql =================================================================== --- trunk/library/configs/db/patches.sql 2011-11-25 12:55:53 UTC (rev 288) +++ trunk/library/configs/db/patches.sql 2011-11-25 16:12:43 UTC (rev 289) @@ -325,9 +325,15 @@ UPDATE `gems__organizations` SET gor_has_respondents = COALESCE((SELECT 1 FROM gems__respondent2org WHERE gr2o_id_organization = gor_id_organization GROUP BY gr2o_id_organization), 0); UPDATE `gems__organizations` SET gor_add_respondents = CASE WHEN gor_has_respondents = 1 AND gor_active = 1 THEN 1 ELSE 0 END; +ALTER TABLE `gems__organizations` ADD gor_respondent_group bigint unsigned null AFTER gor_add_respondents; + -- PATCH: Log failed logins INSERT INTO `gems__log_actions` (`glac_id_action`, `glac_name`, `glac_change`, `glac_log`, `glac_created`) VALUES (NULL , 'loginFail', '0', '1', CURRENT_TIMESTAMP); -- PATCH: IP ranges for groups ALTER TABLE `gems__groups` ADD `ggp_allowed_ip_ranges` TEXT CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null AFTER `ggp_respondent_members`; + +-- PATCH: Roles fields sometimes empty +ALTER TABLE gems__roles CHANGE grl_parents grl_parents text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null; +ALTER TABLE gems__roles CHANGE grl_privileges grl_privileges text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null; Modified: trunk/library/configs/db/tables/gems__organizations.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__organizations.20.sql 2011-11-25 12:55:53 UTC (rev 288) +++ trunk/library/configs/db/tables/gems__organizations.20.sql 2011-11-25 16:12:43 UTC (rev 289) @@ -1,33 +1,34 @@ CREATE TABLE if not exists gems__organizations ( - gor_id_organization bigint unsigned not null auto_increment, + gor_id_organization bigint unsigned not null auto_increment, - gor_name varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, - gor_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gor_location varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gor_url varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gor_task varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gor_name varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + gor_code varchar(20) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gor_location varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gor_url varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gor_task varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, -- A commy separated list of organization numbers that can look at respondents in this organization - gor_accessible_by text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gor_accessible_by text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gor_contact_name varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gor_contact_email varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gor_welcome text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gor_signature text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gor_contact_name varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gor_contact_email varchar(127) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gor_welcome text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, + gor_signature text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, - gor_style varchar(15) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'gems', - gor_iso_lang char(2) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' - not null default 'en' references gems__languages (gml_iso_lang), + gor_style varchar(15) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null default 'gems', + gor_iso_lang char(2) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' + not null default 'en' references gems__languages (gml_iso_lang), - gor_has_respondents boolean not null default 1, - gor_add_respondents boolean not null default 1, - gor_active boolean not null default 1, + gor_has_respondents boolean not null default 1, + gor_add_respondents boolean not null default 1, + gor_respondent_group bigint unsigned references gems__groups (ggp_id_group) null, + gor_active boolean not null default 1, - gor_changed timestamp not null default current_timestamp on update current_timestamp, - gor_changed_by bigint unsigned not null, - gor_created timestamp not null, - gor_created_by bigint unsigned not null, + gor_changed timestamp not null default current_timestamp on update current_timestamp, + gor_changed_by bigint unsigned not null, + gor_created timestamp not null, + gor_created_by bigint unsigned not null, PRIMARY KEY(gor_id_organization), UNIQUE (gor_code) Modified: trunk/library/configs/db/tables/gems__roles.20.sql =================================================================== --- trunk/library/configs/db/tables/gems__roles.20.sql 2011-11-25 12:55:53 UTC (rev 288) +++ trunk/library/configs/db/tables/gems__roles.20.sql 2011-11-25 16:12:43 UTC (rev 289) @@ -4,10 +4,10 @@ grl_name varchar(30) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, grl_description varchar(50) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, - grl_parents text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + grl_parents text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, -- The grl_parents is a comma-separated list of parents for this role - grl_privileges text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' not null, + grl_privileges text CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' null, -- The grl_privilege is a comma-separated list of privileges for this role grl_changed timestamp not null default current_timestamp on update current_timestamp, Modified: trunk/library/languages/default-en.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-en.po =================================================================== --- trunk/library/languages/default-en.po 2011-11-25 12:55:53 UTC (rev 288) +++ trunk/library/languages/default-en.po 2011-11-25 16:12:43 UTC (rev 289) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse EN\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-23 19:43+0100\n" +"POT-Creation-Date: 2011-11-25 17:05+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -23,53 +23,53 @@ msgid "Path %s not writable" msgstr "Path %s not writable" -#: classes/GemsEscort.php:887 +#: classes/GemsEscort.php:891 #, php-format msgid "User: %s" msgstr "User: %s" -#: classes/GemsEscort.php:911 +#: classes/GemsEscort.php:916 msgid "version" msgstr "version" -#: classes/GemsEscort.php:1342 +#: classes/GemsEscort.php:1347 msgid "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" msgstr "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" -#: classes/GemsEscort.php:1469 +#: classes/GemsEscort.php:1474 msgid "Please check back later." msgstr "Please check back later." -#: classes/GemsEscort.php:1471 -#: classes/GemsEscort.php:1475 #: classes/GemsEscort.php:1476 +#: classes/GemsEscort.php:1480 +#: classes/GemsEscort.php:1481 msgid "System is in maintenance mode" msgstr "System is in maintenance mode" -#: classes/GemsEscort.php:1486 +#: classes/GemsEscort.php:1491 msgid "No access to site." msgstr "No access to site." -#: classes/GemsEscort.php:1488 -#: classes/GemsEscort.php:1524 +#: classes/GemsEscort.php:1493 +#: classes/GemsEscort.php:1529 msgid "You have no access to this site." msgstr "You have no access to this site." -#: classes/GemsEscort.php:1504 +#: classes/GemsEscort.php:1509 msgid "No access to page" msgstr "No access to page" -#: classes/GemsEscort.php:1506 +#: classes/GemsEscort.php:1511 #, php-format msgid "Access to this page is not allowed for current role: %s." msgstr "Access to this page is not allowed for current role: %s." -#: classes/GemsEscort.php:1511 -#: classes/GemsEscort.php:1522 +#: classes/GemsEscort.php:1516 +#: classes/GemsEscort.php:1527 msgid "You are no longer logged in." msgstr "You are no longer logged in." -#: classes/GemsEscort.php:1512 +#: classes/GemsEscort.php:1517 msgid "You must login to access this page." msgstr "You must login to access this page." @@ -1094,50 +1094,50 @@ msgid "Your password must be changed." msgstr "Your password must be changed." -#: classes/Gems/Default/IndexAction.php:301 +#: classes/Gems/Default/IndexAction.php:300 #, php-format msgid "Login successful, welcome %s." msgstr "Login successful, welcome %s." -#: classes/Gems/Default/IndexAction.php:341 +#: classes/Gems/Default/IndexAction.php:340 #, php-format msgid "Good bye: %s." msgstr "Good bye: %s." -#: classes/Gems/Default/IndexAction.php:366 +#: classes/Gems/Default/IndexAction.php:365 msgid "Reset accepted, enter your new password." msgstr "Reset accepted, enter your new password." -#: classes/Gems/Default/IndexAction.php:370 +#: classes/Gems/Default/IndexAction.php:369 msgid "This key timed out or does not belong to this user." msgstr "This key timed out or does not belong to this user." -#: classes/Gems/Default/IndexAction.php:387 +#: classes/Gems/Default/IndexAction.php:386 msgid "Password reset requested" msgstr "Password reset requested" -#: classes/Gems/Default/IndexAction.php:388 +#: classes/Gems/Default/IndexAction.php:387 #, php-format msgid "To reset your password for %s, please click this link: %s" msgstr "To reset your password for %s, please click this link: %s" -#: classes/Gems/Default/IndexAction.php:393 +#: classes/Gems/Default/IndexAction.php:392 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:395 +#: classes/Gems/Default/IndexAction.php:394 msgid "Unable to send e-mail." msgstr "Unable to send e-mail." -#: classes/Gems/Default/IndexAction.php:400 +#: classes/Gems/Default/IndexAction.php:399 msgid "No such user found or no e-mail address known or user cannot be reset." msgstr "No such user found or no e-mail address known or user cannot be reset." -#: classes/Gems/Default/IndexAction.php:404 +#: classes/Gems/Default/IndexAction.php:403 msgid "We received your password reset key." msgstr "We received your password reset key." -#: classes/Gems/Default/IndexAction.php:405 +#: classes/Gems/Default/IndexAction.php:404 msgid "Please enter the organization and username belonging to this key." msgstr "Please enter the organization and username belonging to this key." @@ -1484,7 +1484,7 @@ msgstr "Login Name" #: classes/Gems/Default/OptionAction.php:188 -#: classes/Gems/Default/OrganizationAction.php:191 +#: classes/Gems/Default/OrganizationAction.php:134 #: classes/Gems/Default/RespondentAction.php:173 #: classes/Gems/Default/StaffAction.php:224 msgid "Language" @@ -1513,100 +1513,100 @@ msgid "Item" msgstr "Item" -#: classes/Gems/Default/OrganizationAction.php:124 -msgid "Cookies must be enabled." -msgstr "Cookies must be enabled." - -#: classes/Gems/Default/OrganizationAction.php:127 +#: classes/Gems/Default/OrganizationAction.php:91 msgid "Invalid organization." msgstr "Invalid organization." -#: classes/Gems/Default/OrganizationAction.php:135 +#: classes/Gems/Default/OrganizationAction.php:99 msgid "New organization..." msgstr "New organization..." -#: classes/Gems/Default/OrganizationAction.php:144 -msgid "Choose an organization" -msgstr "Choose an organization" - -#: classes/Gems/Default/OrganizationAction.php:180 +#: classes/Gems/Default/OrganizationAction.php:123 msgid "Url" msgstr "Url" -#: classes/Gems/Default/OrganizationAction.php:181 +#: classes/Gems/Default/OrganizationAction.php:124 msgid "Task" msgstr "Task" -#: classes/Gems/Default/OrganizationAction.php:182 +#: classes/Gems/Default/OrganizationAction.php:125 msgid "Contact name" msgstr "Contact name" -#: classes/Gems/Default/OrganizationAction.php:183 +#: classes/Gems/Default/OrganizationAction.php:126 msgid "Contact email" msgstr "Contact email" -#: classes/Gems/Default/OrganizationAction.php:186 +#: classes/Gems/Default/OrganizationAction.php:129 msgid "Style" msgstr "Style" -#: classes/Gems/Default/OrganizationAction.php:195 +#: classes/Gems/Default/OrganizationAction.php:138 msgid "Can the organization be used?" msgstr "Can the organization be used?" -#: classes/Gems/Default/OrganizationAction.php:196 +#: classes/Gems/Default/OrganizationAction.php:139 msgid "Accepting" msgstr "Accepting" -#: classes/Gems/Default/OrganizationAction.php:196 +#: classes/Gems/Default/OrganizationAction.php:139 msgid "Can new respondents be added to the organization?" msgstr "Can new patients be added to the organization?" -#: classes/Gems/Default/OrganizationAction.php:197 +#: classes/Gems/Default/OrganizationAction.php:140 msgid "Does the organization have respondents?" msgstr "Does the organization have patients?" -#: classes/Gems/Default/OrganizationAction.php:201 +#: classes/Gems/Default/OrganizationAction.php:141 +msgid "Respondent group" +msgstr "Patient group" + +#: classes/Gems/Default/OrganizationAction.php:141 +msgid "Allows respondents to login." +msgstr "Allow patients to login." + +#: classes/Gems/Default/OrganizationAction.php:145 msgid "Greeting" msgstr "Greeting" -#: classes/Gems/Default/OrganizationAction.php:201 -#: classes/Gems/Default/OrganizationAction.php:202 +#: classes/Gems/Default/OrganizationAction.php:145 +#: classes/Gems/Default/OrganizationAction.php:146 msgid "For emails and token forward screen." msgstr "For emails and token forward screen." -#: classes/Gems/Default/OrganizationAction.php:202 +#: classes/Gems/Default/OrganizationAction.php:146 msgid "Signature" msgstr "Signature" -#: classes/Gems/Default/OrganizationAction.php:204 +#: classes/Gems/Default/OrganizationAction.php:148 msgid "Accessible by" msgstr "Accessible by" -#: classes/Gems/Default/OrganizationAction.php:204 +#: classes/Gems/Default/OrganizationAction.php:148 msgid "Checked organizations see this organizations respondents." msgstr "Checked organizations see this organizations patients." -#: classes/Gems/Default/OrganizationAction.php:214 +#: classes/Gems/Default/OrganizationAction.php:158 msgid "Code name" msgstr "Code name" -#: classes/Gems/Default/OrganizationAction.php:214 +#: classes/Gems/Default/OrganizationAction.php:158 msgid "Only for programmers." msgstr "Only for programmers." -#: classes/Gems/Default/OrganizationAction.php:228 +#: classes/Gems/Default/OrganizationAction.php:172 msgid "Delete organization" msgstr "Delete organization" -#: classes/Gems/Default/OrganizationAction.php:238 +#: classes/Gems/Default/OrganizationAction.php:182 msgid "Edit organization" msgstr "Edit organization" -#: classes/Gems/Default/OrganizationAction.php:248 +#: classes/Gems/Default/OrganizationAction.php:192 msgid "Participating organizations" msgstr "Participating organizations" -#: classes/Gems/Default/OrganizationAction.php:258 +#: classes/Gems/Default/OrganizationAction.php:202 msgid "Show organization" msgstr "Show organization" @@ -3442,6 +3442,10 @@ msgstr[0] "A password should contain at least one number." msgstr[1] "A password should contain at least %d numbers." +#: classes/Gems/User/User.php:765 +msgid "Cookies must be enabled for this site." +msgstr "Cookies must be enabled for this site." + #: classes/Gems/User/UserPasswordValidator.php:115 msgid "Wrong password." msgstr "Wrong password." @@ -3784,7 +3788,6 @@ msgstr "Deleted token %s for survey %s." #: snippets/DeleteTrackTokenSnippet.php:277 -#: snippets/EditTrackTokenSnippet.php:174 #, php-format msgid "%d token changed by recalculation." msgid_plural "%d tokens changed by recalculation." @@ -3809,10 +3812,12 @@ msgstr "Recalculate track" #: snippets/RespondentDetailsSnippet.php:59 +#: snippets/RespondentDetailsWithAssignmentsSnippet.php:74 msgid "Respondent information" msgstr "Patient information" #: snippets/RespondentDetailsSnippet.php:71 +#: snippets/RespondentDetailsWithAssignmentsSnippet.php:97 msgid "Respondent nr: " msgstr "Patient nr:" @@ -3900,6 +3905,10 @@ msgid "This track can be assigned since %s." msgstr "This track can be assigned since %s." +#: snippets/Organization/ChooseOrganizationSnippet.php:86 +msgid "Choose an organization" +msgstr "Choose an organization" + #: snippets/Organization/ChooseOrganizationSnippet.php:93 msgid "This organization cannot have any respondents, please choose one that does:" msgstr "This organization cannot have any patients, please choose one that does:" @@ -3908,8 +3917,8 @@ msgid "This organization cannot have any respondents." msgstr "This organization cannot have any patients." -#~ msgid "Allow new respondents" -#~ msgstr "Allow new patients" +#~ msgid "Cookies must be enabled." +#~ msgstr "Cookies must be enabled." #~ msgid "Please update the database" #~ msgstr "Please update the database" Modified: trunk/library/languages/default-nl.mo =================================================================== (Binary files differ) Modified: trunk/library/languages/default-nl.po =================================================================== --- trunk/library/languages/default-nl.po 2011-11-25 12:55:53 UTC (rev 288) +++ trunk/library/languages/default-nl.po 2011-11-25 16:12:43 UTC (rev 289) @@ -2,7 +2,7 @@ msgstr "" "Project-Id-Version: Pulse NL\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2011-11-23 19:43+0100\n" +"POT-Creation-Date: 2011-11-25 17:06+0100\n" "PO-Revision-Date: \n" "Last-Translator: Matijs de Jong <mj...@ma...>\n" "Language-Team: Erasmus MGZ <mat...@ma...>\n" @@ -23,53 +23,53 @@ msgid "Path %s not writable" msgstr "Path %s niet schrijfbaar" -#: classes/GemsEscort.php:887 +#: classes/GemsEscort.php:891 #, php-format msgid "User: %s" msgstr "Login: %s" -#: classes/GemsEscort.php:911 +#: classes/GemsEscort.php:916 msgid "version" msgstr "versie" -#: classes/GemsEscort.php:1342 +#: classes/GemsEscort.php:1347 msgid "Take note: your session has expired, your inputs were not saved. Please check the input data and try again" msgstr "Let op: uw sessie is verlopen, uw invoer is niet opgeslagen. Controleer uw gegevens en probeer a.u.b. opnieuw." -#: classes/GemsEscort.php:1469 +#: classes/GemsEscort.php:1474 msgid "Please check back later." msgstr "Probeer het later opnieuw." -#: classes/GemsEscort.php:1471 -#: classes/GemsEscort.php:1475 #: classes/GemsEscort.php:1476 +#: classes/GemsEscort.php:1480 +#: classes/GemsEscort.php:1481 msgid "System is in maintenance mode" msgstr "Systeem is in onderhoudsmodus" -#: classes/GemsEscort.php:1486 +#: classes/GemsEscort.php:1491 msgid "No access to site." msgstr "Geen toegang tot website." -#: classes/GemsEscort.php:1488 -#: classes/GemsEscort.php:1524 +#: classes/GemsEscort.php:1493 +#: classes/GemsEscort.php:1529 msgid "You have no access to this site." msgstr "U heeft geen toegang tot deze website." -#: classes/GemsEscort.php:1504 +#: classes/GemsEscort.php:1509 msgid "No access to page" msgstr "Geen toegang tot pagina" -#: classes/GemsEscort.php:1506 +#: classes/GemsEscort.php:1511 #, php-format msgid "Access to this page is not allowed for current role: %s." msgstr "U heeft geen toegang tot deze pagina. Uw huidige rol is: %s." -#: classes/GemsEscort.php:1511 -#: classes/GemsEscort.php:1522 +#: classes/GemsEscort.php:1516 +#: classes/GemsEscort.php:1527 msgid "You are no longer logged in." msgstr "U bent niet meer ingelogd." -#: classes/GemsEscort.php:1512 +#: classes/GemsEscort.php:1517 msgid "You must login to access this page." msgstr "U moet ingelogd zijn voor toegang tot deze pagina." @@ -1094,50 +1094,50 @@ msgid "Your password must be changed." msgstr "Uw wachtwoord moet veranderd worden." -#: classes/Gems/Default/IndexAction.php:301 +#: classes/Gems/Default/IndexAction.php:300 #, php-format msgid "Login successful, welcome %s." msgstr "Login in orde, welkom %s." -#: classes/Gems/Default/IndexAction.php:341 +#: classes/Gems/Default/IndexAction.php:340 #, php-format msgid "Good bye: %s." msgstr "Tot ziens: %s." -#: classes/Gems/Default/IndexAction.php:366 +#: classes/Gems/Default/IndexAction.php:365 msgid "Reset accepted, enter your new password." msgstr "Reset geaccepteerd, voer uw nieuwe wachtwoord in." -#: classes/Gems/Default/IndexAction.php:370 +#: classes/Gems/Default/IndexAction.php:369 msgid "This key timed out or does not belong to this user." msgstr "Te oude sleutel of sleutel hoort niet bij gebruiker." -#: classes/Gems/Default/IndexAction.php:387 +#: classes/Gems/Default/IndexAction.php:386 msgid "Password reset requested" msgstr "Wachtwoord reset aangevraagd" -#: classes/Gems/Default/IndexAction.php:388 +#: classes/Gems/Default/IndexAction.php:387 #, php-format msgid "To reset your password for %s, please click this link: %s" msgstr "Om uw wachtwoord voor %s te resetten, klik op deze link: %s" -#: classes/Gems/Default/IndexAction.php:393 +#: classes/Gems/Default/IndexAction.php:392 msgid "We sent you an e-mail with a reset link. Click on the link in the e-mail." msgstr "We hebben u een email met reset link gestuurd. Klik op de link in de email." -#: classes/Gems/Default/IndexAction.php:395 +#: classes/Gems/Default/IndexAction.php:394 msgid "Unable to send e-mail." msgstr "Verzenden e-mail mislukt." -#: classes/Gems/Default/IndexAction.php:400 +#: classes/Gems/Default/IndexAction.php:399 msgid "No such user found or no e-mail address known or user cannot be reset." msgstr "Gebruiker niet gevonden of e-mail adres onbekend of gebruiker kan niet gereset worden." -#: classes/Gems/Default/IndexAction.php:404 +#: classes/Gems/Default/IndexAction.php:403 msgid "We received your password reset key." msgstr "Wachtwoord resetsleutel ontvangen." -#: classes/Gems/Default/IndexAction.php:405 +#: classes/Gems/Default/IndexAction.php:404 msgid "Please enter the organization and username belonging to this key." msgstr "Geef de organisatie en gebruikersnaam die bij deze sleutel horen op." @@ -1484,7 +1484,7 @@ msgstr "Login Naam" #: classes/Gems/Default/OptionAction.php:188 -#: classes/Gems/Default/OrganizationAction.php:191 +#: classes/Gems/Default/OrganizationAction.php:134 #: classes/Gems/Default/RespondentAction.php:173 #: classes/Gems/Default/StaffAction.php:224 msgid "Language" @@ -1513,100 +1513,100 @@ msgid "Item" msgstr "Item" -#: classes/Gems/Default/OrganizationAction.php:124 -msgid "Cookies must be enabled." -msgstr "Zonder cookies kan de taal niet ingesteld worden." - -#: classes/Gems/Default/OrganizationAction.php:127 +#: classes/Gems/Default/OrganizationAction.php:91 msgid "Invalid organization." msgstr "Ongeldige organisatie." -#: classes/Gems/Default/OrganizationAction.php:135 +#: classes/Gems/Default/OrganizationAction.php:99 msgid "New organization..." msgstr "Nieuwe organisatie..." -#: classes/Gems/Default/OrganizationAction.php:144 -msgid "Choose an organization" -msgstr "Kies een organisatie" - -#: classes/Gems/Default/OrganizationAction.php:180 +#: classes/Gems/Default/OrganizationAction.php:123 msgid "Url" msgstr "Url" -#: classes/Gems/Default/OrganizationAction.php:181 +#: classes/Gems/Default/OrganizationAction.php:124 msgid "Task" msgstr "Taak" -#: classes/Gems/Default/OrganizationAction.php:182 +#: classes/Gems/Default/OrganizationAction.php:125 msgid "Contact name" msgstr "Contact naam" -#: classes/Gems/Default/OrganizationAction.php:183 +#: classes/Gems/Default/OrganizationAction.php:126 msgid "Contact email" msgstr "Contact email" -#: classes/Gems/Default/OrganizationAction.php:186 +#: classes/Gems/Default/OrganizationAction.php:129 msgid "Style" msgstr "Stijl" -#: classes/Gems/Default/OrganizationAction.php:195 +#: classes/Gems/Default/OrganizationAction.php:138 msgid "Can the organization be used?" msgstr "Is de organisatie in gebruik?" -#: classes/Gems/Default/OrganizationAction.php:196 +#: classes/Gems/Default/OrganizationAction.php:139 msgid "Accepting" msgstr "Accepteerd" -#: classes/Gems/Default/OrganizationAction.php:196 +#: classes/Gems/Default/OrganizationAction.php:139 msgid "Can new respondents be added to the organization?" msgstr "Accepteert de organisatie nieuwe patiënten?" -#: classes/Gems/Default/OrganizationAction.php:197 +#: classes/Gems/Default/OrganizationAction.php:140 msgid "Does the organization have respondents?" msgstr "Heeft de organisatie patiënten?" -#: classes/Gems/Default/OrganizationAction.php:201 +#: classes/Gems/Default/OrganizationAction.php:141 +msgid "Respondent group" +msgstr "Patiënten groep" + +#: classes/Gems/Default/OrganizationAction.php:141 +msgid "Allows respondents to login." +msgstr "Patiënten toestaan in te loggen." + +#: classes/Gems/Default/OrganizationAction.php:145 msgid "Greeting" msgstr "Begroeting" -#: classes/Gems/Default/OrganizationAction.php:201 -#: classes/Gems/Default/OrganizationAction.php:202 +#: classes/Gems/Default/OrganizationAction.php:145 +#: classes/Gems/Default/OrganizationAction.php:146 msgid "For emails and token forward screen." msgstr "Voor emails en kenmerk scherm." -#: classes/Gems/Default/OrganizationAction.php:202 +#: classes/Gems/Default/OrganizationAction.php:146 msgid "Signature" msgstr "Handtekening" -#: classes/Gems/Default/OrganizationAction.php:204 +#: classes/Gems/Default/OrganizationAction.php:148 msgid "Accessible by" msgstr "Toegankelijk voor" -#: classes/Gems/Default/OrganizationAction.php:204 +#: classes/Gems/Default/OrganizationAction.php:148 msgid "Checked organizations see this organizations respondents." msgstr "Geselecteerde organizaties kunnen de patiënten van deze organisatie bekijken." -#: classes/Gems/Default/OrganizationAction.php:214 +#: classes/Gems/Default/OrganizationAction.php:158 msgid "Code name" msgstr "Code naam" -#: classes/Gems/Default/OrganizationAction.php:214 +#: classes/Gems/Default/OrganizationAction.php:158 msgid "Only for programmers." msgstr "Uitsluitend voor programmeurs." -#: classes/Gems/Default/OrganizationAction.php:228 +#: classes/Gems/Default/OrganizationAction.php:172 msgid "Delete organization" msgstr "Verwijder organisatie" -#: classes/Gems/Default/OrganizationAction.php:238 +#: classes/Gems/Default/OrganizationAction.php:182 msgid "Edit organization" msgstr "Bewerk organisatie" -#: classes/Gems/Default/OrganizationAction.php:248 +#: classes/Gems/Default/OrganizationAction.php:192 msgid "Participating organizations" msgstr "Deelnemende organisaties" -#: classes/Gems/Default/OrganizationAction.php:258 +#: classes/Gems/Default/OrganizationAction.php:202 msgid "Show organization" msgstr "Toon organisatie" @@ -3442,6 +3442,10 @@ msgstr[0] "Het wachtwoord moet minstens een getal bevatten." msgstr[1] "Het wachtwoord moet minstens %d getallen bevatten." +#: classes/Gems/User/User.php:765 +msgid "Cookies must be enabled for this site." +msgstr "Zonder cookies heeft u geen toegang tot deze site." + #: classes/Gems/User/UserPasswordValidator.php:115 msgid "Wrong password." msgstr "Verkeerd wachtwoord." @@ -3784,7 +3788,6 @@ msgstr "Kenmerk %s voor vragenlijsten %s is verwijderd." #: snippets/DeleteTrackTokenSnippet.php:277 -#: snippets/EditTrackTokenSnippet.php:174 #, php-format msgid "%d token changed by recalculation." msgid_plural "%d tokens changed by recalculation." @@ -3809,10 +3812,12 @@ msgstr "Berekening traject opnieuw" #: snippets/RespondentDetailsSnippet.php:59 +#: snippets/RespondentDetailsWithAssignmentsSnippet.php:74 msgid "Respondent information" msgstr "Patiënt informatie" #: snippets/RespondentDetailsSnippet.php:71 +#: snippets/RespondentDetailsWithAssignmentsSnippet.php:97 msgid "Respondent nr: " msgstr "Patiënt nr:" @@ -3900,6 +3905,10 @@ msgid "This track can be assigned since %s." msgstr "Dit traject kan sinds %s aan een patiënt toegewezen worden." +#: snippets/Organization/ChooseOrganizationSnippet.php:86 +msgid "Choose an organization" +msgstr "Kies een organisatie" + #: snippets/Organization/ChooseOrganizationSnippet.php:93 msgid "This organization cannot have any respondents, please choose one that does:" msgstr "Deze organisatie heeft geen patiënten. Kies een organisatie met patiënten." @@ -3908,8 +3917,8 @@ msgid "This organization cannot have any respondents." msgstr "Deze organisatie heeft geen patiënten." -#~ msgid "Allow new responde... [truncated message content] |