Skip to content

Commit

Permalink
fixed ticket #1483 - jauth listener: improved 'actif' check
Browse files Browse the repository at this point in the history
the check of the 'actif' field on the user can be know either '1', 'true', 'on', 'yes'
  • Loading branch information
laurentj committed Mar 18, 2013
1 parent f20ecac commit 28ed30f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/jelix-modules/jauth/classes/jauth.listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @subpackage jauth
* @author Laurent Jouanneau
* @contributor
* @copyright 2006 Laurent Jouanneau
* @copyright 2006-2013 Laurent Jouanneau
* @link http://www.jelix.org
* @licence GNU General Public Licence see LICENCE file or http://www.gnu.org/licenses/gpl.html
*/
Expand All @@ -18,13 +18,11 @@ function onAuthCanLogin ($event) {
$user = $event->getParam('user');
$ok = true;
if(isset($user->actif)){
$ok = ($user->actif == '1');
$ok = filter_var($user->actif, FILTER_VALIDATE_BOOLEAN);
}

$ok = $ok && ($user->password != '');

$event->Add(array('canlogin'=>$ok));

}
}
?>

0 comments on commit 28ed30f

Please sign in to comment.