[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6901] API: fixes
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6901] API: fixes |
Date: |
Tue, 01 Feb 2011 12:58:33 +0000 |
Revision: 6901
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6901
Author: sigurdne
Date: 2011-02-01 12:58:33 +0000 (Tue, 01 Feb 2011)
Log Message:
-----------
API: fixes
Modified Paths:
--------------
trunk/phpgwapi/inc/class.account.inc.php
trunk/phpgwapi/setup/phpgw_no.lang
trunk/preferences/setup/phpgw_no.lang
Modified: trunk/phpgwapi/inc/class.account.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.account.inc.php 2011-02-01 12:21:56 UTC (rev
6900)
+++ trunk/phpgwapi/inc/class.account.inc.php 2011-02-01 12:58:33 UTC (rev
6901)
@@ -710,25 +710,38 @@
}
else
{
+ $error = array();
switch (
$GLOBALS['phpgw_info']['server']['password_level'] )
{
default:
case 'NONALPHA':
-
self::_validate_password_level_nonalpha($passwd);
+ $error[] =
self::_validate_password_level_nonalpha($passwd);
// fall through
case '1NUM':
-
self::_validate_password_level_1num($passwd);
+ $error[] =
self::_validate_password_level_1num($passwd);
// fall through
case '2LOW':
-
self::_validate_password_level_2low($passwd);
+ $error[] =
self::_validate_password_level_2low($passwd);
// fall through
case '2UPPER':
-
self::_validate_password_level_2upper($passwd);
+ $error[] =
self::_validate_password_level_2upper($passwd);
// fall through
case '8CHAR':
-
self::_validate_password_level_8char($passwd);
+ $error[] =
self::_validate_password_level_8char($passwd);
}
}
+ if($error)
+ {
+ $msq = array();
+ foreach($error as $_msq)
+ {
+ if($_msq)
+ {
+ $msq[] = $_msq;
+ }
+ }
+ throw new
Exception(implode('<br/>',array_reverse($msq)));
+ }
}
/**
@@ -740,11 +753,14 @@
*/
protected static function
_validate_password_level_8char($passwd)
{
+ $error = '';
$len = strlen($passwd);
if ( $len < 8 )
{
- throw new Exception(lang('Password must be at
least 8 characters long, not %1', $len));
+ $error = lang('Password must be at least 8
characters long, not %1', $len);
+ //throw new Exception(lang('Password must be at
least 8 characters long, not %1', $len));
}
+ return $error;
}
/**
@@ -756,11 +772,14 @@
*/
protected static function
_validate_password_level_2upper($passwd)
{
+ $error = '';
$m = array();
if ( preg_match_all('/[A-Z]/', $passwd, $m) < 2 )
{
- throw new Exception(lang('Password must contain
at least 2 upper case characters'));
+ $error = lang('Password must contain at least 2
upper case characters');
+ //throw new Exception(lang('Password must
contain at least 2 upper case characters'));
}
+ return $error;
}
/**
* Check that a password contain at least 2 lower case
characters
@@ -771,11 +790,14 @@
*/
protected static function _validate_password_level_2low($passwd)
{
+ $error = '';
$m = array();
if ( preg_match_all('/[a-z]/', $passwd, $m) < 2 )
{
- throw new Exception(lang('Password must contain
at least 2 lower case characters'));
+ $error = lang('Password must contain at least 2
lower case characters');
+ //throw new Exception(lang('Password must
contain at least 2 lower case characters'));
}
+ return $error;
}
/**
* Check that a password contain at least 1 number
@@ -786,11 +808,14 @@
*/
protected static function _validate_password_level_1num($passwd)
{
+ $error = '';
$m = array();
if ( !preg_match_all('/[0-9]/', $passwd, $m) )
{
- throw new Exception(lang('Password must contain
at least 1 number'));
+ $error = lang('Password must contain at least 1
number');
+ //throw new Exception(lang('Password must
contain at least 1 number'));
}
+ return $error;
}
/**
* Check that a password contain at least 1 non alphanumeric
character
@@ -801,11 +826,14 @@
*/
protected static function
_validate_password_level_nonalpha($passwd)
{
+ $error = '';
$m = array();
if ( !preg_match_all('/\W/', $passwd, $m) )
{
- throw new Exception(lang('Password must contain
at least 1 non alphanumeric character'));
+ $error = lang('Password must contain at least 1
non alphanumeric character');
+ //throw new Exception(lang('Password must
contain at least 1 non alphanumeric character'));
}
+ return $error;
}
/**
Modified: trunk/phpgwapi/setup/phpgw_no.lang
===================================================================
--- trunk/phpgwapi/setup/phpgw_no.lang 2011-02-01 12:21:56 UTC (rev 6900)
+++ trunk/phpgwapi/setup/phpgw_no.lang 2011-02-01 12:58:33 UTC (rev 6901)
@@ -129,3 +129,8 @@
version common no versjon
you have been successfully logged out login no Du har nå logget ut
Info: you have changed domain from "%1" to "%2" login no
Informasjon: Du har endret domene fra "%1" til "%2"
+Password must be at least 8 characters long, not %1 common no Passord
må være minst på 8 tegn, du forsøker med %1
+Password must contain at least 2 upper case characters common no Passord
må inneholde minst 2 store bosktaver
+Password must contain at least 2 lower case characters common no Passord
må inneholde minst 2 små bosktaver
+Password must contain at least 1 number common no Passord må
inneholde minst 1 tall
+Password must contain at least 1 non alphanumeric character common no
Passord må inneholde minst 1 spesialtegn
Modified: trunk/preferences/setup/phpgw_no.lang
===================================================================
--- trunk/preferences/setup/phpgw_no.lang 2011-02-01 12:21:56 UTC (rev
6900)
+++ trunk/preferences/setup/phpgw_no.lang 2011-02-01 12:58:33 UTC (rev
6901)
@@ -5,7 +5,7 @@
enter your new password preferences no Skriv inn ditt nye
passord
language preferences no Språk
max matchs per page preferences no Max matches per side
-note: this feature does *not* change your email password. this will need to be
done manually. preferences no Noter: Denne funksonen endrer *ikke*
ditt epost passord. Dette må gjøres manuellt.
+note: this feature does *not* change your email password. this will need to be
done manually. preferences no Noter: Denne funksjonen endrer *ikke*
ditt epost passord. Dette må gjøres manuellt.
please, select a new theme preferences no Vennligst velg et nytt
tema
re-enter your password preferences no Skriv inn ditt passord igjen
select different theme preferences no Velg annet tema
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6901] API: fixes,
Sigurd Nes <=