diff --git a/lib/plugins/authpdo/auth.php b/lib/plugins/authpdo/auth.php index 23ce780d393771f534595798c80b52373b8ce1b9..45b2ca647d9bb3b3b0979e5acd0497bc0288a32b 100644 --- a/lib/plugins/authpdo/auth.php +++ b/lib/plugins/authpdo/auth.php @@ -48,6 +48,7 @@ class auth_plugin_authpdo extends DokuWiki_Auth_Plugin { ); } catch(PDOException $e) { $this->_debug($e); + msg($this->getLang('connectfail'), -1); $this->success = false; return; } @@ -253,6 +254,7 @@ class auth_plugin_authpdo extends DokuWiki_Auth_Plugin { FAIL: $this->pdo->rollBack(); $this->_debug('Transaction rolled back', 0, __LINE__); + msg($this->getLang('writefail'), -1); return null; // return error } @@ -342,6 +344,7 @@ class auth_plugin_authpdo extends DokuWiki_Auth_Plugin { FAIL: $this->pdo->rollBack(); $this->_debug('Transaction rolled back', 0, __LINE__); + msg($this->getLang('writefail'), -1); return false; // return error } diff --git a/lib/plugins/authpdo/conf/default.php b/lib/plugins/authpdo/conf/default.php index 50dfbd0c90778bf2284258cc5c561654220b3058..4e2503716f90f39d49cb59d8426a3a51312397ac 100644 --- a/lib/plugins/authpdo/conf/default.php +++ b/lib/plugins/authpdo/conf/default.php @@ -5,7 +5,6 @@ * @author Andreas Gohr <andi@splitbrain.org> */ - $conf['debug'] = 0; $conf['dsn'] = ''; $conf['user'] = ''; @@ -19,12 +18,20 @@ $conf['pass'] = ''; */ $conf['select-user'] = ''; +/** + * statement to select a single user identified by its login name + * + * input: :user, [uid] + * return: group + */ +$conf['select-user-groups'] = ''; + /** * Select all the existing group names * * return: group, [gid], [*] */ -$conf['select-group'] = ''; +$conf['select-groups'] = ''; /** * Create a new user @@ -58,8 +65,7 @@ $conf['list-users'] = ''; * input: :user, :name, :mail, :group * out: count */ -$conf['list-users'] = ''; - +$conf['count-users'] = ''; /** * Update user data (except password and user name) diff --git a/lib/plugins/authpdo/conf/metadata.php b/lib/plugins/authpdo/conf/metadata.php index e020d5c450c871b4e2cf192cca7b69c8e7061028..2fb4a86bf2c2d08bfbce06083fc0407d44feff23 100644 --- a/lib/plugins/authpdo/conf/metadata.php +++ b/lib/plugins/authpdo/conf/metadata.php @@ -5,6 +5,22 @@ * @author Andreas Gohr <andi@splitbrain.org> */ +$meta['debug'] = array('onoff', '_caution' => 'security'); +$meta['dsn'] = array('string', '_caution' => 'danger'); +$meta['user'] = array('string', '_caution' => 'danger'); +$meta['pass'] = array('password', '_caution' => 'danger'); +$meta['select-user'] = array('', '_caution' => 'danger'); +$meta['select-user-groups'] = array('', '_caution' => 'danger'); +$meta['select-groups'] = array('', '_caution' => 'danger'); +$meta['insert-user'] = array('', '_caution' => 'danger'); +$meta['delete-user'] = array('', '_caution' => 'danger'); +$meta['list-users'] = array('', '_caution' => 'danger'); +$meta['count-users'] = array('', '_caution' => 'danger'); +$meta['update-user-info'] = array('', '_caution' => 'danger'); +$meta['update-user-login'] = array('', '_caution' => 'danger'); +$meta['update-user-pass'] = array('', '_caution' => 'danger'); +$meta['insert-group'] = array('', '_caution' => 'danger'); +$meta['join-group'] = array('', '_caution' => 'danger'); +$meta['leave-group'] = array('', '_caution' => 'danger'); -//$meta['fixme'] = array('string'); diff --git a/lib/plugins/authpdo/lang/en/lang.php b/lib/plugins/authpdo/lang/en/lang.php index de9f8125289a6fe9ef83f92dc526af6c3d07d968..a0057519bdeaa561eb58c58d6e4a2e26844c9623 100644 --- a/lib/plugins/authpdo/lang/en/lang.php +++ b/lib/plugins/authpdo/lang/en/lang.php @@ -1,16 +1,13 @@ <?php /** * English language file for authpdo plugin + * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) * - * @author Andreas Gohr <andi@splitbrain.org> */ -// menu entry for admin plugins -// $lang['menu'] = 'Your menu entry'; - -// custom language strings for the plugin -// $lang['fixme'] = 'FIXME'; - - +$lang['connectfail'] = 'Failed to connect to database.'; +$lang['userexists'] = 'Sorry, a user with this login already exists.'; +$lang['usernotexists'] = 'Sorry, that user doesn\'t exist.'; +$lang['writefail'] = 'Unable to modify user data. Please inform the Wiki-Admin'; //Setup VIM: ex: et ts=4 : diff --git a/lib/plugins/authpdo/lang/en/settings.php b/lib/plugins/authpdo/lang/en/settings.php index 503511aceb668b53e09a2b92eaa3f337ae2eb1b4..9e700690c3a88489fa6b113a0c2ef81b80855cd9 100644 --- a/lib/plugins/authpdo/lang/en/settings.php +++ b/lib/plugins/authpdo/lang/en/settings.php @@ -5,9 +5,20 @@ * @author Andreas Gohr <andi@splitbrain.org> */ -// keys need to match the config setting name -// $lang['fixme'] = 'FIXME'; - - - -//Setup VIM: ex: et ts=4 : +$lang['debug'] = 'Print out detailed error messages. Should be disabled after setup.'; +$lang['dsn'] = 'The DSN to connect to the database.'; +$lang['user'] = 'The user for the above database connection (empty for sqlite)'; +$lang['pass'] = 'The password for the above database connection (empty for sqlite)'; +$lang['select-user'] = 'SQL Statement to select the data of a single user'; +$lang['select-user-groups'] = 'SQL Statement to select all groups of a single user'; +$lang['select-groups'] = 'SQL Statement to select all available groups'; +$lang['insert-user'] = 'SQL Statement to insert a new user into the database'; +$lang['delete-user'] = 'SQL Statement to remove a single user from the database'; +$lang['list-users'] = 'SQL Statement to list users matching a filter'; +$lang['count-users'] = 'SQL Statement to count users matching a filter'; +$lang['update-user-info'] = 'SQL Statement to update the full name and email address of a single user'; +$lang['update-user-login'] = 'SQL Statement to update the login name of a single user'; +$lang['update-user-pass'] = 'SQL Statement to update the password of a single user'; +$lang['insert-group'] = 'SQL Statement to insert a new group into the database'; +$lang['join-group'] = 'SQL Statement to add a user to an exisitng group'; +$lang['leave-group'] = 'SQL Statement to remove a user from a group';