From 3a97088971109f1611a03329d12e5296a8c3c515 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 3 May 2015 11:25:06 +0100 Subject: make it possible to remove entries from DOKU_PREFS cookie --- inc/common.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/common.php b/inc/common.php index 5a8b5c900..e14bd7af4 100644 --- a/inc/common.php +++ b/inc/common.php @@ -1875,6 +1875,7 @@ function get_doku_pref($pref, $default) { /** * Add a preference to the DokuWiki cookie * (remembering $_COOKIE['DOKU_PREFS'] is urlencoded) + * Remove it by setting $val to false * * @param string $pref preference key * @param string $val preference value @@ -1891,12 +1892,17 @@ function set_doku_pref($pref, $val) { $enc_pref = rawurlencode($pref); for($i = 0; $i < $cnt; $i += 2) { if($parts[$i] == $enc_pref) { - $parts[$i + 1] = rawurlencode($val); + if ($val !== false) { + $parts[$i + 1] = rawurlencode($val); + } else { + unset($parts[$i]); + unset($parts[$i + 1]); + } break; } } $cookieVal = implode('#', $parts); - } else if (!$orig) { + } else if (!$orig && $val !== false) { $cookieVal = ($_COOKIE['DOKU_PREFS'] ? $_COOKIE['DOKU_PREFS'].'#' : '').rawurlencode($pref).'#'.rawurlencode($val); } -- cgit v1.2.3 From c93edcafa17e4189ce3be461b6374a62664d2d51 Mon Sep 17 00:00:00 2001 From: Johan Wijnker Date: Tue, 5 May 2015 16:31:25 +0200 Subject: translation update --- inc/lang/nl/lang.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'inc') diff --git a/inc/lang/nl/lang.php b/inc/lang/nl/lang.php index f0a235d67..e7d82af19 100644 --- a/inc/lang/nl/lang.php +++ b/inc/lang/nl/lang.php @@ -25,6 +25,7 @@ * @author Rene * @author Johan Vervloet * @author Mijndert + * @author Johan Wijnker */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; @@ -353,3 +354,5 @@ $lang['currentns'] = 'Huidige namespace'; $lang['searchresult'] = 'Zoekresultaat'; $lang['plainhtml'] = 'Alleen HTML'; $lang['wikimarkup'] = 'Wiki Opmaak'; +$lang['page_nonexist_rev'] = 'Pagina bestaat niet bij %s. Het is vervolgens aangemaakt bij %s.'; +$lang['unable_to_parse_date'] = 'Begrijp het niet bij parameter "% s".'; -- cgit v1.2.3 From db9faf025cf129d15a086a803e8056e977975d76 Mon Sep 17 00:00:00 2001 From: Patrick Brown Date: Wed, 6 May 2015 01:30:59 -0400 Subject: Report more meaningful errors when an auth backend fails. closes #1093 --- inc/auth.php | 25 +++++++++++++------------ inc/lang/en/lang.php | 2 ++ 2 files changed, 15 insertions(+), 12 deletions(-) (limited to 'inc') diff --git a/inc/auth.php b/inc/auth.php index 17923ba2a..dd0fc35b3 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -1006,7 +1006,7 @@ function register() { //okay try to create the user if(!$auth->triggerUserMod('create', array($login, $pass, $fullname, $email))) { - msg($lang['reguexists'], -1); + msg($lang['regfail'], -1); return false; } @@ -1098,17 +1098,18 @@ function updateprofile() { } } - if($result = $auth->triggerUserMod('modify', array($INPUT->server->str('REMOTE_USER'), &$changes))) { - // update cookie and session with the changed data - if($changes['pass']) { - list( /*user*/, $sticky, /*pass*/) = auth_getCookie(); - $pass = auth_encrypt($changes['pass'], auth_cookiesalt(!$sticky, true)); - auth_setCookie($INPUT->server->str('REMOTE_USER'), $pass, (bool) $sticky); - } - return true; + if(!($result = $auth->triggerUserMod('modify', array($INPUT->server->str('REMOTE_USER'), &$changes)))) { + msg($lang['proffail'], -1); + return false; } - return false; + // update cookie and session with the changed data + if($changes['pass']) { + list( /*user*/, $sticky, /*pass*/) = auth_getCookie(); + $pass = auth_encrypt($changes['pass'], auth_cookiesalt(!$sticky, true)); + auth_setCookie($INPUT->server->str('REMOTE_USER'), $pass, (bool) $sticky); + } + return true; } /** @@ -1221,7 +1222,7 @@ function act_resendpwd() { // change it if(!$auth->triggerUserMod('modify', array($user, array('pass' => $pass)))) { - msg('error modifying user data', -1); + msg($lang['proffail'], -1); return false; } @@ -1229,7 +1230,7 @@ function act_resendpwd() { $pass = auth_pwgen($user); if(!$auth->triggerUserMod('modify', array($user, array('pass' => $pass)))) { - msg('error modifying user data', -1); + msg($lang['proffail'], -1); return false; } diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php index 3f11a1ee4..2bbf61000 100644 --- a/inc/lang/en/lang.php +++ b/inc/lang/en/lang.php @@ -75,6 +75,7 @@ $lang['regmissing'] = 'Sorry, you must fill in all fields.'; $lang['reguexists'] = 'Sorry, a user with this login already exists.'; $lang['regsuccess'] = 'The user has been created and the password was sent by email.'; $lang['regsuccess2'] = 'The user has been created.'; +$lang['regfail'] = 'The user could not be created.'; $lang['regmailfail'] = 'Looks like there was an error on sending the password mail. Please contact the admin!'; $lang['regbadmail'] = 'The given email address looks invalid - if you think this is an error, contact the admin'; $lang['regbadpass'] = 'The two given passwords are not identical, please try again.'; @@ -90,6 +91,7 @@ $lang['profdeleteuser'] = 'Delete Account'; $lang['profdeleted'] = 'Your user account has been deleted from this wiki'; $lang['profconfdelete'] = 'I wish to remove my account from this wiki.
This action can not be undone.'; $lang['profconfdeletemissing'] = 'Confirmation check box not ticked'; +$lang['proffail'] = 'User profile was not updated.'; $lang['pwdforget'] = 'Forgotten your password? Get a new one'; $lang['resendna'] = 'This wiki does not support password resending.'; -- cgit v1.2.3 From 99a5b03f106be4dd58ea09dd0613e4a496f9c06a Mon Sep 17 00:00:00 2001 From: TLed Date: Wed, 6 May 2015 22:53:43 +0200 Subject: 2y is also used for bcryt --- inc/PassHash.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/PassHash.class.php b/inc/PassHash.class.php index 15f896dcf..0701c4116 100644 --- a/inc/PassHash.class.php +++ b/inc/PassHash.class.php @@ -50,7 +50,7 @@ class PassHash { } elseif(preg_match('/^md5\$(.{5})\$/', $hash, $m)) { $method = 'djangomd5'; $salt = $m[1]; - } elseif(preg_match('/^\$2a\$(.{2})\$/', $hash, $m)) { + } elseif(preg_match('/^\$2(a|y)\$(.{2})\$/', $hash, $m)) { $method = 'bcrypt'; $salt = $hash; } elseif(substr($hash, 0, 6) == '{SSHA}') { -- cgit v1.2.3 From e6c4392f11bb5a668be8e874560af910b71d72f8 Mon Sep 17 00:00:00 2001 From: Patrick Brown Date: Thu, 7 May 2015 01:43:32 -0400 Subject: Fix scrutinizer issues with auth --- inc/auth.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'inc') diff --git a/inc/auth.php b/inc/auth.php index dd0fc35b3..60b8c7c78 100644 --- a/inc/auth.php +++ b/inc/auth.php @@ -1098,7 +1098,7 @@ function updateprofile() { } } - if(!($result = $auth->triggerUserMod('modify', array($INPUT->server->str('REMOTE_USER'), &$changes)))) { + if(!$auth->triggerUserMod('modify', array($INPUT->server->str('REMOTE_USER'), &$changes))) { msg($lang['proffail'], -1); return false; } -- cgit v1.2.3 From c9a3a44ccbcf2ff1ed427df5f6911a1028989e43 Mon Sep 17 00:00:00 2001 From: Danny Buckhof Date: Thu, 7 May 2015 14:45:55 +0200 Subject: translation update --- inc/lang/no/lang.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'inc') diff --git a/inc/lang/no/lang.php b/inc/lang/no/lang.php index 2aa8cdcda..fddbf1419 100644 --- a/inc/lang/no/lang.php +++ b/inc/lang/no/lang.php @@ -22,6 +22,7 @@ * @author Boris * @author Christopher Schive * @author Patrick + * @author Danny Buckhof */ $lang['encoding'] = 'utf-8'; $lang['direction'] = 'ltr'; @@ -87,6 +88,7 @@ $lang['regmissing'] = 'Vennligst fyll ut alle felt.'; $lang['reguexists'] = 'Det finnes allerede en konto med dette brukernavnet.'; $lang['regsuccess'] = 'Brukerkonto har blitt laget og passord har blitt sendt via e-post.'; $lang['regsuccess2'] = 'Brukeren har blitt laget.'; +$lang['regfail'] = 'Brukeren kan ikke opprettes'; $lang['regmailfail'] = 'En feil oppstod da passordet ditt skulle sendes via e-post. Vennligst kontakt administratoren!'; $lang['regbadmail'] = 'Den angitte e-post adressen ser ut til å være ugyldig. Vennligst kontakt administratoren om du anser dette som feilaktig.'; $lang['regbadpass'] = 'De to angitte passordene er ikke like, vennligst forsøk igjen.'; @@ -101,6 +103,7 @@ $lang['profdeleteuser'] = 'Slett konto'; $lang['profdeleted'] = 'Din brukerkonto har blitt slettet fra denne wikien'; $lang['profconfdelete'] = 'Jeg ønsker å fjerne min konto fra denne wikien.
Denne handlingen kan ikke omgjøres.'; $lang['profconfdeletemissing'] = 'Boks for bekreftelse ikke avkrysset'; +$lang['proffail'] = 'Brukerprofilen ble ikke oppdatert'; $lang['pwdforget'] = 'Glemt passordet ditt? Få deg et nytt'; $lang['resendna'] = 'Denne wikien støtter ikke nyutsending av passord.'; $lang['resendpwd'] = 'Sett nytt passord for'; @@ -298,6 +301,7 @@ $lang['i_modified'] = 'For sikkerhets skyld vil dette skriptet bare v Dokuwiki-installasjonsinstruksen'; $lang['i_funcna'] = 'PHP-funksjonen %s er ikke tilgjengelig. Kanskje din leverandør har deaktivert den av noen grunn?'; $lang['i_phpver'] = 'Din PHP versjon %s er lavere enn kravet %s. Du må oppgradere PHP installasjonen. '; +$lang['i_mbfuncoverload'] = 'mbstring.func_overload må deaktiveres i php.ini for å kjøre DokuWiki.'; $lang['i_permfail'] = '%s er ikke skrivbar for DokuWiki. Du må fikse rettighetene for denne mappen!'; $lang['i_confexists'] = '%s eksisterer allerede'; $lang['i_writeerr'] = 'Kunne ikke opprette %s. Du må sjekke mappe-/filrettigheter og opprette filen manuelt.'; @@ -354,3 +358,4 @@ $lang['searchresult'] = 'Søk i resultat'; $lang['plainhtml'] = 'Enkel HTML'; $lang['wikimarkup'] = 'wiki-format'; $lang['page_nonexist_rev'] = 'Finnes ingen side på %s. Den er derfor laget på %s'; +$lang['unable_to_parse_date'] = 'Ikke mulig å tolke "%s".'; -- cgit v1.2.3