diff options
-rw-r--r-- | _test/cases/inc/auth_password.test.php | 14 | ||||
-rw-r--r-- | inc/PassHash.class.php | 16 | ||||
-rw-r--r-- | lib/plugins/config/lang/fr/lang.php | 2 | ||||
-rw-r--r-- | lib/plugins/popularity/lang/fr/lang.php | 7 | ||||
-rw-r--r-- | lib/plugins/popularity/lang/fr/submitted.txt | 2 |
5 files changed, 31 insertions, 10 deletions
diff --git a/_test/cases/inc/auth_password.test.php b/_test/cases/inc/auth_password.test.php index d19b2a0e7..8646e3226 100644 --- a/_test/cases/inc/auth_password.test.php +++ b/_test/cases/inc/auth_password.test.php @@ -18,8 +18,8 @@ class auth_password_test extends UnitTestCase { 'kmd5' => 'a579299436d7969791189acadd86fcb716', 'pmd5' => '$P$abcdefgh1RC6Fd32heUzl7EYCG9uGw.', 'hmd5' => '$H$abcdefgh1ZbJodHxmeXVAhEzTG7IAp.', - 'djangomd5' => '$md5$abcde$d0fdddeda8cd92725d2b54148ac09158', - 'djangosha1' => '$sha1$abcde$c8e65a7f0acc9158843048a53dcc5a6bc4d17678', + 'djangomd5' => 'md5$abcde$d0fdddeda8cd92725d2b54148ac09158', + 'djangosha1' => 'sha1$abcde$c8e65a7f0acc9158843048a53dcc5a6bc4d17678', ); @@ -39,6 +39,16 @@ class auth_password_test extends UnitTestCase { } } + function test_verifySelf(){ + foreach($this->passes as $method => $hash){ + $info = "testing method $method"; + $this->signal('failinfo',$info); + + $hash = auth_cryptPassword('foo'.$method); + $this->assertTrue(auth_verifyPassword('foo'.$method,$hash)); + } + } + function test_verifyPassword_nohash(){ $this->assertTrue(auth_verifyPassword('foo','$1$$n1rTiFE0nRifwV/43bVon/')); } diff --git a/inc/PassHash.class.php b/inc/PassHash.class.php index dce1a5ace..cb46c5928 100644 --- a/inc/PassHash.class.php +++ b/inc/PassHash.class.php @@ -41,10 +41,10 @@ class PassHash { $method = 'pmd5'; $salt = $m[1]; $magic = 'H'; - }elseif(preg_match('/^\$sha1\$(.{5})\$/',$hash,$m)){ + }elseif(preg_match('/^sha1\$(.{5})\$/',$hash,$m)){ $method = 'djangosha1'; $salt = $m[1]; - }elseif(preg_match('/^\$md5\$(.{5})\$/',$hash,$m)){ + }elseif(preg_match('/^md5\$(.{5})\$/',$hash,$m)){ $method = 'djangomd5'; $salt = $m[1]; }elseif(substr($hash,0,6) == '{SSHA}'){ @@ -77,11 +77,13 @@ class PassHash { /** * Create a random salt * - * @todo use full range of characters instead of hex values only * @param int $len - The length of the salt */ public function gen_salt($len=32){ - return substr(md5(uniqid(rand(), true)),0,$len); + $salt = ''; + $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'; + for($i=0;$i<$len,$i++;) $salt .= $chars[mt_rand(0,61)]; + return $salt; } /** @@ -348,13 +350,14 @@ class PassHash { * Uses salted SHA1 hashs. Salt is 5 bytes long. * This is used by the Django Python framework * + * @link http://docs.djangoproject.com/en/dev/topics/auth/#passwords * @param string $clear - the clear text to hash * @param string $salt - the salt to use, null for random * @returns string - hashed password */ public function hash_djangosha1($clear, $salt=null){ $this->init_salt($salt,5); - return '$sha1$'.$salt.'$'.sha1($salt.$clear); + return 'sha1$'.$salt.'$'.sha1($salt.$clear); } /** @@ -363,13 +366,14 @@ class PassHash { * Uses salted MD5 hashs. Salt is 5 bytes long. * This is used by the Django Python framework * + * @link http://docs.djangoproject.com/en/dev/topics/auth/#passwords * @param string $clear - the clear text to hash * @param string $salt - the salt to use, null for random * @returns string - hashed password */ public function hash_djangomd5($clear, $salt=null){ $this->init_salt($salt,5); - return '$md5$'.$salt.'$'.md5($salt.$clear); + return 'md5$'.$salt.'$'.md5($salt.$clear); } } diff --git a/lib/plugins/config/lang/fr/lang.php b/lib/plugins/config/lang/fr/lang.php index b51c260fc..7f3e39845 100644 --- a/lib/plugins/config/lang/fr/lang.php +++ b/lib/plugins/config/lang/fr/lang.php @@ -161,7 +161,7 @@ $lang['userewrite_o_2'] = 'Interne à DokuWiki'; $lang['deaccent_o_0'] = 'off'; $lang['deaccent_o_1'] = 'supprimer les accents'; $lang['deaccent_o_2'] = 'convertir en roman'; -$lang['gdlib_o_0'] = 'GD Lib non disponible'; +$lang['gdlib_o_0'] = 'Librairie GD non disponible'; $lang['gdlib_o_1'] = 'version 1.x'; $lang['gdlib_o_2'] = 'auto-détectée'; $lang['rss_type_o_rss'] = 'RSS 0.91'; diff --git a/lib/plugins/popularity/lang/fr/lang.php b/lib/plugins/popularity/lang/fr/lang.php index 5ddd074a7..1157d1fa6 100644 --- a/lib/plugins/popularity/lang/fr/lang.php +++ b/lib/plugins/popularity/lang/fr/lang.php @@ -13,5 +13,10 @@ * @author Florian Gaub <floriang@floriang.net> * @author Samuel Dorsaz samuel.dorsaz@novelion.net */ -$lang['name'] = 'Enquête de popularité (peut nécessiter un certain temps pour être chargé)'; +$lang['name'] = 'Enquête de popularité (peut nécessiter un certain temps pour être chargée)'; $lang['submit'] = 'Envoyer les données'; +$lang['autosubmit'] = 'Envoyer les données automatiquement chaque mois'; +$lang['submissionFailed'] = 'Les données ne peuvent pas être envoyées à cause des erreurs suivantes :'; +$lang['submitDirectly'] = 'Vous pouvez envoyer le données manuellement en soumettant ce formulaire.'; +$lang['autosubmitError'] = 'La dernière soumission automatique a échoué pour les raisons suivantes :'; +$lang['lastSent'] = 'Les données ont été envoyées'; diff --git a/lib/plugins/popularity/lang/fr/submitted.txt b/lib/plugins/popularity/lang/fr/submitted.txt new file mode 100644 index 000000000..0bc4cfe71 --- /dev/null +++ b/lib/plugins/popularity/lang/fr/submitted.txt @@ -0,0 +1,2 @@ +====== Enquête de popularité ====== +Les données ont été envoyées avec succès.
\ No newline at end of file |