summaryrefslogtreecommitdiff
path: root/lib/plugins/usermanager/admin.php
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2006-02-03 16:03:02 +0100
committerAndreas Gohr <andi@splitbrain.org>2006-02-03 16:03:02 +0100
commit82fd59b6cf8cda9b2c419fb08bbc40a571b36fe8 (patch)
treecddf8d28de73822bb0932f005f4056d925cc7025 /lib/plugins/usermanager/admin.php
parentce070a9f83cfdd14001e835635ff4e1a3f43f41c (diff)
downloadrpg-82fd59b6cf8cda9b2c419fb08bbc40a571b36fe8.tar.gz
rpg-82fd59b6cf8cda9b2c419fb08bbc40a571b36fe8.tar.bz2
new way of auth module capability checking
This changes the way of how the capabilities of the used auth module are checked as suggested as first option in http://www.freelists.org/archives/dokuwiki/01-2006/msg00267.html The MySQL backend WAS NOT TESTED and probably needs some work. darcs-hash:20060203150302-7ad00-c524cafe20499f32e76ad42b4e68d7c635f6a9e9.gz
Diffstat (limited to 'lib/plugins/usermanager/admin.php')
-rw-r--r--lib/plugins/usermanager/admin.php36
1 files changed, 20 insertions, 16 deletions
diff --git a/lib/plugins/usermanager/admin.php b/lib/plugins/usermanager/admin.php
index d96fbfb6d..8ba4472ac 100644
--- a/lib/plugins/usermanager/admin.php
+++ b/lib/plugins/usermanager/admin.php
@@ -40,7 +40,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
if (!isset($auth)) {
$this->disabled = $this->lang['noauth'];
- } else if (!$auth->canDo('retrieveUsers')) {
+ } else if (!$auth->canDo('getUsers')) {
$this->disabled = $this->lang['notsupported'];
} else {
@@ -103,8 +103,8 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
}
if ($cmd != "search") {
- if (!empty($_REQUEST['start']))
- $this->_start = $_REQUEST['start'];
+ if (!empty($_REQUEST['start']))
+ $this->_start = $_REQUEST['start'];
$this->_filter = $this->_retrieveFilter();
}
@@ -145,15 +145,15 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$users = array_keys($user_list);
$page_buttons = $this->_pagination();
- $delete_disable = $this->_auth->canDo('deleteUsers') ? '' : 'disabled="disabled"';
+ $delete_disable = $this->_auth->canDo('delUser') ? '' : 'disabled="disabled"';
- if ($this->_auth->canDo('modifyUser')) {
- $edit_disable = '';
- $img_useredit = 'user_edit.png';
- } else {
- $edit_disable = 'disabled="disabled"';
- $img_useredit = 'no_user_edit.png';
- }
+ if ($this->_auth->canDo('UserMod')) {
+ $edit_disable = '';
+ $img_useredit = 'user_edit.png';
+ } else {
+ $edit_disable = 'disabled="disabled"';
+ $img_useredit = 'no_user_edit.png';
+ }
print $this->locale_xhtml('intro');
print $this->locale_xhtml('list');
@@ -220,7 +220,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
$style = $this->_edit_user ? " style=\"width: 46%; float: left;\"" : "";
- if ($this->_auth->canDo('createUser')) {
+ if ($this->_auth->canDo('addUser')) {
ptln("<div".$style.">");
print $this->locale_xhtml('add');
ptln(" <div class=\"level2\">");
@@ -231,7 +231,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
ptln("</div>");
}
- if($this->_edit_user && $this->_auth->canDo('modifyUser')){
+ if($this->_edit_user && $this->_auth->canDo('UserMod')){
ptln("<div".$style." id=\"scroll__here\">");
print $this->locale_xhtml('edit');
ptln(" <div class=\"level2\">");
@@ -243,6 +243,10 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
}
}
+
+ /**
+ * @todo disable fields which the backend can't change
+ */
function _htmlUserForm($cmd,$user=null,$indent=0) {
if ($user) {
@@ -300,7 +304,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
function _addUser(){
- if (!$this->_auth->canDo('createUser')) return false;
+ if (!$this->_auth->canDo('addUser')) return false;
list($user,$pass,$name,$mail,$grps) = $this->_retrieveUser();
if (empty($user)) return false;
@@ -313,7 +317,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
*/
function _deleteUser(){
- if (!$this->_auth->canDo('deleteUsers')) return false;
+ if (!$this->_auth->canDo('delUser')) return false;
$selected = $_REQUEST['delete'];
if (!is_array($selected) || empty($selected)) return false;
@@ -334,7 +338,7 @@ class admin_plugin_usermanager extends DokuWiki_Admin_Plugin {
* Modify user
*/
function _modifyUser(){
- if (!$this->_auth->canDo('modifyUser')) return false;
+ if (!$this->_auth->canDo('UserMod')) return false;
list($user,$pass,$name,$mail,$grps) = $this->_retrieveUser();
if (empty($user)) return false;