summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/auth.php58
-rw-r--r--inc/auth/basic.class.php4
-rw-r--r--inc/lang/de/lang.php2
-rw-r--r--inc/lang/en/lang.php2
4 files changed, 38 insertions, 28 deletions
diff --git a/inc/auth.php b/inc/auth.php
index 76ce525cf..26d208a1f 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -23,51 +23,55 @@
$auth_class = "auth_".$conf['authtype'];
if (!class_exists($auth_class)) $auth_class = "auth_basic";
$auth = new $auth_class();
+ if ($auth->success == false) {
+ msg($lang['authmodfailed'],-1);
+ unset($auth);
+ }
// interface between current dokuwiki/old auth system and new style auth object
function auth_canDo($fn) {
- global $auth;
- return method_exists($auth, $fn);
- }
+ global $auth;
+ return method_exists($auth, $fn);
+ }
- // mandatory functions - these should exist
+ // mandatory functions - these should exist
function auth_checkPass($user,$pass) {
- global $auth;
- return method_exists($auth,'checkPass') ? $auth->checkPass($user, $pass) : false;
- }
+ global $auth;
+ return method_exists($auth,'checkPass') ? $auth->checkPass($user, $pass) : false;
+ }
- function auth_getUserData($user) {
- global $auth;
- return method_exists($auth, 'getUserData') ? $auth->getUserData($user) : false;
- }
+ function auth_getUserData($user) {
+ global $auth;
+ return method_exists($auth, 'getUserData') ? $auth->getUserData($user) : false;
+ }
- // optional functions, behave gracefully if these don't exist;
- // potential calling code should query whether these exist in advance
+ // optional functions, behave gracefully if these don't exist;
+ // potential calling code should query whether these exist in advance
function auth_createUser($user,$pass,$name,$mail) {
- global $auth;
- return method_exists($auth, 'createUser') ? $auth->createUser($user,$pass,$name,$mail) : null;
- }
+ global $auth;
+ return method_exists($auth, 'createUser') ? $auth->createUser($user,$pass,$name,$mail) : null;
+ }
- function auth_modifyUser($user, $changes) {
- global $auth;
- return method_exists($auth, 'modifyUser') ? $auth->modifyUser($user,$changes) : false;
- }
+ function auth_modifyUser($user, $changes) {
+ global $auth;
+ return method_exists($auth, 'modifyUser') ? $auth->modifyUser($user,$changes) : false;
+ }
function auth_deleteUsers($users) {
- global $auth;
- return method_exists($auth, 'deleteUsers') ? $auth->deleteUsers($users) : 0;
- }
+ global $auth;
+ return method_exists($auth, 'deleteUsers') ? $auth->deleteUsers($users) : 0;
+ }
- // other functions, will only be accessed by new code
- //- these must query auth_canDo() or test method existence themselves.
+ // other functions, will only be accessed by new code
+ //- these must query auth_canDo() or test method existence themselves.
} else {
// old style auth functions
require_once(DOKU_INC.'inc/auth/'.$conf['authtype'].'.php');
$auth = null;
- // new function, allows other parts of dokuwiki to know what they can and can't do
- function auth_canDo($fn) { return function_exists("auth_$fn"); }
+ // new function, allows other parts of dokuwiki to know what they can and can't do
+ function auth_canDo($fn) { return function_exists("auth_$fn"); }
}
if (!defined('DOKU_COOKIE')) define('DOKU_COOKIE', 'DW'.md5($conf['title']));
diff --git a/inc/auth/basic.class.php b/inc/auth/basic.class.php
index cf19e2c79..8905f283d 100644
--- a/inc/auth/basic.class.php
+++ b/inc/auth/basic.class.php
@@ -10,6 +10,8 @@
class auth_basic {
+ var $success = TRUE;
+
/**
* Check user+password [ MUST BE OVERRIDDEN ]
*
@@ -156,4 +158,4 @@ class auth_basic {
# msg("authorisation method does not support alteration of group memberships", -1);
# return false;
# }
-} \ No newline at end of file
+}
diff --git a/inc/lang/de/lang.php b/inc/lang/de/lang.php
index 717200396..1f6818c29 100644
--- a/inc/lang/de/lang.php
+++ b/inc/lang/de/lang.php
@@ -171,4 +171,6 @@ $lang['subscribe_noaddress']= 'Weil Deine E-Mail-Adresse fehlt, kannst Du leider
$lang['unsubscribe_success']= 'Das Abonnement von %s für die Seite %s wurde aufgelöst';
$lang['unsubscribe_error'] = 'Das Abonnement von %s für die Seite %s konnte nicht aufgelöst werden';
+$lang['authmodfailed'] = 'Benutzerüberprüfung nicht möglich. Bitte wenden Sie sich an den Systembetreuer.';
+
//Setup VIM: ex: et ts=2 enc=utf-8 :
diff --git a/inc/lang/en/lang.php b/inc/lang/en/lang.php
index e615b4afd..a0cd67029 100644
--- a/inc/lang/en/lang.php
+++ b/inc/lang/en/lang.php
@@ -190,4 +190,6 @@ $lang['subscribe_noaddress']= 'There is no address associated with your login, y
$lang['unsubscribe_success']= 'Removed %s from subscription list for %s';
$lang['unsubscribe_error'] = 'Error removing %s from subscription list for %s';
+$lang['authmodfailed'] = 'User authentification not possible. Please inform your system administrator.';
+
//Setup VIM: ex: et ts=2 enc=utf-8 :