mirror of
https://github.com/e107inc/e107.git
synced 2025-03-14 01:19:44 +01:00
Function for editable userclasses
This commit is contained in:
parent
8f75b14e7d
commit
52c02eb3a0
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_admin/userclass2.php,v $
|
||||
| $Revision: 1.4 $
|
||||
| $Date: 2007-12-26 16:32:05 $
|
||||
| $Revision: 1.5 $
|
||||
| $Date: 2008-01-07 22:30:19 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -326,7 +326,7 @@ switch ($action)
|
||||
<tr>
|
||||
<td class='forumheader3'>".UCSLAN_24."</td>
|
||||
<td class='forumheader3'>";
|
||||
$text .= "<select name='userclass_editclass' class='tbox'>".$e_userclass->vetted_tree('userclass_editclass',array($e_userclass,'select'), $userclass_editclass,"main,admin,classes,matchclass,member").'</select>';
|
||||
$text .= "<select name='userclass_editclass' class='tbox'>".$e_userclass->vetted_tree('userclass_editclass',array($e_userclass,'select'), $userclass_editclass,"nobody,main,admin,classes,matchclass,member").'</select>';
|
||||
// .r_userclass("userclass_editclass", $userclass_editclass, "off", "main,admin,classes,matchclass,public,nobody").
|
||||
$text .= "</td>
|
||||
<td class='forumheader3'>".UCSLAN_32."</td>
|
||||
@ -441,11 +441,17 @@ $ns->tablerender(UCSLAN_21, $text);
|
||||
$text .= $e_userclass->show_graphical_tree(TRUE); // Print with debug options
|
||||
$ns->tablerender(UCSLAN_21, $text);
|
||||
|
||||
$text = "<table cellpadding='3'><tr><td colspan='4'>Class rights for first 20 users in database</td></tr><tr><td>User ID</td><td>Disp Name</td><td>Raw classes</td><td>Inherited classes</td></tr>";
|
||||
$text = "<table cellpadding='3'><tr><td colspan='5'>Class rights for first 20 users in database</td></tr>
|
||||
<tr><td>User ID</td><td>Disp Name</td><td>Raw classes</td><td>Inherited classes</td><td>Editable classes</td></tr>";
|
||||
$sql->db_Select('user','user_id,user_name,user_class',"ORDER BY user_id LIMIT 0,20",'no_where');
|
||||
while ($row = $sql->db_Fetch())
|
||||
{
|
||||
$text .= "<tr><td>".$row['user_id']."</td><td>".$row['user_name']."</td><td>".$row['user_class']."</td><td>".$e_userclass->get_all_user_classes($row['user_class'])."</td></tr>";
|
||||
$inherit = $e_userclass->get_all_user_classes($row['user_class']);
|
||||
$text .= "<tr><td>".$row['user_id']."</td>
|
||||
<td>".$row['user_name']."</td><td>".$row['user_class']."</td>
|
||||
<td>".$inherit."</td>
|
||||
<td>".$e_userclass->get_editable_classes($inherit)."</td>
|
||||
</tr>";
|
||||
}
|
||||
$text .= "</table>";
|
||||
$ns->tablerender(UCSLAN_21, $text);
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_handlers/userclass_class.php,v $
|
||||
| $Revision: 1.7 $
|
||||
| $Date: 2007-12-29 22:32:58 $
|
||||
| $Revision: 1.8 $
|
||||
| $Date: 2008-01-07 22:30:19 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -154,6 +154,27 @@ class user_class
|
||||
}
|
||||
|
||||
|
||||
// Returns a list of user classes which can be edited by the specified classlist (defaults to current user's classes)
|
||||
function get_editable_classes($class_list = USERCLASS_LIST)
|
||||
{
|
||||
$ret = array();
|
||||
$possibles = array_flip(explode(',',$class_list));
|
||||
foreach ($possibles as $uc => $uv)
|
||||
{
|
||||
$ec = $this->class_tree[$uc]['userclass_editclass'];
|
||||
$vis = $this->class_tree[$uc]['userclass_visibility'];
|
||||
if (
|
||||
(($ec == e_UC_PUBLIC) || isset($possibles[$ec]))
|
||||
&&
|
||||
(($vis == e_UC_PUBLIC) || isset($possibles[$vis]))
|
||||
)
|
||||
{
|
||||
$ret[] = $uc;
|
||||
}
|
||||
}
|
||||
return implode(',',$ret);
|
||||
}
|
||||
|
||||
|
||||
// Given a comma separated list, returns the minimum number of class memberships required to achieve this (i.e. strips classes 'above' another in the tree)
|
||||
// Requires the class tree to have been initialised
|
||||
@ -801,7 +822,7 @@ class user_class_admin extends user_class
|
||||
$name_line = '';
|
||||
if ($this->graph_debug) $name_line = $this->class_tree[$listnum]['userclass_id'].":";
|
||||
$name_line .= $this->class_tree[$listnum]['userclass_name'];
|
||||
if ($this->graph_debug) $name_line .= "[vis:".$this->class_tree[$listnum]['userclass_visibility']."] = ".$this->class_tree[$listnum]['userclass_accum'];
|
||||
if ($this->graph_debug) $name_line .= "[vis:".$this->class_tree[$listnum]['userclass_visibility'].", edit:".$this->class_tree[$listnum]['userclass_editclass']."] = ".$this->class_tree[$listnum]['userclass_accum'];
|
||||
// Next (commented out) line gives a 'conventional' link
|
||||
// $ret .= "<img src='images/topicon.png' alt='class icon' /><a href='".e_ADMIN."userclass2.php?config.edit.{$this->class_tree[$listnum]['userclass_id']}'>".$this->class_tree[$listnum]['userclass_name']."</a></div>";
|
||||
$ret .= "<img src='".UC_ICON_DIR."topicon.png' alt='class icon' />
|
||||
|
@ -11,8 +11,8 @@
|
||||
| GNU General Public License (http://gnu.org).
|
||||
|
|
||||
| $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/help/userclass2.php,v $
|
||||
| $Revision: 1.2 $
|
||||
| $Date: 2007-12-22 12:39:24 $
|
||||
| $Revision: 1.3 $
|
||||
| $Date: 2008-01-07 22:30:29 $
|
||||
| $Author: e107steved $
|
||||
+----------------------------------------------------------------------------+
|
||||
*/
|
||||
@ -44,11 +44,12 @@ switch (varsettrue($qs[0],'config'))
|
||||
case 'debug' :
|
||||
$text = "For advanced users only - shows the hierarchy of the classes, plus the assigned classes and the classes to which the first 20 site members have access.<br />
|
||||
The number in front of the class name is its unique ID (reference number). The 'Everyone' class has an ID of 0 (zero). E107 uses these IDs throughout to refer to classes.<br />
|
||||
After the class name is the class visibility - [vis:253] for example. This means that the class will be visible in most selectors only if the current user is a member of class 253.<br />
|
||||
After the class name is the class visibility and editability - [vis:253, edit: 27] for example. This means that the class will be visible in most selectors only if the current user is a member of class 253,
|
||||
and the user may edit their class membership only if they are a member of class 27.<br />
|
||||
Finally, after the '=', is a list of all classes above each class in the tree, plus the ID of that class. Thus a user who is a member of a particular class will
|
||||
be a member of all the classes in this list.<br /><br />
|
||||
To help with understanding, the class membership of the first 20 members is shown. The first entry on each line shows the classes of which the user is a member. The
|
||||
second entry lists all the classes where the user is a member once inheritance takes effect.";
|
||||
second entry lists all the classes where the user is a member once inheritance takes effect. The third entry shows which class memberships they can edit";
|
||||
break;
|
||||
case 'test' :
|
||||
case 'special' :
|
||||
@ -61,7 +62,8 @@ switch (varsettrue($qs[0],'config'))
|
||||
then create a forum which only allowed users in the TEST class to access it.<br /><br />
|
||||
The class name is displayed in drop-down lists and the like; in some places the more detailed description is also displayed.<br /><br />
|
||||
The class icon may be displayed in various places on the site, if one is set.<br /><br />
|
||||
To allow users to determine whether they can be a member of a class, allow them to manage it.<br /><br />
|
||||
To allow users to determine whether they can be a member of a class, allow them to manage it. If you set 'no-one' here, only the admins
|
||||
can manage membership of the class<br /><br />
|
||||
The 'visibility' field allows you to hide the class from most members - applies in some of the drop-down lists and checkboxes.<br /><br />
|
||||
The 'class parent' allows you to set a hierarchy of classes, where the classes lower down the hierarchy also have the rights of their parent class,
|
||||
and that classes' parent, and so on. The resulting tree is shown in the lower part of the page; you can expand and contract branches by clicking on the '+' and '-' boxes.";
|
||||
|
Loading…
x
Reference in New Issue
Block a user