|
From: <gem...@li...> - 2012-03-09 08:28:35
|
Revision: 540
http://gemstracker.svn.sourceforge.net/gemstracker/?rev=540&view=rev
Author: mennodekker
Date: 2012-03-09 08:28:26 +0000 (Fri, 09 Mar 2012)
Log Message:
-----------
Fixed incrementing login delay while still in delay period
Added configurable default consent
Modified Paths:
--------------
trunk/library/classes/Gems/Auth.php
trunk/library/classes/Gems/Default/RespondentAction.php
trunk/library/classes/Gems/Model.php
Modified: trunk/library/classes/Gems/Auth.php
===================================================================
--- trunk/library/classes/Gems/Auth.php 2012-03-08 16:20:56 UTC (rev 539)
+++ trunk/library/classes/Gems/Auth.php 2012-03-09 08:28:26 UTC (rev 540)
@@ -110,6 +110,7 @@
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 = ?";
@@ -159,10 +160,10 @@
$values['gula_last_failed'] = null;
} else {
if ($values['gula_failed_logins']) {
- // MUtil_Echo::track($result->getCode(), self::ERROR_PASSWORD_DELAY);
// Only increment when we have no password delay as the right password
- // will not be accepted when we are in the delay.
- if ($result->getCode() <> self::ERROR_PASSWORD_DELAY) {
+ // 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');
}
Modified: trunk/library/classes/Gems/Default/RespondentAction.php
===================================================================
--- trunk/library/classes/Gems/Default/RespondentAction.php 2012-03-08 16:20:56 UTC (rev 539)
+++ trunk/library/classes/Gems/Default/RespondentAction.php 2012-03-09 08:28:26 UTC (rev 540)
@@ -391,7 +391,9 @@
$data = $model->applyRequest($this->getRequest(), true)->loadFirst();
}
- if ($data['gr2o_consent'] == $model->get('gr2o_consent', 'default')) {
+ //Check if we have the 'Unknown' consent, and present a warning. The project default consent is
+ //normally 'Unknown' but this can be overruled in project.ini so checking for default is not right
+ if ($data['gr2o_consent'] == 'Unknown') {
$url = $this->view->url(array('controller' => 'respondent', 'action' => 'edit', 'id' => $data['gr2o_patient_nr'])) . '#tabContainer-frag-3';
$this->addMessage(MUtil_Html::create()->a($url, $this->_('Please settle the informed consent form for this respondent.')));
}
Modified: trunk/library/classes/Gems/Model.php
===================================================================
--- trunk/library/classes/Gems/Model.php 2012-03-08 16:20:56 UTC (rev 539)
+++ trunk/library/classes/Gems/Model.php 2012-03-09 08:28:26 UTC (rev 540)
@@ -204,7 +204,7 @@
$model->setIfExists('gr2o_patient_nr', 'label', $this->translate->_('Respondent nr'));
$model->setIfExists('gr2o_opened', 'label', $this->translate->_('Opened'), 'formatFunction', $translated->formatDateTime);
- $model->setIfExists('gr2o_consent', 'label', $this->translate->_('Consent'), 'multiOptions', MUtil_Lazy::call($this->util->getDbLookup()->getUserConsents));
+ $model->setIfExists('gr2o_consent', 'label', $this->translate->_('Consent'), 'multiOptions', MUtil_Lazy::call($this->util->getDbLookup()->getUserConsents), 'default', $this->util->getDefaultConsent());
$model->setIfExists('grs_email', 'label', $this->translate->_('E-Mail'));
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|