Revision history for UserAdmin
Additions:
This is the development page for the User Administration module. The User Administration module has been committed to the [[http://wush.net/websvn/wikka/listing.php?repname=wikka&path=%2Fbranches%2F1.1.6.4%2F 1.1.6.4 branch]] and will be available with the [[http://blog.wikkawiki.org/2007/11/23/pre-release-announcement-for-securityantispam-release-1164/ 1.1.6.4 release]]. **Documentation** http://docs.wikkawiki.org/UserAdministration
Deletions:
Revision [19407]
Edited on 2008-01-28 00:15:44 by BrianKoontz [Modified links pointing to docs server]No Differences
Additions:
~~-**delete users** (forthcoming: see this [[RemovingUsers discussion]]) ''-- done as of 1.1.6.4; however, other core changes must be made to recognize users as being deleted''
Deletions:
Additions:
This is the development page for the User Administration module. The User Administration module has been committed to the [[http://wush.net/websvn/wikka/listing.php?repname=wikka&path=%2Fbranches%2F1.1.6.4%2F 1.1.6.4 branch]] and will be available with the [[http://blog.wikkawiki.org/2007/11/23/pre-release-announcement-for-securityantispam-release-1164/ 1.1.6.4 release]].
Deletions:
Additions:
===== User Administration Module =====
~~~& noted, good idea -- DarTar
~~~~& See DanWestUserReg. Worked for me as intended. I'd say, this function's done --MasinAlDujaili, 2007-05-21
~~-**send user feedback** ''-- done'';
~~-**rename users**
~~~&//If anyone is interested, running through the seven tables and updating every instance of your old wiki name to your new wiki name will effectively change your name throughout the wiki.// copied from comment on the homepage. --NilsLindenberg
~~-manage **user privileges** (forthcoming);
~-Display user's **owned pages** ''-- done'';
~-Display user's **comments** ''-- done''.
~-Display user's **changes** ''-- done'';
~-//other...//
The code below must be saved as ##actions/useradmin.php## and can be used by adding ##""{{useradmin}}""## in the body of a page.
Here's a preview of the interface (the email and IP fields are masked for privacy reasons)
----
==sample output==
""
<h3 id="hn_User_Administration"> User Administration </h3>
<br />
<form action="#" method="post" id="form_user_admin_panel">
<fieldset><legend>Filter view:</legend>
<label for="q">Search user:</label> <input type ="text" id="q" name="q" title="Enter a search string" size="20" maxlength="50" value=" "/> <input type="submit" value="Submit" /><br />
<label for="l">Show</label>
<select name="l" id="l" title="Select records-per-page limit">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
<option value="300">300</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="857">857</option>
</select> <label for="l">records per page</label> <input type="submit" value="Apply" /><br />
Records (857): 1-10 | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=10&q=" title="Show records from 11 to 20">11-20</a>
<br />
(Sorted by:<em>signuptime, desc</em>)
</fieldset></form>
<form action="http://wikka.jsnx.com/UserAdminTest" id="form_b5eda0a745">
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select RobinW"/></td>
<td>RobinW</td>
<td>[email protected]</td>
<td class="time">2005-07-30 02:06:20</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3"><a title="Display comments by RobinW (1)" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=comments">1</a></td>
<td class="center"><a title="Remove user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=delete">delete</a> :: <a title="Send feedback to user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select VictorManuelVarela"/></td>
<td><a href="http://wikka.jsnx.com/VictorManuelVarela" title=" ">VictorManuelVarela</a></td>
<td>[email protected]</td>
<td class="time">2005-07-30 00:01:13</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by VictorManuelVarela (1)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by VictorManuelVarela (6)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=changes">6</a></td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=delete">delete</a> :: <a title="Send feedback to user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select EniBevoli"/></td>
<td>EniBevoli</td>
<td>[email protected]</td>
<td class="time">2005-07-29 12:13:44</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2"><a title="Display page edits by EniBevoli (4)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=changes">4</a></td>
<td class="number c3"><a title="Display comments by EniBevoli (1)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=comments">1</a></td>
<td class="center"><a title="Remove user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=delete">delete</a> :: <a title="Send feedback to user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select MyPrivateWiki"/></td>
<td>MyPrivateWiki</td>
<td>[email protected]</td>
<td class="time">2005-07-28 20:30:36</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=delete">delete</a> :: <a title="Send feedback to user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select DaSt"/></td>
<td>DaSt</td>
<td>[email protected]</td>
<td class="time">2005-07-27 17:32:06</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=delete">delete</a> :: <a title="Send feedback to user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select WikiSop"/></td>
<td>WikiSop</td>
<td>[email protected]</td>
<td class="time">2005-07-27 14:59:07</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=delete">delete</a> :: <a title="Send feedback to user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select Aragorn2005"/></td>
<td>Aragorn2005</td>
<td>[email protected]</td>
<td class="time">2005-07-27 08:48:46</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=delete">delete</a> :: <a title="Send feedback to user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
<fieldset><legend>Mass-action</legend>[<a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=1" title="Check all records">Check all</a> | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=0" title="Uncheck all records">Uncheck all</a>]<br /><label for="action" >With selected</label> <select title="Choose action to apply to selected records" id="action" name="action"><option value=" " selected="selected">---</option><option value="massdelete">Remove all</option><option value="massfeedback">Send feedback to all</option></select> <input type="submit" value="Submit" /></fieldset></form>
""
----
===Current version=== (//2005-08-31//):
##0.5##
~-users can be sorted by different fields (click on table header to reverse sort order), searched and paged;
~-if the current user is not an administrator, then the ##lastuser.php## action is displayed
~-feedback can be sent to single users.
~-displays pages owned by each user.
~-displays pages changed by each user.
~-displays pages commented by each user.
~-added extra column for Signup IP ( installed on this server as a beta feature).
~~-TrackIPaddressMod for (possible) install on 'your' server
~-added constants, UI strings and a bunch of configurable options including styling options (see below).
==Files needed== (//2004-09-16//):
~-##actions/useradmin.php##: see code on this page;
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (enhanced version of FeedbackAction); ''2005-04-18 - action parameter support added''
~-##[[UserPagesAction actions/userpages.php]]## (enhanced version of ##mypages.php##);''2005-04-18 - action parameter support added''
~-##[[UserChangesAction actions/userchanges.php]]## (enhanced version of ##mychanges.php##); ''2005-04-18 - action parameter support added''
~-##[[UserCommentsAction actions/usercomments.php]]## (new action); ''2004-11-23 - ""RewriteRules"" bug fixed''
===To do ===
~-mass-operations;
~-deleting/banning users;
~-integrate with other admin modules.
----
====The code====
<<##actions/useradmin.php##<<
**Note:** this action uses the ##ipaddress## field that has been added as a beta antispam feature to this server. Lines relative to this field have been commented out in the code to allow installation on a native wikka package
The code has also been adapted to take advantage of the ##[[WikkaCountingRecords getCount()]]## method, which is required for the action to work.
%%(php;1)
<?php
/**
* Display a module for user management.
*
* This action allows admins to display information on registered users.
* Users can be searched, paged, filtered. User-related statistics are given,
* showing the number of commented, created and modified pages. A feedback
* handler allows admins to send an email to single users. If the current user
* is not an administrator, then the lastuser action is displayed instead.
*
* @package Actions
* @name Useradmin
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.5
* @since Wikka 1.1.X.X
*
* @input integer $colcolor optional: enables color for statistics columns
* 1: enables colored columns;
* 0: disables colored columns;
* default: 1;
* @input integer $rowcolor optional: enables alternate row colors
* 1: enables colored rows;
* 0: disables colored rows;
* default: 1;
*
* @output A list of users registered on the current server.
*
* @todo
* - mass-operations;
* - deleting/banning users;
* - integrate with other admin modules.
*/
//utilities
/**
* Build an array of numbers consisting of 'ranges' with increasing step size in each 'range'.
*
* A list of numbers like this is useful for instance for a dropdown to choose
* a period expressed in number of days: a difference between 2 and 5 days may
* be significant while that between 92 and 95 may not be.
*
* @author {@link http://wikka.jsnx.com/JavaWoman JavaWoman}
* @copyright Copyright (c) 2005, Marjolein Katsma
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @version 1.0
*
* @param mixed $limits required: single integer or array of integers;
* defines the upper limits of the ranges as well as the next step size
* @param int $max required: upper limit for the whole list
* (will be included if smaller than the largest limit)
* @param int $firstinc optional: increment for the first range; default 1
* @return array resulting list of numbers
*/
// utilities
function optionRanges($limits, $max, $firstinc = 1)
{
// initializations
if (is_int($limits)) $limits = array($limits);
if ($firstinc < 1) $firstinc = 1;
$opts = array();
$inc = $firstinc;
// first element is the first increment
$opts[] = $inc;
// each $limit is the upper limit of a 'range'
foreach ($limits as $limit)
{
for ($i = $inc + $inc; $i <= $limit && $i < $max; $i += $inc)
{
$opts[] = $i;
}
// we quit at $max, even if there are more $limit elements
if ($limit >= $max)
{
// add $max to the list; then break out of the loop
$opts[] = $max;
break;
}
// when $limit is reached, it becomes the new start and increment for the next 'range'
$inc = $limit;
}
return $opts;
}
// restrict access to admins
if ($this->IsAdmin($this->GetUser())) {
// -------------------------------------
// set default values as constants
define('DEFAULT_RECORDS_LIMIT', '10'); # number of records per page
define('DEFAULT_MIN_RECORDS_DISPLAY', '5'); # min number of records
define('DEFAULT_RECORDS_RANGE',serialize(array('10','50','100','500','1000'))); #range array for records pager
define('DEFAULT_SORT_FIELD', 'signuptime'); # sort field
define('DEFAULT_SORT_ORDER', 'desc'); # sort order, ascendant or descendant
define('DEFAULT_START', '0'); # start record
define('DEFAULT_SEARCH', ''); # keyword to restrict search
define('ALTERNATE_ROW_COLOR', '1'); # switch alternate row color
define('STAT_COLUMN_COLOR', '1'); # switch color for statistics columns
// -------------------------------------
// User-interface: icons
define('OWNED_ICON', 'images/icons/16x16/stock_keyring.png');
define('EDITS_ICON', 'images/icons/16x16/text-editor.png');
define('COMMENTS_ICON', 'images/icons/16x16/stock_help-agent.png');
// -------------------------------------
// User-interface: strings
define('PAGE_TITLE','User Administration');
define('FORM_LEGEND','Filter view:');
define('FORM_SEARCH_STRING_LABEL','Search user:');
define('FORM_SEARCH_STRING_TITLE','Enter a search string');
define('FORM_SEARCH_SUBMIT','Submit');
define('FORM_PAGER_LABEL_BEFORE','Show');
define('FORM_PAGER_TITLE','Select records-per-page limit');
define('FORM_PAGER_LABEL_AFTER','records per page');
define('FORM_PAGER_SUBMIT','Apply');
define('FORM_PAGER_LINK','Show records from %d to %d');
define('FORM_RESULT_INFO','Records');
define('FORM_RESULT_SORTED_BY','Sorted by:');
define('TABLE_HEADING_USERNAME','User Name');
define('TABLE_HEADING_USERNAME_TITLE','Sort by user name');
define('TABLE_HEADING_EMAIL','Email');
define('TABLE_HEADING_EMAIL_TITLE','Sort by email');
define('TABLE_HEADING_SIGNUPTIME','Signup Time');
define('TABLE_HEADING_SIGNUPTIME_TITLE','Sort by signup time');
define('TABLE_HEADING_SIGNUPIP','Signup IP');
define('TABLE_HEADING_SIGNUPIP_TITLE','Sort by signup IP');
define('TABLE_SUMMARY','List of users registered on this server');
define('TABLE_HEADING_OWNED_TITLE','Owned Pages');
define('TABLE_HEADING_EDITS_TITLE','Page Edits');
define('TABLE_HEADING_COMMENTS_TITLE','Comments');
define('ACTION_DELETE_LINK_TITLE','Remove user %s');
define('ACTION_FEEDBACK_LINK_TITLE','Send feedback to user %s');
define('ACTION_DELETE_LINK','delete');
define('ACTION_FEEDBACK_LINK','feedback');
define('TABLE_CELL_OWNED_TITLE','Display pages owned by %s (%d)');
define('TABLE_CELL_EDITS_TITLE','Display page edits by %s (%d)');
define('TABLE_CELL_COMMENTS_TITLE','Display comments by %s (%d)');
define('SELECT_RECORD_TITLE','Select %s');
define('CHECK_ALL_TITLE','Check all records');
define('CHECK_ALL','Check all');
define('UNCHECK_ALL_TITLE','Uncheck all records');
define('UNCHECK_ALL','Uncheck all');
define('FORM_MASSACTION_LEGEND','Mass-action');
define('FORM_MASSACTION_LABEL','With selected');
define('FORM_MASSACTION_SELECT_TITLE','Choose action to apply to selected records');
define('FORM_MASSACTION_OPT_DELETE','Remove all');
define('FORM_MASSACTION_OPT_FEEDBACK','Send feedback to all');
define('FORM_MASSACTION_SUBMIT','Submit');
define('ERROR_NO_MATCHES','Sorry, there are no users matching "%s"');
//initialize row & column colors variables
$r = 1; #initialize row counter
$r_color = ALTERNATE_ROW_COLOR; #get alternate row color option
$c_color = STAT_COLUMN_COLOR; #get column color option
// record dropdown
$user_limits = unserialize(DEFAULT_RECORDS_RANGE);
// pager
$prev = '';
$next = '';
//override defaults with action parameters
if (is_array($vars))
{
foreach ($vars as $param => $value)
{
switch ($param)
{
case 'colcolor':
$c_color = (preg_match('/[01]/',$value))? $value : STAT_COLUMN_COLOR;
break;
case 'rowcolor':
$r_color = (preg_match('/[01]/',$value))? $value : ALTERNATE_ROW_COLOR;
break;
}
}
}
//perform actions if required
if ($_GET['action'] == 'feedback' || $_REQUEST['mail'])
{
echo $this->Action('userfeedback');
}
elseif ($_GET['action'] == 'owned')
{
echo $this->Action('userpages');
}
elseif ($_GET['action'] == 'changes')
{
echo $this->Action('userchanges');
}
elseif ($_GET['action'] == 'comments')
{
echo $this->Action('usercomments');
}
else
{
// process URL variables
# JW 2005-07-19 some modifications to avoid notices but these are still not actually secure
// number of records per page
if (isset($_POST['l']))
$l = $_POST['l'];
elseif (isset($_GET['l']))
$l = $_GET['l'];
else
$l = DEFAULT_RECORDS_LIMIT;
// sort field
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : DEFAULT_SORT_FIELD;
// sort order
$d = (isset($_GET['d'])) ? $_GET['d'] : DEFAULT_SORT_ORDER;
// start record
$s = (isset($_GET['s'])) ? $_GET['s'] : DEFAULT_START;
// search string
if (isset($_POST['q']))
$q = $_POST['q'];
elseif (isset($_GET['q']))
$q = $_GET['q'];
else
$q = DEFAULT_SEARCH;
// select all
$checked = '';
if (isset($_GET['selectall']))
{
$checked = (1 == $_GET['selectall']) ? ' checked="checked"' : '';
}
// restrict MySQL query by search string
$where = ('' == $q) ? "1" : "`name` LIKE '%".$q."%'";
// get total number of users
$numusers = $this->getCount('users', $where);
// print page header
echo $this->Format('==== '.PAGE_TITLE.' ==== --- ');
// build pager form
$form = $this->FormOpen('','','post','user_admin_panel');
$form .= '<fieldset><legend>'.FORM_LEGEND.'</legend>'."\n";
$form .= '<label for="q">'.FORM_SEARCH_STRING_LABEL.'</label> <input type ="text" id="q" name="q" title="'.FORM_SEARCH_STRING_TITLE.'" size="20" maxlength="50" value="'.$q.'"/> <input type="submit" value="'.FORM_SEARCH_SUBMIT.'" /><br />'."\n";
// ranged drop-down
$users_opts = optionRanges($user_limits,$numusers,DEFAULT_MIN_RECORDS_DISPLAY);
$form .= '<label for="l">'.FORM_PAGER_LABEL_BEFORE.'</label> '."\n";
$form .= '<select name="l" id="l" title="'.FORM_PAGER_TITLE.'">'."\n";
// build drop-down
foreach ($users_opts as $opt) {
$selected = ($opt == $l) ? ' selected="selected"' : '';
$form .= '<option value="'.$opt.'"'.$selected.'>'.$opt.'</option>'."\n";
}
$form .= '</select> <label for="l">'.FORM_PAGER_LABEL_AFTER.'</label> <input type="submit" value="'.FORM_PAGER_SUBMIT.'" /><br />'."\n";
// build pager links
if ($s > 0)
$prev = '<a href="' .$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s-$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s-$l+1), $s).'">'.($s-$l+1).'-'.$s.'</a> | '."\n";
if ($numusers > ($s + $l))
$next = ' | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s+$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s+$l+1), ($s+2*$l)).'">'.($s+$l+1).'-'.($s+2*$l).'</a>'."\n";
$form .= FORM_RESULT_INFO.' ('.$numusers.'): '.$prev.($s+1).'-'.($s+$l).$next.'<br />'."\n";
$form .= '('.FORM_RESULT_SORTED_BY.'<em>'.$sort.', '.$d.'</em>)'."\n";
$form .= '</fieldset>'.$this->FormClose()."\n";
// print form
echo $form;
// get user list
$userdata = $this->LoadAll("SELECT * FROM ".$this->config["table_prefix"]."users WHERE ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// build header links
$nameheader = '<a href="'.$this->Href('','', (($sort == 'name' && $d == 'asc')? 'l='.$l.'&sort=name&d=desc' : 'l='.$l.'&sort=name&d=asc')).'" title="'.TABLE_HEADING_USERNAME_TITLE.'">'.TABLE_HEADING_USERNAME.'</a>';
$emailheader = '<a href="'.$this->Href('','', (($sort == 'email' && $d == 'asc')? 'l='.$l.'&sort=email&d=desc' : 'l='.$l.'&sort=email&d=asc')).'" title="'.TABLE_HEADING_EMAIL_TITLE.'">'.TABLE_HEADING_EMAIL.'</a>';
$timeheader = '<a href="'.$this->Href('','', (($sort == 'signuptime' && $d == 'desc')? 'l='.$l.'&sort=signuptime&d=asc' : 'l='.$l.'')).'" title="'.TABLE_HEADING_SIGNUPTIME_TITLE.'">'.TABLE_HEADING_SIGNUPTIME.'</a>';
/*$ipheader = '<a href="'.$this->Href('','', (($sort == 'ipaddress' && $d == 'desc')? 'l='.$l.'&sort=ipaddress&d=asc' : 'l='.$l.'&sort=ipaddress&d=desc')).'" title="'.TABLE_HEADING_SIGNUPIP_TITLE.'">'.TABLE_HEADING_SIGNUPIP.'</a>'; # installed as beta feature at wikka.jsnx.com */
// build table headers
$htmlout = "<table summary=\"".TABLE_SUMMARY."\" border=\"1px\" id=\"admin_table\">\n<thead>\n".
" <tr>\n".
" <th> </th>\n".
" <th>".$nameheader."</th>\n".
" <th>".$emailheader."</th>\n".
" <th>".$timeheader."</th>\n".
/* " <th>".$ipheader."</th>\n". # installed as beta feature at wikka.jsnx.com */
" <th class=\"number ".(($c_color == 1)? ' c1' : '')."\" title=\"".TABLE_HEADING_OWNED_TITLE."\">;<img src=\"".OWNED_ICON."\" alt=\"O\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c2' : '')."\" title=\"".TABLE_HEADING_EDITS_TITLE."\"><img src=\"".EDITS_ICON."\" alt=\"E\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c3' : '')."\" title=\"".TABLE_HEADING_COMMENTS_TITLE."\"><img src=\"".COMMENTS_ICON."\" alt=\"C\"/></th>\n".
" <th class=\"center\">Actions</th>\n".
" </tr>\n</thead>\n";
// print user table
foreach($userdata as $user) {
// get counts
$where_owned = "`owner` = '".$user['name']."' AND latest = 'Y'";
$where_changes = "`user` = '".$user['name']."'";
$where_comments = "`user` = '".$user['name']."'";
$numowned = $this->getCount('pages', $where_owned);
$numchanges = $this->getCount('pages', $where_changes);
$numcomments = $this->getCount('comments', $where_comments);
// build statistics links if needed
$ownedlink = ($numowned > 0)? '<a title="'.sprintf(TABLE_CELL_OWNED_TITLE,$user['name'],$numowned).'" href="'.$this->Href('','','user='.$user['name'].'&action=owned').'">'.$numowned.'</a>' : '0';
$changeslink = ($numchanges > 0)? '<a title="'.sprintf(TABLE_CELL_EDITS_TITLE,$user['name'],$numchanges).'" href="'.$this->Href('','','user='.$user['name'].'&action=changes').'">'.$numchanges.'</a>' : '0';
$commentslink = ($numcomments > 0)? '<a title="'.sprintf(TABLE_CELL_COMMENTS_TITLE,$user['name'],$numcomments).'" href="'.$this->Href('','','user='.$user['name'].'&action=comments').'">'.$numcomments.'</a>' : '0';
// build handler links
$deleteuser = '<a title="'.sprintf(ACTION_DELETE_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=delete').'">'.ACTION_DELETE_LINK.'</a>';
$feedbackuser = '<a title="'.sprintf(ACTION_FEEDBACK_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=feedback').'">'.ACTION_FEEDBACK_LINK.'</a>';
// build table body
$htmlout .= "<tbody>\n";
if ($r_color == 1) {
$htmlout .= "<tr ".(($r%2)? '' : 'class="alt"').">\n"; #enable alternate row color
} else {
$htmlout .= "<tr>\n"; #disable alternate row color
}
$htmlout .= " <td><input type=\"checkbox\" id=\"".$user['id']."\"".$checked." title=\"".sprintf(SELECT_RECORD_TITLE,$user['name'])."\"/></td>\n".
" <td>".(($this->ExistsPage($user['name']))? $this->Link($user['name']) : $user['name'])."</td>\n". #check if userpage exists
" <td>".$user['email']."</td>\n".
" <td class=\"time\">".$user['signuptime']."</td>\n".
/* " <td>".$user['ipaddress']."</td>\n". # installed as beta feature at wikka.jsnx.com */
" <td class=\"number".(($c_color == 1)? ' c1' : '')."\">".$ownedlink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c2' : '')."\">".$changeslink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c3' : '')."\">".$commentslink."</td>\n". #set column color
" <td class=\"center\">".$deleteuser." :: ".$feedbackuser."</td>\n";
$htmlout .= " </tr>\n</tbody>\n";
//increase row counter ----- alternate row colors
if ($r_color == 1) $r++;
}
$htmlout .= "</table>\n";
// print the table
echo $this->FormOpen('','','get');
echo $htmlout;
// multiple-user operations (forthcoming) JW 2005-07-19 accesskey removed (causes more problems than it solves)
echo '<fieldset><legend>'.FORM_MASSACTION_LEGEND.'</legend>';
echo '[<a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=1').'" title="'.CHECK_ALL_TITLE.'">'.CHECK_ALL.'</a> | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=0').'" title="'.UNCHECK_ALL_TITLE.'">'.UNCHECK_ALL.'</a>]<br />';
echo '<label for="action" >'.FORM_MASSACTION_LABEL.'</label> <select title="'.FORM_MASSACTION_SELECT_TITLE.'" id="action" name="action">';
echo '<option value="" selected="selected">---</option>';
echo '<option value="massdelete">'.FORM_MASSACTION_OPT_DELETE.'</option>';
echo '<option value="massfeedback">'.FORM_MASSACTION_OPT_FEEDBACK.'</option>';
echo '</select> <input type="submit" value="'.FORM_MASSACTION_SUBMIT.'" />';
echo '</fieldset>';
echo $this->FormClose();
}
else
{
// no records matching the search string: print error message
echo '<p><span class="error">'.sprintf(ERROR_NO_MATCHES, $q).'</span></p>';
}
}
} else {
// user is not admin
echo $this->Action('lastusers');
}
?>
%%
===New CSS classes===
The styling of the tables requires a bunch of [[TableStyling new CSS classes]].
----
==== Styling options ====
The ##useradmin## action accepts two optional styling parameters:
##colcolor##
Enables color for statistics columns
1: enables colored columns (default);
0: disables colored columns;
##rowcolor##
Enables alternate row colors
1: enables colored rows (default);
0: disables colored rows;
The following examples show how the table is rendered using these two parameters:
**No styling:** ##""{{useradmin colcolor="0" rowcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows only:** ##""{{useradmin colcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Colored columns only:** ##""{{useradmin rowcolor="0"}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows and colored columns:** ##""{{useradmin}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
----
CategoryDevelopmentActions CategoryDevelopmentAdmin
~~~& noted, good idea -- DarTar
~~~~& See DanWestUserReg. Worked for me as intended. I'd say, this function's done --MasinAlDujaili, 2007-05-21
~~-**send user feedback** ''-- done'';
~~-**rename users**
~~~&//If anyone is interested, running through the seven tables and updating every instance of your old wiki name to your new wiki name will effectively change your name throughout the wiki.// copied from comment on the homepage. --NilsLindenberg
~~-manage **user privileges** (forthcoming);
~-Display user's **owned pages** ''-- done'';
~-Display user's **comments** ''-- done''.
~-Display user's **changes** ''-- done'';
~-//other...//
The code below must be saved as ##actions/useradmin.php## and can be used by adding ##""{{useradmin}}""## in the body of a page.
Here's a preview of the interface (the email and IP fields are masked for privacy reasons)
----
==sample output==
""
<h3 id="hn_User_Administration"> User Administration </h3>
<br />
<form action="#" method="post" id="form_user_admin_panel">
<fieldset><legend>Filter view:</legend>
<label for="q">Search user:</label> <input type ="text" id="q" name="q" title="Enter a search string" size="20" maxlength="50" value=" "/> <input type="submit" value="Submit" /><br />
<label for="l">Show</label>
<select name="l" id="l" title="Select records-per-page limit">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
<option value="300">300</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="857">857</option>
</select> <label for="l">records per page</label> <input type="submit" value="Apply" /><br />
Records (857): 1-10 | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=10&q=" title="Show records from 11 to 20">11-20</a>
<br />
(Sorted by:<em>signuptime, desc</em>)
</fieldset></form>
<form action="http://wikka.jsnx.com/UserAdminTest" id="form_b5eda0a745">
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select RobinW"/></td>
<td>RobinW</td>
<td>[email protected]</td>
<td class="time">2005-07-30 02:06:20</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3"><a title="Display comments by RobinW (1)" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=comments">1</a></td>
<td class="center"><a title="Remove user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=delete">delete</a> :: <a title="Send feedback to user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select VictorManuelVarela"/></td>
<td><a href="http://wikka.jsnx.com/VictorManuelVarela" title=" ">VictorManuelVarela</a></td>
<td>[email protected]</td>
<td class="time">2005-07-30 00:01:13</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by VictorManuelVarela (1)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by VictorManuelVarela (6)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=changes">6</a></td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=delete">delete</a> :: <a title="Send feedback to user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select EniBevoli"/></td>
<td>EniBevoli</td>
<td>[email protected]</td>
<td class="time">2005-07-29 12:13:44</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2"><a title="Display page edits by EniBevoli (4)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=changes">4</a></td>
<td class="number c3"><a title="Display comments by EniBevoli (1)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=comments">1</a></td>
<td class="center"><a title="Remove user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=delete">delete</a> :: <a title="Send feedback to user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select MyPrivateWiki"/></td>
<td>MyPrivateWiki</td>
<td>[email protected]</td>
<td class="time">2005-07-28 20:30:36</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=delete">delete</a> :: <a title="Send feedback to user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select DaSt"/></td>
<td>DaSt</td>
<td>[email protected]</td>
<td class="time">2005-07-27 17:32:06</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=delete">delete</a> :: <a title="Send feedback to user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select WikiSop"/></td>
<td>WikiSop</td>
<td>[email protected]</td>
<td class="time">2005-07-27 14:59:07</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=delete">delete</a> :: <a title="Send feedback to user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select Aragorn2005"/></td>
<td>Aragorn2005</td>
<td>[email protected]</td>
<td class="time">2005-07-27 08:48:46</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=delete">delete</a> :: <a title="Send feedback to user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
<fieldset><legend>Mass-action</legend>[<a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=1" title="Check all records">Check all</a> | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=0" title="Uncheck all records">Uncheck all</a>]<br /><label for="action" >With selected</label> <select title="Choose action to apply to selected records" id="action" name="action"><option value=" " selected="selected">---</option><option value="massdelete">Remove all</option><option value="massfeedback">Send feedback to all</option></select> <input type="submit" value="Submit" /></fieldset></form>
""
----
===Current version=== (//2005-08-31//):
##0.5##
~-users can be sorted by different fields (click on table header to reverse sort order), searched and paged;
~-if the current user is not an administrator, then the ##lastuser.php## action is displayed
~-feedback can be sent to single users.
~-displays pages owned by each user.
~-displays pages changed by each user.
~-displays pages commented by each user.
~-added extra column for Signup IP ( installed on this server as a beta feature).
~~-TrackIPaddressMod for (possible) install on 'your' server
~-added constants, UI strings and a bunch of configurable options including styling options (see below).
==Files needed== (//2004-09-16//):
~-##actions/useradmin.php##: see code on this page;
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (enhanced version of FeedbackAction); ''2005-04-18 - action parameter support added''
~-##[[UserPagesAction actions/userpages.php]]## (enhanced version of ##mypages.php##);''2005-04-18 - action parameter support added''
~-##[[UserChangesAction actions/userchanges.php]]## (enhanced version of ##mychanges.php##); ''2005-04-18 - action parameter support added''
~-##[[UserCommentsAction actions/usercomments.php]]## (new action); ''2004-11-23 - ""RewriteRules"" bug fixed''
===To do ===
~-mass-operations;
~-deleting/banning users;
~-integrate with other admin modules.
----
====The code====
<<##actions/useradmin.php##<<
**Note:** this action uses the ##ipaddress## field that has been added as a beta antispam feature to this server. Lines relative to this field have been commented out in the code to allow installation on a native wikka package
The code has also been adapted to take advantage of the ##[[WikkaCountingRecords getCount()]]## method, which is required for the action to work.
%%(php;1)
<?php
/**
* Display a module for user management.
*
* This action allows admins to display information on registered users.
* Users can be searched, paged, filtered. User-related statistics are given,
* showing the number of commented, created and modified pages. A feedback
* handler allows admins to send an email to single users. If the current user
* is not an administrator, then the lastuser action is displayed instead.
*
* @package Actions
* @name Useradmin
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.5
* @since Wikka 1.1.X.X
*
* @input integer $colcolor optional: enables color for statistics columns
* 1: enables colored columns;
* 0: disables colored columns;
* default: 1;
* @input integer $rowcolor optional: enables alternate row colors
* 1: enables colored rows;
* 0: disables colored rows;
* default: 1;
*
* @output A list of users registered on the current server.
*
* @todo
* - mass-operations;
* - deleting/banning users;
* - integrate with other admin modules.
*/
//utilities
/**
* Build an array of numbers consisting of 'ranges' with increasing step size in each 'range'.
*
* A list of numbers like this is useful for instance for a dropdown to choose
* a period expressed in number of days: a difference between 2 and 5 days may
* be significant while that between 92 and 95 may not be.
*
* @author {@link http://wikka.jsnx.com/JavaWoman JavaWoman}
* @copyright Copyright (c) 2005, Marjolein Katsma
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @version 1.0
*
* @param mixed $limits required: single integer or array of integers;
* defines the upper limits of the ranges as well as the next step size
* @param int $max required: upper limit for the whole list
* (will be included if smaller than the largest limit)
* @param int $firstinc optional: increment for the first range; default 1
* @return array resulting list of numbers
*/
// utilities
function optionRanges($limits, $max, $firstinc = 1)
{
// initializations
if (is_int($limits)) $limits = array($limits);
if ($firstinc < 1) $firstinc = 1;
$opts = array();
$inc = $firstinc;
// first element is the first increment
$opts[] = $inc;
// each $limit is the upper limit of a 'range'
foreach ($limits as $limit)
{
for ($i = $inc + $inc; $i <= $limit && $i < $max; $i += $inc)
{
$opts[] = $i;
}
// we quit at $max, even if there are more $limit elements
if ($limit >= $max)
{
// add $max to the list; then break out of the loop
$opts[] = $max;
break;
}
// when $limit is reached, it becomes the new start and increment for the next 'range'
$inc = $limit;
}
return $opts;
}
// restrict access to admins
if ($this->IsAdmin($this->GetUser())) {
// -------------------------------------
// set default values as constants
define('DEFAULT_RECORDS_LIMIT', '10'); # number of records per page
define('DEFAULT_MIN_RECORDS_DISPLAY', '5'); # min number of records
define('DEFAULT_RECORDS_RANGE',serialize(array('10','50','100','500','1000'))); #range array for records pager
define('DEFAULT_SORT_FIELD', 'signuptime'); # sort field
define('DEFAULT_SORT_ORDER', 'desc'); # sort order, ascendant or descendant
define('DEFAULT_START', '0'); # start record
define('DEFAULT_SEARCH', ''); # keyword to restrict search
define('ALTERNATE_ROW_COLOR', '1'); # switch alternate row color
define('STAT_COLUMN_COLOR', '1'); # switch color for statistics columns
// -------------------------------------
// User-interface: icons
define('OWNED_ICON', 'images/icons/16x16/stock_keyring.png');
define('EDITS_ICON', 'images/icons/16x16/text-editor.png');
define('COMMENTS_ICON', 'images/icons/16x16/stock_help-agent.png');
// -------------------------------------
// User-interface: strings
define('PAGE_TITLE','User Administration');
define('FORM_LEGEND','Filter view:');
define('FORM_SEARCH_STRING_LABEL','Search user:');
define('FORM_SEARCH_STRING_TITLE','Enter a search string');
define('FORM_SEARCH_SUBMIT','Submit');
define('FORM_PAGER_LABEL_BEFORE','Show');
define('FORM_PAGER_TITLE','Select records-per-page limit');
define('FORM_PAGER_LABEL_AFTER','records per page');
define('FORM_PAGER_SUBMIT','Apply');
define('FORM_PAGER_LINK','Show records from %d to %d');
define('FORM_RESULT_INFO','Records');
define('FORM_RESULT_SORTED_BY','Sorted by:');
define('TABLE_HEADING_USERNAME','User Name');
define('TABLE_HEADING_USERNAME_TITLE','Sort by user name');
define('TABLE_HEADING_EMAIL','Email');
define('TABLE_HEADING_EMAIL_TITLE','Sort by email');
define('TABLE_HEADING_SIGNUPTIME','Signup Time');
define('TABLE_HEADING_SIGNUPTIME_TITLE','Sort by signup time');
define('TABLE_HEADING_SIGNUPIP','Signup IP');
define('TABLE_HEADING_SIGNUPIP_TITLE','Sort by signup IP');
define('TABLE_SUMMARY','List of users registered on this server');
define('TABLE_HEADING_OWNED_TITLE','Owned Pages');
define('TABLE_HEADING_EDITS_TITLE','Page Edits');
define('TABLE_HEADING_COMMENTS_TITLE','Comments');
define('ACTION_DELETE_LINK_TITLE','Remove user %s');
define('ACTION_FEEDBACK_LINK_TITLE','Send feedback to user %s');
define('ACTION_DELETE_LINK','delete');
define('ACTION_FEEDBACK_LINK','feedback');
define('TABLE_CELL_OWNED_TITLE','Display pages owned by %s (%d)');
define('TABLE_CELL_EDITS_TITLE','Display page edits by %s (%d)');
define('TABLE_CELL_COMMENTS_TITLE','Display comments by %s (%d)');
define('SELECT_RECORD_TITLE','Select %s');
define('CHECK_ALL_TITLE','Check all records');
define('CHECK_ALL','Check all');
define('UNCHECK_ALL_TITLE','Uncheck all records');
define('UNCHECK_ALL','Uncheck all');
define('FORM_MASSACTION_LEGEND','Mass-action');
define('FORM_MASSACTION_LABEL','With selected');
define('FORM_MASSACTION_SELECT_TITLE','Choose action to apply to selected records');
define('FORM_MASSACTION_OPT_DELETE','Remove all');
define('FORM_MASSACTION_OPT_FEEDBACK','Send feedback to all');
define('FORM_MASSACTION_SUBMIT','Submit');
define('ERROR_NO_MATCHES','Sorry, there are no users matching "%s"');
//initialize row & column colors variables
$r = 1; #initialize row counter
$r_color = ALTERNATE_ROW_COLOR; #get alternate row color option
$c_color = STAT_COLUMN_COLOR; #get column color option
// record dropdown
$user_limits = unserialize(DEFAULT_RECORDS_RANGE);
// pager
$prev = '';
$next = '';
//override defaults with action parameters
if (is_array($vars))
{
foreach ($vars as $param => $value)
{
switch ($param)
{
case 'colcolor':
$c_color = (preg_match('/[01]/',$value))? $value : STAT_COLUMN_COLOR;
break;
case 'rowcolor':
$r_color = (preg_match('/[01]/',$value))? $value : ALTERNATE_ROW_COLOR;
break;
}
}
}
//perform actions if required
if ($_GET['action'] == 'feedback' || $_REQUEST['mail'])
{
echo $this->Action('userfeedback');
}
elseif ($_GET['action'] == 'owned')
{
echo $this->Action('userpages');
}
elseif ($_GET['action'] == 'changes')
{
echo $this->Action('userchanges');
}
elseif ($_GET['action'] == 'comments')
{
echo $this->Action('usercomments');
}
else
{
// process URL variables
# JW 2005-07-19 some modifications to avoid notices but these are still not actually secure
// number of records per page
if (isset($_POST['l']))
$l = $_POST['l'];
elseif (isset($_GET['l']))
$l = $_GET['l'];
else
$l = DEFAULT_RECORDS_LIMIT;
// sort field
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : DEFAULT_SORT_FIELD;
// sort order
$d = (isset($_GET['d'])) ? $_GET['d'] : DEFAULT_SORT_ORDER;
// start record
$s = (isset($_GET['s'])) ? $_GET['s'] : DEFAULT_START;
// search string
if (isset($_POST['q']))
$q = $_POST['q'];
elseif (isset($_GET['q']))
$q = $_GET['q'];
else
$q = DEFAULT_SEARCH;
// select all
$checked = '';
if (isset($_GET['selectall']))
{
$checked = (1 == $_GET['selectall']) ? ' checked="checked"' : '';
}
// restrict MySQL query by search string
$where = ('' == $q) ? "1" : "`name` LIKE '%".$q."%'";
// get total number of users
$numusers = $this->getCount('users', $where);
// print page header
echo $this->Format('==== '.PAGE_TITLE.' ==== --- ');
// build pager form
$form = $this->FormOpen('','','post','user_admin_panel');
$form .= '<fieldset><legend>'.FORM_LEGEND.'</legend>'."\n";
$form .= '<label for="q">'.FORM_SEARCH_STRING_LABEL.'</label> <input type ="text" id="q" name="q" title="'.FORM_SEARCH_STRING_TITLE.'" size="20" maxlength="50" value="'.$q.'"/> <input type="submit" value="'.FORM_SEARCH_SUBMIT.'" /><br />'."\n";
// ranged drop-down
$users_opts = optionRanges($user_limits,$numusers,DEFAULT_MIN_RECORDS_DISPLAY);
$form .= '<label for="l">'.FORM_PAGER_LABEL_BEFORE.'</label> '."\n";
$form .= '<select name="l" id="l" title="'.FORM_PAGER_TITLE.'">'."\n";
// build drop-down
foreach ($users_opts as $opt) {
$selected = ($opt == $l) ? ' selected="selected"' : '';
$form .= '<option value="'.$opt.'"'.$selected.'>'.$opt.'</option>'."\n";
}
$form .= '</select> <label for="l">'.FORM_PAGER_LABEL_AFTER.'</label> <input type="submit" value="'.FORM_PAGER_SUBMIT.'" /><br />'."\n";
// build pager links
if ($s > 0)
$prev = '<a href="' .$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s-$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s-$l+1), $s).'">'.($s-$l+1).'-'.$s.'</a> | '."\n";
if ($numusers > ($s + $l))
$next = ' | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s+$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s+$l+1), ($s+2*$l)).'">'.($s+$l+1).'-'.($s+2*$l).'</a>'."\n";
$form .= FORM_RESULT_INFO.' ('.$numusers.'): '.$prev.($s+1).'-'.($s+$l).$next.'<br />'."\n";
$form .= '('.FORM_RESULT_SORTED_BY.'<em>'.$sort.', '.$d.'</em>)'."\n";
$form .= '</fieldset>'.$this->FormClose()."\n";
// print form
echo $form;
// get user list
$userdata = $this->LoadAll("SELECT * FROM ".$this->config["table_prefix"]."users WHERE ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// build header links
$nameheader = '<a href="'.$this->Href('','', (($sort == 'name' && $d == 'asc')? 'l='.$l.'&sort=name&d=desc' : 'l='.$l.'&sort=name&d=asc')).'" title="'.TABLE_HEADING_USERNAME_TITLE.'">'.TABLE_HEADING_USERNAME.'</a>';
$emailheader = '<a href="'.$this->Href('','', (($sort == 'email' && $d == 'asc')? 'l='.$l.'&sort=email&d=desc' : 'l='.$l.'&sort=email&d=asc')).'" title="'.TABLE_HEADING_EMAIL_TITLE.'">'.TABLE_HEADING_EMAIL.'</a>';
$timeheader = '<a href="'.$this->Href('','', (($sort == 'signuptime' && $d == 'desc')? 'l='.$l.'&sort=signuptime&d=asc' : 'l='.$l.'')).'" title="'.TABLE_HEADING_SIGNUPTIME_TITLE.'">'.TABLE_HEADING_SIGNUPTIME.'</a>';
/*$ipheader = '<a href="'.$this->Href('','', (($sort == 'ipaddress' && $d == 'desc')? 'l='.$l.'&sort=ipaddress&d=asc' : 'l='.$l.'&sort=ipaddress&d=desc')).'" title="'.TABLE_HEADING_SIGNUPIP_TITLE.'">'.TABLE_HEADING_SIGNUPIP.'</a>'; # installed as beta feature at wikka.jsnx.com */
// build table headers
$htmlout = "<table summary=\"".TABLE_SUMMARY."\" border=\"1px\" id=\"admin_table\">\n<thead>\n".
" <tr>\n".
" <th> </th>\n".
" <th>".$nameheader."</th>\n".
" <th>".$emailheader."</th>\n".
" <th>".$timeheader."</th>\n".
/* " <th>".$ipheader."</th>\n". # installed as beta feature at wikka.jsnx.com */
" <th class=\"number ".(($c_color == 1)? ' c1' : '')."\" title=\"".TABLE_HEADING_OWNED_TITLE."\">;<img src=\"".OWNED_ICON."\" alt=\"O\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c2' : '')."\" title=\"".TABLE_HEADING_EDITS_TITLE."\"><img src=\"".EDITS_ICON."\" alt=\"E\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c3' : '')."\" title=\"".TABLE_HEADING_COMMENTS_TITLE."\"><img src=\"".COMMENTS_ICON."\" alt=\"C\"/></th>\n".
" <th class=\"center\">Actions</th>\n".
" </tr>\n</thead>\n";
// print user table
foreach($userdata as $user) {
// get counts
$where_owned = "`owner` = '".$user['name']."' AND latest = 'Y'";
$where_changes = "`user` = '".$user['name']."'";
$where_comments = "`user` = '".$user['name']."'";
$numowned = $this->getCount('pages', $where_owned);
$numchanges = $this->getCount('pages', $where_changes);
$numcomments = $this->getCount('comments', $where_comments);
// build statistics links if needed
$ownedlink = ($numowned > 0)? '<a title="'.sprintf(TABLE_CELL_OWNED_TITLE,$user['name'],$numowned).'" href="'.$this->Href('','','user='.$user['name'].'&action=owned').'">'.$numowned.'</a>' : '0';
$changeslink = ($numchanges > 0)? '<a title="'.sprintf(TABLE_CELL_EDITS_TITLE,$user['name'],$numchanges).'" href="'.$this->Href('','','user='.$user['name'].'&action=changes').'">'.$numchanges.'</a>' : '0';
$commentslink = ($numcomments > 0)? '<a title="'.sprintf(TABLE_CELL_COMMENTS_TITLE,$user['name'],$numcomments).'" href="'.$this->Href('','','user='.$user['name'].'&action=comments').'">'.$numcomments.'</a>' : '0';
// build handler links
$deleteuser = '<a title="'.sprintf(ACTION_DELETE_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=delete').'">'.ACTION_DELETE_LINK.'</a>';
$feedbackuser = '<a title="'.sprintf(ACTION_FEEDBACK_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=feedback').'">'.ACTION_FEEDBACK_LINK.'</a>';
// build table body
$htmlout .= "<tbody>\n";
if ($r_color == 1) {
$htmlout .= "<tr ".(($r%2)? '' : 'class="alt"').">\n"; #enable alternate row color
} else {
$htmlout .= "<tr>\n"; #disable alternate row color
}
$htmlout .= " <td><input type=\"checkbox\" id=\"".$user['id']."\"".$checked." title=\"".sprintf(SELECT_RECORD_TITLE,$user['name'])."\"/></td>\n".
" <td>".(($this->ExistsPage($user['name']))? $this->Link($user['name']) : $user['name'])."</td>\n". #check if userpage exists
" <td>".$user['email']."</td>\n".
" <td class=\"time\">".$user['signuptime']."</td>\n".
/* " <td>".$user['ipaddress']."</td>\n". # installed as beta feature at wikka.jsnx.com */
" <td class=\"number".(($c_color == 1)? ' c1' : '')."\">".$ownedlink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c2' : '')."\">".$changeslink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c3' : '')."\">".$commentslink."</td>\n". #set column color
" <td class=\"center\">".$deleteuser." :: ".$feedbackuser."</td>\n";
$htmlout .= " </tr>\n</tbody>\n";
//increase row counter ----- alternate row colors
if ($r_color == 1) $r++;
}
$htmlout .= "</table>\n";
// print the table
echo $this->FormOpen('','','get');
echo $htmlout;
// multiple-user operations (forthcoming) JW 2005-07-19 accesskey removed (causes more problems than it solves)
echo '<fieldset><legend>'.FORM_MASSACTION_LEGEND.'</legend>';
echo '[<a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=1').'" title="'.CHECK_ALL_TITLE.'">'.CHECK_ALL.'</a> | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=0').'" title="'.UNCHECK_ALL_TITLE.'">'.UNCHECK_ALL.'</a>]<br />';
echo '<label for="action" >'.FORM_MASSACTION_LABEL.'</label> <select title="'.FORM_MASSACTION_SELECT_TITLE.'" id="action" name="action">';
echo '<option value="" selected="selected">---</option>';
echo '<option value="massdelete">'.FORM_MASSACTION_OPT_DELETE.'</option>';
echo '<option value="massfeedback">'.FORM_MASSACTION_OPT_FEEDBACK.'</option>';
echo '</select> <input type="submit" value="'.FORM_MASSACTION_SUBMIT.'" />';
echo '</fieldset>';
echo $this->FormClose();
}
else
{
// no records matching the search string: print error message
echo '<p><span class="error">'.sprintf(ERROR_NO_MATCHES, $q).'</span></p>';
}
}
} else {
// user is not admin
echo $this->Action('lastusers');
}
?>
%%
===New CSS classes===
The styling of the tables requires a bunch of [[TableStyling new CSS classes]].
----
==== Styling options ====
The ##useradmin## action accepts two optional styling parameters:
##colcolor##
Enables color for statistics columns
1: enables colored columns (default);
0: disables colored columns;
##rowcolor##
Enables alternate row colors
1: enables colored rows (default);
0: disables colored rows;
The following examples show how the table is rendered using these two parameters:
**No styling:** ##""{{useradmin colcolor="0" rowcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows only:** ##""{{useradmin colcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Colored columns only:** ##""{{useradmin rowcolor="0"}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows and colored columns:** ##""{{useradmin}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
----
CategoryDevelopmentActions CategoryDevelopmentAdmin
Deletions:
~~~
Additions:
[[http://people.msoe.edu/~millerni/forums.php?show=topic&id=114&forum=13 online meridia]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=157&forum=13 free wwe ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=128&forum=13 phentermine online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=158&forum=13 xanax online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=106&forum=13 hydrocodone online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=160&forum=13 zanaflex online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=102&forum=13 free free ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=97&forum=13 buy didrex]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=135&forum=13 free real ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=100&forum=13 buy fioricet]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=96&forum=13 diazepam online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=136&forum=13 cheap rivotril]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=87&forum=13 ativan online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=144&forum=13 free sonyericsson ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=137&forum=13 free sagem ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=152&forum=13 free verizon ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=139&forum=13 sharp ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=125&forum=13 ortho online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=156&forum=13 wellbutrin online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=151&forum=13 valium]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=121&forum=13 nexium online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=147&forum=13 free tracfone ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=142&forum=13 sony ericsson ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=94&forum=13 free cool ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=161&forum=13 but zoloft]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=117&forum=13 motorola ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=133&forum=13 free qwest ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=138&forum=13 samsung ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=122&forum=13 nextel ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=89&forum=13 cheap celexa]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=99&forum=13 free ericsson ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=115&forum=13 free midi ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=146&forum=13 cheap tenuate]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=109&forum=13 levitra online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=82&forum=13 adipex online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=132&forum=13 punk ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=130&forum=13 propecia online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=83&forum=13 albuterol online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=85&forum=13 alprazolam online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=153&forum=13 viagra online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=148&forum=13 cheap tramadol]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=143&forum=13 sony ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=86&forum=13 ambien online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=103&forum=13 funny ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=104&forum=13 hgh online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=129&forum=13 free polyphonic ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=90&forum=13 cialis online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=123&forum=13 free nokia ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=101&forum=13 but flexeril]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=124&forum=13 norco]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=149&forum=13 cheap ultracet]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=88&forum=13 carisoprodol online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=108&forum=13 free kyocera ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=93&forum=13 cheap clonazepam]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=127&forum=13 pharmacy online online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=95&forum=13 cheap cyclobenzaprine]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=150&forum=13 cheap ultram]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=111&forum=13 cheap lisinopril]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=159&forum=13 cheap xenical]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=162&forum=13 zyban online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=116&forum=13 free mono ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=112&forum=13 buy lorazepam]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=145&forum=13 sprint ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=110&forum=13 cheap lipitor]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=131&forum=13 prozac online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=120&forum=13 free music ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=105&forum=13 cheap hoodia]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=155&forum=13 vigrx online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=98&forum=13 diethylpropion online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=113&forum=13 but lortab]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=154&forum=13 vicodin online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=119&forum=13 mtv ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=84&forum=13 free alltel ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=141&forum=13 soma online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=107&forum=13 jazz ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=140&forum=13 sildenafil online]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=126&forum=13 cheap paxil]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=118&forum=13 mp3 ringtones]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=92&forum=13 cheap clomid]] [[http://people.msoe.edu/~millerni/forums.php?show=topic&id=91&forum=13 cingular ringtones]] ===== User Administration Module =====
~~~
~~~
Deletions:
~~~& noted, good idea -- DarTar
~~~~& See DanWestUserReg. Worked for me as intended. I'd say, this function's done --MasinAlDujaili, 2007-05-21
~~-**send user feedback** ''-- done'';
~~-**rename users**
~~~&//If anyone is interested, running through the seven tables and updating every instance of your old wiki name to your new wiki name will effectively change your name throughout the wiki.// copied from comment on the homepage. --NilsLindenberg
~~-manage **user privileges** (forthcoming);
~-Display user's **owned pages** ''-- done'';
~-Display user's **comments** ''-- done''.
~-Display user's **changes** ''-- done'';
~-//other...//
The code below must be saved as ##actions/useradmin.php## and can be used by adding ##""{{useradmin}}""## in the body of a page.
Here's a preview of the interface (the email and IP fields are masked for privacy reasons)
----
==sample output==
""
<h3 id="hn_User_Administration"> User Administration </h3>
<br />
<form action="#" method="post" id="form_user_admin_panel">
<fieldset><legend>Filter view:</legend>
<label for="q">Search user:</label> <input type ="text" id="q" name="q" title="Enter a search string" size="20" maxlength="50" value=" "/> <input type="submit" value="Submit" /><br />
<label for="l">Show</label>
<select name="l" id="l" title="Select records-per-page limit">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
<option value="300">300</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="857">857</option>
</select> <label for="l">records per page</label> <input type="submit" value="Apply" /><br />
Records (857): 1-10 | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=10&q=" title="Show records from 11 to 20">11-20</a>
<br />
(Sorted by:<em>signuptime, desc</em>)
</fieldset></form>
<form action="http://wikka.jsnx.com/UserAdminTest" id="form_b5eda0a745">
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select RobinW"/></td>
<td>RobinW</td>
<td>[email protected]</td>
<td class="time">2005-07-30 02:06:20</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3"><a title="Display comments by RobinW (1)" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=comments">1</a></td>
<td class="center"><a title="Remove user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=delete">delete</a> :: <a title="Send feedback to user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select VictorManuelVarela"/></td>
<td><a href="http://wikka.jsnx.com/VictorManuelVarela" title=" ">VictorManuelVarela</a></td>
<td>[email protected]</td>
<td class="time">2005-07-30 00:01:13</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by VictorManuelVarela (1)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by VictorManuelVarela (6)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=changes">6</a></td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=delete">delete</a> :: <a title="Send feedback to user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select EniBevoli"/></td>
<td>EniBevoli</td>
<td>[email protected]</td>
<td class="time">2005-07-29 12:13:44</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2"><a title="Display page edits by EniBevoli (4)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=changes">4</a></td>
<td class="number c3"><a title="Display comments by EniBevoli (1)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=comments">1</a></td>
<td class="center"><a title="Remove user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=delete">delete</a> :: <a title="Send feedback to user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select MyPrivateWiki"/></td>
<td>MyPrivateWiki</td>
<td>[email protected]</td>
<td class="time">2005-07-28 20:30:36</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=delete">delete</a> :: <a title="Send feedback to user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select DaSt"/></td>
<td>DaSt</td>
<td>[email protected]</td>
<td class="time">2005-07-27 17:32:06</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=delete">delete</a> :: <a title="Send feedback to user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select WikiSop"/></td>
<td>WikiSop</td>
<td>[email protected]</td>
<td class="time">2005-07-27 14:59:07</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=delete">delete</a> :: <a title="Send feedback to user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select Aragorn2005"/></td>
<td>Aragorn2005</td>
<td>[email protected]</td>
<td class="time">2005-07-27 08:48:46</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=delete">delete</a> :: <a title="Send feedback to user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
<fieldset><legend>Mass-action</legend>[<a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=1" title="Check all records">Check all</a> | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=0" title="Uncheck all records">Uncheck all</a>]<br /><label for="action" >With selected</label> <select title="Choose action to apply to selected records" id="action" name="action"><option value=" " selected="selected">---</option><option value="massdelete">Remove all</option><option value="massfeedback">Send feedback to all</option></select> <input type="submit" value="Submit" /></fieldset></form>
""
----
===Current version=== (//2005-08-31//):
##0.5##
~-users can be sorted by different fields (click on table header to reverse sort order), searched and paged;
~-if the current user is not an administrator, then the ##lastuser.php## action is displayed
~-feedback can be sent to single users.
~-displays pages owned by each user.
~-displays pages changed by each user.
~-displays pages commented by each user.
~-added extra column for Signup IP ( installed on this server as a beta feature).
~~-TrackIPaddressMod for (possible) install on 'your' server
~-added constants, UI strings and a bunch of configurable options including styling options (see below).
==Files needed== (//2004-09-16//):
~-##actions/useradmin.php##: see code on this page;
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (enhanced version of FeedbackAction); ''2005-04-18 - action parameter support added''
~-##[[UserPagesAction actions/userpages.php]]## (enhanced version of ##mypages.php##);''2005-04-18 - action parameter support added''
~-##[[UserChangesAction actions/userchanges.php]]## (enhanced version of ##mychanges.php##); ''2005-04-18 - action parameter support added''
~-##[[UserCommentsAction actions/usercomments.php]]## (new action); ''2004-11-23 - ""RewriteRules"" bug fixed''
===To do ===
~-mass-operations;
~-deleting/banning users;
~-integrate with other admin modules.
----
====The code====
<<##actions/useradmin.php##<<
**Note:** this action uses the ##ipaddress## field that has been added as a beta antispam feature to this server. Lines relative to this field have been commented out in the code to allow installation on a native wikka package
The code has also been adapted to take advantage of the ##[[WikkaCountingRecords getCount()]]## method, which is required for the action to work.
%%(php;1)
<?php
/**
* Display a module for user management.
*
* This action allows admins to display information on registered users.
* Users can be searched, paged, filtered. User-related statistics are given,
* showing the number of commented, created and modified pages. A feedback
* handler allows admins to send an email to single users. If the current user
* is not an administrator, then the lastuser action is displayed instead.
*
* @package Actions
* @name Useradmin
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.5
* @since Wikka 1.1.X.X
*
* @input integer $colcolor optional: enables color for statistics columns
* 1: enables colored columns;
* 0: disables colored columns;
* default: 1;
* @input integer $rowcolor optional: enables alternate row colors
* 1: enables colored rows;
* 0: disables colored rows;
* default: 1;
*
* @output A list of users registered on the current server.
*
* @todo
* - mass-operations;
* - deleting/banning users;
* - integrate with other admin modules.
*/
//utilities
/**
* Build an array of numbers consisting of 'ranges' with increasing step size in each 'range'.
*
* A list of numbers like this is useful for instance for a dropdown to choose
* a period expressed in number of days: a difference between 2 and 5 days may
* be significant while that between 92 and 95 may not be.
*
* @author {@link http://wikka.jsnx.com/JavaWoman JavaWoman}
* @copyright Copyright (c) 2005, Marjolein Katsma
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @version 1.0
*
* @param mixed $limits required: single integer or array of integers;
* defines the upper limits of the ranges as well as the next step size
* @param int $max required: upper limit for the whole list
* (will be included if smaller than the largest limit)
* @param int $firstinc optional: increment for the first range; default 1
* @return array resulting list of numbers
*/
// utilities
function optionRanges($limits, $max, $firstinc = 1)
{
// initializations
if (is_int($limits)) $limits = array($limits);
if ($firstinc < 1) $firstinc = 1;
$opts = array();
$inc = $firstinc;
// first element is the first increment
$opts[] = $inc;
// each $limit is the upper limit of a 'range'
foreach ($limits as $limit)
{
for ($i = $inc + $inc; $i <= $limit && $i < $max; $i += $inc)
{
$opts[] = $i;
}
// we quit at $max, even if there are more $limit elements
if ($limit >= $max)
{
// add $max to the list; then break out of the loop
$opts[] = $max;
break;
}
// when $limit is reached, it becomes the new start and increment for the next 'range'
$inc = $limit;
}
return $opts;
}
// restrict access to admins
if ($this->IsAdmin($this->GetUser())) {
// -------------------------------------
// set default values as constants
define('DEFAULT_RECORDS_LIMIT', '10'); # number of records per page
define('DEFAULT_MIN_RECORDS_DISPLAY', '5'); # min number of records
define('DEFAULT_RECORDS_RANGE',serialize(array('10','50','100','500','1000'))); #range array for records pager
define('DEFAULT_SORT_FIELD', 'signuptime'); # sort field
define('DEFAULT_SORT_ORDER', 'desc'); # sort order, ascendant or descendant
define('DEFAULT_START', '0'); # start record
define('DEFAULT_SEARCH', ''); # keyword to restrict search
define('ALTERNATE_ROW_COLOR', '1'); # switch alternate row color
define('STAT_COLUMN_COLOR', '1'); # switch color for statistics columns
// -------------------------------------
// User-interface: icons
define('OWNED_ICON', 'images/icons/16x16/stock_keyring.png');
define('EDITS_ICON', 'images/icons/16x16/text-editor.png');
define('COMMENTS_ICON', 'images/icons/16x16/stock_help-agent.png');
// -------------------------------------
// User-interface: strings
define('PAGE_TITLE','User Administration');
define('FORM_LEGEND','Filter view:');
define('FORM_SEARCH_STRING_LABEL','Search user:');
define('FORM_SEARCH_STRING_TITLE','Enter a search string');
define('FORM_SEARCH_SUBMIT','Submit');
define('FORM_PAGER_LABEL_BEFORE','Show');
define('FORM_PAGER_TITLE','Select records-per-page limit');
define('FORM_PAGER_LABEL_AFTER','records per page');
define('FORM_PAGER_SUBMIT','Apply');
define('FORM_PAGER_LINK','Show records from %d to %d');
define('FORM_RESULT_INFO','Records');
define('FORM_RESULT_SORTED_BY','Sorted by:');
define('TABLE_HEADING_USERNAME','User Name');
define('TABLE_HEADING_USERNAME_TITLE','Sort by user name');
define('TABLE_HEADING_EMAIL','Email');
define('TABLE_HEADING_EMAIL_TITLE','Sort by email');
define('TABLE_HEADING_SIGNUPTIME','Signup Time');
define('TABLE_HEADING_SIGNUPTIME_TITLE','Sort by signup time');
define('TABLE_HEADING_SIGNUPIP','Signup IP');
define('TABLE_HEADING_SIGNUPIP_TITLE','Sort by signup IP');
define('TABLE_SUMMARY','List of users registered on this server');
define('TABLE_HEADING_OWNED_TITLE','Owned Pages');
define('TABLE_HEADING_EDITS_TITLE','Page Edits');
define('TABLE_HEADING_COMMENTS_TITLE','Comments');
define('ACTION_DELETE_LINK_TITLE','Remove user %s');
define('ACTION_FEEDBACK_LINK_TITLE','Send feedback to user %s');
define('ACTION_DELETE_LINK','delete');
define('ACTION_FEEDBACK_LINK','feedback');
define('TABLE_CELL_OWNED_TITLE','Display pages owned by %s (%d)');
define('TABLE_CELL_EDITS_TITLE','Display page edits by %s (%d)');
define('TABLE_CELL_COMMENTS_TITLE','Display comments by %s (%d)');
define('SELECT_RECORD_TITLE','Select %s');
define('CHECK_ALL_TITLE','Check all records');
define('CHECK_ALL','Check all');
define('UNCHECK_ALL_TITLE','Uncheck all records');
define('UNCHECK_ALL','Uncheck all');
define('FORM_MASSACTION_LEGEND','Mass-action');
define('FORM_MASSACTION_LABEL','With selected');
define('FORM_MASSACTION_SELECT_TITLE','Choose action to apply to selected records');
define('FORM_MASSACTION_OPT_DELETE','Remove all');
define('FORM_MASSACTION_OPT_FEEDBACK','Send feedback to all');
define('FORM_MASSACTION_SUBMIT','Submit');
define('ERROR_NO_MATCHES','Sorry, there are no users matching "%s"');
//initialize row & column colors variables
$r = 1; #initialize row counter
$r_color = ALTERNATE_ROW_COLOR; #get alternate row color option
$c_color = STAT_COLUMN_COLOR; #get column color option
// record dropdown
$user_limits = unserialize(DEFAULT_RECORDS_RANGE);
// pager
$prev = '';
$next = '';
//override defaults with action parameters
if (is_array($vars))
{
foreach ($vars as $param => $value)
{
switch ($param)
{
case 'colcolor':
$c_color = (preg_match('/[01]/',$value))? $value : STAT_COLUMN_COLOR;
break;
case 'rowcolor':
$r_color = (preg_match('/[01]/',$value))? $value : ALTERNATE_ROW_COLOR;
break;
}
}
}
//perform actions if required
if ($_GET['action'] == 'feedback' || $_REQUEST['mail'])
{
echo $this->Action('userfeedback');
}
elseif ($_GET['action'] == 'owned')
{
echo $this->Action('userpages');
}
elseif ($_GET['action'] == 'changes')
{
echo $this->Action('userchanges');
}
elseif ($_GET['action'] == 'comments')
{
echo $this->Action('usercomments');
}
else
{
// process URL variables
# JW 2005-07-19 some modifications to avoid notices but these are still not actually secure
// number of records per page
if (isset($_POST['l']))
$l = $_POST['l'];
elseif (isset($_GET['l']))
$l = $_GET['l'];
else
$l = DEFAULT_RECORDS_LIMIT;
// sort field
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : DEFAULT_SORT_FIELD;
// sort order
$d = (isset($_GET['d'])) ? $_GET['d'] : DEFAULT_SORT_ORDER;
// start record
$s = (isset($_GET['s'])) ? $_GET['s'] : DEFAULT_START;
// search string
if (isset($_POST['q']))
$q = $_POST['q'];
elseif (isset($_GET['q']))
$q = $_GET['q'];
else
$q = DEFAULT_SEARCH;
// select all
$checked = '';
if (isset($_GET['selectall']))
{
$checked = (1 == $_GET['selectall']) ? ' checked="checked"' : '';
}
// restrict MySQL query by search string
$where = ('' == $q) ? "1" : "`name` LIKE '%".$q."%'";
// get total number of users
$numusers = $this->getCount('users', $where);
// print page header
echo $this->Format('==== '.PAGE_TITLE.' ==== --- ');
// build pager form
$form = $this->FormOpen('','','post','user_admin_panel');
$form .= '<fieldset><legend>'.FORM_LEGEND.'</legend>'."\n";
$form .= '<label for="q">'.FORM_SEARCH_STRING_LABEL.'</label> <input type ="text" id="q" name="q" title="'.FORM_SEARCH_STRING_TITLE.'" size="20" maxlength="50" value="'.$q.'"/> <input type="submit" value="'.FORM_SEARCH_SUBMIT.'" /><br />'."\n";
// ranged drop-down
$users_opts = optionRanges($user_limits,$numusers,DEFAULT_MIN_RECORDS_DISPLAY);
$form .= '<label for="l">'.FORM_PAGER_LABEL_BEFORE.'</label> '."\n";
$form .= '<select name="l" id="l" title="'.FORM_PAGER_TITLE.'">'."\n";
// build drop-down
foreach ($users_opts as $opt) {
$selected = ($opt == $l) ? ' selected="selected"' : '';
$form .= '<option value="'.$opt.'"'.$selected.'>'.$opt.'</option>'."\n";
}
$form .= '</select> <label for="l">'.FORM_PAGER_LABEL_AFTER.'</label> <input type="submit" value="'.FORM_PAGER_SUBMIT.'" /><br />'."\n";
// build pager links
if ($s > 0)
$prev = '<a href="' .$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s-$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s-$l+1), $s).'">'.($s-$l+1).'-'.$s.'</a> | '."\n";
if ($numusers > ($s + $l))
$next = ' | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s+$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s+$l+1), ($s+2*$l)).'">'.($s+$l+1).'-'.($s+2*$l).'</a>'."\n";
$form .= FORM_RESULT_INFO.' ('.$numusers.'): '.$prev.($s+1).'-'.($s+$l).$next.'<br />'."\n";
$form .= '('.FORM_RESULT_SORTED_BY.'<em>'.$sort.', '.$d.'</em>)'."\n";
$form .= '</fieldset>'.$this->FormClose()."\n";
// print form
echo $form;
// get user list
$userdata = $this->LoadAll("SELECT * FROM ".$this->config["table_prefix"]."users WHERE ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// build header links
$nameheader = '<a href="'.$this->Href('','', (($sort == 'name' && $d == 'asc')? 'l='.$l.'&sort=name&d=desc' : 'l='.$l.'&sort=name&d=asc')).'" title="'.TABLE_HEADING_USERNAME_TITLE.'">'.TABLE_HEADING_USERNAME.'</a>';
$emailheader = '<a href="'.$this->Href('','', (($sort == 'email' && $d == 'asc')? 'l='.$l.'&sort=email&d=desc' : 'l='.$l.'&sort=email&d=asc')).'" title="'.TABLE_HEADING_EMAIL_TITLE.'">'.TABLE_HEADING_EMAIL.'</a>';
$timeheader = '<a href="'.$this->Href('','', (($sort == 'signuptime' && $d == 'desc')? 'l='.$l.'&sort=signuptime&d=asc' : 'l='.$l.'')).'" title="'.TABLE_HEADING_SIGNUPTIME_TITLE.'">'.TABLE_HEADING_SIGNUPTIME.'</a>';
/*$ipheader = '<a href="'.$this->Href('','', (($sort == 'ipaddress' && $d == 'desc')? 'l='.$l.'&sort=ipaddress&d=asc' : 'l='.$l.'&sort=ipaddress&d=desc')).'" title="'.TABLE_HEADING_SIGNUPIP_TITLE.'">'.TABLE_HEADING_SIGNUPIP.'</a>'; # installed as beta feature at wikka.jsnx.com */
// build table headers
$htmlout = "<table summary=\"".TABLE_SUMMARY."\" border=\"1px\" id=\"admin_table\">\n<thead>\n".
" <tr>\n".
" <th> </th>\n".
" <th>".$nameheader."</th>\n".
" <th>".$emailheader."</th>\n".
" <th>".$timeheader."</th>\n".
/* " <th>".$ipheader."</th>\n". # installed as beta feature at wikka.jsnx.com */
" <th class=\"number ".(($c_color == 1)? ' c1' : '')."\" title=\"".TABLE_HEADING_OWNED_TITLE."\">;<img src=\"".OWNED_ICON."\" alt=\"O\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c2' : '')."\" title=\"".TABLE_HEADING_EDITS_TITLE."\"><img src=\"".EDITS_ICON."\" alt=\"E\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c3' : '')."\" title=\"".TABLE_HEADING_COMMENTS_TITLE."\"><img src=\"".COMMENTS_ICON."\" alt=\"C\"/></th>\n".
" <th class=\"center\">Actions</th>\n".
" </tr>\n</thead>\n";
// print user table
foreach($userdata as $user) {
// get counts
$where_owned = "`owner` = '".$user['name']."' AND latest = 'Y'";
$where_changes = "`user` = '".$user['name']."'";
$where_comments = "`user` = '".$user['name']."'";
$numowned = $this->getCount('pages', $where_owned);
$numchanges = $this->getCount('pages', $where_changes);
$numcomments = $this->getCount('comments', $where_comments);
// build statistics links if needed
$ownedlink = ($numowned > 0)? '<a title="'.sprintf(TABLE_CELL_OWNED_TITLE,$user['name'],$numowned).'" href="'.$this->Href('','','user='.$user['name'].'&action=owned').'">'.$numowned.'</a>' : '0';
$changeslink = ($numchanges > 0)? '<a title="'.sprintf(TABLE_CELL_EDITS_TITLE,$user['name'],$numchanges).'" href="'.$this->Href('','','user='.$user['name'].'&action=changes').'">'.$numchanges.'</a>' : '0';
$commentslink = ($numcomments > 0)? '<a title="'.sprintf(TABLE_CELL_COMMENTS_TITLE,$user['name'],$numcomments).'" href="'.$this->Href('','','user='.$user['name'].'&action=comments').'">'.$numcomments.'</a>' : '0';
// build handler links
$deleteuser = '<a title="'.sprintf(ACTION_DELETE_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=delete').'">'.ACTION_DELETE_LINK.'</a>';
$feedbackuser = '<a title="'.sprintf(ACTION_FEEDBACK_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=feedback').'">'.ACTION_FEEDBACK_LINK.'</a>';
// build table body
$htmlout .= "<tbody>\n";
if ($r_color == 1) {
$htmlout .= "<tr ".(($r%2)? '' : 'class="alt"').">\n"; #enable alternate row color
} else {
$htmlout .= "<tr>\n"; #disable alternate row color
}
$htmlout .= " <td><input type=\"checkbox\" id=\"".$user['id']."\"".$checked." title=\"".sprintf(SELECT_RECORD_TITLE,$user['name'])."\"/></td>\n".
" <td>".(($this->ExistsPage($user['name']))? $this->Link($user['name']) : $user['name'])."</td>\n". #check if userpage exists
" <td>".$user['email']."</td>\n".
" <td class=\"time\">".$user['signuptime']."</td>\n".
/* " <td>".$user['ipaddress']."</td>\n". # installed as beta feature at wikka.jsnx.com */
" <td class=\"number".(($c_color == 1)? ' c1' : '')."\">".$ownedlink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c2' : '')."\">".$changeslink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c3' : '')."\">".$commentslink."</td>\n". #set column color
" <td class=\"center\">".$deleteuser." :: ".$feedbackuser."</td>\n";
$htmlout .= " </tr>\n</tbody>\n";
//increase row counter ----- alternate row colors
if ($r_color == 1) $r++;
}
$htmlout .= "</table>\n";
// print the table
echo $this->FormOpen('','','get');
echo $htmlout;
// multiple-user operations (forthcoming) JW 2005-07-19 accesskey removed (causes more problems than it solves)
echo '<fieldset><legend>'.FORM_MASSACTION_LEGEND.'</legend>';
echo '[<a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=1').'" title="'.CHECK_ALL_TITLE.'">'.CHECK_ALL.'</a> | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=0').'" title="'.UNCHECK_ALL_TITLE.'">'.UNCHECK_ALL.'</a>]<br />';
echo '<label for="action" >'.FORM_MASSACTION_LABEL.'</label> <select title="'.FORM_MASSACTION_SELECT_TITLE.'" id="action" name="action">';
echo '<option value="" selected="selected">---</option>';
echo '<option value="massdelete">'.FORM_MASSACTION_OPT_DELETE.'</option>';
echo '<option value="massfeedback">'.FORM_MASSACTION_OPT_FEEDBACK.'</option>';
echo '</select> <input type="submit" value="'.FORM_MASSACTION_SUBMIT.'" />';
echo '</fieldset>';
echo $this->FormClose();
}
else
{
// no records matching the search string: print error message
echo '<p><span class="error">'.sprintf(ERROR_NO_MATCHES, $q).'</span></p>';
}
}
} else {
// user is not admin
echo $this->Action('lastusers');
}
?>
%%
===New CSS classes===
The styling of the tables requires a bunch of [[TableStyling new CSS classes]].
----
==== Styling options ====
The ##useradmin## action accepts two optional styling parameters:
##colcolor##
Enables color for statistics columns
1: enables colored columns (default);
0: disables colored columns;
##rowcolor##
Enables alternate row colors
1: enables colored rows (default);
0: disables colored rows;
The following examples show how the table is rendered using these two parameters:
**No styling:** ##""{{useradmin colcolor="0" rowcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows only:** ##""{{useradmin colcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Colored columns only:** ##""{{useradmin rowcolor="0"}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows and colored columns:** ##""{{useradmin}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
----
CategoryDevelopmentActions CategoryDevelopmentAdmin
Additions:
~~~& noted, good idea -- DarTar
~~~~& See DanWestUserReg. Worked for me as intended. I'd say, this function's done --MasinAlDujaili, 2007-05-21
~~-**send user feedback** ''-- done'';
~~-**rename users**
~~~&//If anyone is interested, running through the seven tables and updating every instance of your old wiki name to your new wiki name will effectively change your name throughout the wiki.// copied from comment on the homepage. --NilsLindenberg
~~-manage **user privileges** (forthcoming);
~-Display user's **owned pages** ''-- done'';
~-Display user's **comments** ''-- done''.
~-Display user's **changes** ''-- done'';
~-//other...//
The code below must be saved as ##actions/useradmin.php## and can be used by adding ##""{{useradmin}}""## in the body of a page.
Here's a preview of the interface (the email and IP fields are masked for privacy reasons)
----
==sample output==
""
<h3 id="hn_User_Administration"> User Administration </h3>
<br />
<form action="#" method="post" id="form_user_admin_panel">
<fieldset><legend>Filter view:</legend>
<label for="q">Search user:</label> <input type ="text" id="q" name="q" title="Enter a search string" size="20" maxlength="50" value=" "/> <input type="submit" value="Submit" /><br />
<label for="l">Show</label>
<select name="l" id="l" title="Select records-per-page limit">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
<option value="300">300</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="857">857</option>
</select> <label for="l">records per page</label> <input type="submit" value="Apply" /><br />
Records (857): 1-10 | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=10&q=" title="Show records from 11 to 20">11-20</a>
<br />
(Sorted by:<em>signuptime, desc</em>)
</fieldset></form>
<form action="http://wikka.jsnx.com/UserAdminTest" id="form_b5eda0a745">
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select RobinW"/></td>
<td>RobinW</td>
<td>[email protected]</td>
<td class="time">2005-07-30 02:06:20</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3"><a title="Display comments by RobinW (1)" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=comments">1</a></td>
<td class="center"><a title="Remove user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=delete">delete</a> :: <a title="Send feedback to user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select VictorManuelVarela"/></td>
<td><a href="http://wikka.jsnx.com/VictorManuelVarela" title=" ">VictorManuelVarela</a></td>
<td>[email protected]</td>
<td class="time">2005-07-30 00:01:13</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by VictorManuelVarela (1)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by VictorManuelVarela (6)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=changes">6</a></td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=delete">delete</a> :: <a title="Send feedback to user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select EniBevoli"/></td>
<td>EniBevoli</td>
<td>[email protected]</td>
<td class="time">2005-07-29 12:13:44</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2"><a title="Display page edits by EniBevoli (4)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=changes">4</a></td>
<td class="number c3"><a title="Display comments by EniBevoli (1)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=comments">1</a></td>
<td class="center"><a title="Remove user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=delete">delete</a> :: <a title="Send feedback to user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select MyPrivateWiki"/></td>
<td>MyPrivateWiki</td>
<td>[email protected]</td>
<td class="time">2005-07-28 20:30:36</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=delete">delete</a> :: <a title="Send feedback to user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select DaSt"/></td>
<td>DaSt</td>
<td>[email protected]</td>
<td class="time">2005-07-27 17:32:06</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=delete">delete</a> :: <a title="Send feedback to user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select WikiSop"/></td>
<td>WikiSop</td>
<td>[email protected]</td>
<td class="time">2005-07-27 14:59:07</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=delete">delete</a> :: <a title="Send feedback to user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select Aragorn2005"/></td>
<td>Aragorn2005</td>
<td>[email protected]</td>
<td class="time">2005-07-27 08:48:46</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=delete">delete</a> :: <a title="Send feedback to user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
<fieldset><legend>Mass-action</legend>[<a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=1" title="Check all records">Check all</a> | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=0" title="Uncheck all records">Uncheck all</a>]<br /><label for="action" >With selected</label> <select title="Choose action to apply to selected records" id="action" name="action"><option value=" " selected="selected">---</option><option value="massdelete">Remove all</option><option value="massfeedback">Send feedback to all</option></select> <input type="submit" value="Submit" /></fieldset></form>
""
----
===Current version=== (//2005-08-31//):
##0.5##
~-users can be sorted by different fields (click on table header to reverse sort order), searched and paged;
~-if the current user is not an administrator, then the ##lastuser.php## action is displayed
~-feedback can be sent to single users.
~-displays pages owned by each user.
~-displays pages changed by each user.
~-displays pages commented by each user.
~-added extra column for Signup IP ( installed on this server as a beta feature).
~~-TrackIPaddressMod for (possible) install on 'your' server
~-added constants, UI strings and a bunch of configurable options including styling options (see below).
==Files needed== (//2004-09-16//):
~-##actions/useradmin.php##: see code on this page;
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (enhanced version of FeedbackAction); ''2005-04-18 - action parameter support added''
~-##[[UserPagesAction actions/userpages.php]]## (enhanced version of ##mypages.php##);''2005-04-18 - action parameter support added''
~-##[[UserChangesAction actions/userchanges.php]]## (enhanced version of ##mychanges.php##); ''2005-04-18 - action parameter support added''
~-##[[UserCommentsAction actions/usercomments.php]]## (new action); ''2004-11-23 - ""RewriteRules"" bug fixed''
===To do ===
~-mass-operations;
~-deleting/banning users;
~-integrate with other admin modules.
----
====The code====
<<##actions/useradmin.php##<<
**Note:** this action uses the ##ipaddress## field that has been added as a beta antispam feature to this server. Lines relative to this field have been commented out in the code to allow installation on a native wikka package
The code has also been adapted to take advantage of the ##[[WikkaCountingRecords getCount()]]## method, which is required for the action to work.
%%(php;1)
<?php
/**
* Display a module for user management.
*
* This action allows admins to display information on registered users.
* Users can be searched, paged, filtered. User-related statistics are given,
* showing the number of commented, created and modified pages. A feedback
* handler allows admins to send an email to single users. If the current user
* is not an administrator, then the lastuser action is displayed instead.
*
* @package Actions
* @name Useradmin
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.5
* @since Wikka 1.1.X.X
*
* @input integer $colcolor optional: enables color for statistics columns
* 1: enables colored columns;
* 0: disables colored columns;
* default: 1;
* @input integer $rowcolor optional: enables alternate row colors
* 1: enables colored rows;
* 0: disables colored rows;
* default: 1;
*
* @output A list of users registered on the current server.
*
* @todo
* - mass-operations;
* - deleting/banning users;
* - integrate with other admin modules.
*/
//utilities
/**
* Build an array of numbers consisting of 'ranges' with increasing step size in each 'range'.
*
* A list of numbers like this is useful for instance for a dropdown to choose
* a period expressed in number of days: a difference between 2 and 5 days may
* be significant while that between 92 and 95 may not be.
*
* @author {@link http://wikka.jsnx.com/JavaWoman JavaWoman}
* @copyright Copyright (c) 2005, Marjolein Katsma
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @version 1.0
*
* @param mixed $limits required: single integer or array of integers;
* defines the upper limits of the ranges as well as the next step size
* @param int $max required: upper limit for the whole list
* (will be included if smaller than the largest limit)
* @param int $firstinc optional: increment for the first range; default 1
* @return array resulting list of numbers
*/
// utilities
function optionRanges($limits, $max, $firstinc = 1)
{
// initializations
if (is_int($limits)) $limits = array($limits);
if ($firstinc < 1) $firstinc = 1;
$opts = array();
$inc = $firstinc;
// first element is the first increment
$opts[] = $inc;
// each $limit is the upper limit of a 'range'
foreach ($limits as $limit)
{
for ($i = $inc + $inc; $i <= $limit && $i < $max; $i += $inc)
{
$opts[] = $i;
}
// we quit at $max, even if there are more $limit elements
if ($limit >= $max)
{
// add $max to the list; then break out of the loop
$opts[] = $max;
break;
}
// when $limit is reached, it becomes the new start and increment for the next 'range'
$inc = $limit;
}
return $opts;
}
// restrict access to admins
if ($this->IsAdmin($this->GetUser())) {
// -------------------------------------
// set default values as constants
define('DEFAULT_RECORDS_LIMIT', '10'); # number of records per page
define('DEFAULT_MIN_RECORDS_DISPLAY', '5'); # min number of records
define('DEFAULT_RECORDS_RANGE',serialize(array('10','50','100','500','1000'))); #range array for records pager
define('DEFAULT_SORT_FIELD', 'signuptime'); # sort field
define('DEFAULT_SORT_ORDER', 'desc'); # sort order, ascendant or descendant
define('DEFAULT_START', '0'); # start record
define('DEFAULT_SEARCH', ''); # keyword to restrict search
define('ALTERNATE_ROW_COLOR', '1'); # switch alternate row color
define('STAT_COLUMN_COLOR', '1'); # switch color for statistics columns
// -------------------------------------
// User-interface: icons
define('OWNED_ICON', 'images/icons/16x16/stock_keyring.png');
define('EDITS_ICON', 'images/icons/16x16/text-editor.png');
define('COMMENTS_ICON', 'images/icons/16x16/stock_help-agent.png');
// -------------------------------------
// User-interface: strings
define('PAGE_TITLE','User Administration');
define('FORM_LEGEND','Filter view:');
define('FORM_SEARCH_STRING_LABEL','Search user:');
define('FORM_SEARCH_STRING_TITLE','Enter a search string');
define('FORM_SEARCH_SUBMIT','Submit');
define('FORM_PAGER_LABEL_BEFORE','Show');
define('FORM_PAGER_TITLE','Select records-per-page limit');
define('FORM_PAGER_LABEL_AFTER','records per page');
define('FORM_PAGER_SUBMIT','Apply');
define('FORM_PAGER_LINK','Show records from %d to %d');
define('FORM_RESULT_INFO','Records');
define('FORM_RESULT_SORTED_BY','Sorted by:');
define('TABLE_HEADING_USERNAME','User Name');
define('TABLE_HEADING_USERNAME_TITLE','Sort by user name');
define('TABLE_HEADING_EMAIL','Email');
define('TABLE_HEADING_EMAIL_TITLE','Sort by email');
define('TABLE_HEADING_SIGNUPTIME','Signup Time');
define('TABLE_HEADING_SIGNUPTIME_TITLE','Sort by signup time');
define('TABLE_HEADING_SIGNUPIP','Signup IP');
define('TABLE_HEADING_SIGNUPIP_TITLE','Sort by signup IP');
define('TABLE_SUMMARY','List of users registered on this server');
define('TABLE_HEADING_OWNED_TITLE','Owned Pages');
define('TABLE_HEADING_EDITS_TITLE','Page Edits');
define('TABLE_HEADING_COMMENTS_TITLE','Comments');
define('ACTION_DELETE_LINK_TITLE','Remove user %s');
define('ACTION_FEEDBACK_LINK_TITLE','Send feedback to user %s');
define('ACTION_DELETE_LINK','delete');
define('ACTION_FEEDBACK_LINK','feedback');
define('TABLE_CELL_OWNED_TITLE','Display pages owned by %s (%d)');
define('TABLE_CELL_EDITS_TITLE','Display page edits by %s (%d)');
define('TABLE_CELL_COMMENTS_TITLE','Display comments by %s (%d)');
define('SELECT_RECORD_TITLE','Select %s');
define('CHECK_ALL_TITLE','Check all records');
define('CHECK_ALL','Check all');
define('UNCHECK_ALL_TITLE','Uncheck all records');
define('UNCHECK_ALL','Uncheck all');
define('FORM_MASSACTION_LEGEND','Mass-action');
define('FORM_MASSACTION_LABEL','With selected');
define('FORM_MASSACTION_SELECT_TITLE','Choose action to apply to selected records');
define('FORM_MASSACTION_OPT_DELETE','Remove all');
define('FORM_MASSACTION_OPT_FEEDBACK','Send feedback to all');
define('FORM_MASSACTION_SUBMIT','Submit');
define('ERROR_NO_MATCHES','Sorry, there are no users matching "%s"');
//initialize row & column colors variables
$r = 1; #initialize row counter
$r_color = ALTERNATE_ROW_COLOR; #get alternate row color option
$c_color = STAT_COLUMN_COLOR; #get column color option
// record dropdown
$user_limits = unserialize(DEFAULT_RECORDS_RANGE);
// pager
$prev = '';
$next = '';
//override defaults with action parameters
if (is_array($vars))
{
foreach ($vars as $param => $value)
{
switch ($param)
{
case 'colcolor':
$c_color = (preg_match('/[01]/',$value))? $value : STAT_COLUMN_COLOR;
break;
case 'rowcolor':
$r_color = (preg_match('/[01]/',$value))? $value : ALTERNATE_ROW_COLOR;
break;
}
}
}
//perform actions if required
if ($_GET['action'] == 'feedback' || $_REQUEST['mail'])
{
echo $this->Action('userfeedback');
}
elseif ($_GET['action'] == 'owned')
{
echo $this->Action('userpages');
}
elseif ($_GET['action'] == 'changes')
{
echo $this->Action('userchanges');
}
elseif ($_GET['action'] == 'comments')
{
echo $this->Action('usercomments');
}
else
{
// process URL variables
# JW 2005-07-19 some modifications to avoid notices but these are still not actually secure
// number of records per page
if (isset($_POST['l']))
$l = $_POST['l'];
elseif (isset($_GET['l']))
$l = $_GET['l'];
else
$l = DEFAULT_RECORDS_LIMIT;
// sort field
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : DEFAULT_SORT_FIELD;
// sort order
$d = (isset($_GET['d'])) ? $_GET['d'] : DEFAULT_SORT_ORDER;
// start record
$s = (isset($_GET['s'])) ? $_GET['s'] : DEFAULT_START;
// search string
if (isset($_POST['q']))
$q = $_POST['q'];
elseif (isset($_GET['q']))
$q = $_GET['q'];
else
$q = DEFAULT_SEARCH;
// select all
$checked = '';
if (isset($_GET['selectall']))
{
$checked = (1 == $_GET['selectall']) ? ' checked="checked"' : '';
}
// restrict MySQL query by search string
$where = ('' == $q) ? "1" : "`name` LIKE '%".$q."%'";
// get total number of users
$numusers = $this->getCount('users', $where);
// print page header
echo $this->Format('==== '.PAGE_TITLE.' ==== --- ');
// build pager form
$form = $this->FormOpen('','','post','user_admin_panel');
$form .= '<fieldset><legend>'.FORM_LEGEND.'</legend>'."\n";
$form .= '<label for="q">'.FORM_SEARCH_STRING_LABEL.'</label> <input type ="text" id="q" name="q" title="'.FORM_SEARCH_STRING_TITLE.'" size="20" maxlength="50" value="'.$q.'"/> <input type="submit" value="'.FORM_SEARCH_SUBMIT.'" /><br />'."\n";
// ranged drop-down
$users_opts = optionRanges($user_limits,$numusers,DEFAULT_MIN_RECORDS_DISPLAY);
$form .= '<label for="l">'.FORM_PAGER_LABEL_BEFORE.'</label> '."\n";
$form .= '<select name="l" id="l" title="'.FORM_PAGER_TITLE.'">'."\n";
// build drop-down
foreach ($users_opts as $opt) {
$selected = ($opt == $l) ? ' selected="selected"' : '';
$form .= '<option value="'.$opt.'"'.$selected.'>'.$opt.'</option>'."\n";
}
$form .= '</select> <label for="l">'.FORM_PAGER_LABEL_AFTER.'</label> <input type="submit" value="'.FORM_PAGER_SUBMIT.'" /><br />'."\n";
// build pager links
if ($s > 0)
$prev = '<a href="' .$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s-$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s-$l+1), $s).'">'.($s-$l+1).'-'.$s.'</a> | '."\n";
if ($numusers > ($s + $l))
$next = ' | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s+$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s+$l+1), ($s+2*$l)).'">'.($s+$l+1).'-'.($s+2*$l).'</a>'."\n";
$form .= FORM_RESULT_INFO.' ('.$numusers.'): '.$prev.($s+1).'-'.($s+$l).$next.'<br />'."\n";
$form .= '('.FORM_RESULT_SORTED_BY.'<em>'.$sort.', '.$d.'</em>)'."\n";
$form .= '</fieldset>'.$this->FormClose()."\n";
// print form
echo $form;
// get user list
$userdata = $this->LoadAll("SELECT * FROM ".$this->config["table_prefix"]."users WHERE ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// build header links
$nameheader = '<a href="'.$this->Href('','', (($sort == 'name' && $d == 'asc')? 'l='.$l.'&sort=name&d=desc' : 'l='.$l.'&sort=name&d=asc')).'" title="'.TABLE_HEADING_USERNAME_TITLE.'">'.TABLE_HEADING_USERNAME.'</a>';
$emailheader = '<a href="'.$this->Href('','', (($sort == 'email' && $d == 'asc')? 'l='.$l.'&sort=email&d=desc' : 'l='.$l.'&sort=email&d=asc')).'" title="'.TABLE_HEADING_EMAIL_TITLE.'">'.TABLE_HEADING_EMAIL.'</a>';
$timeheader = '<a href="'.$this->Href('','', (($sort == 'signuptime' && $d == 'desc')? 'l='.$l.'&sort=signuptime&d=asc' : 'l='.$l.'')).'" title="'.TABLE_HEADING_SIGNUPTIME_TITLE.'">'.TABLE_HEADING_SIGNUPTIME.'</a>';
/*$ipheader = '<a href="'.$this->Href('','', (($sort == 'ipaddress' && $d == 'desc')? 'l='.$l.'&sort=ipaddress&d=asc' : 'l='.$l.'&sort=ipaddress&d=desc')).'" title="'.TABLE_HEADING_SIGNUPIP_TITLE.'">'.TABLE_HEADING_SIGNUPIP.'</a>'; # installed as beta feature at wikka.jsnx.com */
// build table headers
$htmlout = "<table summary=\"".TABLE_SUMMARY."\" border=\"1px\" id=\"admin_table\">\n<thead>\n".
" <tr>\n".
" <th> </th>\n".
" <th>".$nameheader."</th>\n".
" <th>".$emailheader."</th>\n".
" <th>".$timeheader."</th>\n".
/* " <th>".$ipheader."</th>\n". # installed as beta feature at wikka.jsnx.com */
" <th class=\"number ".(($c_color == 1)? ' c1' : '')."\" title=\"".TABLE_HEADING_OWNED_TITLE."\">;<img src=\"".OWNED_ICON."\" alt=\"O\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c2' : '')."\" title=\"".TABLE_HEADING_EDITS_TITLE."\"><img src=\"".EDITS_ICON."\" alt=\"E\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c3' : '')."\" title=\"".TABLE_HEADING_COMMENTS_TITLE."\"><img src=\"".COMMENTS_ICON."\" alt=\"C\"/></th>\n".
" <th class=\"center\">Actions</th>\n".
" </tr>\n</thead>\n";
// print user table
foreach($userdata as $user) {
// get counts
$where_owned = "`owner` = '".$user['name']."' AND latest = 'Y'";
$where_changes = "`user` = '".$user['name']."'";
$where_comments = "`user` = '".$user['name']."'";
$numowned = $this->getCount('pages', $where_owned);
$numchanges = $this->getCount('pages', $where_changes);
$numcomments = $this->getCount('comments', $where_comments);
// build statistics links if needed
$ownedlink = ($numowned > 0)? '<a title="'.sprintf(TABLE_CELL_OWNED_TITLE,$user['name'],$numowned).'" href="'.$this->Href('','','user='.$user['name'].'&action=owned').'">'.$numowned.'</a>' : '0';
$changeslink = ($numchanges > 0)? '<a title="'.sprintf(TABLE_CELL_EDITS_TITLE,$user['name'],$numchanges).'" href="'.$this->Href('','','user='.$user['name'].'&action=changes').'">'.$numchanges.'</a>' : '0';
$commentslink = ($numcomments > 0)? '<a title="'.sprintf(TABLE_CELL_COMMENTS_TITLE,$user['name'],$numcomments).'" href="'.$this->Href('','','user='.$user['name'].'&action=comments').'">'.$numcomments.'</a>' : '0';
// build handler links
$deleteuser = '<a title="'.sprintf(ACTION_DELETE_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=delete').'">'.ACTION_DELETE_LINK.'</a>';
$feedbackuser = '<a title="'.sprintf(ACTION_FEEDBACK_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=feedback').'">'.ACTION_FEEDBACK_LINK.'</a>';
// build table body
$htmlout .= "<tbody>\n";
if ($r_color == 1) {
$htmlout .= "<tr ".(($r%2)? '' : 'class="alt"').">\n"; #enable alternate row color
} else {
$htmlout .= "<tr>\n"; #disable alternate row color
}
$htmlout .= " <td><input type=\"checkbox\" id=\"".$user['id']."\"".$checked." title=\"".sprintf(SELECT_RECORD_TITLE,$user['name'])."\"/></td>\n".
" <td>".(($this->ExistsPage($user['name']))? $this->Link($user['name']) : $user['name'])."</td>\n". #check if userpage exists
" <td>".$user['email']."</td>\n".
" <td class=\"time\">".$user['signuptime']."</td>\n".
/* " <td>".$user['ipaddress']."</td>\n". # installed as beta feature at wikka.jsnx.com */
" <td class=\"number".(($c_color == 1)? ' c1' : '')."\">".$ownedlink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c2' : '')."\">".$changeslink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c3' : '')."\">".$commentslink."</td>\n". #set column color
" <td class=\"center\">".$deleteuser." :: ".$feedbackuser."</td>\n";
$htmlout .= " </tr>\n</tbody>\n";
//increase row counter ----- alternate row colors
if ($r_color == 1) $r++;
}
$htmlout .= "</table>\n";
// print the table
echo $this->FormOpen('','','get');
echo $htmlout;
// multiple-user operations (forthcoming) JW 2005-07-19 accesskey removed (causes more problems than it solves)
echo '<fieldset><legend>'.FORM_MASSACTION_LEGEND.'</legend>';
echo '[<a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=1').'" title="'.CHECK_ALL_TITLE.'">'.CHECK_ALL.'</a> | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=0').'" title="'.UNCHECK_ALL_TITLE.'">'.UNCHECK_ALL.'</a>]<br />';
echo '<label for="action" >'.FORM_MASSACTION_LABEL.'</label> <select title="'.FORM_MASSACTION_SELECT_TITLE.'" id="action" name="action">';
echo '<option value="" selected="selected">---</option>';
echo '<option value="massdelete">'.FORM_MASSACTION_OPT_DELETE.'</option>';
echo '<option value="massfeedback">'.FORM_MASSACTION_OPT_FEEDBACK.'</option>';
echo '</select> <input type="submit" value="'.FORM_MASSACTION_SUBMIT.'" />';
echo '</fieldset>';
echo $this->FormClose();
}
else
{
// no records matching the search string: print error message
echo '<p><span class="error">'.sprintf(ERROR_NO_MATCHES, $q).'</span></p>';
}
}
} else {
// user is not admin
echo $this->Action('lastusers');
}
?>
%%
===New CSS classes===
The styling of the tables requires a bunch of [[TableStyling new CSS classes]].
----
==== Styling options ====
The ##useradmin## action accepts two optional styling parameters:
##colcolor##
Enables color for statistics columns
1: enables colored columns (default);
0: disables colored columns;
##rowcolor##
Enables alternate row colors
1: enables colored rows (default);
0: disables colored rows;
The following examples show how the table is rendered using these two parameters:
**No styling:** ##""{{useradmin colcolor="0" rowcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows only:** ##""{{useradmin colcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Colored columns only:** ##""{{useradmin rowcolor="0"}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows and colored columns:** ##""{{useradmin}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
----
CategoryDevelopmentActions CategoryDevelopmentAdmin
~~~~& See DanWestUserReg. Worked for me as intended. I'd say, this function's done --MasinAlDujaili, 2007-05-21
~~-**send user feedback** ''-- done'';
~~-**rename users**
~~~&//If anyone is interested, running through the seven tables and updating every instance of your old wiki name to your new wiki name will effectively change your name throughout the wiki.// copied from comment on the homepage. --NilsLindenberg
~~-manage **user privileges** (forthcoming);
~-Display user's **owned pages** ''-- done'';
~-Display user's **comments** ''-- done''.
~-Display user's **changes** ''-- done'';
~-//other...//
The code below must be saved as ##actions/useradmin.php## and can be used by adding ##""{{useradmin}}""## in the body of a page.
Here's a preview of the interface (the email and IP fields are masked for privacy reasons)
----
==sample output==
""
<h3 id="hn_User_Administration"> User Administration </h3>
<br />
<form action="#" method="post" id="form_user_admin_panel">
<fieldset><legend>Filter view:</legend>
<label for="q">Search user:</label> <input type ="text" id="q" name="q" title="Enter a search string" size="20" maxlength="50" value=" "/> <input type="submit" value="Submit" /><br />
<label for="l">Show</label>
<select name="l" id="l" title="Select records-per-page limit">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
<option value="300">300</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="857">857</option>
</select> <label for="l">records per page</label> <input type="submit" value="Apply" /><br />
Records (857): 1-10 | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=10&q=" title="Show records from 11 to 20">11-20</a>
<br />
(Sorted by:<em>signuptime, desc</em>)
</fieldset></form>
<form action="http://wikka.jsnx.com/UserAdminTest" id="form_b5eda0a745">
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select RobinW"/></td>
<td>RobinW</td>
<td>[email protected]</td>
<td class="time">2005-07-30 02:06:20</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3"><a title="Display comments by RobinW (1)" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=comments">1</a></td>
<td class="center"><a title="Remove user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=delete">delete</a> :: <a title="Send feedback to user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select VictorManuelVarela"/></td>
<td><a href="http://wikka.jsnx.com/VictorManuelVarela" title=" ">VictorManuelVarela</a></td>
<td>[email protected]</td>
<td class="time">2005-07-30 00:01:13</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by VictorManuelVarela (1)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by VictorManuelVarela (6)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=changes">6</a></td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=delete">delete</a> :: <a title="Send feedback to user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select EniBevoli"/></td>
<td>EniBevoli</td>
<td>[email protected]</td>
<td class="time">2005-07-29 12:13:44</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2"><a title="Display page edits by EniBevoli (4)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=changes">4</a></td>
<td class="number c3"><a title="Display comments by EniBevoli (1)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=comments">1</a></td>
<td class="center"><a title="Remove user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=delete">delete</a> :: <a title="Send feedback to user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select MyPrivateWiki"/></td>
<td>MyPrivateWiki</td>
<td>[email protected]</td>
<td class="time">2005-07-28 20:30:36</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=delete">delete</a> :: <a title="Send feedback to user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select DaSt"/></td>
<td>DaSt</td>
<td>[email protected]</td>
<td class="time">2005-07-27 17:32:06</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=delete">delete</a> :: <a title="Send feedback to user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select WikiSop"/></td>
<td>WikiSop</td>
<td>[email protected]</td>
<td class="time">2005-07-27 14:59:07</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=delete">delete</a> :: <a title="Send feedback to user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select Aragorn2005"/></td>
<td>Aragorn2005</td>
<td>[email protected]</td>
<td class="time">2005-07-27 08:48:46</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=delete">delete</a> :: <a title="Send feedback to user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
<fieldset><legend>Mass-action</legend>[<a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=1" title="Check all records">Check all</a> | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=0" title="Uncheck all records">Uncheck all</a>]<br /><label for="action" >With selected</label> <select title="Choose action to apply to selected records" id="action" name="action"><option value=" " selected="selected">---</option><option value="massdelete">Remove all</option><option value="massfeedback">Send feedback to all</option></select> <input type="submit" value="Submit" /></fieldset></form>
""
----
===Current version=== (//2005-08-31//):
##0.5##
~-users can be sorted by different fields (click on table header to reverse sort order), searched and paged;
~-if the current user is not an administrator, then the ##lastuser.php## action is displayed
~-feedback can be sent to single users.
~-displays pages owned by each user.
~-displays pages changed by each user.
~-displays pages commented by each user.
~-added extra column for Signup IP ( installed on this server as a beta feature).
~~-TrackIPaddressMod for (possible) install on 'your' server
~-added constants, UI strings and a bunch of configurable options including styling options (see below).
==Files needed== (//2004-09-16//):
~-##actions/useradmin.php##: see code on this page;
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (enhanced version of FeedbackAction); ''2005-04-18 - action parameter support added''
~-##[[UserPagesAction actions/userpages.php]]## (enhanced version of ##mypages.php##);''2005-04-18 - action parameter support added''
~-##[[UserChangesAction actions/userchanges.php]]## (enhanced version of ##mychanges.php##); ''2005-04-18 - action parameter support added''
~-##[[UserCommentsAction actions/usercomments.php]]## (new action); ''2004-11-23 - ""RewriteRules"" bug fixed''
===To do ===
~-mass-operations;
~-deleting/banning users;
~-integrate with other admin modules.
----
====The code====
<<##actions/useradmin.php##<<
**Note:** this action uses the ##ipaddress## field that has been added as a beta antispam feature to this server. Lines relative to this field have been commented out in the code to allow installation on a native wikka package
The code has also been adapted to take advantage of the ##[[WikkaCountingRecords getCount()]]## method, which is required for the action to work.
%%(php;1)
<?php
/**
* Display a module for user management.
*
* This action allows admins to display information on registered users.
* Users can be searched, paged, filtered. User-related statistics are given,
* showing the number of commented, created and modified pages. A feedback
* handler allows admins to send an email to single users. If the current user
* is not an administrator, then the lastuser action is displayed instead.
*
* @package Actions
* @name Useradmin
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.5
* @since Wikka 1.1.X.X
*
* @input integer $colcolor optional: enables color for statistics columns
* 1: enables colored columns;
* 0: disables colored columns;
* default: 1;
* @input integer $rowcolor optional: enables alternate row colors
* 1: enables colored rows;
* 0: disables colored rows;
* default: 1;
*
* @output A list of users registered on the current server.
*
* @todo
* - mass-operations;
* - deleting/banning users;
* - integrate with other admin modules.
*/
//utilities
/**
* Build an array of numbers consisting of 'ranges' with increasing step size in each 'range'.
*
* A list of numbers like this is useful for instance for a dropdown to choose
* a period expressed in number of days: a difference between 2 and 5 days may
* be significant while that between 92 and 95 may not be.
*
* @author {@link http://wikka.jsnx.com/JavaWoman JavaWoman}
* @copyright Copyright (c) 2005, Marjolein Katsma
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @version 1.0
*
* @param mixed $limits required: single integer or array of integers;
* defines the upper limits of the ranges as well as the next step size
* @param int $max required: upper limit for the whole list
* (will be included if smaller than the largest limit)
* @param int $firstinc optional: increment for the first range; default 1
* @return array resulting list of numbers
*/
// utilities
function optionRanges($limits, $max, $firstinc = 1)
{
// initializations
if (is_int($limits)) $limits = array($limits);
if ($firstinc < 1) $firstinc = 1;
$opts = array();
$inc = $firstinc;
// first element is the first increment
$opts[] = $inc;
// each $limit is the upper limit of a 'range'
foreach ($limits as $limit)
{
for ($i = $inc + $inc; $i <= $limit && $i < $max; $i += $inc)
{
$opts[] = $i;
}
// we quit at $max, even if there are more $limit elements
if ($limit >= $max)
{
// add $max to the list; then break out of the loop
$opts[] = $max;
break;
}
// when $limit is reached, it becomes the new start and increment for the next 'range'
$inc = $limit;
}
return $opts;
}
// restrict access to admins
if ($this->IsAdmin($this->GetUser())) {
// -------------------------------------
// set default values as constants
define('DEFAULT_RECORDS_LIMIT', '10'); # number of records per page
define('DEFAULT_MIN_RECORDS_DISPLAY', '5'); # min number of records
define('DEFAULT_RECORDS_RANGE',serialize(array('10','50','100','500','1000'))); #range array for records pager
define('DEFAULT_SORT_FIELD', 'signuptime'); # sort field
define('DEFAULT_SORT_ORDER', 'desc'); # sort order, ascendant or descendant
define('DEFAULT_START', '0'); # start record
define('DEFAULT_SEARCH', ''); # keyword to restrict search
define('ALTERNATE_ROW_COLOR', '1'); # switch alternate row color
define('STAT_COLUMN_COLOR', '1'); # switch color for statistics columns
// -------------------------------------
// User-interface: icons
define('OWNED_ICON', 'images/icons/16x16/stock_keyring.png');
define('EDITS_ICON', 'images/icons/16x16/text-editor.png');
define('COMMENTS_ICON', 'images/icons/16x16/stock_help-agent.png');
// -------------------------------------
// User-interface: strings
define('PAGE_TITLE','User Administration');
define('FORM_LEGEND','Filter view:');
define('FORM_SEARCH_STRING_LABEL','Search user:');
define('FORM_SEARCH_STRING_TITLE','Enter a search string');
define('FORM_SEARCH_SUBMIT','Submit');
define('FORM_PAGER_LABEL_BEFORE','Show');
define('FORM_PAGER_TITLE','Select records-per-page limit');
define('FORM_PAGER_LABEL_AFTER','records per page');
define('FORM_PAGER_SUBMIT','Apply');
define('FORM_PAGER_LINK','Show records from %d to %d');
define('FORM_RESULT_INFO','Records');
define('FORM_RESULT_SORTED_BY','Sorted by:');
define('TABLE_HEADING_USERNAME','User Name');
define('TABLE_HEADING_USERNAME_TITLE','Sort by user name');
define('TABLE_HEADING_EMAIL','Email');
define('TABLE_HEADING_EMAIL_TITLE','Sort by email');
define('TABLE_HEADING_SIGNUPTIME','Signup Time');
define('TABLE_HEADING_SIGNUPTIME_TITLE','Sort by signup time');
define('TABLE_HEADING_SIGNUPIP','Signup IP');
define('TABLE_HEADING_SIGNUPIP_TITLE','Sort by signup IP');
define('TABLE_SUMMARY','List of users registered on this server');
define('TABLE_HEADING_OWNED_TITLE','Owned Pages');
define('TABLE_HEADING_EDITS_TITLE','Page Edits');
define('TABLE_HEADING_COMMENTS_TITLE','Comments');
define('ACTION_DELETE_LINK_TITLE','Remove user %s');
define('ACTION_FEEDBACK_LINK_TITLE','Send feedback to user %s');
define('ACTION_DELETE_LINK','delete');
define('ACTION_FEEDBACK_LINK','feedback');
define('TABLE_CELL_OWNED_TITLE','Display pages owned by %s (%d)');
define('TABLE_CELL_EDITS_TITLE','Display page edits by %s (%d)');
define('TABLE_CELL_COMMENTS_TITLE','Display comments by %s (%d)');
define('SELECT_RECORD_TITLE','Select %s');
define('CHECK_ALL_TITLE','Check all records');
define('CHECK_ALL','Check all');
define('UNCHECK_ALL_TITLE','Uncheck all records');
define('UNCHECK_ALL','Uncheck all');
define('FORM_MASSACTION_LEGEND','Mass-action');
define('FORM_MASSACTION_LABEL','With selected');
define('FORM_MASSACTION_SELECT_TITLE','Choose action to apply to selected records');
define('FORM_MASSACTION_OPT_DELETE','Remove all');
define('FORM_MASSACTION_OPT_FEEDBACK','Send feedback to all');
define('FORM_MASSACTION_SUBMIT','Submit');
define('ERROR_NO_MATCHES','Sorry, there are no users matching "%s"');
//initialize row & column colors variables
$r = 1; #initialize row counter
$r_color = ALTERNATE_ROW_COLOR; #get alternate row color option
$c_color = STAT_COLUMN_COLOR; #get column color option
// record dropdown
$user_limits = unserialize(DEFAULT_RECORDS_RANGE);
// pager
$prev = '';
$next = '';
//override defaults with action parameters
if (is_array($vars))
{
foreach ($vars as $param => $value)
{
switch ($param)
{
case 'colcolor':
$c_color = (preg_match('/[01]/',$value))? $value : STAT_COLUMN_COLOR;
break;
case 'rowcolor':
$r_color = (preg_match('/[01]/',$value))? $value : ALTERNATE_ROW_COLOR;
break;
}
}
}
//perform actions if required
if ($_GET['action'] == 'feedback' || $_REQUEST['mail'])
{
echo $this->Action('userfeedback');
}
elseif ($_GET['action'] == 'owned')
{
echo $this->Action('userpages');
}
elseif ($_GET['action'] == 'changes')
{
echo $this->Action('userchanges');
}
elseif ($_GET['action'] == 'comments')
{
echo $this->Action('usercomments');
}
else
{
// process URL variables
# JW 2005-07-19 some modifications to avoid notices but these are still not actually secure
// number of records per page
if (isset($_POST['l']))
$l = $_POST['l'];
elseif (isset($_GET['l']))
$l = $_GET['l'];
else
$l = DEFAULT_RECORDS_LIMIT;
// sort field
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : DEFAULT_SORT_FIELD;
// sort order
$d = (isset($_GET['d'])) ? $_GET['d'] : DEFAULT_SORT_ORDER;
// start record
$s = (isset($_GET['s'])) ? $_GET['s'] : DEFAULT_START;
// search string
if (isset($_POST['q']))
$q = $_POST['q'];
elseif (isset($_GET['q']))
$q = $_GET['q'];
else
$q = DEFAULT_SEARCH;
// select all
$checked = '';
if (isset($_GET['selectall']))
{
$checked = (1 == $_GET['selectall']) ? ' checked="checked"' : '';
}
// restrict MySQL query by search string
$where = ('' == $q) ? "1" : "`name` LIKE '%".$q."%'";
// get total number of users
$numusers = $this->getCount('users', $where);
// print page header
echo $this->Format('==== '.PAGE_TITLE.' ==== --- ');
// build pager form
$form = $this->FormOpen('','','post','user_admin_panel');
$form .= '<fieldset><legend>'.FORM_LEGEND.'</legend>'."\n";
$form .= '<label for="q">'.FORM_SEARCH_STRING_LABEL.'</label> <input type ="text" id="q" name="q" title="'.FORM_SEARCH_STRING_TITLE.'" size="20" maxlength="50" value="'.$q.'"/> <input type="submit" value="'.FORM_SEARCH_SUBMIT.'" /><br />'."\n";
// ranged drop-down
$users_opts = optionRanges($user_limits,$numusers,DEFAULT_MIN_RECORDS_DISPLAY);
$form .= '<label for="l">'.FORM_PAGER_LABEL_BEFORE.'</label> '."\n";
$form .= '<select name="l" id="l" title="'.FORM_PAGER_TITLE.'">'."\n";
// build drop-down
foreach ($users_opts as $opt) {
$selected = ($opt == $l) ? ' selected="selected"' : '';
$form .= '<option value="'.$opt.'"'.$selected.'>'.$opt.'</option>'."\n";
}
$form .= '</select> <label for="l">'.FORM_PAGER_LABEL_AFTER.'</label> <input type="submit" value="'.FORM_PAGER_SUBMIT.'" /><br />'."\n";
// build pager links
if ($s > 0)
$prev = '<a href="' .$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s-$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s-$l+1), $s).'">'.($s-$l+1).'-'.$s.'</a> | '."\n";
if ($numusers > ($s + $l))
$next = ' | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s+$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s+$l+1), ($s+2*$l)).'">'.($s+$l+1).'-'.($s+2*$l).'</a>'."\n";
$form .= FORM_RESULT_INFO.' ('.$numusers.'): '.$prev.($s+1).'-'.($s+$l).$next.'<br />'."\n";
$form .= '('.FORM_RESULT_SORTED_BY.'<em>'.$sort.', '.$d.'</em>)'."\n";
$form .= '</fieldset>'.$this->FormClose()."\n";
// print form
echo $form;
// get user list
$userdata = $this->LoadAll("SELECT * FROM ".$this->config["table_prefix"]."users WHERE ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// build header links
$nameheader = '<a href="'.$this->Href('','', (($sort == 'name' && $d == 'asc')? 'l='.$l.'&sort=name&d=desc' : 'l='.$l.'&sort=name&d=asc')).'" title="'.TABLE_HEADING_USERNAME_TITLE.'">'.TABLE_HEADING_USERNAME.'</a>';
$emailheader = '<a href="'.$this->Href('','', (($sort == 'email' && $d == 'asc')? 'l='.$l.'&sort=email&d=desc' : 'l='.$l.'&sort=email&d=asc')).'" title="'.TABLE_HEADING_EMAIL_TITLE.'">'.TABLE_HEADING_EMAIL.'</a>';
$timeheader = '<a href="'.$this->Href('','', (($sort == 'signuptime' && $d == 'desc')? 'l='.$l.'&sort=signuptime&d=asc' : 'l='.$l.'')).'" title="'.TABLE_HEADING_SIGNUPTIME_TITLE.'">'.TABLE_HEADING_SIGNUPTIME.'</a>';
/*$ipheader = '<a href="'.$this->Href('','', (($sort == 'ipaddress' && $d == 'desc')? 'l='.$l.'&sort=ipaddress&d=asc' : 'l='.$l.'&sort=ipaddress&d=desc')).'" title="'.TABLE_HEADING_SIGNUPIP_TITLE.'">'.TABLE_HEADING_SIGNUPIP.'</a>'; # installed as beta feature at wikka.jsnx.com */
// build table headers
$htmlout = "<table summary=\"".TABLE_SUMMARY."\" border=\"1px\" id=\"admin_table\">\n<thead>\n".
" <tr>\n".
" <th> </th>\n".
" <th>".$nameheader."</th>\n".
" <th>".$emailheader."</th>\n".
" <th>".$timeheader."</th>\n".
/* " <th>".$ipheader."</th>\n". # installed as beta feature at wikka.jsnx.com */
" <th class=\"number ".(($c_color == 1)? ' c1' : '')."\" title=\"".TABLE_HEADING_OWNED_TITLE."\">;<img src=\"".OWNED_ICON."\" alt=\"O\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c2' : '')."\" title=\"".TABLE_HEADING_EDITS_TITLE."\"><img src=\"".EDITS_ICON."\" alt=\"E\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c3' : '')."\" title=\"".TABLE_HEADING_COMMENTS_TITLE."\"><img src=\"".COMMENTS_ICON."\" alt=\"C\"/></th>\n".
" <th class=\"center\">Actions</th>\n".
" </tr>\n</thead>\n";
// print user table
foreach($userdata as $user) {
// get counts
$where_owned = "`owner` = '".$user['name']."' AND latest = 'Y'";
$where_changes = "`user` = '".$user['name']."'";
$where_comments = "`user` = '".$user['name']."'";
$numowned = $this->getCount('pages', $where_owned);
$numchanges = $this->getCount('pages', $where_changes);
$numcomments = $this->getCount('comments', $where_comments);
// build statistics links if needed
$ownedlink = ($numowned > 0)? '<a title="'.sprintf(TABLE_CELL_OWNED_TITLE,$user['name'],$numowned).'" href="'.$this->Href('','','user='.$user['name'].'&action=owned').'">'.$numowned.'</a>' : '0';
$changeslink = ($numchanges > 0)? '<a title="'.sprintf(TABLE_CELL_EDITS_TITLE,$user['name'],$numchanges).'" href="'.$this->Href('','','user='.$user['name'].'&action=changes').'">'.$numchanges.'</a>' : '0';
$commentslink = ($numcomments > 0)? '<a title="'.sprintf(TABLE_CELL_COMMENTS_TITLE,$user['name'],$numcomments).'" href="'.$this->Href('','','user='.$user['name'].'&action=comments').'">'.$numcomments.'</a>' : '0';
// build handler links
$deleteuser = '<a title="'.sprintf(ACTION_DELETE_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=delete').'">'.ACTION_DELETE_LINK.'</a>';
$feedbackuser = '<a title="'.sprintf(ACTION_FEEDBACK_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=feedback').'">'.ACTION_FEEDBACK_LINK.'</a>';
// build table body
$htmlout .= "<tbody>\n";
if ($r_color == 1) {
$htmlout .= "<tr ".(($r%2)? '' : 'class="alt"').">\n"; #enable alternate row color
} else {
$htmlout .= "<tr>\n"; #disable alternate row color
}
$htmlout .= " <td><input type=\"checkbox\" id=\"".$user['id']."\"".$checked." title=\"".sprintf(SELECT_RECORD_TITLE,$user['name'])."\"/></td>\n".
" <td>".(($this->ExistsPage($user['name']))? $this->Link($user['name']) : $user['name'])."</td>\n". #check if userpage exists
" <td>".$user['email']."</td>\n".
" <td class=\"time\">".$user['signuptime']."</td>\n".
/* " <td>".$user['ipaddress']."</td>\n". # installed as beta feature at wikka.jsnx.com */
" <td class=\"number".(($c_color == 1)? ' c1' : '')."\">".$ownedlink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c2' : '')."\">".$changeslink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c3' : '')."\">".$commentslink."</td>\n". #set column color
" <td class=\"center\">".$deleteuser." :: ".$feedbackuser."</td>\n";
$htmlout .= " </tr>\n</tbody>\n";
//increase row counter ----- alternate row colors
if ($r_color == 1) $r++;
}
$htmlout .= "</table>\n";
// print the table
echo $this->FormOpen('','','get');
echo $htmlout;
// multiple-user operations (forthcoming) JW 2005-07-19 accesskey removed (causes more problems than it solves)
echo '<fieldset><legend>'.FORM_MASSACTION_LEGEND.'</legend>';
echo '[<a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=1').'" title="'.CHECK_ALL_TITLE.'">'.CHECK_ALL.'</a> | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=0').'" title="'.UNCHECK_ALL_TITLE.'">'.UNCHECK_ALL.'</a>]<br />';
echo '<label for="action" >'.FORM_MASSACTION_LABEL.'</label> <select title="'.FORM_MASSACTION_SELECT_TITLE.'" id="action" name="action">';
echo '<option value="" selected="selected">---</option>';
echo '<option value="massdelete">'.FORM_MASSACTION_OPT_DELETE.'</option>';
echo '<option value="massfeedback">'.FORM_MASSACTION_OPT_FEEDBACK.'</option>';
echo '</select> <input type="submit" value="'.FORM_MASSACTION_SUBMIT.'" />';
echo '</fieldset>';
echo $this->FormClose();
}
else
{
// no records matching the search string: print error message
echo '<p><span class="error">'.sprintf(ERROR_NO_MATCHES, $q).'</span></p>';
}
}
} else {
// user is not admin
echo $this->Action('lastusers');
}
?>
%%
===New CSS classes===
The styling of the tables requires a bunch of [[TableStyling new CSS classes]].
----
==== Styling options ====
The ##useradmin## action accepts two optional styling parameters:
##colcolor##
Enables color for statistics columns
1: enables colored columns (default);
0: disables colored columns;
##rowcolor##
Enables alternate row colors
1: enables colored rows (default);
0: disables colored rows;
The following examples show how the table is rendered using these two parameters:
**No styling:** ##""{{useradmin colcolor="0" rowcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows only:** ##""{{useradmin colcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Colored columns only:** ##""{{useradmin rowcolor="0"}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows and colored columns:** ##""{{useradmin}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
----
CategoryDevelopmentActions CategoryDevelopmentAdmin
Deletions:
Additions:
~~~
Deletions:
~~~~& See DanWestUserReg. Worked for me as intended. I'd say, this function's done --MasinAlDujaili, 2007-05-21
~~-**send user feedback** ''-- done'';
~~-**rename users**
~~~&//If anyone is interested, running through the seven tables and updating every instance of your old wiki name to your new wiki name will effectively change your name throughout the wiki.// copied from comment on the homepage. --NilsLindenberg
~~-manage **user privileges** (forthcoming);
~-Display user's **owned pages** ''-- done'';
~-Display user's **comments** ''-- done''.
~-Display user's **changes** ''-- done'';
~-//other...//
The code below must be saved as ##actions/useradmin.php## and can be used by adding ##""{{useradmin}}""## in the body of a page.
Here's a preview of the interface (the email and IP fields are masked for privacy reasons)
----
==sample output==
""
<h3 id="hn_User_Administration"> User Administration </h3>
<br />
<form action="#" method="post" id="form_user_admin_panel">
<fieldset><legend>Filter view:</legend>
<label for="q">Search user:</label> <input type ="text" id="q" name="q" title="Enter a search string" size="20" maxlength="50" value=" "/> <input type="submit" value="Submit" /><br />
<label for="l">Show</label>
<select name="l" id="l" title="Select records-per-page limit">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
<option value="300">300</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="857">857</option>
</select> <label for="l">records per page</label> <input type="submit" value="Apply" /><br />
Records (857): 1-10 | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=10&q=" title="Show records from 11 to 20">11-20</a>
<br />
(Sorted by:<em>signuptime, desc</em>)
</fieldset></form>
<form action="http://wikka.jsnx.com/UserAdminTest" id="form_b5eda0a745">
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select RobinW"/></td>
<td>RobinW</td>
<td>[email protected]</td>
<td class="time">2005-07-30 02:06:20</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3"><a title="Display comments by RobinW (1)" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=comments">1</a></td>
<td class="center"><a title="Remove user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=delete">delete</a> :: <a title="Send feedback to user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select VictorManuelVarela"/></td>
<td><a href="http://wikka.jsnx.com/VictorManuelVarela" title=" ">VictorManuelVarela</a></td>
<td>[email protected]</td>
<td class="time">2005-07-30 00:01:13</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by VictorManuelVarela (1)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by VictorManuelVarela (6)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=changes">6</a></td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=delete">delete</a> :: <a title="Send feedback to user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select EniBevoli"/></td>
<td>EniBevoli</td>
<td>[email protected]</td>
<td class="time">2005-07-29 12:13:44</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2"><a title="Display page edits by EniBevoli (4)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=changes">4</a></td>
<td class="number c3"><a title="Display comments by EniBevoli (1)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=comments">1</a></td>
<td class="center"><a title="Remove user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=delete">delete</a> :: <a title="Send feedback to user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select MyPrivateWiki"/></td>
<td>MyPrivateWiki</td>
<td>[email protected]</td>
<td class="time">2005-07-28 20:30:36</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=delete">delete</a> :: <a title="Send feedback to user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select DaSt"/></td>
<td>DaSt</td>
<td>[email protected]</td>
<td class="time">2005-07-27 17:32:06</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=delete">delete</a> :: <a title="Send feedback to user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select WikiSop"/></td>
<td>WikiSop</td>
<td>[email protected]</td>
<td class="time">2005-07-27 14:59:07</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=delete">delete</a> :: <a title="Send feedback to user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select Aragorn2005"/></td>
<td>Aragorn2005</td>
<td>[email protected]</td>
<td class="time">2005-07-27 08:48:46</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=delete">delete</a> :: <a title="Send feedback to user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
<fieldset><legend>Mass-action</legend>[<a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=1" title="Check all records">Check all</a> | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=0" title="Uncheck all records">Uncheck all</a>]<br /><label for="action" >With selected</label> <select title="Choose action to apply to selected records" id="action" name="action"><option value=" " selected="selected">---</option><option value="massdelete">Remove all</option><option value="massfeedback">Send feedback to all</option></select> <input type="submit" value="Submit" /></fieldset></form>
""
----
===Current version=== (//2005-08-31//):
##0.5##
~-users can be sorted by different fields (click on table header to reverse sort order), searched and paged;
~-if the current user is not an administrator, then the ##lastuser.php## action is displayed
~-feedback can be sent to single users.
~-displays pages owned by each user.
~-displays pages changed by each user.
~-displays pages commented by each user.
~-added extra column for Signup IP ( installed on this server as a beta feature).
~~-TrackIPaddressMod for (possible) install on 'your' server
~-added constants, UI strings and a bunch of configurable options including styling options (see below).
==Files needed== (//2004-09-16//):
~-##actions/useradmin.php##: see code on this page;
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (enhanced version of FeedbackAction); ''2005-04-18 - action parameter support added''
~-##[[UserPagesAction actions/userpages.php]]## (enhanced version of ##mypages.php##);''2005-04-18 - action parameter support added''
~-##[[UserChangesAction actions/userchanges.php]]## (enhanced version of ##mychanges.php##); ''2005-04-18 - action parameter support added''
~-##[[UserCommentsAction actions/usercomments.php]]## (new action); ''2004-11-23 - ""RewriteRules"" bug fixed''
===To do ===
~-mass-operations;
~-deleting/banning users;
~-integrate with other admin modules.
----
====The code====
<<##actions/useradmin.php##<<
**Note:** this action uses the ##ipaddress## field that has been added as a beta antispam feature to this server. Lines relative to this field have been commented out in the code to allow installation on a native wikka package
The code has also been adapted to take advantage of the ##[[WikkaCountingRecords getCount()]]## method, which is required for the action to work.
%%(php;1)
<?php
/**
* Display a module for user management.
*
* This action allows admins to display information on registered users.
* Users can be searched, paged, filtered. User-related statistics are given,
* showing the number of commented, created and modified pages. A feedback
* handler allows admins to send an email to single users. If the current user
* is not an administrator, then the lastuser action is displayed instead.
*
* @package Actions
* @name Useradmin
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 0.5
* @since Wikka 1.1.X.X
*
* @input integer $colcolor optional: enables color for statistics columns
* 1: enables colored columns;
* 0: disables colored columns;
* default: 1;
* @input integer $rowcolor optional: enables alternate row colors
* 1: enables colored rows;
* 0: disables colored rows;
* default: 1;
*
* @output A list of users registered on the current server.
*
* @todo
* - mass-operations;
* - deleting/banning users;
* - integrate with other admin modules.
*/
//utilities
/**
* Build an array of numbers consisting of 'ranges' with increasing step size in each 'range'.
*
* A list of numbers like this is useful for instance for a dropdown to choose
* a period expressed in number of days: a difference between 2 and 5 days may
* be significant while that between 92 and 95 may not be.
*
* @author {@link http://wikka.jsnx.com/JavaWoman JavaWoman}
* @copyright Copyright (c) 2005, Marjolein Katsma
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @version 1.0
*
* @param mixed $limits required: single integer or array of integers;
* defines the upper limits of the ranges as well as the next step size
* @param int $max required: upper limit for the whole list
* (will be included if smaller than the largest limit)
* @param int $firstinc optional: increment for the first range; default 1
* @return array resulting list of numbers
*/
// utilities
function optionRanges($limits, $max, $firstinc = 1)
{
// initializations
if (is_int($limits)) $limits = array($limits);
if ($firstinc < 1) $firstinc = 1;
$opts = array();
$inc = $firstinc;
// first element is the first increment
$opts[] = $inc;
// each $limit is the upper limit of a 'range'
foreach ($limits as $limit)
{
for ($i = $inc + $inc; $i <= $limit && $i < $max; $i += $inc)
{
$opts[] = $i;
}
// we quit at $max, even if there are more $limit elements
if ($limit >= $max)
{
// add $max to the list; then break out of the loop
$opts[] = $max;
break;
}
// when $limit is reached, it becomes the new start and increment for the next 'range'
$inc = $limit;
}
return $opts;
}
// restrict access to admins
if ($this->IsAdmin($this->GetUser())) {
// -------------------------------------
// set default values as constants
define('DEFAULT_RECORDS_LIMIT', '10'); # number of records per page
define('DEFAULT_MIN_RECORDS_DISPLAY', '5'); # min number of records
define('DEFAULT_RECORDS_RANGE',serialize(array('10','50','100','500','1000'))); #range array for records pager
define('DEFAULT_SORT_FIELD', 'signuptime'); # sort field
define('DEFAULT_SORT_ORDER', 'desc'); # sort order, ascendant or descendant
define('DEFAULT_START', '0'); # start record
define('DEFAULT_SEARCH', ''); # keyword to restrict search
define('ALTERNATE_ROW_COLOR', '1'); # switch alternate row color
define('STAT_COLUMN_COLOR', '1'); # switch color for statistics columns
// -------------------------------------
// User-interface: icons
define('OWNED_ICON', 'images/icons/16x16/stock_keyring.png');
define('EDITS_ICON', 'images/icons/16x16/text-editor.png');
define('COMMENTS_ICON', 'images/icons/16x16/stock_help-agent.png');
// -------------------------------------
// User-interface: strings
define('PAGE_TITLE','User Administration');
define('FORM_LEGEND','Filter view:');
define('FORM_SEARCH_STRING_LABEL','Search user:');
define('FORM_SEARCH_STRING_TITLE','Enter a search string');
define('FORM_SEARCH_SUBMIT','Submit');
define('FORM_PAGER_LABEL_BEFORE','Show');
define('FORM_PAGER_TITLE','Select records-per-page limit');
define('FORM_PAGER_LABEL_AFTER','records per page');
define('FORM_PAGER_SUBMIT','Apply');
define('FORM_PAGER_LINK','Show records from %d to %d');
define('FORM_RESULT_INFO','Records');
define('FORM_RESULT_SORTED_BY','Sorted by:');
define('TABLE_HEADING_USERNAME','User Name');
define('TABLE_HEADING_USERNAME_TITLE','Sort by user name');
define('TABLE_HEADING_EMAIL','Email');
define('TABLE_HEADING_EMAIL_TITLE','Sort by email');
define('TABLE_HEADING_SIGNUPTIME','Signup Time');
define('TABLE_HEADING_SIGNUPTIME_TITLE','Sort by signup time');
define('TABLE_HEADING_SIGNUPIP','Signup IP');
define('TABLE_HEADING_SIGNUPIP_TITLE','Sort by signup IP');
define('TABLE_SUMMARY','List of users registered on this server');
define('TABLE_HEADING_OWNED_TITLE','Owned Pages');
define('TABLE_HEADING_EDITS_TITLE','Page Edits');
define('TABLE_HEADING_COMMENTS_TITLE','Comments');
define('ACTION_DELETE_LINK_TITLE','Remove user %s');
define('ACTION_FEEDBACK_LINK_TITLE','Send feedback to user %s');
define('ACTION_DELETE_LINK','delete');
define('ACTION_FEEDBACK_LINK','feedback');
define('TABLE_CELL_OWNED_TITLE','Display pages owned by %s (%d)');
define('TABLE_CELL_EDITS_TITLE','Display page edits by %s (%d)');
define('TABLE_CELL_COMMENTS_TITLE','Display comments by %s (%d)');
define('SELECT_RECORD_TITLE','Select %s');
define('CHECK_ALL_TITLE','Check all records');
define('CHECK_ALL','Check all');
define('UNCHECK_ALL_TITLE','Uncheck all records');
define('UNCHECK_ALL','Uncheck all');
define('FORM_MASSACTION_LEGEND','Mass-action');
define('FORM_MASSACTION_LABEL','With selected');
define('FORM_MASSACTION_SELECT_TITLE','Choose action to apply to selected records');
define('FORM_MASSACTION_OPT_DELETE','Remove all');
define('FORM_MASSACTION_OPT_FEEDBACK','Send feedback to all');
define('FORM_MASSACTION_SUBMIT','Submit');
define('ERROR_NO_MATCHES','Sorry, there are no users matching "%s"');
//initialize row & column colors variables
$r = 1; #initialize row counter
$r_color = ALTERNATE_ROW_COLOR; #get alternate row color option
$c_color = STAT_COLUMN_COLOR; #get column color option
// record dropdown
$user_limits = unserialize(DEFAULT_RECORDS_RANGE);
// pager
$prev = '';
$next = '';
//override defaults with action parameters
if (is_array($vars))
{
foreach ($vars as $param => $value)
{
switch ($param)
{
case 'colcolor':
$c_color = (preg_match('/[01]/',$value))? $value : STAT_COLUMN_COLOR;
break;
case 'rowcolor':
$r_color = (preg_match('/[01]/',$value))? $value : ALTERNATE_ROW_COLOR;
break;
}
}
}
//perform actions if required
if ($_GET['action'] == 'feedback' || $_REQUEST['mail'])
{
echo $this->Action('userfeedback');
}
elseif ($_GET['action'] == 'owned')
{
echo $this->Action('userpages');
}
elseif ($_GET['action'] == 'changes')
{
echo $this->Action('userchanges');
}
elseif ($_GET['action'] == 'comments')
{
echo $this->Action('usercomments');
}
else
{
// process URL variables
# JW 2005-07-19 some modifications to avoid notices but these are still not actually secure
// number of records per page
if (isset($_POST['l']))
$l = $_POST['l'];
elseif (isset($_GET['l']))
$l = $_GET['l'];
else
$l = DEFAULT_RECORDS_LIMIT;
// sort field
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : DEFAULT_SORT_FIELD;
// sort order
$d = (isset($_GET['d'])) ? $_GET['d'] : DEFAULT_SORT_ORDER;
// start record
$s = (isset($_GET['s'])) ? $_GET['s'] : DEFAULT_START;
// search string
if (isset($_POST['q']))
$q = $_POST['q'];
elseif (isset($_GET['q']))
$q = $_GET['q'];
else
$q = DEFAULT_SEARCH;
// select all
$checked = '';
if (isset($_GET['selectall']))
{
$checked = (1 == $_GET['selectall']) ? ' checked="checked"' : '';
}
// restrict MySQL query by search string
$where = ('' == $q) ? "1" : "`name` LIKE '%".$q."%'";
// get total number of users
$numusers = $this->getCount('users', $where);
// print page header
echo $this->Format('==== '.PAGE_TITLE.' ==== --- ');
// build pager form
$form = $this->FormOpen('','','post','user_admin_panel');
$form .= '<fieldset><legend>'.FORM_LEGEND.'</legend>'."\n";
$form .= '<label for="q">'.FORM_SEARCH_STRING_LABEL.'</label> <input type ="text" id="q" name="q" title="'.FORM_SEARCH_STRING_TITLE.'" size="20" maxlength="50" value="'.$q.'"/> <input type="submit" value="'.FORM_SEARCH_SUBMIT.'" /><br />'."\n";
// ranged drop-down
$users_opts = optionRanges($user_limits,$numusers,DEFAULT_MIN_RECORDS_DISPLAY);
$form .= '<label for="l">'.FORM_PAGER_LABEL_BEFORE.'</label> '."\n";
$form .= '<select name="l" id="l" title="'.FORM_PAGER_TITLE.'">'."\n";
// build drop-down
foreach ($users_opts as $opt) {
$selected = ($opt == $l) ? ' selected="selected"' : '';
$form .= '<option value="'.$opt.'"'.$selected.'>'.$opt.'</option>'."\n";
}
$form .= '</select> <label for="l">'.FORM_PAGER_LABEL_AFTER.'</label> <input type="submit" value="'.FORM_PAGER_SUBMIT.'" /><br />'."\n";
// build pager links
if ($s > 0)
$prev = '<a href="' .$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s-$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s-$l+1), $s).'">'.($s-$l+1).'-'.$s.'</a> | '."\n";
if ($numusers > ($s + $l))
$next = ' | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s+$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s+$l+1), ($s+2*$l)).'">'.($s+$l+1).'-'.($s+2*$l).'</a>'."\n";
$form .= FORM_RESULT_INFO.' ('.$numusers.'): '.$prev.($s+1).'-'.($s+$l).$next.'<br />'."\n";
$form .= '('.FORM_RESULT_SORTED_BY.'<em>'.$sort.', '.$d.'</em>)'."\n";
$form .= '</fieldset>'.$this->FormClose()."\n";
// print form
echo $form;
// get user list
$userdata = $this->LoadAll("SELECT * FROM ".$this->config["table_prefix"]."users WHERE ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// build header links
$nameheader = '<a href="'.$this->Href('','', (($sort == 'name' && $d == 'asc')? 'l='.$l.'&sort=name&d=desc' : 'l='.$l.'&sort=name&d=asc')).'" title="'.TABLE_HEADING_USERNAME_TITLE.'">'.TABLE_HEADING_USERNAME.'</a>';
$emailheader = '<a href="'.$this->Href('','', (($sort == 'email' && $d == 'asc')? 'l='.$l.'&sort=email&d=desc' : 'l='.$l.'&sort=email&d=asc')).'" title="'.TABLE_HEADING_EMAIL_TITLE.'">'.TABLE_HEADING_EMAIL.'</a>';
$timeheader = '<a href="'.$this->Href('','', (($sort == 'signuptime' && $d == 'desc')? 'l='.$l.'&sort=signuptime&d=asc' : 'l='.$l.'')).'" title="'.TABLE_HEADING_SIGNUPTIME_TITLE.'">'.TABLE_HEADING_SIGNUPTIME.'</a>';
/*$ipheader = '<a href="'.$this->Href('','', (($sort == 'ipaddress' && $d == 'desc')? 'l='.$l.'&sort=ipaddress&d=asc' : 'l='.$l.'&sort=ipaddress&d=desc')).'" title="'.TABLE_HEADING_SIGNUPIP_TITLE.'">'.TABLE_HEADING_SIGNUPIP.'</a>'; # installed as beta feature at wikka.jsnx.com */
// build table headers
$htmlout = "<table summary=\"".TABLE_SUMMARY."\" border=\"1px\" id=\"admin_table\">\n<thead>\n".
" <tr>\n".
" <th> </th>\n".
" <th>".$nameheader."</th>\n".
" <th>".$emailheader."</th>\n".
" <th>".$timeheader."</th>\n".
/* " <th>".$ipheader."</th>\n". # installed as beta feature at wikka.jsnx.com */
" <th class=\"number ".(($c_color == 1)? ' c1' : '')."\" title=\"".TABLE_HEADING_OWNED_TITLE."\">;<img src=\"".OWNED_ICON."\" alt=\"O\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c2' : '')."\" title=\"".TABLE_HEADING_EDITS_TITLE."\"><img src=\"".EDITS_ICON."\" alt=\"E\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c3' : '')."\" title=\"".TABLE_HEADING_COMMENTS_TITLE."\"><img src=\"".COMMENTS_ICON."\" alt=\"C\"/></th>\n".
" <th class=\"center\">Actions</th>\n".
" </tr>\n</thead>\n";
// print user table
foreach($userdata as $user) {
// get counts
$where_owned = "`owner` = '".$user['name']."' AND latest = 'Y'";
$where_changes = "`user` = '".$user['name']."'";
$where_comments = "`user` = '".$user['name']."'";
$numowned = $this->getCount('pages', $where_owned);
$numchanges = $this->getCount('pages', $where_changes);
$numcomments = $this->getCount('comments', $where_comments);
// build statistics links if needed
$ownedlink = ($numowned > 0)? '<a title="'.sprintf(TABLE_CELL_OWNED_TITLE,$user['name'],$numowned).'" href="'.$this->Href('','','user='.$user['name'].'&action=owned').'">'.$numowned.'</a>' : '0';
$changeslink = ($numchanges > 0)? '<a title="'.sprintf(TABLE_CELL_EDITS_TITLE,$user['name'],$numchanges).'" href="'.$this->Href('','','user='.$user['name'].'&action=changes').'">'.$numchanges.'</a>' : '0';
$commentslink = ($numcomments > 0)? '<a title="'.sprintf(TABLE_CELL_COMMENTS_TITLE,$user['name'],$numcomments).'" href="'.$this->Href('','','user='.$user['name'].'&action=comments').'">'.$numcomments.'</a>' : '0';
// build handler links
$deleteuser = '<a title="'.sprintf(ACTION_DELETE_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=delete').'">'.ACTION_DELETE_LINK.'</a>';
$feedbackuser = '<a title="'.sprintf(ACTION_FEEDBACK_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=feedback').'">'.ACTION_FEEDBACK_LINK.'</a>';
// build table body
$htmlout .= "<tbody>\n";
if ($r_color == 1) {
$htmlout .= "<tr ".(($r%2)? '' : 'class="alt"').">\n"; #enable alternate row color
} else {
$htmlout .= "<tr>\n"; #disable alternate row color
}
$htmlout .= " <td><input type=\"checkbox\" id=\"".$user['id']."\"".$checked." title=\"".sprintf(SELECT_RECORD_TITLE,$user['name'])."\"/></td>\n".
" <td>".(($this->ExistsPage($user['name']))? $this->Link($user['name']) : $user['name'])."</td>\n". #check if userpage exists
" <td>".$user['email']."</td>\n".
" <td class=\"time\">".$user['signuptime']."</td>\n".
/* " <td>".$user['ipaddress']."</td>\n". # installed as beta feature at wikka.jsnx.com */
" <td class=\"number".(($c_color == 1)? ' c1' : '')."\">".$ownedlink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c2' : '')."\">".$changeslink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c3' : '')."\">".$commentslink."</td>\n". #set column color
" <td class=\"center\">".$deleteuser." :: ".$feedbackuser."</td>\n";
$htmlout .= " </tr>\n</tbody>\n";
//increase row counter ----- alternate row colors
if ($r_color == 1) $r++;
}
$htmlout .= "</table>\n";
// print the table
echo $this->FormOpen('','','get');
echo $htmlout;
// multiple-user operations (forthcoming) JW 2005-07-19 accesskey removed (causes more problems than it solves)
echo '<fieldset><legend>'.FORM_MASSACTION_LEGEND.'</legend>';
echo '[<a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=1').'" title="'.CHECK_ALL_TITLE.'">'.CHECK_ALL.'</a> | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=0').'" title="'.UNCHECK_ALL_TITLE.'">'.UNCHECK_ALL.'</a>]<br />';
echo '<label for="action" >'.FORM_MASSACTION_LABEL.'</label> <select title="'.FORM_MASSACTION_SELECT_TITLE.'" id="action" name="action">';
echo '<option value="" selected="selected">---</option>';
echo '<option value="massdelete">'.FORM_MASSACTION_OPT_DELETE.'</option>';
echo '<option value="massfeedback">'.FORM_MASSACTION_OPT_FEEDBACK.'</option>';
echo '</select> <input type="submit" value="'.FORM_MASSACTION_SUBMIT.'" />';
echo '</fieldset>';
echo $this->FormClose();
}
else
{
// no records matching the search string: print error message
echo '<p><span class="error">'.sprintf(ERROR_NO_MATCHES, $q).'</span></p>';
}
}
} else {
// user is not admin
echo $this->Action('lastusers');
}
?>
%%
===New CSS classes===
The styling of the tables requires a bunch of [[TableStyling new CSS classes]].
----
==== Styling options ====
The ##useradmin## action accepts two optional styling parameters:
##colcolor##
Enables color for statistics columns
1: enables colored columns (default);
0: disables colored columns;
##rowcolor##
Enables alternate row colors
1: enables colored rows (default);
0: disables colored rows;
The following examples show how the table is rendered using these two parameters:
**No styling:** ##""{{useradmin colcolor="0" rowcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows only:** ##""{{useradmin colcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Colored columns only:** ##""{{useradmin rowcolor="0"}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
**Alternate rows and colored columns:** ##""{{useradmin}}""##
""
<table summary="List of users registered on this server" border="1px" id="admin_table">
<thead>
<tr>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
</tr>
</thead>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
</tr>
</tbody>
<tbody>
<tr>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
</tr>
</tbody>
</table>
""
----
CategoryDevelopmentActions CategoryDevelopmentAdmin
Revision [16620]
Edited on 2007-05-21 04:38:41 by MasinAlDujaili [mentioned Dan West's UserReg action]Additions:
~~~~& See DanWestUserReg. Worked for me as intended. I'd say, this function's done --MasinAlDujaili, 2007-05-21
Deletions:
Revision [16619]
Edited on 2007-05-21 04:37:57 by MasinAlDujaili [mentioned Dan West's UserReg action]Additions:
~~~~& See DanWestUserReg. Worked for me as intended. I'd say --MasinAlDujaili, 2007-05-21
" <th class=\"number ".(($c_color == 1)? ' c1' : '')."\" title=\"".TABLE_HEADING_OWNED_TITLE."\">;<img src=\"".OWNED_ICON."\" alt=\"O\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c1' : '')."\" title=\"".TABLE_HEADING_OWNED_TITLE."\">;<img src=\"".OWNED_ICON."\" alt=\"O\"/></th>\n".
Deletions:
Additions:
~~-TrackIPaddressMod for (possible) install on 'your' server
Additions:
The code has also been adapted to take advantage of the ##[[WikkaCountingRecords getCount()]]## method, which is required for the action to work.
Additions:
~-Are you an administrator of this site ? --- Give it a [[UserAdminTest try]]
Additions:
**No styling:** ##""{{useradmin colcolor="0" rowcolor="0"}}""##
**Alternate rows only:** ##""{{useradmin colcolor="0"}}""##
**Colored columns only:** ##""{{useradmin rowcolor="0"}}""##
**Alternate rows and colored columns:** ##""{{useradmin}}""##
**Alternate rows only:** ##""{{useradmin colcolor="0"}}""##
**Colored columns only:** ##""{{useradmin rowcolor="0"}}""##
**Alternate rows and colored columns:** ##""{{useradmin}}""##
Deletions:
**##""{{useradmin colcolor="0"}}""##**
**##""{{useradmin rowcolor="0"}}""##**
**##""{{useradmin}}""##**
Additions:
##0.5##
* @version 0.5
* @version 0.5
Deletions:
Additions:
~-""<a href="UserAdmin#hn_Current_version">Current version</a>""
~-""<a href="UserAdmin#hn_To_do">To do</a>""
===Current version=== (//2005-08-31//):
===To do ===
~-mass-operations;
~-deleting/banning users;
~-integrate with other admin modules.
~-""<a href="UserAdmin#hn_To_do">To do</a>""
===Current version=== (//2005-08-31//):
===To do ===
~-mass-operations;
~-deleting/banning users;
~-integrate with other admin modules.
Deletions:
Additions:
This is the development page for the User Administration action.
This action is meant to allow Wikka Administrators to manage users and perform several maintenance operations.
It displays the standard LastUsers list to non-admins.
This action is meant to allow Wikka Administrators to manage users and perform several maintenance operations.
It displays the standard LastUsers list to non-admins.
Additions:
>><<**Table of Contents:**
~-""<a href="UserAdmin#hn_Styling_options">Styling options</a>""<<
::c::
~-""<a href="UserAdmin#hn_Styling_options">Styling options</a>""<<
::c::
Deletions:
**Table of Contents:**
~-""<a href="UserAdmin#hn_Styling_options">Styling options</a>""
Additions:
**Table of Contents:**
~-""<a href="UserAdmin#hn_Why">Why?</a>""
~-""<a href="UserAdmin#hn_The_code">The code</a>""
~-""<a href="UserAdmin#hn_Styling_options">Styling options</a>""
=== Why? ===
~-""<a href="UserAdmin#hn_Why">Why?</a>""
~-""<a href="UserAdmin#hn_The_code">The code</a>""
~-""<a href="UserAdmin#hn_Styling_options">Styling options</a>""
=== Why? ===
No Differences
Additions:
**##""{{useradmin}}""##**
Additions:
~-AdminModules
~-WikkaBetaFeatures
~-UnderDevelopment
==sample output==
The styling of the tables requires a bunch of [[TableStyling new CSS classes]].
The ##useradmin## action accepts two optional styling parameters:
##colcolor##
Enables color for statistics columns
1: enables colored columns (default);
0: disables colored columns;
##rowcolor##
Enables alternate row colors
1: enables colored rows (default);
0: disables colored rows;
The following examples show how the table is rendered using these two parameters:
**##""{{useradmin colcolor="0" rowcolor="0"}}""##**
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<tr>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<tr>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
**##""{{useradmin colcolor="0"}}""##**
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<tr>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
**##""{{useradmin rowcolor="0"}}""##**
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<tr>
<tr>
~-WikkaBetaFeatures
~-UnderDevelopment
==sample output==
The styling of the tables requires a bunch of [[TableStyling new CSS classes]].
The ##useradmin## action accepts two optional styling parameters:
##colcolor##
Enables color for statistics columns
1: enables colored columns (default);
0: disables colored columns;
##rowcolor##
Enables alternate row colors
1: enables colored rows (default);
0: disables colored rows;
The following examples show how the table is rendered using these two parameters:
**##""{{useradmin colcolor="0" rowcolor="0"}}""##**
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<tr>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<tr>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
**##""{{useradmin colcolor="0"}}""##**
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<th class="number" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<td class="number"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="number">0</td>
<td class="number">0</td>
<td class="number">0</td>
<tr>
<td class="number"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
**##""{{useradmin rowcolor="0"}}""##**
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<tr>
<tr>
Deletions:
//(stub)//
//(stub)//
Additions:
**Note:** this action uses the ##ipaddress## field that has been added as a beta antispam feature to this server. Lines relative to this field have been commented out in the code to allow installation on a native wikka package
Deletions:
Additions:
The code below must be saved as ##actions/useradmin.php## and can be used by adding ##""{{useradmin}}""## in the body of a page.
Here's a preview of the interface (the email and IP fields are masked for privacy reasons)
<br />
<form action="#" method="post" id="form_user_admin_panel">
<fieldset><legend>Filter view:</legend>
<label for="q">Search user:</label> <input type ="text" id="q" name="q" title="Enter a search string" size="20" maxlength="50" value=" "/> <input type="submit" value="Submit" /><br />
<label for="l">Show</label>
<select name="l" id="l" title="Select records-per-page limit">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
<option value="300">300</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="857">857</option>
</select> <label for="l">records per page</label> <input type="submit" value="Apply" /><br />
Records (857): 1-10 | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=10&q=" title="Show records from 11 to 20">11-20</a>
<br />
(Sorted by:<em>signuptime, desc</em>)
</fieldset></form>
<form action="http://wikka.jsnx.com/UserAdminTest" id="form_b5eda0a745">
<table summary="List of users registered on this server" border="1px" id="admin_table">
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
<tr >
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select RobinW"/></td>
<td>RobinW</td>
<td>[email protected]</td>
<td class="time">2005-07-30 02:06:20</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3"><a title="Display comments by RobinW (1)" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=comments">1</a></td>
<td class="center"><a title="Remove user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=delete">delete</a> :: <a title="Send feedback to user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=feedback">feedback</a></td>
<tr >
<td><input type="checkbox" id=" " title="Select VictorManuelVarela"/></td>
<td><a href="http://wikka.jsnx.com/VictorManuelVarela" title=" ">VictorManuelVarela</a></td>
<td>[email protected]</td>
<td class="time">2005-07-30 00:01:13</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by VictorManuelVarela (1)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by VictorManuelVarela (6)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=changes">6</a></td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=delete">delete</a> :: <a title="Send feedback to user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=feedback">feedback</a></td>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select EniBevoli"/></td>
<td>EniBevoli</td>
<td>[email protected]</td>
<td class="time">2005-07-29 12:13:44</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2"><a title="Display page edits by EniBevoli (4)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=changes">4</a></td>
<td class="number c3"><a title="Display comments by EniBevoli (1)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=comments">1</a></td>
<td class="center"><a title="Remove user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=delete">delete</a> :: <a title="Send feedback to user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=feedback">feedback</a></td>
<tr >
<td><input type="checkbox" id=" " title="Select MyPrivateWiki"/></td>
<td>MyPrivateWiki</td>
<td>[email protected]</td>
<td class="time">2005-07-28 20:30:36</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=delete">delete</a> :: <a title="Send feedback to user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=feedback">feedback</a></td>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select DaSt"/></td>
<td>DaSt</td>
<td>[email protected]</td>
<td class="time">2005-07-27 17:32:06</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=delete">delete</a> :: <a title="Send feedback to user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=feedback">feedback</a></td>
<tr >
<td><input type="checkbox" id=" " title="Select WikiSop"/></td>
<td>WikiSop</td>
<td>[email protected]</td>
<td class="time">2005-07-27 14:59:07</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=delete">delete</a> :: <a title="Send feedback to user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=feedback">feedback</a></td>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select Aragorn2005"/></td>
<td>Aragorn2005</td>
<td>[email protected]</td>
<td class="time">2005-07-27 08:48:46</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=delete">delete</a> :: <a title="Send feedback to user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=feedback">feedback</a></td>
<fieldset><legend>Mass-action</legend>[<a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=1" title="Check all records">Check all</a> | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=0" title="Uncheck all records">Uncheck all</a>]<br /><label for="action" >With selected</label> <select title="Choose action to apply to selected records" id="action" name="action"><option value=" " selected="selected">---</option><option value="massdelete">Remove all</option><option value="massfeedback">Send feedback to all</option></select> <input type="submit" value="Submit" /></fieldset></form>
==Current features== (//2005-08-31//):
~-added extra column for Signup IP ( installed on this server as a beta feature).
~-added constants, UI strings and a bunch of configurable options including styling options (see below).
==Files needed== (//2004-09-16//):
====The code====
**Note: this action uses the ##ipaddress## field that has been added as a beta antispam feature to this server. Lines relative to this field have been commented out in the code to allow installation on a native wikka package**
%%(php;1)
* @version 1.2
* @input integer $colcolor optional: enables color for statistics columns
* 1: enables colored columns;
* 0: disables colored columns;
* default: 1;
* @input integer $rowcolor optional: enables alternate row colors
* 1: enables colored rows;
* 0: disables colored rows;
* default: 1;
* @output A list of users registered on the current server.
//utilities
* Build an array of numbers consisting of 'ranges' with increasing step size in each 'range'.
* A list of numbers like this is useful for instance for a dropdown to choose
* a period expressed in number of days: a difference between 2 and 5 days may
* be significant while that between 92 and 95 may not be.
* @author {@link http://wikka.jsnx.com/JavaWoman JavaWoman}
* @copyright Copyright (c) 2005, Marjolein Katsma
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @version 1.0
* @param mixed $limits required: single integer or array of integers;
* defines the upper limits of the ranges as well as the next step size
* @param int $max required: upper limit for the whole list
* (will be included if smaller than the largest limit)
* @param int $firstinc optional: increment for the first range; default 1
* @return array resulting list of numbers
// utilities
function optionRanges($limits, $max, $firstinc = 1)
{
// initializations
if (is_int($limits)) $limits = array($limits);
if ($firstinc < 1) $firstinc = 1;
$opts = array();
$inc = $firstinc;
// first element is the first increment
$opts[] = $inc;
// each $limit is the upper limit of a 'range'
foreach ($limits as $limit)
for ($i = $inc + $inc; $i <= $limit && $i < $max; $i += $inc)
{
$opts[] = $i;
// we quit at $max, even if there are more $limit elements
if ($limit >= $max)
{
// add $max to the list; then break out of the loop
$opts[] = $max;
break;
// when $limit is reached, it becomes the new start and increment for the next 'range'
$inc = $limit;
return $opts;
// restrict access to admins
// -------------------------------------
// set default values as constants
define('DEFAULT_RECORDS_LIMIT', '10'); # number of records per page
define('DEFAULT_MIN_RECORDS_DISPLAY', '5'); # min number of records
define('DEFAULT_RECORDS_RANGE',serialize(array('10','50','100','500','1000'))); #range array for records pager
define('DEFAULT_SORT_FIELD', 'signuptime'); # sort field
define('DEFAULT_SORT_ORDER', 'desc'); # sort order, ascendant or descendant
define('DEFAULT_START', '0'); # start record
define('DEFAULT_SEARCH', ''); # keyword to restrict search
define('ALTERNATE_ROW_COLOR', '1'); # switch alternate row color
define('STAT_COLUMN_COLOR', '1'); # switch color for statistics columns
// -------------------------------------
// User-interface: icons
define('OWNED_ICON', 'images/icons/16x16/stock_keyring.png');
define('EDITS_ICON', 'images/icons/16x16/text-editor.png');
define('COMMENTS_ICON', 'images/icons/16x16/stock_help-agent.png');
// -------------------------------------
// User-interface: strings
define('PAGE_TITLE','User Administration');
define('FORM_LEGEND','Filter view:');
define('FORM_SEARCH_STRING_LABEL','Search user:');
define('FORM_SEARCH_STRING_TITLE','Enter a search string');
define('FORM_SEARCH_SUBMIT','Submit');
define('FORM_PAGER_LABEL_BEFORE','Show');
define('FORM_PAGER_TITLE','Select records-per-page limit');
define('FORM_PAGER_LABEL_AFTER','records per page');
define('FORM_PAGER_SUBMIT','Apply');
define('FORM_PAGER_LINK','Show records from %d to %d');
define('FORM_RESULT_INFO','Records');
define('FORM_RESULT_SORTED_BY','Sorted by:');
define('TABLE_HEADING_USERNAME','User Name');
define('TABLE_HEADING_USERNAME_TITLE','Sort by user name');
define('TABLE_HEADING_EMAIL','Email');
define('TABLE_HEADING_EMAIL_TITLE','Sort by email');
define('TABLE_HEADING_SIGNUPTIME','Signup Time');
define('TABLE_HEADING_SIGNUPTIME_TITLE','Sort by signup time');
define('TABLE_HEADING_SIGNUPIP','Signup IP');
define('TABLE_HEADING_SIGNUPIP_TITLE','Sort by signup IP');
define('TABLE_SUMMARY','List of users registered on this server');
define('TABLE_HEADING_OWNED_TITLE','Owned Pages');
define('TABLE_HEADING_EDITS_TITLE','Page Edits');
define('TABLE_HEADING_COMMENTS_TITLE','Comments');
define('ACTION_DELETE_LINK_TITLE','Remove user %s');
define('ACTION_FEEDBACK_LINK_TITLE','Send feedback to user %s');
define('ACTION_DELETE_LINK','delete');
define('ACTION_FEEDBACK_LINK','feedback');
define('TABLE_CELL_OWNED_TITLE','Display pages owned by %s (%d)');
define('TABLE_CELL_EDITS_TITLE','Display page edits by %s (%d)');
define('TABLE_CELL_COMMENTS_TITLE','Display comments by %s (%d)');
define('SELECT_RECORD_TITLE','Select %s');
define('CHECK_ALL_TITLE','Check all records');
define('CHECK_ALL','Check all');
define('UNCHECK_ALL_TITLE','Uncheck all records');
define('UNCHECK_ALL','Uncheck all');
define('FORM_MASSACTION_LEGEND','Mass-action');
define('FORM_MASSACTION_LABEL','With selected');
define('FORM_MASSACTION_SELECT_TITLE','Choose action to apply to selected records');
define('FORM_MASSACTION_OPT_DELETE','Remove all');
define('FORM_MASSACTION_OPT_FEEDBACK','Send feedback to all');
define('FORM_MASSACTION_SUBMIT','Submit');
define('ERROR_NO_MATCHES','Sorry, there are no users matching "%s"');
//initialize row & column colors variables
$r = 1; #initialize row counter
$r_color = ALTERNATE_ROW_COLOR; #get alternate row color option
$c_color = STAT_COLUMN_COLOR; #get column color option
// record dropdown
$user_limits = unserialize(DEFAULT_RECORDS_RANGE);
// pager
//override defaults with action parameters
if (is_array($vars))
foreach ($vars as $param => $value)
{
switch ($param)
{
case 'colcolor':
$c_color = (preg_match('/[01]/',$value))? $value : STAT_COLUMN_COLOR;
break;
case 'rowcolor':
$r_color = (preg_match('/[01]/',$value))? $value : ALTERNATE_ROW_COLOR;
break;
}
//perform actions if required
if ($_GET['action'] == 'feedback' || $_REQUEST['mail'])
echo $this->Action('userfeedback');
}
elseif ($_GET['action'] == 'owned')
echo $this->Action('userpages');
}
elseif ($_GET['action'] == 'changes')
echo $this->Action('userchanges');
}
elseif ($_GET['action'] == 'comments')
echo $this->Action('usercomments');
}
else
// process URL variables
# JW 2005-07-19 some modifications to avoid notices but these are still not actually secure
// number of records per page
if (isset($_POST['l']))
$l = $_POST['l'];
elseif (isset($_GET['l']))
$l = $_GET['l'];
else
$l = DEFAULT_RECORDS_LIMIT;
// sort field
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : DEFAULT_SORT_FIELD;
// sort order
$d = (isset($_GET['d'])) ? $_GET['d'] : DEFAULT_SORT_ORDER;
// start record
$s = (isset($_GET['s'])) ? $_GET['s'] : DEFAULT_START;
// search string
if (isset($_POST['q']))
$q = $_POST['q'];
elseif (isset($_GET['q']))
$q = $_GET['q'];
else
$q = DEFAULT_SEARCH;
// select all
$checked = '';
if (isset($_GET['selectall']))
{
$checked = (1 == $_GET['selectall']) ? ' checked="checked"' : '';
// restrict MySQL query by search string
$where = ('' == $q) ? "1" : "`name` LIKE '%".$q."%'";
// get total number of users
$numusers = $this->getCount('users', $where);
// print page header
echo $this->Format('==== '.PAGE_TITLE.' ==== --- ');
// build pager form
$form = $this->FormOpen('','','post','user_admin_panel');
$form .= '<fieldset><legend>'.FORM_LEGEND.'</legend>'."\n";
$form .= '<label for="q">'.FORM_SEARCH_STRING_LABEL.'</label> <input type ="text" id="q" name="q" title="'.FORM_SEARCH_STRING_TITLE.'" size="20" maxlength="50" value="'.$q.'"/> <input type="submit" value="'.FORM_SEARCH_SUBMIT.'" /><br />'."\n";
// ranged drop-down
$users_opts = optionRanges($user_limits,$numusers,DEFAULT_MIN_RECORDS_DISPLAY);
$form .= '<label for="l">'.FORM_PAGER_LABEL_BEFORE.'</label> '."\n";
$form .= '<select name="l" id="l" title="'.FORM_PAGER_TITLE.'">'."\n";
// build drop-down
foreach ($users_opts as $opt) {
$selected = ($opt == $l) ? ' selected="selected"' : '';
$form .= '<option value="'.$opt.'"'.$selected.'>'.$opt.'</option>'."\n";
$form .= '</select> <label for="l">'.FORM_PAGER_LABEL_AFTER.'</label> <input type="submit" value="'.FORM_PAGER_SUBMIT.'" /><br />'."\n";
// build pager links
if ($s > 0)
$prev = '<a href="' .$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s-$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s-$l+1), $s).'">'.($s-$l+1).'-'.$s.'</a> | '."\n";
if ($numusers > ($s + $l))
$next = ' | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s+$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s+$l+1), ($s+2*$l)).'">'.($s+$l+1).'-'.($s+2*$l).'</a>'."\n";
$form .= FORM_RESULT_INFO.' ('.$numusers.'): '.$prev.($s+1).'-'.($s+$l).$next.'<br />'."\n";
$form .= '('.FORM_RESULT_SORTED_BY.'<em>'.$sort.', '.$d.'</em>)'."\n";
$form .= '</fieldset>'.$this->FormClose()."\n";
// print form
echo $form;
// get user list
$userdata = $this->LoadAll("SELECT * FROM ".$this->config["table_prefix"]."users WHERE ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// build header links
$nameheader = '<a href="'.$this->Href('','', (($sort == 'name' && $d == 'asc')? 'l='.$l.'&sort=name&d=desc' : 'l='.$l.'&sort=name&d=asc')).'" title="'.TABLE_HEADING_USERNAME_TITLE.'">'.TABLE_HEADING_USERNAME.'</a>';
$emailheader = '<a href="'.$this->Href('','', (($sort == 'email' && $d == 'asc')? 'l='.$l.'&sort=email&d=desc' : 'l='.$l.'&sort=email&d=asc')).'" title="'.TABLE_HEADING_EMAIL_TITLE.'">'.TABLE_HEADING_EMAIL.'</a>';
$timeheader = '<a href="'.$this->Href('','', (($sort == 'signuptime' && $d == 'desc')? 'l='.$l.'&sort=signuptime&d=asc' : 'l='.$l.'')).'" title="'.TABLE_HEADING_SIGNUPTIME_TITLE.'">'.TABLE_HEADING_SIGNUPTIME.'</a>';
/*$ipheader = '<a href="'.$this->Href('','', (($sort == 'ipaddress' && $d == 'desc')? 'l='.$l.'&sort=ipaddress&d=asc' : 'l='.$l.'&sort=ipaddress&d=desc')).'" title="'.TABLE_HEADING_SIGNUPIP_TITLE.'">'.TABLE_HEADING_SIGNUPIP.'</a>'; # installed as beta feature at wikka.jsnx.com */
// build table headers
$htmlout = "<table summary=\"".TABLE_SUMMARY."\" border=\"1px\" id=\"admin_table\">\n<thead>\n".
" <tr>\n".
" <th> </th>\n".
" <th>".$nameheader."</th>\n".
" <th>".$emailheader."</th>\n".
" <th>".$timeheader."</th>\n".
/* " <th>".$ipheader."</th>\n". # installed as beta feature at wikka.jsnx.com */
" <th class=\"number ".(($c_color == 1)? ' c1' : '')."\" title=\"".TABLE_HEADING_OWNED_TITLE."\"><img src=\"".OWNED_ICON."\" alt=\"O\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c2' : '')."\" title=\"".TABLE_HEADING_EDITS_TITLE."\"><img src=\"".EDITS_ICON."\" alt=\"E\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c3' : '')."\" title=\"".TABLE_HEADING_COMMENTS_TITLE."\"><img src=\"".COMMENTS_ICON."\" alt=\"C\"/></th>\n".
" <th class=\"center\">Actions</th>\n".
" </tr>\n</thead>\n";
// print user table
foreach($userdata as $user) {
// get counts
$where_owned = "`owner` = '".$user['name']."' AND latest = 'Y'";
$where_changes = "`user` = '".$user['name']."'";
$where_comments = "`user` = '".$user['name']."'";
$numowned = $this->getCount('pages', $where_owned);
$numchanges = $this->getCount('pages', $where_changes);
$numcomments = $this->getCount('comments', $where_comments);
// build statistics links if needed
$ownedlink = ($numowned > 0)? '<a title="'.sprintf(TABLE_CELL_OWNED_TITLE,$user['name'],$numowned).'" href="'.$this->Href('','','user='.$user['name'].'&action=owned').'">'.$numowned.'</a>' : '0';
$changeslink = ($numchanges > 0)? '<a title="'.sprintf(TABLE_CELL_EDITS_TITLE,$user['name'],$numchanges).'" href="'.$this->Href('','','user='.$user['name'].'&action=changes').'">'.$numchanges.'</a>' : '0';
$commentslink = ($numcomments > 0)? '<a title="'.sprintf(TABLE_CELL_COMMENTS_TITLE,$user['name'],$numcomments).'" href="'.$this->Href('','','user='.$user['name'].'&action=comments').'">'.$numcomments.'</a>' : '0';
// build handler links
$deleteuser = '<a title="'.sprintf(ACTION_DELETE_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=delete').'">'.ACTION_DELETE_LINK.'</a>';
$feedbackuser = '<a title="'.sprintf(ACTION_FEEDBACK_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=feedback').'">'.ACTION_FEEDBACK_LINK.'</a>';
// build table body
$htmlout .= "<tbody>\n";
if ($r_color == 1) {
$htmlout .= "<tr ".(($r%2)? '' : 'class="alt"').">\n"; #enable alternate row color
} else {
$htmlout .= "<tr>\n"; #disable alternate row color
}
$htmlout .= " <td><input type=\"checkbox\" id=\"".$user['id']."\"".$checked." title=\"".sprintf(SELECT_RECORD_TITLE,$user['name'])."\"/></td>\n".
" <td>".(($this->ExistsPage($user['name']))? $this->Link($user['name']) : $user['name'])."</td>\n". #check if userpage exists
" <td>".$user['email']."</td>\n".
" <td class=\"time\">".$user['signuptime']."</td>\n".
/* " <td>".$user['ipaddress']."</td>\n". # installed as beta feature at wikka.jsnx.com */
" <td class=\"number".(($c_color == 1)? ' c1' : '')."\">".$ownedlink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c2' : '')."\">".$changeslink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c3' : '')."\">".$commentslink."</td>\n". #set column color
" <td class=\"center\">".$deleteuser." :: ".$feedbackuser."</td>\n";
$htmlout .= " </tr>\n</tbody>\n";
//increase row counter ----- alternate row colors
if ($r_color == 1) $r++;
}
$htmlout .= "</table>\n";
// print the table
echo $this->FormOpen('','','get');
echo $htmlout;
// multiple-user operations (forthcoming) JW 2005-07-19 accesskey removed (causes more problems than it solves)
echo '<fieldset><legend>'.FORM_MASSACTION_LEGEND.'</legend>';
echo '[<a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=1').'" title="'.CHECK_ALL_TITLE.'">'.CHECK_ALL.'</a> | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=0').'" title="'.UNCHECK_ALL_TITLE.'">'.UNCHECK_ALL.'</a>]<br />';
echo '<label for="action" >'.FORM_MASSACTION_LABEL.'</label> <select title="'.FORM_MASSACTION_SELECT_TITLE.'" id="action" name="action">';
echo '<option value="" selected="selected">---</option>';
echo '<option value="massdelete">'.FORM_MASSACTION_OPT_DELETE.'</option>';
echo '<option value="massfeedback">'.FORM_MASSACTION_OPT_FEEDBACK.'</option>';
echo '</select> <input type="submit" value="'.FORM_MASSACTION_SUBMIT.'" />';
echo '</fieldset>';
echo $this->FormClose();
}
else
{
// no records matching the search string: print error message
echo '<p><span class="error">'.sprintf(ERROR_NO_MATCHES, $q).'</span></p>';
echo $this->Action('lastusers');
===New CSS classes===
//(stub)//
==== Styling options ====
//(stub)//
Here's a preview of the interface (the email and IP fields are masked for privacy reasons)
<br />
<form action="#" method="post" id="form_user_admin_panel">
<fieldset><legend>Filter view:</legend>
<label for="q">Search user:</label> <input type ="text" id="q" name="q" title="Enter a search string" size="20" maxlength="50" value=" "/> <input type="submit" value="Submit" /><br />
<label for="l">Show</label>
<select name="l" id="l" title="Select records-per-page limit">
<option value="5">5</option>
<option value="10" selected="selected">10</option>
<option value="20">20</option>
<option value="30">30</option>
<option value="40">40</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
<option value="300">300</option>
<option value="400">400</option>
<option value="500">500</option>
<option value="857">857</option>
</select> <label for="l">records per page</label> <input type="submit" value="Apply" /><br />
Records (857): 1-10 | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=10&q=" title="Show records from 11 to 20">11-20</a>
<br />
(Sorted by:<em>signuptime, desc</em>)
</fieldset></form>
<form action="http://wikka.jsnx.com/UserAdminTest" id="form_b5eda0a745">
<table summary="List of users registered on this server" border="1px" id="admin_table">
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">User Name</a></th>
<th class="number c1" title="Owned Pages"><img src="images/icons/16x16/stock_keyring.png" alt="O"/></th>
<th class="number c2" title="Page Edits"><img src="images/icons/16x16/text-editor.png" alt="E"/></th>
<th class="number c3" title="Comments"><img src="images/icons/16x16/stock_help-agent.png" alt="C"/></th>
<th class="center">Actions</th>
<tr >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>[email protected]</td>
<td class="time">2005-08-01 09:01:54</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by HypeXR (2)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=changes">2</a></td>
<td class="number c3"><a title="Display comments by HypeXR (1)" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=comments">1</a></td>
<td class="center"><a title="Remove user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=delete">delete</a> :: <a title="Send feedback to user HypeXR" href="http://wikka.jsnx.com/UserAdminTest?user=HypeXR&action=feedback">feedback</a></td>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>[email protected]</td>
<td class="time">2005-07-31 19:35:26</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=delete">delete</a> :: <a title="Send feedback to user WiebTest" href="http://wikka.jsnx.com/UserAdminTest?user=WiebTest&action=feedback">feedback</a></td>
<tr >
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>[email protected]</td>
<td class="time">2005-07-31 00:22:58</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by DennyShimkoski (6)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=owned">6</a></td>
<td class="number c2"><a title="Display page edits by DennyShimkoski (38)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=changes">38</a></td>
<td class="number c3"><a title="Display comments by DennyShimkoski (1)" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=comments">1</a></td>
<td class="center"><a title="Remove user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=delete">delete</a> :: <a title="Send feedback to user DennyShimkoski" href="http://wikka.jsnx.com/UserAdminTest?user=DennyShimkoski&action=feedback">feedback</a></td>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select RobinW"/></td>
<td>RobinW</td>
<td>[email protected]</td>
<td class="time">2005-07-30 02:06:20</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3"><a title="Display comments by RobinW (1)" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=comments">1</a></td>
<td class="center"><a title="Remove user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=delete">delete</a> :: <a title="Send feedback to user RobinW" href="http://wikka.jsnx.com/UserAdminTest?user=RobinW&action=feedback">feedback</a></td>
<tr >
<td><input type="checkbox" id=" " title="Select VictorManuelVarela"/></td>
<td><a href="http://wikka.jsnx.com/VictorManuelVarela" title=" ">VictorManuelVarela</a></td>
<td>[email protected]</td>
<td class="time">2005-07-30 00:01:13</td>
<td>XX.XX.XX.XX</td>
<td class="number c1"><a title="Display pages owned by VictorManuelVarela (1)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=owned">1</a></td>
<td class="number c2"><a title="Display page edits by VictorManuelVarela (6)" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=changes">6</a></td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=delete">delete</a> :: <a title="Send feedback to user VictorManuelVarela" href="http://wikka.jsnx.com/UserAdminTest?user=VictorManuelVarela&action=feedback">feedback</a></td>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select EniBevoli"/></td>
<td>EniBevoli</td>
<td>[email protected]</td>
<td class="time">2005-07-29 12:13:44</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2"><a title="Display page edits by EniBevoli (4)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=changes">4</a></td>
<td class="number c3"><a title="Display comments by EniBevoli (1)" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=comments">1</a></td>
<td class="center"><a title="Remove user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=delete">delete</a> :: <a title="Send feedback to user EniBevoli" href="http://wikka.jsnx.com/UserAdminTest?user=EniBevoli&action=feedback">feedback</a></td>
<tr >
<td><input type="checkbox" id=" " title="Select MyPrivateWiki"/></td>
<td>MyPrivateWiki</td>
<td>[email protected]</td>
<td class="time">2005-07-28 20:30:36</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=delete">delete</a> :: <a title="Send feedback to user MyPrivateWiki" href="http://wikka.jsnx.com/UserAdminTest?user=MyPrivateWiki&action=feedback">feedback</a></td>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select DaSt"/></td>
<td>DaSt</td>
<td>[email protected]</td>
<td class="time">2005-07-27 17:32:06</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=delete">delete</a> :: <a title="Send feedback to user DaSt" href="http://wikka.jsnx.com/UserAdminTest?user=DaSt&action=feedback">feedback</a></td>
<tr >
<td><input type="checkbox" id=" " title="Select WikiSop"/></td>
<td>WikiSop</td>
<td>[email protected]</td>
<td class="time">2005-07-27 14:59:07</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=delete">delete</a> :: <a title="Send feedback to user WikiSop" href="http://wikka.jsnx.com/UserAdminTest?user=WikiSop&action=feedback">feedback</a></td>
<tr class="alt">
<td><input type="checkbox" id=" " title="Select Aragorn2005"/></td>
<td>Aragorn2005</td>
<td>[email protected]</td>
<td class="time">2005-07-27 08:48:46</td>
<td>XX.XX.XX.XX</td>
<td class="number c1">0</td>
<td class="number c2">0</td>
<td class="number c3">0</td>
<td class="center"><a title="Remove user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=delete">delete</a> :: <a title="Send feedback to user Aragorn2005" href="http://wikka.jsnx.com/UserAdminTest?user=Aragorn2005&action=feedback">feedback</a></td>
<fieldset><legend>Mass-action</legend>[<a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=1" title="Check all records">Check all</a> | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=0&q=&selectall=0" title="Uncheck all records">Uncheck all</a>]<br /><label for="action" >With selected</label> <select title="Choose action to apply to selected records" id="action" name="action"><option value=" " selected="selected">---</option><option value="massdelete">Remove all</option><option value="massfeedback">Send feedback to all</option></select> <input type="submit" value="Submit" /></fieldset></form>
==Current features== (//2005-08-31//):
~-added extra column for Signup IP ( installed on this server as a beta feature).
~-added constants, UI strings and a bunch of configurable options including styling options (see below).
==Files needed== (//2004-09-16//):
====The code====
**Note: this action uses the ##ipaddress## field that has been added as a beta antispam feature to this server. Lines relative to this field have been commented out in the code to allow installation on a native wikka package**
%%(php;1)
* @version 1.2
* @input integer $colcolor optional: enables color for statistics columns
* 1: enables colored columns;
* 0: disables colored columns;
* default: 1;
* @input integer $rowcolor optional: enables alternate row colors
* 1: enables colored rows;
* 0: disables colored rows;
* default: 1;
* @output A list of users registered on the current server.
//utilities
* Build an array of numbers consisting of 'ranges' with increasing step size in each 'range'.
* A list of numbers like this is useful for instance for a dropdown to choose
* a period expressed in number of days: a difference between 2 and 5 days may
* be significant while that between 92 and 95 may not be.
* @author {@link http://wikka.jsnx.com/JavaWoman JavaWoman}
* @copyright Copyright (c) 2005, Marjolein Katsma
* @license http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License
* @version 1.0
* @param mixed $limits required: single integer or array of integers;
* defines the upper limits of the ranges as well as the next step size
* @param int $max required: upper limit for the whole list
* (will be included if smaller than the largest limit)
* @param int $firstinc optional: increment for the first range; default 1
* @return array resulting list of numbers
// utilities
function optionRanges($limits, $max, $firstinc = 1)
{
// initializations
if (is_int($limits)) $limits = array($limits);
if ($firstinc < 1) $firstinc = 1;
$opts = array();
$inc = $firstinc;
// first element is the first increment
$opts[] = $inc;
// each $limit is the upper limit of a 'range'
foreach ($limits as $limit)
for ($i = $inc + $inc; $i <= $limit && $i < $max; $i += $inc)
{
$opts[] = $i;
// we quit at $max, even if there are more $limit elements
if ($limit >= $max)
{
// add $max to the list; then break out of the loop
$opts[] = $max;
break;
// when $limit is reached, it becomes the new start and increment for the next 'range'
$inc = $limit;
return $opts;
// restrict access to admins
// -------------------------------------
// set default values as constants
define('DEFAULT_RECORDS_LIMIT', '10'); # number of records per page
define('DEFAULT_MIN_RECORDS_DISPLAY', '5'); # min number of records
define('DEFAULT_RECORDS_RANGE',serialize(array('10','50','100','500','1000'))); #range array for records pager
define('DEFAULT_SORT_FIELD', 'signuptime'); # sort field
define('DEFAULT_SORT_ORDER', 'desc'); # sort order, ascendant or descendant
define('DEFAULT_START', '0'); # start record
define('DEFAULT_SEARCH', ''); # keyword to restrict search
define('ALTERNATE_ROW_COLOR', '1'); # switch alternate row color
define('STAT_COLUMN_COLOR', '1'); # switch color for statistics columns
// -------------------------------------
// User-interface: icons
define('OWNED_ICON', 'images/icons/16x16/stock_keyring.png');
define('EDITS_ICON', 'images/icons/16x16/text-editor.png');
define('COMMENTS_ICON', 'images/icons/16x16/stock_help-agent.png');
// -------------------------------------
// User-interface: strings
define('PAGE_TITLE','User Administration');
define('FORM_LEGEND','Filter view:');
define('FORM_SEARCH_STRING_LABEL','Search user:');
define('FORM_SEARCH_STRING_TITLE','Enter a search string');
define('FORM_SEARCH_SUBMIT','Submit');
define('FORM_PAGER_LABEL_BEFORE','Show');
define('FORM_PAGER_TITLE','Select records-per-page limit');
define('FORM_PAGER_LABEL_AFTER','records per page');
define('FORM_PAGER_SUBMIT','Apply');
define('FORM_PAGER_LINK','Show records from %d to %d');
define('FORM_RESULT_INFO','Records');
define('FORM_RESULT_SORTED_BY','Sorted by:');
define('TABLE_HEADING_USERNAME','User Name');
define('TABLE_HEADING_USERNAME_TITLE','Sort by user name');
define('TABLE_HEADING_EMAIL','Email');
define('TABLE_HEADING_EMAIL_TITLE','Sort by email');
define('TABLE_HEADING_SIGNUPTIME','Signup Time');
define('TABLE_HEADING_SIGNUPTIME_TITLE','Sort by signup time');
define('TABLE_HEADING_SIGNUPIP','Signup IP');
define('TABLE_HEADING_SIGNUPIP_TITLE','Sort by signup IP');
define('TABLE_SUMMARY','List of users registered on this server');
define('TABLE_HEADING_OWNED_TITLE','Owned Pages');
define('TABLE_HEADING_EDITS_TITLE','Page Edits');
define('TABLE_HEADING_COMMENTS_TITLE','Comments');
define('ACTION_DELETE_LINK_TITLE','Remove user %s');
define('ACTION_FEEDBACK_LINK_TITLE','Send feedback to user %s');
define('ACTION_DELETE_LINK','delete');
define('ACTION_FEEDBACK_LINK','feedback');
define('TABLE_CELL_OWNED_TITLE','Display pages owned by %s (%d)');
define('TABLE_CELL_EDITS_TITLE','Display page edits by %s (%d)');
define('TABLE_CELL_COMMENTS_TITLE','Display comments by %s (%d)');
define('SELECT_RECORD_TITLE','Select %s');
define('CHECK_ALL_TITLE','Check all records');
define('CHECK_ALL','Check all');
define('UNCHECK_ALL_TITLE','Uncheck all records');
define('UNCHECK_ALL','Uncheck all');
define('FORM_MASSACTION_LEGEND','Mass-action');
define('FORM_MASSACTION_LABEL','With selected');
define('FORM_MASSACTION_SELECT_TITLE','Choose action to apply to selected records');
define('FORM_MASSACTION_OPT_DELETE','Remove all');
define('FORM_MASSACTION_OPT_FEEDBACK','Send feedback to all');
define('FORM_MASSACTION_SUBMIT','Submit');
define('ERROR_NO_MATCHES','Sorry, there are no users matching "%s"');
//initialize row & column colors variables
$r = 1; #initialize row counter
$r_color = ALTERNATE_ROW_COLOR; #get alternate row color option
$c_color = STAT_COLUMN_COLOR; #get column color option
// record dropdown
$user_limits = unserialize(DEFAULT_RECORDS_RANGE);
// pager
//override defaults with action parameters
if (is_array($vars))
foreach ($vars as $param => $value)
{
switch ($param)
{
case 'colcolor':
$c_color = (preg_match('/[01]/',$value))? $value : STAT_COLUMN_COLOR;
break;
case 'rowcolor':
$r_color = (preg_match('/[01]/',$value))? $value : ALTERNATE_ROW_COLOR;
break;
}
//perform actions if required
if ($_GET['action'] == 'feedback' || $_REQUEST['mail'])
echo $this->Action('userfeedback');
}
elseif ($_GET['action'] == 'owned')
echo $this->Action('userpages');
}
elseif ($_GET['action'] == 'changes')
echo $this->Action('userchanges');
}
elseif ($_GET['action'] == 'comments')
echo $this->Action('usercomments');
}
else
// process URL variables
# JW 2005-07-19 some modifications to avoid notices but these are still not actually secure
// number of records per page
if (isset($_POST['l']))
$l = $_POST['l'];
elseif (isset($_GET['l']))
$l = $_GET['l'];
else
$l = DEFAULT_RECORDS_LIMIT;
// sort field
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : DEFAULT_SORT_FIELD;
// sort order
$d = (isset($_GET['d'])) ? $_GET['d'] : DEFAULT_SORT_ORDER;
// start record
$s = (isset($_GET['s'])) ? $_GET['s'] : DEFAULT_START;
// search string
if (isset($_POST['q']))
$q = $_POST['q'];
elseif (isset($_GET['q']))
$q = $_GET['q'];
else
$q = DEFAULT_SEARCH;
// select all
$checked = '';
if (isset($_GET['selectall']))
{
$checked = (1 == $_GET['selectall']) ? ' checked="checked"' : '';
// restrict MySQL query by search string
$where = ('' == $q) ? "1" : "`name` LIKE '%".$q."%'";
// get total number of users
$numusers = $this->getCount('users', $where);
// print page header
echo $this->Format('==== '.PAGE_TITLE.' ==== --- ');
// build pager form
$form = $this->FormOpen('','','post','user_admin_panel');
$form .= '<fieldset><legend>'.FORM_LEGEND.'</legend>'."\n";
$form .= '<label for="q">'.FORM_SEARCH_STRING_LABEL.'</label> <input type ="text" id="q" name="q" title="'.FORM_SEARCH_STRING_TITLE.'" size="20" maxlength="50" value="'.$q.'"/> <input type="submit" value="'.FORM_SEARCH_SUBMIT.'" /><br />'."\n";
// ranged drop-down
$users_opts = optionRanges($user_limits,$numusers,DEFAULT_MIN_RECORDS_DISPLAY);
$form .= '<label for="l">'.FORM_PAGER_LABEL_BEFORE.'</label> '."\n";
$form .= '<select name="l" id="l" title="'.FORM_PAGER_TITLE.'">'."\n";
// build drop-down
foreach ($users_opts as $opt) {
$selected = ($opt == $l) ? ' selected="selected"' : '';
$form .= '<option value="'.$opt.'"'.$selected.'>'.$opt.'</option>'."\n";
$form .= '</select> <label for="l">'.FORM_PAGER_LABEL_AFTER.'</label> <input type="submit" value="'.FORM_PAGER_SUBMIT.'" /><br />'."\n";
// build pager links
if ($s > 0)
$prev = '<a href="' .$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s-$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s-$l+1), $s).'">'.($s-$l+1).'-'.$s.'</a> | '."\n";
if ($numusers > ($s + $l))
$next = ' | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s+$l)).'&q='.$q.'" title="'.sprintf(FORM_PAGER_LINK, ($s+$l+1), ($s+2*$l)).'">'.($s+$l+1).'-'.($s+2*$l).'</a>'."\n";
$form .= FORM_RESULT_INFO.' ('.$numusers.'): '.$prev.($s+1).'-'.($s+$l).$next.'<br />'."\n";
$form .= '('.FORM_RESULT_SORTED_BY.'<em>'.$sort.', '.$d.'</em>)'."\n";
$form .= '</fieldset>'.$this->FormClose()."\n";
// print form
echo $form;
// get user list
$userdata = $this->LoadAll("SELECT * FROM ".$this->config["table_prefix"]."users WHERE ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// build header links
$nameheader = '<a href="'.$this->Href('','', (($sort == 'name' && $d == 'asc')? 'l='.$l.'&sort=name&d=desc' : 'l='.$l.'&sort=name&d=asc')).'" title="'.TABLE_HEADING_USERNAME_TITLE.'">'.TABLE_HEADING_USERNAME.'</a>';
$emailheader = '<a href="'.$this->Href('','', (($sort == 'email' && $d == 'asc')? 'l='.$l.'&sort=email&d=desc' : 'l='.$l.'&sort=email&d=asc')).'" title="'.TABLE_HEADING_EMAIL_TITLE.'">'.TABLE_HEADING_EMAIL.'</a>';
$timeheader = '<a href="'.$this->Href('','', (($sort == 'signuptime' && $d == 'desc')? 'l='.$l.'&sort=signuptime&d=asc' : 'l='.$l.'')).'" title="'.TABLE_HEADING_SIGNUPTIME_TITLE.'">'.TABLE_HEADING_SIGNUPTIME.'</a>';
/*$ipheader = '<a href="'.$this->Href('','', (($sort == 'ipaddress' && $d == 'desc')? 'l='.$l.'&sort=ipaddress&d=asc' : 'l='.$l.'&sort=ipaddress&d=desc')).'" title="'.TABLE_HEADING_SIGNUPIP_TITLE.'">'.TABLE_HEADING_SIGNUPIP.'</a>'; # installed as beta feature at wikka.jsnx.com */
// build table headers
$htmlout = "<table summary=\"".TABLE_SUMMARY."\" border=\"1px\" id=\"admin_table\">\n<thead>\n".
" <tr>\n".
" <th> </th>\n".
" <th>".$nameheader."</th>\n".
" <th>".$emailheader."</th>\n".
" <th>".$timeheader."</th>\n".
/* " <th>".$ipheader."</th>\n". # installed as beta feature at wikka.jsnx.com */
" <th class=\"number ".(($c_color == 1)? ' c1' : '')."\" title=\"".TABLE_HEADING_OWNED_TITLE."\"><img src=\"".OWNED_ICON."\" alt=\"O\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c2' : '')."\" title=\"".TABLE_HEADING_EDITS_TITLE."\"><img src=\"".EDITS_ICON."\" alt=\"E\"/></th>\n".
" <th class=\"number ".(($c_color == 1)? ' c3' : '')."\" title=\"".TABLE_HEADING_COMMENTS_TITLE."\"><img src=\"".COMMENTS_ICON."\" alt=\"C\"/></th>\n".
" <th class=\"center\">Actions</th>\n".
" </tr>\n</thead>\n";
// print user table
foreach($userdata as $user) {
// get counts
$where_owned = "`owner` = '".$user['name']."' AND latest = 'Y'";
$where_changes = "`user` = '".$user['name']."'";
$where_comments = "`user` = '".$user['name']."'";
$numowned = $this->getCount('pages', $where_owned);
$numchanges = $this->getCount('pages', $where_changes);
$numcomments = $this->getCount('comments', $where_comments);
// build statistics links if needed
$ownedlink = ($numowned > 0)? '<a title="'.sprintf(TABLE_CELL_OWNED_TITLE,$user['name'],$numowned).'" href="'.$this->Href('','','user='.$user['name'].'&action=owned').'">'.$numowned.'</a>' : '0';
$changeslink = ($numchanges > 0)? '<a title="'.sprintf(TABLE_CELL_EDITS_TITLE,$user['name'],$numchanges).'" href="'.$this->Href('','','user='.$user['name'].'&action=changes').'">'.$numchanges.'</a>' : '0';
$commentslink = ($numcomments > 0)? '<a title="'.sprintf(TABLE_CELL_COMMENTS_TITLE,$user['name'],$numcomments).'" href="'.$this->Href('','','user='.$user['name'].'&action=comments').'">'.$numcomments.'</a>' : '0';
// build handler links
$deleteuser = '<a title="'.sprintf(ACTION_DELETE_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=delete').'">'.ACTION_DELETE_LINK.'</a>';
$feedbackuser = '<a title="'.sprintf(ACTION_FEEDBACK_LINK_TITLE, $user['name']).'" href="'.$this->Href('','','user='.$user['name'].'&action=feedback').'">'.ACTION_FEEDBACK_LINK.'</a>';
// build table body
$htmlout .= "<tbody>\n";
if ($r_color == 1) {
$htmlout .= "<tr ".(($r%2)? '' : 'class="alt"').">\n"; #enable alternate row color
} else {
$htmlout .= "<tr>\n"; #disable alternate row color
}
$htmlout .= " <td><input type=\"checkbox\" id=\"".$user['id']."\"".$checked." title=\"".sprintf(SELECT_RECORD_TITLE,$user['name'])."\"/></td>\n".
" <td>".(($this->ExistsPage($user['name']))? $this->Link($user['name']) : $user['name'])."</td>\n". #check if userpage exists
" <td>".$user['email']."</td>\n".
" <td class=\"time\">".$user['signuptime']."</td>\n".
/* " <td>".$user['ipaddress']."</td>\n". # installed as beta feature at wikka.jsnx.com */
" <td class=\"number".(($c_color == 1)? ' c1' : '')."\">".$ownedlink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c2' : '')."\">".$changeslink."</td>\n". #set column color
" <td class=\"number".(($c_color == 1)? ' c3' : '')."\">".$commentslink."</td>\n". #set column color
" <td class=\"center\">".$deleteuser." :: ".$feedbackuser."</td>\n";
$htmlout .= " </tr>\n</tbody>\n";
//increase row counter ----- alternate row colors
if ($r_color == 1) $r++;
}
$htmlout .= "</table>\n";
// print the table
echo $this->FormOpen('','','get');
echo $htmlout;
// multiple-user operations (forthcoming) JW 2005-07-19 accesskey removed (causes more problems than it solves)
echo '<fieldset><legend>'.FORM_MASSACTION_LEGEND.'</legend>';
echo '[<a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=1').'" title="'.CHECK_ALL_TITLE.'">'.CHECK_ALL.'</a> | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.$s.'&q='.$q.'&selectall=0').'" title="'.UNCHECK_ALL_TITLE.'">'.UNCHECK_ALL.'</a>]<br />';
echo '<label for="action" >'.FORM_MASSACTION_LABEL.'</label> <select title="'.FORM_MASSACTION_SELECT_TITLE.'" id="action" name="action">';
echo '<option value="" selected="selected">---</option>';
echo '<option value="massdelete">'.FORM_MASSACTION_OPT_DELETE.'</option>';
echo '<option value="massfeedback">'.FORM_MASSACTION_OPT_FEEDBACK.'</option>';
echo '</select> <input type="submit" value="'.FORM_MASSACTION_SUBMIT.'" />';
echo '</fieldset>';
echo $this->FormClose();
}
else
{
// no records matching the search string: print error message
echo '<p><span class="error">'.sprintf(ERROR_NO_MATCHES, $q).'</span></p>';
echo $this->Action('lastusers');
===New CSS classes===
//(stub)//
==== Styling options ====
//(stub)//
Deletions:
Here's a preview of the interface (email addresses are masked for privacy reasons)
<br /> <form action="#" method="post" id="form_42b90196b4">
<div style="float:left; margin-top:10px; margin-bottom:10px; padding:10px; border:1px dotted #AAA; background-color:#EEE; line-height:.9em"><p>Search user: <input type ="text" title="Enter a search string" name="q" size="20" maxlength="50" value=" "/><input type="submit" value="Submit" /></p><p>Show <select name="l" title="Select records-per-page limit"><option value="10" selected>10</option><option value="20" >20</option><option value="30" >30</option><option value="40" >40</option><option value="50" >50</option><option value="60" >60</option><option value="70" >70</option><option value="80" >80</option><option value="90" >90</option><option value="100" >100</option><option value="110" >110</option><option value="120" >120</option><option value="130" >130</option><option value="140" >140</option><option value="150" >150</option><option value="160" >160</option><option value="170" >170</option><option value="180" >180</option><option value="190" >190</option><option value="200" >200</option><option value="210" >210</option><option value="220" >220</option><option value="230" >230</option><option value="240" >240</option><option value="250" >250</option><option value="260" >260</option><option value="270" >270</option><option value="280" >280</option><option value="290" >290</option><option value="300" >300</option><option value="310" >310</option><option value="320" >320</option><option value="330" >330</option><option value="340" >340</option><option value="350" >350</option><option value="360" >360</option><option value="370" >370</option><option value="380" >380</option><option value="390" >390</option><option value="400" >400</option><option value="410" >410</option><option value="420" >420</option><option value="430" >430</option><option value="440" >440</option><option value="450" >450</option><option value="460" >460</option><option value="470" >470</option><option value="480" >480</option><option value="490" >490</option><option value="500" >500</option><option value="510" >510</option><option value="520" >520</option><option value="530" >530</option><option value="540" >540</option><option value="550" >550</option><option value="560" >560</option><option value="570" >570</option><option value="580" >580</option><option value="590" >590</option><option value="600" >600</option><option value="610" >610</option><option value="620" >620</option><option value="630" >630</option><option value="640" >640</option><option value="650" >650</option><option value="660" >660</option><option value="670" >670</option><option value="680" >680</option><option value="690" >690</option><option value="700" >700</option><option value="710" >710</option><option value="720" >720</option><option value="730" >730</option><option value="740" >740</option><option value="750" >750</option><option value="760" >760</option><option value="770" >770</option><option value="780" >780</option><option value="790" >790</option><option value="800" >800</option><option value="810" >810</option><option value="820" >820</option><option value="830" >830</option><option value="840" >840</option><option value="850" >850</option></select> records per page <input type="submit" value="Apply" /></p><p>[Records (844): <strong>1-10</strong> | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=10&q=" title="Show records from 11 to 20">11-20</a> (sorted by: <em>signuptime, desc</em> )]</p></div></form>
<div class="pagedata" style="clear:both">
<table width="100%" border="1px">
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">Name</a></th>
<th title="Owned pages" abbr="Owned pages">O</th>
<th title="Page edits" abbr="Page edits">E</th>
<th title="Comments" abbr="Comments">C</th>
<th>Actions</th>
<td><input type="checkbox" id=" " title="Select BaW"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/BaW/edit" title="Create this page">BaW</a></td>
<td>[email protected]</td>
<td class="time">2005-07-24 19:17:39</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center /><a title="Display comments by BaW" href="http://wikka.jsnx.com/UserAdminTest?user=BaW&action=comments">1</a></td>
<td><center />delete :: <a title="Send feedback to BaW" href="http://wikka.jsnx.com/UserAdminTest?user=BaW&action=feedback">feedback</a></td>
<td><input type="checkbox" id=" " title="Select Cride5"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/Cride5/edit" title="Create this page">Cride5</a></td>
<td>[email protected]</td>
<td class="time">2005-07-24 16:51:32</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to Cride5" href="http://wikka.jsnx.com/UserAdminTest?user=Cride5&action=feedback">feedback</a></td>
<td><input type="checkbox" id=" " title="Select SimonSchlachter"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/SimonSchlachter/edit" title="Create this page">SimonSchlachter</a></td>
<td>wikka.*[email protected]</td>
<td class="time">2005-07-24 14:05:12</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to SimonSchlachter" href="http://wikka.jsnx.com/UserAdminTest?user=SimonSchlachter&action=feedback">feedback</a></td>
<td><input type="checkbox" id=" " title="Select AndreasDether"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/AndreasDether/edit" title="Create this page">AndreasDether</a></td>
<td>[email protected]</td>
<td class="time">2005-07-23 15:53:34</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to AndreasDether" href="http://wikka.jsnx.com/UserAdminTest?user=AndreasDether&action=feedback">feedback</a></td>
<td><input type="checkbox" title="Select AlexHazlewood"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlexHazlewood/edit" title="Create this page">AlexHazlewood</a></td>
<td>[email protected]</td>
<td class="time">2005-07-23 15:38:09</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to AlexHazlewood" href="http://wikka.jsnx.com/UserAdminTest?user=AlexHazlewood&action=feedback">feedback</a></td>
<td><input type="checkbox" title="Select ZielGruppe"/></td>
<td><a href="http://wikka.jsnx.com/ZielGruppe" title=" ">ZielGruppe</a></td>
<td>[email protected]</td>
<td class="time">2005-07-23 14:43:53</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center /><a title="Display pages owned by ZielGruppe" href="http://wikka.jsnx.com/UserAdminTest?user=ZielGruppe&action=owned">1</a></td>
<td><center /><a title="Display page edits by ZielGruppe" href="http://wikka.jsnx.com/UserAdminTest?user=ZielGruppe&action=changes">1</a></td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to ZielGruppe" href="http://wikka.jsnx.com/UserAdminTest?user=ZielGruppe&action=feedback">feedback</a></td>
<td><input type="checkbox" id=" " title="Select DorTor"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/DorTor/edit" title="Create this page">DorTor</a></td>
<td>[email protected]</td>
<td class="time">2005-07-22 21:32:13</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to DorTor" href="http://wikka.jsnx.com/UserAdminTest?user=DorTor&action=feedback">feedback</a></td>
<td><input type="checkbox" id=" " title="Select TechnoSight"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/TechnoSight/edit" title="Create this page">TechnoSight</a></td>
<td>[email protected]</td>
<td class="time">2005-07-22 16:10:02</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to TechnoSight" href="http://wikka.jsnx.com/UserAdminTest?user=TechnoSight&action=feedback">feedback</a></td>
<td><input type="checkbox" id=" " title="Select SaBreyn"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/SaBreyn/edit" title="Create this page">SaBreyn</a></td>
<td>[email protected]</td>
<td class="time">2005-07-21 22:20:08</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to SaBreyn" href="http://wikka.jsnx.com/UserAdminTest?user=SaBreyn&action=feedback">feedback</a></td>
<td><input type="checkbox" id=" " title="Select KaihuaWang"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/KaihuaWang/edit" title="Create this page">KaihuaWang</a></td>
<td>[email protected]</td>
<td class="time">2005-07-21 02:36:18</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to KaihuaWang" href="http://wikka.jsnx.com/UserAdminTest?user=KaihuaWang&action=feedback">feedback</a></td>
</div>
**Current features** (//2005-07-25//):
~-added extra column for beta feature (Signup IP) installed on this server.
~~&Note - if you want to test the code below with the standard Wikka tables, you'll have to remove the lines marked with the ##[remove this line]## comment.
**Files needed** (//2004-09-16//):
%%(php)
* @version 1.1
* @output user data table
* - sanitize code;
// admin only code
// set default values as constants
define('DEFAULT_RECORDS_LIMIT', '20'); # number of records per page
define('DEFAULT_REC_LIMIT_STEP', '10'); # step for selectable records limit
define('DEFAULT_SORT_FIELD', 'signuptime'); # sort field
define('DEFAULT_SORT_ORDER', 'desc'); # sort order, ascendant or descendant
define('DEFAULT_START', '0'); # start record
define('DEFAULT_SEARCH', ''); # keyword to restrict page search
if ($_GET['action'] == 'feedback' || $_REQUEST['mail']) {
echo $this->Action('userfeedback');
} else if ($_GET['action'] == 'owned') {
echo $this->Action('userpages');
} else if ($_GET['action'] == 'changes') {
echo $this->Action('userchanges');
} else if ($_GET['action'] == 'comments') {
echo $this->Action('usercomments');
// pager defaults
// limit records per page
if (isset($_POST['l']))
$l = $_POST['l'];
elseif (isset($_GET['l']))
$l = $_GET['l'];
else
$l = DEFAULT_RECORDS_LIMIT;
// sort field
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : DEFAULT_SORT_FIELD;
// sort order
$d = (isset($_GET['d'])) ? $_GET['d'] : DEFAULT_SORT_ORDER;
// start record
$s = (isset($_GET['s'])) ? $_GET['s'] : DEFAULT_START;
// search field
if (isset($_POST['q']))
$q = $_POST['q'];
elseif (isset($_GET['q']))
$q = $_GET['q'];
else
$q = DEFAULT_SEARCH;
// select all
$checked = '';
if (isset($_GET['selectall']))
$checked = (1 == $_GET['selectall']) ? ' checked="checked"' : '';
// search results
$where = ('' == $q) ? "1" : "`name` LIKE '%".$q."%'";
echo $this->Format('==== User Administration ==== --- ---');
// 1. Get total number of users
$numusers = $this->getCount('users', $where);
// 2. Display pager form
$form = $this->FormOpen('','','post');
$form .= '<div style="float:left; margin-top:10px; margin-bottom:10px; padding:10px; border:1px dotted #AAA; background-color:#EEE; line-height:.9em">';
$form .='<p>Search user: <input type ="text" title="Enter a search string" name="q" size="20" maxlength="50" value="'.$q.'"/><input type="submit" value="Submit" /></p>';
$form .= '<p>Show <select name="l" title="Select records-per-page limit">';
for ($rec=DEFAULT_REC_LIMIT_STEP; $rec < ($numusers+DEFAULT_REC_LIMIT_STEP); $rec+=DEFAULT_REC_LIMIT_STEP) {
$selected = ($l == $rec)? 'selected' : '';
$form .= '<option value="'.$rec.'" '.$selected.'>'.$rec.'</option>';
$form .= '</select> records per page <input type="submit" value="Apply" /></p';
// build pager links
if ($s > 0)
$prev = '<a href="' .$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s-$l)).'&q='.$q.'" title="Show records from '.($s-$l+1).' to '.$s.'">'.($s-$l+1).'-'.$s.'</a> | ';
if ($numusers > ($s + $l))
$next = ' | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s+$l)).'&q='.$q.'" title="Show records from '.($s+$l+1).' to '.($s+2*$l).'">'.($s+$l+1).'-'.($s+2*$l).'</a>';
$form .= '<p>[Records ('.$numusers.'): '.$prev.'<strong>'.($s+1).'-'.($s+$l).'</strong>'.$next.' (sorted by: <em>'.$sort.', '.$d.'</em> )]</p>';
$form .= '</div>'.$this->FormClose();
echo $form;
// get user list
$userdata = $this->LoadAll("SELECT * FROM ".$this->config["table_prefix"]."users WHERE ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// build table headers
$nameheader = '<a href="'.$this->Href('','', (($sort == 'name' && $d == 'asc')? 'l='.$l.'&sort=name&d=desc' : 'l='.$l.'&sort=name&d=asc')).'" title="Sort by user name">Name</a>';
$emailheader = '<a href="'.$this->Href('','', (($sort == 'email' && $d == 'asc')? 'l='.$l.'&sort=email&d=desc' : 'l='.$l.'&sort=email&d=asc')).'" title="Sort by email">Email</a>';
$timeheader = '<a href="'.$this->Href('','', (($sort == 'signuptime' && $d == 'desc')? 'l='.$l.'&sort=signuptime&d=asc' : 'l='.$l.'')).'" title="Sort by signup time">Signup Time</a>';
$ipheader = '<a href="'.$this->Href('','', (($sort == 'ipaddress' && $d == 'desc')? 'l='.$l.'&sort=ipaddress&d=asc' : 'l='.$l.'&sort=ipaddress&d=desc')).'" title="Sort by signup IP">Signup IP</a>';
// print table headers
$htmlout = "<div class=\"pagedata\" style=\"clear:both\">\n<table id=\"compare\" width=\"100%\" border=\"1px\">\n<thead>\n".
" <tr>\n".
" <th> </th>\n".
" <th>".$nameheader."</th>\n".
" <th>".$emailheader."</th>\n".
" <th>".$timeheader."</th>\n".
" <th>".$ipheader."</th>\n". #[remove this line if you are using standard Wikka tables]
" <th title=\"Owned pages\" abbr=\"Owned pages\">O</th>\n".
" <th title=\"Page edits\" abbr=\"Page edits\">E</th>\n".
" <th title=\"Comments\" abbr=\"Comments\">C</th>\n".
" <th>Actions</th>\n".
" </tr>\n</thead>\n";
// print user table
foreach($userdata as $user) {
// get counts
$where_owned = "`owner` = '".$user['name']."' AND latest = 'Y'";
$where_changes = "`user` = '".$user['name']."'";
$where_comments = "`user` = '".$user['name']."'";
$numowned = $this->getCount('pages', $where_owned);
$numchanges = $this->getCount('pages', $where_changes);
$numcomments = $this->getCount('comments', $where_comments);
// build statistics links if needed
$ownedlink = ($numowned > 0)? '<a title="Display pages owned by '.$user['name'].'" href="'.$this->Href('','','user='.$user['name'].'&action=owned').'">'.$numowned.'</a>' : '0';
$changeslink = ($numchanges > 0)? '<a title="Display page edits by '.$user['name'].'" href="'.$this->Href('','','user='.$user['name'].'&action=changes').'">'.$numchanges.'</a>' : '0';
$commentslink = ($numcomments > 0)? '<a title="Display comments by '.$user['name'].'" href="'.$this->Href('','','user='.$user['name'].'&action=comments').'">'.$numcomments.'</a>' : '0';
$htmlout .= "<tbody>\n <tr>\n".
" <td><input type=\"checkbox\" id=\"".$user['id']."\"".$checked." title=\"Select ".$user['name']."\"/></td>\n".
" <td>".$this->Link($user['name'])."</td>\n".
" <td>".$user['email']."</td>\n".
" <td class=\"time\">".$user['signuptime']."</td>\n".
" <td>".$user['ipaddress']."</td>\n". #[remove this line if you are using standard Wikka tables]
" <td><center />".$ownedlink."</td>\n".
" <td><center />".$changeslink."</td>\n".
" <td><center />".$commentslink."</td>\n".
" <td><center />delete :: <a title=\"Send feedback to ".$user['name']."\" href=\"".$this->Href('','','user='.$user['name'].'&action=feedback')."\">feedback</a></td>\n";
$htmlout .= " </tr>\n</tbody>\n";
$htmlout .= "</table>\n</div>\n";
echo $htmlout;
} else {
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".$_POST["search"]."\"</strong></p>";
echo $this->Action("lastusers");
Additions:
The code below must be saved as ##actions/useradmin.php## and used as ##""{{useradmin}}""##.
""
<h3 id="hn_User_Administration"> User Administration </h3>
<br /> <form action="#" method="post" id="form_42b90196b4">
<div style="float:left; margin-top:10px; margin-bottom:10px; padding:10px; border:1px dotted #AAA; background-color:#EEE; line-height:.9em"><p>Search user: <input type ="text" title="Enter a search string" name="q" size="20" maxlength="50" value=" "/><input type="submit" value="Submit" /></p><p>Show <select name="l" title="Select records-per-page limit"><option value="10" selected>10</option><option value="20" >20</option><option value="30" >30</option><option value="40" >40</option><option value="50" >50</option><option value="60" >60</option><option value="70" >70</option><option value="80" >80</option><option value="90" >90</option><option value="100" >100</option><option value="110" >110</option><option value="120" >120</option><option value="130" >130</option><option value="140" >140</option><option value="150" >150</option><option value="160" >160</option><option value="170" >170</option><option value="180" >180</option><option value="190" >190</option><option value="200" >200</option><option value="210" >210</option><option value="220" >220</option><option value="230" >230</option><option value="240" >240</option><option value="250" >250</option><option value="260" >260</option><option value="270" >270</option><option value="280" >280</option><option value="290" >290</option><option value="300" >300</option><option value="310" >310</option><option value="320" >320</option><option value="330" >330</option><option value="340" >340</option><option value="350" >350</option><option value="360" >360</option><option value="370" >370</option><option value="380" >380</option><option value="390" >390</option><option value="400" >400</option><option value="410" >410</option><option value="420" >420</option><option value="430" >430</option><option value="440" >440</option><option value="450" >450</option><option value="460" >460</option><option value="470" >470</option><option value="480" >480</option><option value="490" >490</option><option value="500" >500</option><option value="510" >510</option><option value="520" >520</option><option value="530" >530</option><option value="540" >540</option><option value="550" >550</option><option value="560" >560</option><option value="570" >570</option><option value="580" >580</option><option value="590" >590</option><option value="600" >600</option><option value="610" >610</option><option value="620" >620</option><option value="630" >630</option><option value="640" >640</option><option value="650" >650</option><option value="660" >660</option><option value="670" >670</option><option value="680" >680</option><option value="690" >690</option><option value="700" >700</option><option value="710" >710</option><option value="720" >720</option><option value="730" >730</option><option value="740" >740</option><option value="750" >750</option><option value="760" >760</option><option value="770" >770</option><option value="780" >780</option><option value="790" >790</option><option value="800" >800</option><option value="810" >810</option><option value="820" >820</option><option value="830" >830</option><option value="840" >840</option><option value="850" >850</option></select> records per page <input type="submit" value="Apply" /></p><p>[Records (844): <strong>1-10</strong> | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=10&q=" title="Show records from 11 to 20">11-20</a> (sorted by: <em>signuptime, desc</em> )]</p></div></form>
<div class="pagedata" style="clear:both">
<thead>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th title="Owned pages" abbr="Owned pages">O</th>
<th title="Page edits" abbr="Page edits">E</th>
<th title="Comments" abbr="Comments">C</th>
</thead>
<tbody>
<td><input type="checkbox" id=" " title="Select BaW"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/BaW/edit" title="Create this page">BaW</a></td>
<td>[email protected]</td>
<td class="time">2005-07-24 19:17:39</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center /><a title="Display comments by BaW" href="http://wikka.jsnx.com/UserAdminTest?user=BaW&action=comments">1</a></td>
<td><center />delete :: <a title="Send feedback to BaW" href="http://wikka.jsnx.com/UserAdminTest?user=BaW&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select Cride5"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/Cride5/edit" title="Create this page">Cride5</a></td>
<td>[email protected]</td>
<td class="time">2005-07-24 16:51:32</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to Cride5" href="http://wikka.jsnx.com/UserAdminTest?user=Cride5&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select SimonSchlachter"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/SimonSchlachter/edit" title="Create this page">SimonSchlachter</a></td>
<td>wikka.*[email protected]</td>
<td class="time">2005-07-24 14:05:12</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to SimonSchlachter" href="http://wikka.jsnx.com/UserAdminTest?user=SimonSchlachter&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select AndreasDether"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/AndreasDether/edit" title="Create this page">AndreasDether</a></td>
<td>[email protected]</td>
<td class="time">2005-07-23 15:53:34</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to AndreasDether" href="http://wikka.jsnx.com/UserAdminTest?user=AndreasDether&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" title="Select AlexHazlewood"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlexHazlewood/edit" title="Create this page">AlexHazlewood</a></td>
<td>[email protected]</td>
<td class="time">2005-07-23 15:38:09</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to AlexHazlewood" href="http://wikka.jsnx.com/UserAdminTest?user=AlexHazlewood&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" title="Select ZielGruppe"/></td>
<td><a href="http://wikka.jsnx.com/ZielGruppe" title=" ">ZielGruppe</a></td>
<td>[email protected]</td>
<td class="time">2005-07-23 14:43:53</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center /><a title="Display pages owned by ZielGruppe" href="http://wikka.jsnx.com/UserAdminTest?user=ZielGruppe&action=owned">1</a></td>
<td><center /><a title="Display page edits by ZielGruppe" href="http://wikka.jsnx.com/UserAdminTest?user=ZielGruppe&action=changes">1</a></td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to ZielGruppe" href="http://wikka.jsnx.com/UserAdminTest?user=ZielGruppe&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select DorTor"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/DorTor/edit" title="Create this page">DorTor</a></td>
<td>[email protected]</td>
<td class="time">2005-07-22 21:32:13</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to DorTor" href="http://wikka.jsnx.com/UserAdminTest?user=DorTor&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select TechnoSight"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/TechnoSight/edit" title="Create this page">TechnoSight</a></td>
<td>[email protected]</td>
<td class="time">2005-07-22 16:10:02</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to TechnoSight" href="http://wikka.jsnx.com/UserAdminTest?user=TechnoSight&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select SaBreyn"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/SaBreyn/edit" title="Create this page">SaBreyn</a></td>
<td>[email protected]</td>
<td class="time">2005-07-21 22:20:08</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to SaBreyn" href="http://wikka.jsnx.com/UserAdminTest?user=SaBreyn&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select KaihuaWang"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/KaihuaWang/edit" title="Create this page">KaihuaWang</a></td>
<td>[email protected]</td>
<td class="time">2005-07-21 02:36:18</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to KaihuaWang" href="http://wikka.jsnx.com/UserAdminTest?user=KaihuaWang&action=feedback">feedback</a></td>
</tbody>
</table>
</div>
""
**Current features** (//2005-07-25//):
~-added extra column for beta feature (Signup IP) installed on this server.
~~&Note - if you want to test the code below with the standard Wikka tables, you'll have to remove the lines marked with the ##[remove this line]## comment.
/**
* Display a module for user management.
*
* This action allows admins to display information on registered users.
* Users can be searched, paged, filtered. User-related statistics are given,
* showing the number of commented, created and modified pages. A feedback
* handler allows admins to send an email to single users. If the current user
* is not an administrator, then the lastuser action is displayed instead.
*
* @package Actions
* @name Useradmin
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 1.1
* @since Wikka 1.1.X.X
* @output user data table
*
* @todo
* - mass-operations;
* - deleting/banning users;
* - sanitize code;
* - integrate with other admin modules.
*/
// set default values as constants
define('DEFAULT_RECORDS_LIMIT', '20'); # number of records per page
define('DEFAULT_REC_LIMIT_STEP', '10'); # step for selectable records limit
define('DEFAULT_SORT_FIELD', 'signuptime'); # sort field
define('DEFAULT_SORT_ORDER', 'desc'); # sort order, ascendant or descendant
define('DEFAULT_START', '0'); # start record
define('DEFAULT_SEARCH', ''); # keyword to restrict page search
if ($_GET['action'] == 'feedback' || $_REQUEST['mail']) {
echo $this->Action('userfeedback');
} else if ($_GET['action'] == 'owned') {
echo $this->Action('userpages');
} else if ($_GET['action'] == 'changes') {
echo $this->Action('userchanges');
} else if ($_GET['action'] == 'comments') {
echo $this->Action('usercomments');
if (isset($_POST['l']))
$l = $_POST['l'];
elseif (isset($_GET['l']))
$l = $_GET['l'];
else
$l = DEFAULT_RECORDS_LIMIT;
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : DEFAULT_SORT_FIELD;
$d = (isset($_GET['d'])) ? $_GET['d'] : DEFAULT_SORT_ORDER;
$s = (isset($_GET['s'])) ? $_GET['s'] : DEFAULT_START;
// search field
if (isset($_POST['q']))
$q = $_POST['q'];
elseif (isset($_GET['q']))
$q = $_GET['q'];
else
$q = DEFAULT_SEARCH;
// select all
$checked = '';
if (isset($_GET['selectall']))
{
$checked = (1 == $_GET['selectall']) ? ' checked="checked"' : '';
$where = ('' == $q) ? "1" : "`name` LIKE '%".$q."%'";
echo $this->Format('==== User Administration ==== --- ---');
$numusers = $this->getCount('users', $where);
$form = $this->FormOpen('','','post');
$form .= '<div style="float:left; margin-top:10px; margin-bottom:10px; padding:10px; border:1px dotted #AAA; background-color:#EEE; line-height:.9em">';
$form .='<p>Search user: <input type ="text" title="Enter a search string" name="q" size="20" maxlength="50" value="'.$q.'"/><input type="submit" value="Submit" /></p>';
$form .= '<p>Show <select name="l" title="Select records-per-page limit">';
for ($rec=DEFAULT_REC_LIMIT_STEP; $rec < ($numusers+DEFAULT_REC_LIMIT_STEP); $rec+=DEFAULT_REC_LIMIT_STEP) {
$selected = ($l == $rec)? 'selected' : '';
$form .= '<option value="'.$rec.'" '.$selected.'>'.$rec.'</option>';
$form .= '</select> records per page <input type="submit" value="Apply" /></p';
// build pager links
$prev = '';
$next = '';
if ($s > 0)
$prev = '<a href="' .$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s-$l)).'&q='.$q.'" title="Show records from '.($s-$l+1).' to '.$s.'">'.($s-$l+1).'-'.$s.'</a> | ';
if ($numusers > ($s + $l))
$next = ' | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s+$l)).'&q='.$q.'" title="Show records from '.($s+$l+1).' to '.($s+2*$l).'">'.($s+$l+1).'-'.($s+2*$l).'</a>';
$form .= '<p>[Records ('.$numusers.'): '.$prev.'<strong>'.($s+1).'-'.($s+$l).'</strong>'.$next.' (sorted by: <em>'.$sort.', '.$d.'</em> )]</p>';
$form .= '</div>'.$this->FormClose();
// get user list
$userdata = $this->LoadAll("SELECT * FROM ".$this->config["table_prefix"]."users WHERE ".
// build table headers
$nameheader = '<a href="'.$this->Href('','', (($sort == 'name' && $d == 'asc')? 'l='.$l.'&sort=name&d=desc' : 'l='.$l.'&sort=name&d=asc')).'" title="Sort by user name">Name</a>';
$emailheader = '<a href="'.$this->Href('','', (($sort == 'email' && $d == 'asc')? 'l='.$l.'&sort=email&d=desc' : 'l='.$l.'&sort=email&d=asc')).'" title="Sort by email">Email</a>';
$timeheader = '<a href="'.$this->Href('','', (($sort == 'signuptime' && $d == 'desc')? 'l='.$l.'&sort=signuptime&d=asc' : 'l='.$l.'')).'" title="Sort by signup time">Signup Time</a>';
$ipheader = '<a href="'.$this->Href('','', (($sort == 'ipaddress' && $d == 'desc')? 'l='.$l.'&sort=ipaddress&d=asc' : 'l='.$l.'&sort=ipaddress&d=desc')).'" title="Sort by signup IP">Signup IP</a>';
$htmlout = "<div class=\"pagedata\" style=\"clear:both\">\n<table id=\"compare\" width=\"100%\" border=\"1px\">\n<thead>\n".
" <th> </th>\n".
" <th>".$nameheader."</th>\n".
" <th>".$emailheader."</th>\n".
" <th>".$timeheader."</th>\n".
" <th>".$ipheader."</th>\n". #[remove this line if you are using standard Wikka tables]
" <th title=\"Owned pages\" abbr=\"Owned pages\">O</th>\n".
" <th title=\"Page edits\" abbr=\"Page edits\">E</th>\n".
" <th title=\"Comments\" abbr=\"Comments\">C</th>\n".
" </tr>\n</thead>\n";
// get counts
$where_owned = "`owner` = '".$user['name']."' AND latest = 'Y'";
$where_changes = "`user` = '".$user['name']."'";
$where_comments = "`user` = '".$user['name']."'";
$numowned = $this->getCount('pages', $where_owned);
$numchanges = $this->getCount('pages', $where_changes);
$numcomments = $this->getCount('comments', $where_comments);
// build statistics links if needed
$ownedlink = ($numowned > 0)? '<a title="Display pages owned by '.$user['name'].'" href="'.$this->Href('','','user='.$user['name'].'&action=owned').'">'.$numowned.'</a>' : '0';
$changeslink = ($numchanges > 0)? '<a title="Display page edits by '.$user['name'].'" href="'.$this->Href('','','user='.$user['name'].'&action=changes').'">'.$numchanges.'</a>' : '0';
$commentslink = ($numcomments > 0)? '<a title="Display comments by '.$user['name'].'" href="'.$this->Href('','','user='.$user['name'].'&action=comments').'">'.$numcomments.'</a>' : '0';
$htmlout .= "<tbody>\n <tr>\n".
" <td><input type=\"checkbox\" id=\"".$user['id']."\"".$checked." title=\"Select ".$user['name']."\"/></td>\n".
" <td>".$this->Link($user['name'])."</td>\n".
" <td>".$user['email']."</td>\n".
" <td class=\"time\">".$user['signuptime']."</td>\n".
" <td>".$user['ipaddress']."</td>\n". #[remove this line if you are using standard Wikka tables]
" <td><center />".$ownedlink."</td>\n".
" <td><center />".$changeslink."</td>\n".
" <td><center />".$commentslink."</td>\n".
" <td><center />delete :: <a title=\"Send feedback to ".$user['name']."\" href=\"".$this->Href('','','user='.$user['name'].'&action=feedback')."\">feedback</a></td>\n";
$htmlout .= " </tr>\n</tbody>\n";
$htmlout .= "</table>\n</div>\n";
echo $htmlout;
""
<h3 id="hn_User_Administration"> User Administration </h3>
<br /> <form action="#" method="post" id="form_42b90196b4">
<div style="float:left; margin-top:10px; margin-bottom:10px; padding:10px; border:1px dotted #AAA; background-color:#EEE; line-height:.9em"><p>Search user: <input type ="text" title="Enter a search string" name="q" size="20" maxlength="50" value=" "/><input type="submit" value="Submit" /></p><p>Show <select name="l" title="Select records-per-page limit"><option value="10" selected>10</option><option value="20" >20</option><option value="30" >30</option><option value="40" >40</option><option value="50" >50</option><option value="60" >60</option><option value="70" >70</option><option value="80" >80</option><option value="90" >90</option><option value="100" >100</option><option value="110" >110</option><option value="120" >120</option><option value="130" >130</option><option value="140" >140</option><option value="150" >150</option><option value="160" >160</option><option value="170" >170</option><option value="180" >180</option><option value="190" >190</option><option value="200" >200</option><option value="210" >210</option><option value="220" >220</option><option value="230" >230</option><option value="240" >240</option><option value="250" >250</option><option value="260" >260</option><option value="270" >270</option><option value="280" >280</option><option value="290" >290</option><option value="300" >300</option><option value="310" >310</option><option value="320" >320</option><option value="330" >330</option><option value="340" >340</option><option value="350" >350</option><option value="360" >360</option><option value="370" >370</option><option value="380" >380</option><option value="390" >390</option><option value="400" >400</option><option value="410" >410</option><option value="420" >420</option><option value="430" >430</option><option value="440" >440</option><option value="450" >450</option><option value="460" >460</option><option value="470" >470</option><option value="480" >480</option><option value="490" >490</option><option value="500" >500</option><option value="510" >510</option><option value="520" >520</option><option value="530" >530</option><option value="540" >540</option><option value="550" >550</option><option value="560" >560</option><option value="570" >570</option><option value="580" >580</option><option value="590" >590</option><option value="600" >600</option><option value="610" >610</option><option value="620" >620</option><option value="630" >630</option><option value="640" >640</option><option value="650" >650</option><option value="660" >660</option><option value="670" >670</option><option value="680" >680</option><option value="690" >690</option><option value="700" >700</option><option value="710" >710</option><option value="720" >720</option><option value="730" >730</option><option value="740" >740</option><option value="750" >750</option><option value="760" >760</option><option value="770" >770</option><option value="780" >780</option><option value="790" >790</option><option value="800" >800</option><option value="810" >810</option><option value="820" >820</option><option value="830" >830</option><option value="840" >840</option><option value="850" >850</option></select> records per page <input type="submit" value="Apply" /></p><p>[Records (844): <strong>1-10</strong> | <a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=desc&s=10&q=" title="Show records from 11 to 20">11-20</a> (sorted by: <em>signuptime, desc</em> )]</p></div></form>
<div class="pagedata" style="clear:both">
<thead>
<th> </th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=name&d=asc" title="Sort by user name">Name</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=email&d=asc" title="Sort by email">Email</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=signuptime&d=asc" title="Sort by signup time">Signup Time</a></th>
<th><a href="http://wikka.jsnx.com/UserAdminTest?l=10&sort=ipaddress&d=desc" title="Sort by signup IP">Signup IP</a></th>
<th title="Owned pages" abbr="Owned pages">O</th>
<th title="Page edits" abbr="Page edits">E</th>
<th title="Comments" abbr="Comments">C</th>
</thead>
<tbody>
<td><input type="checkbox" id=" " title="Select BaW"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/BaW/edit" title="Create this page">BaW</a></td>
<td>[email protected]</td>
<td class="time">2005-07-24 19:17:39</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center /><a title="Display comments by BaW" href="http://wikka.jsnx.com/UserAdminTest?user=BaW&action=comments">1</a></td>
<td><center />delete :: <a title="Send feedback to BaW" href="http://wikka.jsnx.com/UserAdminTest?user=BaW&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select Cride5"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/Cride5/edit" title="Create this page">Cride5</a></td>
<td>[email protected]</td>
<td class="time">2005-07-24 16:51:32</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to Cride5" href="http://wikka.jsnx.com/UserAdminTest?user=Cride5&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select SimonSchlachter"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/SimonSchlachter/edit" title="Create this page">SimonSchlachter</a></td>
<td>wikka.*[email protected]</td>
<td class="time">2005-07-24 14:05:12</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to SimonSchlachter" href="http://wikka.jsnx.com/UserAdminTest?user=SimonSchlachter&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select AndreasDether"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/AndreasDether/edit" title="Create this page">AndreasDether</a></td>
<td>[email protected]</td>
<td class="time">2005-07-23 15:53:34</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to AndreasDether" href="http://wikka.jsnx.com/UserAdminTest?user=AndreasDether&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" title="Select AlexHazlewood"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlexHazlewood/edit" title="Create this page">AlexHazlewood</a></td>
<td>[email protected]</td>
<td class="time">2005-07-23 15:38:09</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to AlexHazlewood" href="http://wikka.jsnx.com/UserAdminTest?user=AlexHazlewood&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" title="Select ZielGruppe"/></td>
<td><a href="http://wikka.jsnx.com/ZielGruppe" title=" ">ZielGruppe</a></td>
<td>[email protected]</td>
<td class="time">2005-07-23 14:43:53</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center /><a title="Display pages owned by ZielGruppe" href="http://wikka.jsnx.com/UserAdminTest?user=ZielGruppe&action=owned">1</a></td>
<td><center /><a title="Display page edits by ZielGruppe" href="http://wikka.jsnx.com/UserAdminTest?user=ZielGruppe&action=changes">1</a></td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to ZielGruppe" href="http://wikka.jsnx.com/UserAdminTest?user=ZielGruppe&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select DorTor"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/DorTor/edit" title="Create this page">DorTor</a></td>
<td>[email protected]</td>
<td class="time">2005-07-22 21:32:13</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to DorTor" href="http://wikka.jsnx.com/UserAdminTest?user=DorTor&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select TechnoSight"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/TechnoSight/edit" title="Create this page">TechnoSight</a></td>
<td>[email protected]</td>
<td class="time">2005-07-22 16:10:02</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to TechnoSight" href="http://wikka.jsnx.com/UserAdminTest?user=TechnoSight&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select SaBreyn"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/SaBreyn/edit" title="Create this page">SaBreyn</a></td>
<td>[email protected]</td>
<td class="time">2005-07-21 22:20:08</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to SaBreyn" href="http://wikka.jsnx.com/UserAdminTest?user=SaBreyn&action=feedback">feedback</a></td>
</tbody>
<tbody>
<td><input type="checkbox" id=" " title="Select KaihuaWang"/></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/KaihuaWang/edit" title="Create this page">KaihuaWang</a></td>
<td>[email protected]</td>
<td class="time">2005-07-21 02:36:18</td>
<td>XXX.XXX.XXX.XXX</td>
<td><center />0</td>
<td><center />0</td>
<td><center />0</td>
<td><center />delete :: <a title="Send feedback to KaihuaWang" href="http://wikka.jsnx.com/UserAdminTest?user=KaihuaWang&action=feedback">feedback</a></td>
</tbody>
</table>
</div>
""
**Current features** (//2005-07-25//):
~-added extra column for beta feature (Signup IP) installed on this server.
~~&Note - if you want to test the code below with the standard Wikka tables, you'll have to remove the lines marked with the ##[remove this line]## comment.
/**
* Display a module for user management.
*
* This action allows admins to display information on registered users.
* Users can be searched, paged, filtered. User-related statistics are given,
* showing the number of commented, created and modified pages. A feedback
* handler allows admins to send an email to single users. If the current user
* is not an administrator, then the lastuser action is displayed instead.
*
* @package Actions
* @name Useradmin
*
* @author {@link http://wikka.jsnx.com/DarTar Dario Taraborelli}
* @version 1.1
* @since Wikka 1.1.X.X
* @output user data table
*
* @todo
* - mass-operations;
* - deleting/banning users;
* - sanitize code;
* - integrate with other admin modules.
*/
// set default values as constants
define('DEFAULT_RECORDS_LIMIT', '20'); # number of records per page
define('DEFAULT_REC_LIMIT_STEP', '10'); # step for selectable records limit
define('DEFAULT_SORT_FIELD', 'signuptime'); # sort field
define('DEFAULT_SORT_ORDER', 'desc'); # sort order, ascendant or descendant
define('DEFAULT_START', '0'); # start record
define('DEFAULT_SEARCH', ''); # keyword to restrict page search
if ($_GET['action'] == 'feedback' || $_REQUEST['mail']) {
echo $this->Action('userfeedback');
} else if ($_GET['action'] == 'owned') {
echo $this->Action('userpages');
} else if ($_GET['action'] == 'changes') {
echo $this->Action('userchanges');
} else if ($_GET['action'] == 'comments') {
echo $this->Action('usercomments');
if (isset($_POST['l']))
$l = $_POST['l'];
elseif (isset($_GET['l']))
$l = $_GET['l'];
else
$l = DEFAULT_RECORDS_LIMIT;
$sort = (isset($_GET['sort'])) ? $_GET['sort'] : DEFAULT_SORT_FIELD;
$d = (isset($_GET['d'])) ? $_GET['d'] : DEFAULT_SORT_ORDER;
$s = (isset($_GET['s'])) ? $_GET['s'] : DEFAULT_START;
// search field
if (isset($_POST['q']))
$q = $_POST['q'];
elseif (isset($_GET['q']))
$q = $_GET['q'];
else
$q = DEFAULT_SEARCH;
// select all
$checked = '';
if (isset($_GET['selectall']))
{
$checked = (1 == $_GET['selectall']) ? ' checked="checked"' : '';
$where = ('' == $q) ? "1" : "`name` LIKE '%".$q."%'";
echo $this->Format('==== User Administration ==== --- ---');
$numusers = $this->getCount('users', $where);
$form = $this->FormOpen('','','post');
$form .= '<div style="float:left; margin-top:10px; margin-bottom:10px; padding:10px; border:1px dotted #AAA; background-color:#EEE; line-height:.9em">';
$form .='<p>Search user: <input type ="text" title="Enter a search string" name="q" size="20" maxlength="50" value="'.$q.'"/><input type="submit" value="Submit" /></p>';
$form .= '<p>Show <select name="l" title="Select records-per-page limit">';
for ($rec=DEFAULT_REC_LIMIT_STEP; $rec < ($numusers+DEFAULT_REC_LIMIT_STEP); $rec+=DEFAULT_REC_LIMIT_STEP) {
$selected = ($l == $rec)? 'selected' : '';
$form .= '<option value="'.$rec.'" '.$selected.'>'.$rec.'</option>';
$form .= '</select> records per page <input type="submit" value="Apply" /></p';
// build pager links
$prev = '';
$next = '';
if ($s > 0)
$prev = '<a href="' .$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s-$l)).'&q='.$q.'" title="Show records from '.($s-$l+1).' to '.$s.'">'.($s-$l+1).'-'.$s.'</a> | ';
if ($numusers > ($s + $l))
$next = ' | <a href="'.$this->Href('','','l='.$l.'&sort='.$sort.'&d='.$d.'&s='.($s+$l)).'&q='.$q.'" title="Show records from '.($s+$l+1).' to '.($s+2*$l).'">'.($s+$l+1).'-'.($s+2*$l).'</a>';
$form .= '<p>[Records ('.$numusers.'): '.$prev.'<strong>'.($s+1).'-'.($s+$l).'</strong>'.$next.' (sorted by: <em>'.$sort.', '.$d.'</em> )]</p>';
$form .= '</div>'.$this->FormClose();
// get user list
$userdata = $this->LoadAll("SELECT * FROM ".$this->config["table_prefix"]."users WHERE ".
// build table headers
$nameheader = '<a href="'.$this->Href('','', (($sort == 'name' && $d == 'asc')? 'l='.$l.'&sort=name&d=desc' : 'l='.$l.'&sort=name&d=asc')).'" title="Sort by user name">Name</a>';
$emailheader = '<a href="'.$this->Href('','', (($sort == 'email' && $d == 'asc')? 'l='.$l.'&sort=email&d=desc' : 'l='.$l.'&sort=email&d=asc')).'" title="Sort by email">Email</a>';
$timeheader = '<a href="'.$this->Href('','', (($sort == 'signuptime' && $d == 'desc')? 'l='.$l.'&sort=signuptime&d=asc' : 'l='.$l.'')).'" title="Sort by signup time">Signup Time</a>';
$ipheader = '<a href="'.$this->Href('','', (($sort == 'ipaddress' && $d == 'desc')? 'l='.$l.'&sort=ipaddress&d=asc' : 'l='.$l.'&sort=ipaddress&d=desc')).'" title="Sort by signup IP">Signup IP</a>';
$htmlout = "<div class=\"pagedata\" style=\"clear:both\">\n<table id=\"compare\" width=\"100%\" border=\"1px\">\n<thead>\n".
" <th> </th>\n".
" <th>".$nameheader."</th>\n".
" <th>".$emailheader."</th>\n".
" <th>".$timeheader."</th>\n".
" <th>".$ipheader."</th>\n". #[remove this line if you are using standard Wikka tables]
" <th title=\"Owned pages\" abbr=\"Owned pages\">O</th>\n".
" <th title=\"Page edits\" abbr=\"Page edits\">E</th>\n".
" <th title=\"Comments\" abbr=\"Comments\">C</th>\n".
" </tr>\n</thead>\n";
// get counts
$where_owned = "`owner` = '".$user['name']."' AND latest = 'Y'";
$where_changes = "`user` = '".$user['name']."'";
$where_comments = "`user` = '".$user['name']."'";
$numowned = $this->getCount('pages', $where_owned);
$numchanges = $this->getCount('pages', $where_changes);
$numcomments = $this->getCount('comments', $where_comments);
// build statistics links if needed
$ownedlink = ($numowned > 0)? '<a title="Display pages owned by '.$user['name'].'" href="'.$this->Href('','','user='.$user['name'].'&action=owned').'">'.$numowned.'</a>' : '0';
$changeslink = ($numchanges > 0)? '<a title="Display page edits by '.$user['name'].'" href="'.$this->Href('','','user='.$user['name'].'&action=changes').'">'.$numchanges.'</a>' : '0';
$commentslink = ($numcomments > 0)? '<a title="Display comments by '.$user['name'].'" href="'.$this->Href('','','user='.$user['name'].'&action=comments').'">'.$numcomments.'</a>' : '0';
$htmlout .= "<tbody>\n <tr>\n".
" <td><input type=\"checkbox\" id=\"".$user['id']."\"".$checked." title=\"Select ".$user['name']."\"/></td>\n".
" <td>".$this->Link($user['name'])."</td>\n".
" <td>".$user['email']."</td>\n".
" <td class=\"time\">".$user['signuptime']."</td>\n".
" <td>".$user['ipaddress']."</td>\n". #[remove this line if you are using standard Wikka tables]
" <td><center />".$ownedlink."</td>\n".
" <td><center />".$changeslink."</td>\n".
" <td><center />".$commentslink."</td>\n".
" <td><center />delete :: <a title=\"Send feedback to ".$user['name']."\" href=\"".$this->Href('','','user='.$user['name'].'&action=feedback')."\">feedback</a></td>\n";
$htmlout .= " </tr>\n</tbody>\n";
$htmlout .= "</table>\n</div>\n";
echo $htmlout;
Deletions:
-- DarTar
""<h3> User Administration </h3>
<br /> <form action="#" method="post">
Show
<select name="l" onChange="form.submit()">
<option value="10" selected>10</option>
<option value="20" >20</option>
<option value="30" >30</option>
<option value="40" >40</option>
<option value="50" >50</option>
<option value="60" >60</option>
<option value="70" >70</option>
<option value="80" >80</option>
<option value="90" >90</option>
<option value="100" >100</option>
<option value="110" >110</option>
<option value="120" >120</option>
<option value="130" >130</option>
<option value="140" >140</option>
<option value="150" >150</option>
<option value="160" >160</option>
<option value="170" >170</option>
<option value="180" >180</option>
<option value="190" >190</option>
<option value="200" >200</option>
<option value="210" >210</option>
</select> records per page ::
Search user: <input type ="text" name="search" size="20" maxlength="50" value=''/>
</form>
[Records (206): <b>1-10</b> | <a href="http://wikka.jsnx.com/#?l=10&sort=name&d=asc&s=10">11-20</a> (sorted by: <em>name, asc</em> )]<br /><br />
<th><a href="http://wikka.jsnx.com/#?l=10&sort=name&d=desc">Name</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10&sort=email&d=asc">Email</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10">Signup Date/Time</a></th>
<th>Owned</th>
<th>Modified</th>
<th>Comments</th>
<td><a href="http://wikka.jsnx.com/AbA" title=''>AbA</a></td>
<td>[email protected]</td>
<td>(2004-10-27 15:39:25)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=changes">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=comments">3</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AbA&action=feedback">feedback</a></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/AdmiN/edit" title="Create this page">AdmiN</a></td>
<td>[email protected]</td>
<td>(2004-12-01 06:45:56)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdmiN&action=feedback">feedback</a></td>
<td><a href="http://wikka.jsnx.com/AdrianB" title=''>AdrianB</a></td>
<td>[email protected]</td>
<td>(2004-05-19 15:48:37)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=changes">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdrianB&action=feedback">feedback</a></td>
<td><a href="http://wikka.jsnx.com/AHerdOfTurtles" title=''>AHerdOfTurtles</a></td>
<td>[email protected]</td>
<td>(2004-09-18 19:42:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=changes">9</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=comments">4</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=feedback">feedback</a></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlekAndreev/edit" title="Create this page">AlekAndreev</a></td>
<td>[email protected]</td>
<td>(2004-11-01 20:06:31)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=feedback">feedback</a></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlessandroRonchi/edit" title="Create this page">AlessandroRonchi</a></td>
<td>[email protected]</td>
<td>(2004-10-21 13:12:36)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=feedback">feedback</a></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlexM/edit" title="Create this page">AlexM</a></td>
<td>[email protected]</td>
<td>(2004-11-20 06:02:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlexM&action=feedback">feedback</a></td>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlleyCat/edit" title="Create this page">AlleyCat</a></td>
<td>[email protected]</td>
<td>(2004-11-21 18:23:19)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlleyCat&action=feedback">feedback</a></td>
<td><a href="http://wikka.jsnx.com/AndreaRossato" title=''>AndreaRossato</a></td>
<td>[email protected]</td>
<td>(2004-07-19 11:03:42)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=owned">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=changes">25</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=comments">7</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=feedback">feedback</a></td>
<td><a href="http://wikka.jsnx.com/AndrewEddie" title=''>AndrewEddie</a></td>
<td>[email protected]</td>
<td>(2004-10-12 22:23:32)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=changes">3</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=feedback">feedback</a></td>
</table>""
**Current features** (//2004-11-22//):
// USER ADMINISTRATION MODULE
// Last Updated: 2004-11-11
// Version 1.0
// Displays to the Wikka admins a list of registered users
// * Users can be sorted by different fields, searched and paged
// * For each user, full statistics are shown with the number of commented, created and modified pages
// * Specific actions (delete/send feedback) can be performed on single users
// * If the current user is not an administrator, then the lastuser action is displayed instead
if ($_GET["action"] == "feedback" || $_REQUEST["mail"]) {
echo $this->Action("userfeedback");
} else if ($_GET["action"] == "owned") {
echo $this->Action("userpages");
} else if ($_GET["action"] == "changes") {
echo $this->Action("userchanges");
} else if ($_GET["action"] == "comments") {
echo $this->Action("usercomments");
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
$sort = (!$_GET["sort"])? "signuptime" : $_GET["sort"];
$d = (!$_GET["d"])? "desc" : $_GET["d"];
$s = (!$_GET["s"])? "0" : $_GET["s"];
$where = ($_POST["search"])? "WHERE name LIKE \"%".$_POST["search"]."%\"" : "";
echo $this->Format("==== User Administration ==== --- ---");
$users = $this->LoadSingle("select count(*) as n FROM ".$this->config["table_prefix"]."users ".$where);
$numusers = $users['n'];
$form = $this->FormOpen("","","post");
$form .= "Show\n<select name=\"l\" onChange=\"form.submit()\">\n";
for ($rec=10; $rec < ($numusers+10); $rec+=10) {
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
$form .= "</select> records per page :: \n".
"Search user: <input type =\"text\" name=\"search\" size=\"20\" maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
$this->FormClose();
if($s > 0)
$prev = "<a href=\"" .$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s-$l))."\">".($s-$l+1)."-".$s."</a> | ";
if($numusers > ($s + $l))
$next = " | <a href=\"".$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s+$l))."\">".($s+$l+1)."-".($s+2*$l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next." (sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
// get user data
$userdata = $this->LoadAll("SELECT name, email, signuptime FROM ".$this->config["table_prefix"]."users ".
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <th><a href=\"".$this->Href("","", (($sort == "name" && $d == "asc")? "l=".$l."&sort=name&d=desc" :
"l=".$l."&sort=name&d=asc"))."\">Name</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "email" && $d == "asc")? "l=".$l."&sort=email&d=desc" :
"l=".$l."&sort=email&d=asc"))."\">Email</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "signuptime" && $d == "desc")? "l=".$l."&sort=signuptime&d=asc" :
"l=".$l.""))."\">Signup Date/Time</a></th>\n".
" <th>Owned</th>\n".
" <th>Modified</th>\n".
" <th>Comments</th>\n".
" </tr>\n";
$htmlout .= " <tr>\n";
$num = $this->LoadSingle("SELECT COUNT(*) AS n FROM ".$this->config["table_prefix"].
"pages WHERE owner='".$user["name"]."' AND latest = 'Y'");
$numchanges = $this->LoadSingle("SELECT COUNT(*) AS m FROM ".$this->config["table_prefix"].
"pages WHERE user='".$user["name"]."'");
$numcomments = $this->LoadSingle("SELECT COUNT(*) AS q FROM ".$this->config["table_prefix"].
"comments WHERE user='".$user["name"]."'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"].
"</td>\n<td>(".$user["signuptime"].")</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=owned")."\">".$num["n"]."</a>)"."</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=changes")."\">".$numchanges["m"]."</a>)</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=comments")."\">".$numcomments["q"]."</a>)</td>\n".
"<td><center />delete :: <a href=\"".$this->Href("","","user=".$user["name"]."&action=feedback")."\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
$htmlout .= "</table>\n";
print($htmlout);
Additions:
>>**See also:**
AdminModules
>>::c::
AdminModules
>>::c::
Additions:
CategoryDevelopmentActions CategoryDevelopmentAdmin
Deletions:
Additions:
~~-**rename users**
~~~&//If anyone is interested, running through the seven tables and updating every instance of your old wiki name to your new wiki name will effectively change your name throughout the wiki.// copied from comment on the homepage. --NilsLindenberg
~~~&//If anyone is interested, running through the seven tables and updating every instance of your old wiki name to your new wiki name will effectively change your name throughout the wiki.// copied from comment on the homepage. --NilsLindenberg
Additions:
===== User Administration Module =====
{{lastedit}}
I've started writing some code for a user administration module. I think this might be interesting for wikka-based projects with a large number of registered users.
This action will enable Wikka administrators (or, in the future, users belonging to an //Admin// group) to have access to several user management functions from a single page:
~-Display a pageable, sortable and searchable **list of registered users** ''-- done'';
~-Perform specific **actions** on single users, like:
~~-**delete users** (forthcoming: see this [[RemovingUsers discussion]]);
~~-**add users** - in case the registration of a page is turned off, but you want to add a user
~~~& noted, good idea -- DarTar
~~-**send user feedback** ''-- done'';
~~-manage **user privileges** (forthcoming);
~-Display user's **owned pages** ''-- done'';
~-Display user's **comments** ''-- done''.
~-Display user's **changes** ''-- done'';
~-//other...//
The code below (to be saved as ##actions/useradmin.php## and used as ##""{{useradmin}}""## ) is just a very first draft. Contributions and improvements are welcome (especially to make the code lighter).
-- DarTar
Here's a preview of the interface (email addresses are masked for privacy reasons)
----
""<h3> User Administration </h3>
<br /> <form action="#" method="post">
Show
<select name="l" onChange="form.submit()">
<option value="10" selected>10</option>
<option value="20" >20</option>
<option value="30" >30</option>
<option value="40" >40</option>
<option value="50" >50</option>
<option value="60" >60</option>
<option value="70" >70</option>
<option value="80" >80</option>
<option value="90" >90</option>
<option value="100" >100</option>
<option value="110" >110</option>
<option value="120" >120</option>
<option value="130" >130</option>
<option value="140" >140</option>
<option value="150" >150</option>
<option value="160" >160</option>
<option value="170" >170</option>
<option value="180" >180</option>
<option value="190" >190</option>
<option value="200" >200</option>
<option value="210" >210</option>
</select> records per page ::
Search user: <input type ="text" name="search" size="20" maxlength="50" value=''/>
</form>
[Records (206): <b>1-10</b> | <a href="http://wikka.jsnx.com/#?l=10&sort=name&d=asc&s=10">11-20</a> (sorted by: <em>name, asc</em> )]<br /><br />
<table width="100%" border="1px">
<tr>
<th><a href="http://wikka.jsnx.com/#?l=10&sort=name&d=desc">Name</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10&sort=email&d=asc">Email</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10">Signup Date/Time</a></th>
<th>Owned</th>
<th>Modified</th>
<th>Comments</th>
<th>Actions</th>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AbA" title=''>AbA</a></td>
<td>[email protected]</td>
<td>(2004-10-27 15:39:25)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=changes">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=comments">3</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AbA&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AdmiN/edit" title="Create this page">AdmiN</a></td>
<td>[email protected]</td>
<td>(2004-12-01 06:45:56)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdmiN&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AdrianB" title=''>AdrianB</a></td>
<td>[email protected]</td>
<td>(2004-05-19 15:48:37)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=changes">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdrianB&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AHerdOfTurtles" title=''>AHerdOfTurtles</a></td>
<td>[email protected]</td>
<td>(2004-09-18 19:42:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=changes">9</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=comments">4</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlekAndreev/edit" title="Create this page">AlekAndreev</a></td>
<td>[email protected]</td>
<td>(2004-11-01 20:06:31)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlessandroRonchi/edit" title="Create this page">AlessandroRonchi</a></td>
<td>[email protected]</td>
<td>(2004-10-21 13:12:36)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlexM/edit" title="Create this page">AlexM</a></td>
<td>[email protected]</td>
<td>(2004-11-20 06:02:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlexM&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlleyCat/edit" title="Create this page">AlleyCat</a></td>
<td>[email protected]</td>
<td>(2004-11-21 18:23:19)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlleyCat&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AndreaRossato" title=''>AndreaRossato</a></td>
<td>[email protected]</td>
<td>(2004-07-19 11:03:42)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=owned">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=changes">25</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=comments">7</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AndrewEddie" title=''>AndrewEddie</a></td>
<td>[email protected]</td>
<td>(2004-10-12 22:23:32)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=changes">3</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=feedback">feedback</a></td>
</tr>
</table>""
----
**Current features** (//2004-11-22//):
~-users can be sorted by different fields (click on table header to reverse sort order), searched and paged;
~-if the current user is not an administrator, then the ##lastuser.php## action is displayed
~-feedback can be sent to single users.
~-displays pages owned by each user.
~-displays pages changed by each user.
~-displays pages commented by each user.
**Files needed** (//2004-09-16//):
~-##actions/useradmin.php##: see code on this page;
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (enhanced version of FeedbackAction); ''2005-04-18 - action parameter support added''
~-##[[UserPagesAction actions/userpages.php]]## (enhanced version of ##mypages.php##);''2005-04-18 - action parameter support added''
~-##[[UserChangesAction actions/userchanges.php]]## (enhanced version of ##mychanges.php##); ''2005-04-18 - action parameter support added''
~-##[[UserCommentsAction actions/usercomments.php]]## (new action); ''2004-11-23 - ""RewriteRules"" bug fixed''
----
<<##actions/useradmin.php##<<
%%(php)
<?php
// USER ADMINISTRATION MODULE
// Last Updated: 2004-11-11
// Version 1.0
// Displays to the Wikka admins a list of registered users
// * Users can be sorted by different fields, searched and paged
// * For each user, full statistics are shown with the number of commented, created and modified pages
// * Specific actions (delete/send feedback) can be performed on single users
// * If the current user is not an administrator, then the lastuser action is displayed instead
// admin only code
if ($this->IsAdmin($this->GetUser())) {
if ($_GET["action"] == "feedback" || $_REQUEST["mail"]) {
echo $this->Action("userfeedback");
} else if ($_GET["action"] == "owned") {
echo $this->Action("userpages");
} else if ($_GET["action"] == "changes") {
echo $this->Action("userchanges");
} else if ($_GET["action"] == "comments") {
echo $this->Action("usercomments");
} else {
// pager defaults
// limit records per page
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// sort field
$sort = (!$_GET["sort"])? "signuptime" : $_GET["sort"];
// sort order
$d = (!$_GET["d"])? "desc" : $_GET["d"];
// start record
$s = (!$_GET["s"])? "0" : $_GET["s"];
// search results
$where = ($_POST["search"])? "WHERE name LIKE \"%".$_POST["search"]."%\"" : "";
echo $this->Format("==== User Administration ==== --- ---");
// 1. Get total number of users
$users = $this->LoadSingle("select count(*) as n FROM ".$this->config["table_prefix"]."users ".$where);
$numusers = $users['n'];
// 2. Display pager form
$form = $this->FormOpen("","","post");
$form .= "Show\n<select name=\"l\" onChange=\"form.submit()\">\n";
for ($rec=10; $rec < ($numusers+10); $rec+=10) {
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
}
$form .= "</select> records per page :: \n".
"Search user: <input type =\"text\" name=\"search\" size=\"20\" maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
$this->FormClose();
echo $form;
if($s > 0)
$prev = "<a href=\"" .$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s-$l))."\">".($s-$l+1)."-".$s."</a> | ";
if($numusers > ($s + $l))
$next = " | <a href=\"".$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s+$l))."\">".($s+$l+1)."-".($s+2*$l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next." (sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
// get user data
$userdata = $this->LoadAll("SELECT name, email, signuptime FROM ".$this->config["table_prefix"]."users ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// print table headers
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <tr>\n".
" <th><a href=\"".$this->Href("","", (($sort == "name" && $d == "asc")? "l=".$l."&sort=name&d=desc" :
"l=".$l."&sort=name&d=asc"))."\">Name</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "email" && $d == "asc")? "l=".$l."&sort=email&d=desc" :
"l=".$l."&sort=email&d=asc"))."\">Email</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "signuptime" && $d == "desc")? "l=".$l."&sort=signuptime&d=asc" :
"l=".$l.""))."\">Signup Date/Time</a></th>\n".
" <th>Owned</th>\n".
" <th>Modified</th>\n".
" <th>Comments</th>\n".
" <th>Actions</th>\n".
" </tr>\n";
// print user table
foreach($userdata as $user) {
$htmlout .= " <tr>\n";
$num = $this->LoadSingle("SELECT COUNT(*) AS n FROM ".$this->config["table_prefix"].
"pages WHERE owner='".$user["name"]."' AND latest = 'Y'");
$numchanges = $this->LoadSingle("SELECT COUNT(*) AS m FROM ".$this->config["table_prefix"].
"pages WHERE user='".$user["name"]."'");
$numcomments = $this->LoadSingle("SELECT COUNT(*) AS q FROM ".$this->config["table_prefix"].
"comments WHERE user='".$user["name"]."'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"].
"</td>\n<td>(".$user["signuptime"].")</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=owned")."\">".$num["n"]."</a>)"."</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=changes")."\">".$numchanges["m"]."</a>)</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=comments")."\">".$numcomments["q"]."</a>)</td>\n".
"<td><center />delete :: <a href=\"".$this->Href("","","user=".$user["name"]."&action=feedback")."\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
}
$htmlout .= "</table>\n";
print($htmlout);
} else {
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".$_POST["search"]."\"</strong></p>";
}
}
} else {
// user is not admin
echo $this->Action("lastusers");
}
?>
%%
----
{{lastedit}}
I've started writing some code for a user administration module. I think this might be interesting for wikka-based projects with a large number of registered users.
This action will enable Wikka administrators (or, in the future, users belonging to an //Admin// group) to have access to several user management functions from a single page:
~-Display a pageable, sortable and searchable **list of registered users** ''-- done'';
~-Perform specific **actions** on single users, like:
~~-**delete users** (forthcoming: see this [[RemovingUsers discussion]]);
~~-**add users** - in case the registration of a page is turned off, but you want to add a user
~~~& noted, good idea -- DarTar
~~-**send user feedback** ''-- done'';
~~-manage **user privileges** (forthcoming);
~-Display user's **owned pages** ''-- done'';
~-Display user's **comments** ''-- done''.
~-Display user's **changes** ''-- done'';
~-//other...//
The code below (to be saved as ##actions/useradmin.php## and used as ##""{{useradmin}}""## ) is just a very first draft. Contributions and improvements are welcome (especially to make the code lighter).
-- DarTar
Here's a preview of the interface (email addresses are masked for privacy reasons)
----
""<h3> User Administration </h3>
<br /> <form action="#" method="post">
Show
<select name="l" onChange="form.submit()">
<option value="10" selected>10</option>
<option value="20" >20</option>
<option value="30" >30</option>
<option value="40" >40</option>
<option value="50" >50</option>
<option value="60" >60</option>
<option value="70" >70</option>
<option value="80" >80</option>
<option value="90" >90</option>
<option value="100" >100</option>
<option value="110" >110</option>
<option value="120" >120</option>
<option value="130" >130</option>
<option value="140" >140</option>
<option value="150" >150</option>
<option value="160" >160</option>
<option value="170" >170</option>
<option value="180" >180</option>
<option value="190" >190</option>
<option value="200" >200</option>
<option value="210" >210</option>
</select> records per page ::
Search user: <input type ="text" name="search" size="20" maxlength="50" value=''/>
</form>
[Records (206): <b>1-10</b> | <a href="http://wikka.jsnx.com/#?l=10&sort=name&d=asc&s=10">11-20</a> (sorted by: <em>name, asc</em> )]<br /><br />
<table width="100%" border="1px">
<tr>
<th><a href="http://wikka.jsnx.com/#?l=10&sort=name&d=desc">Name</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10&sort=email&d=asc">Email</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10">Signup Date/Time</a></th>
<th>Owned</th>
<th>Modified</th>
<th>Comments</th>
<th>Actions</th>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AbA" title=''>AbA</a></td>
<td>[email protected]</td>
<td>(2004-10-27 15:39:25)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=changes">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=comments">3</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AbA&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AdmiN/edit" title="Create this page">AdmiN</a></td>
<td>[email protected]</td>
<td>(2004-12-01 06:45:56)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdmiN&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AdrianB" title=''>AdrianB</a></td>
<td>[email protected]</td>
<td>(2004-05-19 15:48:37)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=changes">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdrianB&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AHerdOfTurtles" title=''>AHerdOfTurtles</a></td>
<td>[email protected]</td>
<td>(2004-09-18 19:42:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=changes">9</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=comments">4</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlekAndreev/edit" title="Create this page">AlekAndreev</a></td>
<td>[email protected]</td>
<td>(2004-11-01 20:06:31)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlessandroRonchi/edit" title="Create this page">AlessandroRonchi</a></td>
<td>[email protected]</td>
<td>(2004-10-21 13:12:36)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlexM/edit" title="Create this page">AlexM</a></td>
<td>[email protected]</td>
<td>(2004-11-20 06:02:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlexM&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlleyCat/edit" title="Create this page">AlleyCat</a></td>
<td>[email protected]</td>
<td>(2004-11-21 18:23:19)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlleyCat&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AndreaRossato" title=''>AndreaRossato</a></td>
<td>[email protected]</td>
<td>(2004-07-19 11:03:42)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=owned">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=changes">25</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=comments">7</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AndrewEddie" title=''>AndrewEddie</a></td>
<td>[email protected]</td>
<td>(2004-10-12 22:23:32)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=changes">3</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=feedback">feedback</a></td>
</tr>
</table>""
----
**Current features** (//2004-11-22//):
~-users can be sorted by different fields (click on table header to reverse sort order), searched and paged;
~-if the current user is not an administrator, then the ##lastuser.php## action is displayed
~-feedback can be sent to single users.
~-displays pages owned by each user.
~-displays pages changed by each user.
~-displays pages commented by each user.
**Files needed** (//2004-09-16//):
~-##actions/useradmin.php##: see code on this page;
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (enhanced version of FeedbackAction); ''2005-04-18 - action parameter support added''
~-##[[UserPagesAction actions/userpages.php]]## (enhanced version of ##mypages.php##);''2005-04-18 - action parameter support added''
~-##[[UserChangesAction actions/userchanges.php]]## (enhanced version of ##mychanges.php##); ''2005-04-18 - action parameter support added''
~-##[[UserCommentsAction actions/usercomments.php]]## (new action); ''2004-11-23 - ""RewriteRules"" bug fixed''
----
<<##actions/useradmin.php##<<
%%(php)
<?php
// USER ADMINISTRATION MODULE
// Last Updated: 2004-11-11
// Version 1.0
// Displays to the Wikka admins a list of registered users
// * Users can be sorted by different fields, searched and paged
// * For each user, full statistics are shown with the number of commented, created and modified pages
// * Specific actions (delete/send feedback) can be performed on single users
// * If the current user is not an administrator, then the lastuser action is displayed instead
// admin only code
if ($this->IsAdmin($this->GetUser())) {
if ($_GET["action"] == "feedback" || $_REQUEST["mail"]) {
echo $this->Action("userfeedback");
} else if ($_GET["action"] == "owned") {
echo $this->Action("userpages");
} else if ($_GET["action"] == "changes") {
echo $this->Action("userchanges");
} else if ($_GET["action"] == "comments") {
echo $this->Action("usercomments");
} else {
// pager defaults
// limit records per page
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// sort field
$sort = (!$_GET["sort"])? "signuptime" : $_GET["sort"];
// sort order
$d = (!$_GET["d"])? "desc" : $_GET["d"];
// start record
$s = (!$_GET["s"])? "0" : $_GET["s"];
// search results
$where = ($_POST["search"])? "WHERE name LIKE \"%".$_POST["search"]."%\"" : "";
echo $this->Format("==== User Administration ==== --- ---");
// 1. Get total number of users
$users = $this->LoadSingle("select count(*) as n FROM ".$this->config["table_prefix"]."users ".$where);
$numusers = $users['n'];
// 2. Display pager form
$form = $this->FormOpen("","","post");
$form .= "Show\n<select name=\"l\" onChange=\"form.submit()\">\n";
for ($rec=10; $rec < ($numusers+10); $rec+=10) {
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
}
$form .= "</select> records per page :: \n".
"Search user: <input type =\"text\" name=\"search\" size=\"20\" maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
$this->FormClose();
echo $form;
if($s > 0)
$prev = "<a href=\"" .$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s-$l))."\">".($s-$l+1)."-".$s."</a> | ";
if($numusers > ($s + $l))
$next = " | <a href=\"".$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s+$l))."\">".($s+$l+1)."-".($s+2*$l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next." (sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
// get user data
$userdata = $this->LoadAll("SELECT name, email, signuptime FROM ".$this->config["table_prefix"]."users ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// print table headers
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <tr>\n".
" <th><a href=\"".$this->Href("","", (($sort == "name" && $d == "asc")? "l=".$l."&sort=name&d=desc" :
"l=".$l."&sort=name&d=asc"))."\">Name</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "email" && $d == "asc")? "l=".$l."&sort=email&d=desc" :
"l=".$l."&sort=email&d=asc"))."\">Email</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "signuptime" && $d == "desc")? "l=".$l."&sort=signuptime&d=asc" :
"l=".$l.""))."\">Signup Date/Time</a></th>\n".
" <th>Owned</th>\n".
" <th>Modified</th>\n".
" <th>Comments</th>\n".
" <th>Actions</th>\n".
" </tr>\n";
// print user table
foreach($userdata as $user) {
$htmlout .= " <tr>\n";
$num = $this->LoadSingle("SELECT COUNT(*) AS n FROM ".$this->config["table_prefix"].
"pages WHERE owner='".$user["name"]."' AND latest = 'Y'");
$numchanges = $this->LoadSingle("SELECT COUNT(*) AS m FROM ".$this->config["table_prefix"].
"pages WHERE user='".$user["name"]."'");
$numcomments = $this->LoadSingle("SELECT COUNT(*) AS q FROM ".$this->config["table_prefix"].
"comments WHERE user='".$user["name"]."'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"].
"</td>\n<td>(".$user["signuptime"].")</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=owned")."\">".$num["n"]."</a>)"."</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=changes")."\">".$numchanges["m"]."</a>)</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=comments")."\">".$numcomments["q"]."</a>)</td>\n".
"<td><center />delete :: <a href=\"".$this->Href("","","user=".$user["name"]."&action=feedback")."\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
}
$htmlout .= "</table>\n";
print($htmlout);
} else {
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".$_POST["search"]."\"</strong></p>";
}
}
} else {
// user is not admin
echo $this->Action("lastusers");
}
?>
%%
----
Deletions:
{{lastedit}}
I've started writing some code for a user administration module. I think this might be interesting for wikka-based projects with a large number of registered users.
This action will enable Wikka administrators (or, in the future, users belonging to an //Admin// group) to have access to several user management functions from a single page:
~-Display a pageable, sortable and searchable **list of registered users** ''-- done'';
~-Perform specific **actions** on single users, like:
~~-**delete users** (forthcoming: see this [[RemovingUsers discussion]]);
~~-**add users** - in case the registration of a page is turned off, but you want to add a user
~~~& noted, good idea -- DarTar
~~-**send user feedback** ''-- done'';
~~-manage **user privileges** (forthcoming);
~-Display user's **owned pages** ''-- done'';
~-Display user's **comments** ''-- done''.
~-Display user's **changes** ''-- done'';
~-//other...//
The code below (to be saved as ##actions/useradmin.php## and used as ##""{{useradmin}}""## ) is just a very first draft. Contributions and improvements are welcome (especially to make the code lighter).
-- DarTar
Here's a preview of the interface (email addresses are masked for privacy reasons)
----
""<h3> User Administration </h3>
<br /> <form action="#" method="post">
Show
<select name="l" onChange="form.submit()">
<option value="10" selected>10</option>
<option value="20" >20</option>
<option value="30" >30</option>
<option value="40" >40</option>
<option value="50" >50</option>
<option value="60" >60</option>
<option value="70" >70</option>
<option value="80" >80</option>
<option value="90" >90</option>
<option value="100" >100</option>
<option value="110" >110</option>
<option value="120" >120</option>
<option value="130" >130</option>
<option value="140" >140</option>
<option value="150" >150</option>
<option value="160" >160</option>
<option value="170" >170</option>
<option value="180" >180</option>
<option value="190" >190</option>
<option value="200" >200</option>
<option value="210" >210</option>
</select> records per page ::
Search user: <input type ="text" name="search" size="20" maxlength="50" value=''/>
</form>
[Records (206): <b>1-10</b> | <a href="http://wikka.jsnx.com/#?l=10&sort=name&d=asc&s=10">11-20</a> (sorted by: <em>name, asc</em> )]<br /><br />
<table width="100%" border="1px">
<tr>
<th><a href="http://wikka.jsnx.com/#?l=10&sort=name&d=desc">Name</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10&sort=email&d=asc">Email</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10">Signup Date/Time</a></th>
<th>Owned</th>
<th>Modified</th>
<th>Comments</th>
<th>Actions</th>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AbA" title=''>AbA</a></td>
<td>[email protected]</td>
<td>(2004-10-27 15:39:25)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=changes">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=comments">3</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AbA&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AdmiN/edit" title="Create this page">AdmiN</a></td>
<td>[email protected]</td>
<td>(2004-12-01 06:45:56)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdmiN&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AdrianB" title=''>AdrianB</a></td>
<td>[email protected]</td>
<td>(2004-05-19 15:48:37)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=changes">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdrianB&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AHerdOfTurtles" title=''>AHerdOfTurtles</a></td>
<td>[email protected]</td>
<td>(2004-09-18 19:42:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=changes">9</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=comments">4</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlekAndreev/edit" title="Create this page">AlekAndreev</a></td>
<td>[email protected]</td>
<td>(2004-11-01 20:06:31)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlessandroRonchi/edit" title="Create this page">AlessandroRonchi</a></td>
<td>[email protected]</td>
<td>(2004-10-21 13:12:36)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlexM/edit" title="Create this page">AlexM</a></td>
<td>[email protected]</td>
<td>(2004-11-20 06:02:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlexM&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlleyCat/edit" title="Create this page">AlleyCat</a></td>
<td>[email protected]</td>
<td>(2004-11-21 18:23:19)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlleyCat&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AndreaRossato" title=''>AndreaRossato</a></td>
<td>[email protected]</td>
<td>(2004-07-19 11:03:42)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=owned">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=changes">25</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=comments">7</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AndrewEddie" title=''>AndrewEddie</a></td>
<td>[email protected]</td>
<td>(2004-10-12 22:23:32)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=changes">3</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=feedback">feedback</a></td>
</tr>
</table>""
----
**Current features** (//2004-11-22//):
~-users can be sorted by different fields (click on table header to reverse sort order), searched and paged;
~-if the current user is not an administrator, then the ##lastuser.php## action is displayed
~-feedback can be sent to single users.
~-displays pages owned by each user.
~-displays pages changed by each user.
~-displays pages commented by each user.
**Files needed** (//2004-09-16//):
~-##actions/useradmin.php##: see code on this page;
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (updated version of FeedbackAction); ''2004-11-22 - ""RewriteRules"" bug fixed''
~-##[[UserPagesAction actions/userpages.php]]## (updated version of ##mypages.php##);
~-##[[UserChangesAction actions/userchanges.php]]## (updated version of ##mychanges.php##); ''2004-11-23 - ""RewriteRules"" bug fixed''
~-##[[UserCommentsAction actions/usercomments.php]]## (new action); ''2004-11-23 - ""RewriteRules"" bug fixed''
----
<<##actions/useradmin.php##<<
%%(php)
<?php
// USER ADMINISTRATION MODULE
// Last Updated: 2004-11-11
// Version 1.0
// Displays to the Wikka admins a list of registered users
// * Users can be sorted by different fields, searched and paged
// * For each user, full statistics are shown with the number of commented, created and modified pages
// * Specific actions (delete/send feedback) can be performed on single users
// * If the current user is not an administrator, then the lastuser action is displayed instead
// admin only code
if ($this->IsAdmin($this->GetUser())) {
if ($_GET["action"] == "feedback" || $_REQUEST["mail"]) {
echo $this->Action("userfeedback");
} else if ($_GET["action"] == "owned") {
echo $this->Action("userpages");
} else if ($_GET["action"] == "changes") {
echo $this->Action("userchanges");
} else if ($_GET["action"] == "comments") {
echo $this->Action("usercomments");
} else {
// pager defaults
// limit records per page
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// sort field
$sort = (!$_GET["sort"])? "signuptime" : $_GET["sort"];
// sort order
$d = (!$_GET["d"])? "desc" : $_GET["d"];
// start record
$s = (!$_GET["s"])? "0" : $_GET["s"];
// search results
$where = ($_POST["search"])? "WHERE name LIKE \"%".$_POST["search"]."%\"" : "";
echo $this->Format("==== User Administration ==== --- ---");
// 1. Get total number of users
$users = $this->LoadSingle("select count(*) as n FROM ".$this->config["table_prefix"]."users ".$where);
$numusers = $users['n'];
// 2. Display pager form
$form = $this->FormOpen("","","post");
$form .= "Show\n<select name=\"l\" onChange=\"form.submit()\">\n";
for ($rec=10; $rec < ($numusers+10); $rec+=10) {
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
}
$form .= "</select> records per page :: \n".
"Search user: <input type =\"text\" name=\"search\" size=\"20\" maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
$this->FormClose();
echo $form;
if($s > 0)
$prev = "<a href=\"" .$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s-$l))."\">".($s-$l+1)."-".$s."</a> | ";
if($numusers > ($s + $l))
$next = " | <a href=\"".$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s+$l))."\">".($s+$l+1)."-".($s+2*$l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next." (sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
// get user data
$userdata = $this->LoadAll("SELECT name, email, signuptime FROM ".$this->config["table_prefix"]."users ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// print table headers
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <tr>\n".
" <th><a href=\"".$this->Href("","", (($sort == "name" && $d == "asc")? "l=".$l."&sort=name&d=desc" :
"l=".$l."&sort=name&d=asc"))."\">Name</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "email" && $d == "asc")? "l=".$l."&sort=email&d=desc" :
"l=".$l."&sort=email&d=asc"))."\">Email</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "signuptime" && $d == "desc")? "l=".$l."&sort=signuptime&d=asc" :
"l=".$l.""))."\">Signup Date/Time</a></th>\n".
" <th>Owned</th>\n".
" <th>Modified</th>\n".
" <th>Comments</th>\n".
" <th>Actions</th>\n".
" </tr>\n";
// print user table
foreach($userdata as $user) {
$htmlout .= " <tr>\n";
$num = $this->LoadSingle("SELECT COUNT(*) AS n FROM ".$this->config["table_prefix"].
"pages WHERE owner='".$user["name"]."' AND latest = 'Y'");
$numchanges = $this->LoadSingle("SELECT COUNT(*) AS m FROM ".$this->config["table_prefix"].
"pages WHERE user='".$user["name"]."'");
$numcomments = $this->LoadSingle("SELECT COUNT(*) AS q FROM ".$this->config["table_prefix"].
"comments WHERE user='".$user["name"]."'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"].
"</td>\n<td>(".$user["signuptime"].")</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=owned")."\">".$num["n"]."</a>)"."</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=changes")."\">".$numchanges["m"]."</a>)</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=comments")."\">".$numcomments["q"]."</a>)</td>\n".
"<td><center />delete :: <a href=\"".$this->Href("","","user=".$user["name"]."&action=feedback")."\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
}
$htmlout .= "</table>\n";
print($htmlout);
} else {
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".$_POST["search"]."\"</strong></p>";
}
}
} else {
// user is not admin
echo $this->Action("lastusers");
}
?>
%%
----
Additions:
~~~& noted, good idea -- DarTar
Additions:
~~-**add users** - in case the registration of a page is turned off, but you want to add a user
Additions:
CategoryUserContributions
Deletions:
Additions:
{{lastedit}}
Here's a preview of the interface (email addresses are masked for privacy reasons)
""<h3> User Administration </h3>
<br /> <form action="#" method="post">
Show
<select name="l" onChange="form.submit()">
<option value="10" selected>10</option>
<option value="20" >20</option>
<option value="30" >30</option>
<option value="40" >40</option>
<option value="50" >50</option>
<option value="60" >60</option>
<option value="70" >70</option>
<option value="80" >80</option>
<option value="90" >90</option>
<option value="100" >100</option>
<option value="110" >110</option>
<option value="120" >120</option>
<option value="130" >130</option>
<option value="140" >140</option>
<option value="150" >150</option>
<option value="160" >160</option>
<option value="170" >170</option>
<option value="180" >180</option>
<option value="190" >190</option>
<option value="200" >200</option>
<option value="210" >210</option>
</select> records per page ::
Search user: <input type ="text" name="search" size="20" maxlength="50" value=''/>
</form>
[Records (206): <b>1-10</b> | <a href="http://wikka.jsnx.com/#?l=10&sort=name&d=asc&s=10">11-20</a> (sorted by: <em>name, asc</em> )]<br /><br />
<table width="100%" border="1px">
<tr>
<th><a href="http://wikka.jsnx.com/#?l=10&sort=name&d=desc">Name</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10&sort=email&d=asc">Email</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10">Signup Date/Time</a></th>
<th>Owned</th>
<th>Modified</th>
<th>Comments</th>
<th>Actions</th>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AbA" title=''>AbA</a></td>
<td>[email protected]</td>
<td>(2004-10-27 15:39:25)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=changes">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=comments">3</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AbA&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AdmiN/edit" title="Create this page">AdmiN</a></td>
<td>[email protected]</td>
<td>(2004-12-01 06:45:56)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdmiN&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AdrianB" title=''>AdrianB</a></td>
<td>[email protected]</td>
<td>(2004-05-19 15:48:37)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=changes">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdrianB&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AHerdOfTurtles" title=''>AHerdOfTurtles</a></td>
<td>[email protected]</td>
<td>(2004-09-18 19:42:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=changes">9</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=comments">4</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlekAndreev/edit" title="Create this page">AlekAndreev</a></td>
<td>[email protected]</td>
<td>(2004-11-01 20:06:31)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlessandroRonchi/edit" title="Create this page">AlessandroRonchi</a></td>
<td>[email protected]</td>
<td>(2004-10-21 13:12:36)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlexM/edit" title="Create this page">AlexM</a></td>
<td>[email protected]</td>
<td>(2004-11-20 06:02:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlexM&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlleyCat/edit" title="Create this page">AlleyCat</a></td>
<td>[email protected]</td>
<td>(2004-11-21 18:23:19)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlleyCat&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AndreaRossato" title=''>AndreaRossato</a></td>
<td>[email protected]</td>
<td>(2004-07-19 11:03:42)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=owned">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=changes">25</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=comments">7</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AndrewEddie" title=''>AndrewEddie</a></td>
<td>[email protected]</td>
<td>(2004-10-12 22:23:32)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=changes">3</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=feedback">feedback</a></td>
</tr>
</table>""
Here's a preview of the interface (email addresses are masked for privacy reasons)
""<h3> User Administration </h3>
<br /> <form action="#" method="post">
Show
<select name="l" onChange="form.submit()">
<option value="10" selected>10</option>
<option value="20" >20</option>
<option value="30" >30</option>
<option value="40" >40</option>
<option value="50" >50</option>
<option value="60" >60</option>
<option value="70" >70</option>
<option value="80" >80</option>
<option value="90" >90</option>
<option value="100" >100</option>
<option value="110" >110</option>
<option value="120" >120</option>
<option value="130" >130</option>
<option value="140" >140</option>
<option value="150" >150</option>
<option value="160" >160</option>
<option value="170" >170</option>
<option value="180" >180</option>
<option value="190" >190</option>
<option value="200" >200</option>
<option value="210" >210</option>
</select> records per page ::
Search user: <input type ="text" name="search" size="20" maxlength="50" value=''/>
</form>
[Records (206): <b>1-10</b> | <a href="http://wikka.jsnx.com/#?l=10&sort=name&d=asc&s=10">11-20</a> (sorted by: <em>name, asc</em> )]<br /><br />
<table width="100%" border="1px">
<tr>
<th><a href="http://wikka.jsnx.com/#?l=10&sort=name&d=desc">Name</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10&sort=email&d=asc">Email</a></th>
<th><a href="http://wikka.jsnx.com/#?l=10">Signup Date/Time</a></th>
<th>Owned</th>
<th>Modified</th>
<th>Comments</th>
<th>Actions</th>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AbA" title=''>AbA</a></td>
<td>[email protected]</td>
<td>(2004-10-27 15:39:25)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=changes">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AbA&action=comments">3</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AbA&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AdmiN/edit" title="Create this page">AdmiN</a></td>
<td>[email protected]</td>
<td>(2004-12-01 06:45:56)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdmiN&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdmiN&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AdrianB" title=''>AdrianB</a></td>
<td>[email protected]</td>
<td>(2004-05-19 15:48:37)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=changes">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AdrianB&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AdrianB&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AHerdOfTurtles" title=''>AHerdOfTurtles</a></td>
<td>[email protected]</td>
<td>(2004-09-18 19:42:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=changes">9</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=comments">4</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AHerdOfTurtles&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlekAndreev/edit" title="Create this page">AlekAndreev</a></td>
<td>[email protected]</td>
<td>(2004-11-01 20:06:31)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlekAndreev&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlessandroRonchi/edit" title="Create this page">AlessandroRonchi</a></td>
<td>[email protected]</td>
<td>(2004-10-21 13:12:36)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlessandroRonchi&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlexM/edit" title="Create this page">AlexM</a></td>
<td>[email protected]</td>
<td>(2004-11-20 06:02:39)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlexM&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlexM&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a class="missingpage" href="http://wikka.jsnx.com/AlleyCat/edit" title="Create this page">AlleyCat</a></td>
<td>[email protected]</td>
<td>(2004-11-21 18:23:19)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=owned">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=changes">0</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AlleyCat&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AlleyCat&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AndreaRossato" title=''>AndreaRossato</a></td>
<td>[email protected]</td>
<td>(2004-07-19 11:03:42)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=owned">4</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=changes">25</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=comments">7</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndreaRossato&action=feedback">feedback</a></td>
</tr>
<tr>
<td><a href="http://wikka.jsnx.com/AndrewEddie" title=''>AndrewEddie</a></td>
<td>[email protected]</td>
<td>(2004-10-12 22:23:32)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=owned">1</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=changes">3</a>)</td>
<td><center />(<a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=comments">0</a>)</td>
<td><center />delete :: <a href="http://wikka.jsnx.com/#?user=AndrewEddie&action=feedback">feedback</a></td>
</tr>
</table>""
Deletions:
<<[[http://skins.openformats.org/images/useradmin.jpg Screenshot]]<<::c::
Additions:
~-##[[UserChangesAction actions/userchanges.php]]## (updated version of ##mychanges.php##); ''2004-11-23 - ""RewriteRules"" bug fixed''
~-##[[UserCommentsAction actions/usercomments.php]]## (new action); ''2004-11-23 - ""RewriteRules"" bug fixed''
~-##[[UserCommentsAction actions/usercomments.php]]## (new action); ''2004-11-23 - ""RewriteRules"" bug fixed''
Deletions:
~-##[[UserCommentsAction actions/usercomments.php]]## (new action);
Additions:
===== User Administration Module =====
''Last Updated: 2004-11-22 - ""RewriteRules"" bug fixed ''
I've started writing some code for a user administration module. I think this might be interesting for wikka-based projects with a large number of registered users.
~~-**delete users** (forthcoming: see this [[RemovingUsers discussion]]);
''Last Updated: 2004-11-22 - ""RewriteRules"" bug fixed ''
I've started writing some code for a user administration module. I think this might be interesting for wikka-based projects with a large number of registered users.
~~-**delete users** (forthcoming: see this [[RemovingUsers discussion]]);
Deletions:
''Last Updated: 2004-11-22 - Fixed problem with rewriterules''
I've started writing some code for a user administration tool. I think this might be interesting for wikka-based projects with a large number of registered users.
~~-**delete users** (see this [[RemovingUsers discussion]]);
Deletions:
Additions:
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (updated version of FeedbackAction); ''2004-11-22 - ""RewriteRules"" bug fixed''
Deletions:
Additions:
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (updated version of FeedbackAction); ''2004-11-22 - ''RewriteRules'' bug fixed''
Deletions:
Additions:
''Last Updated: 2004-11-22 - Fixed problem with rewriterules''
**Current features** (//2004-11-22//):
// USER ADMINISTRATION MODULE
// Last Updated: 2004-11-11
// Version 1.0
// * Users can be sorted by different fields, searched and paged
// * For each user, full statistics are shown with the number of commented, created and modified pages
// * Specific actions (delete/send feedback) can be performed on single users
// * If the current user is not an administrator, then the lastuser action is displayed instead
$page = $this->config['base_url'].$this->GetPageTag();
if ($_GET["action"] == "feedback" || $_REQUEST["mail"]) {
echo $this->Action("userfeedback");
} else if ($_GET["action"] == "owned") {
echo $this->Action("userpages");
} else if ($_GET["action"] == "changes") {
echo $this->Action("userchanges");
} else if ($_GET["action"] == "comments") {
echo $this->Action("usercomments");
// pager defaults
// limit records per page
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// sort field
$sort = (!$_GET["sort"])? "signuptime" : $_GET["sort"];
// sort order
$d = (!$_GET["d"])? "desc" : $_GET["d"];
// start record
$s = (!$_GET["s"])? "0" : $_GET["s"];
// search results
$where = ($_POST["search"])? "WHERE name LIKE \"%".$_POST["search"]."%\"" : "";
echo $this->Format("==== User Administration ==== --- ---");
// 1. Get total number of users
$users = $this->LoadSingle("select count(*) as n FROM ".$this->config["table_prefix"]."users ".$where);
$numusers = $users['n'];
// 2. Display pager form
$form = $this->FormOpen("","","post");
$form .= "Show\n<select name=\"l\" onChange=\"form.submit()\">\n";
for ($rec=10; $rec < ($numusers+10); $rec+=10) {
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
$form .= "</select> records per page :: \n".
"Search user: <input type =\"text\" name=\"search\" size=\"20\" maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
$this->FormClose();
echo $form;
if($s > 0)
$prev = "<a href=\"" .$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s-$l))."\">".($s-$l+1)."-".$s."</a> | ";
if($numusers > ($s + $l))
$next = " | <a href=\"".$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s+$l))."\">".($s+$l+1)."-".($s+2*$l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next." (sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
// get user data
$userdata = $this->LoadAll("SELECT name, email, signuptime FROM ".$this->config["table_prefix"]."users ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// print table headers
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <tr>\n".
" <th><a href=\"".$this->Href("","", (($sort == "name" && $d == "asc")? "l=".$l."&sort=name&d=desc" :
"l=".$l."&sort=name&d=asc"))."\">Name</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "email" && $d == "asc")? "l=".$l."&sort=email&d=desc" :
"l=".$l."&sort=email&d=asc"))."\">Email</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "signuptime" && $d == "desc")? "l=".$l."&sort=signuptime&d=asc" :
"l=".$l.""))."\">Signup Date/Time</a></th>\n".
" </tr>\n";
// print user table
foreach($userdata as $user) {
$num = $this->LoadSingle("SELECT COUNT(*) AS n FROM ".$this->config["table_prefix"].
"pages WHERE owner='".$user["name"]."' AND latest = 'Y'");
$numchanges = $this->LoadSingle("SELECT COUNT(*) AS m FROM ".$this->config["table_prefix"].
"pages WHERE user='".$user["name"]."'");
$numcomments = $this->LoadSingle("SELECT COUNT(*) AS q FROM ".$this->config["table_prefix"].
"comments WHERE user='".$user["name"]."'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"].
"</td>\n<td>(".$user["signuptime"].")</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=owned")."\">".$num["n"]."</a>)"."</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=changes")."\">".$numchanges["m"]."</a>)</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=comments")."\">".$numcomments["q"]."</a>)</td>\n".
"<td><center />delete :: <a href=\"".$this->Href("","","user=".$user["name"]."&action=feedback")."\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".$_POST["search"]."\"</strong></p>";
// user is not admin
**Current features** (//2004-11-22//):
// USER ADMINISTRATION MODULE
// Last Updated: 2004-11-11
// Version 1.0
// * Users can be sorted by different fields, searched and paged
// * For each user, full statistics are shown with the number of commented, created and modified pages
// * Specific actions (delete/send feedback) can be performed on single users
// * If the current user is not an administrator, then the lastuser action is displayed instead
$page = $this->config['base_url'].$this->GetPageTag();
if ($_GET["action"] == "feedback" || $_REQUEST["mail"]) {
echo $this->Action("userfeedback");
} else if ($_GET["action"] == "owned") {
echo $this->Action("userpages");
} else if ($_GET["action"] == "changes") {
echo $this->Action("userchanges");
} else if ($_GET["action"] == "comments") {
echo $this->Action("usercomments");
// pager defaults
// limit records per page
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// sort field
$sort = (!$_GET["sort"])? "signuptime" : $_GET["sort"];
// sort order
$d = (!$_GET["d"])? "desc" : $_GET["d"];
// start record
$s = (!$_GET["s"])? "0" : $_GET["s"];
// search results
$where = ($_POST["search"])? "WHERE name LIKE \"%".$_POST["search"]."%\"" : "";
echo $this->Format("==== User Administration ==== --- ---");
// 1. Get total number of users
$users = $this->LoadSingle("select count(*) as n FROM ".$this->config["table_prefix"]."users ".$where);
$numusers = $users['n'];
// 2. Display pager form
$form = $this->FormOpen("","","post");
$form .= "Show\n<select name=\"l\" onChange=\"form.submit()\">\n";
for ($rec=10; $rec < ($numusers+10); $rec+=10) {
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
$form .= "</select> records per page :: \n".
"Search user: <input type =\"text\" name=\"search\" size=\"20\" maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
$this->FormClose();
echo $form;
if($s > 0)
$prev = "<a href=\"" .$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s-$l))."\">".($s-$l+1)."-".$s."</a> | ";
if($numusers > ($s + $l))
$next = " | <a href=\"".$this->Href("","","l=".$l."&sort=".$sort."&d=".$d."&s=".($s+$l))."\">".($s+$l+1)."-".($s+2*$l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next." (sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
// get user data
$userdata = $this->LoadAll("SELECT name, email, signuptime FROM ".$this->config["table_prefix"]."users ".
$where." ORDER BY ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// print table headers
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <tr>\n".
" <th><a href=\"".$this->Href("","", (($sort == "name" && $d == "asc")? "l=".$l."&sort=name&d=desc" :
"l=".$l."&sort=name&d=asc"))."\">Name</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "email" && $d == "asc")? "l=".$l."&sort=email&d=desc" :
"l=".$l."&sort=email&d=asc"))."\">Email</a></th>\n".
" <th><a href=\"".$this->Href("","", (($sort == "signuptime" && $d == "desc")? "l=".$l."&sort=signuptime&d=asc" :
"l=".$l.""))."\">Signup Date/Time</a></th>\n".
" </tr>\n";
// print user table
foreach($userdata as $user) {
$num = $this->LoadSingle("SELECT COUNT(*) AS n FROM ".$this->config["table_prefix"].
"pages WHERE owner='".$user["name"]."' AND latest = 'Y'");
$numchanges = $this->LoadSingle("SELECT COUNT(*) AS m FROM ".$this->config["table_prefix"].
"pages WHERE user='".$user["name"]."'");
$numcomments = $this->LoadSingle("SELECT COUNT(*) AS q FROM ".$this->config["table_prefix"].
"comments WHERE user='".$user["name"]."'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"].
"</td>\n<td>(".$user["signuptime"].")</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=owned")."\">".$num["n"]."</a>)"."</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=changes")."\">".$numchanges["m"]."</a>)</td>\n <td><center />".
"(<a href=\"".$this->Href("","","user=".$user["name"]."&action=comments")."\">".$numcomments["q"]."</a>)</td>\n".
"<td><center />delete :: <a href=\"".$this->Href("","","user=".$user["name"]."&action=feedback")."\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".$_POST["search"]."\"</strong></p>";
// user is not admin
Deletions:
// USER ADMINISTRATION TOOL
$page = $PHP_SELF.$this->GetPageTag();
// Perform specific actions on single users
// A. Delete user (forthcoming...)
// B. Send user feedback
if ($_GET["action"] == "feedback" || $_GET["mail"]) {
echo $this->Action("userfeedback");
// C. Show user owned pages
} else if ($_GET["action"] == "owned") {
echo $this->Action("userpages");
// D. Show user modified pages
} else if ($_GET["action"] == "changes") {
echo $this->Action("userchanges");
// E. Show user comments
} else if ($_GET["action"] == "comments") {
echo $this->Action("usercomments");
// F. Main screen: display user table
// limit records per page
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// Set defaults:
// sort field
$sort = (!$_GET["sort"])? "signuptime" : $_GET["sort"];
// sort order
$d = (!$_GET["d"])? "desc" : $_GET["d"];
// start record
$s = (!$_GET["s"])? "0" : $_GET["s"];
// Restrict query to search string
if ($_POST["search"]) $where = "WHERE name LIKE \"%".$_POST["search"]."%\"";
echo $this->Format("==== User Administration ==== --- ---");
// Build pager
// 1. get total number of users
$users = $this->LoadSingle("select count(*) as n FROM ".$this->config["table_prefix"]."users ".$where);
$numusers = $users['n'];
// 2. display pager form
$form = "<form action=\"".$page."\" method=\"post\">Show\n
<select name=\"l\" onChange=\"form.submit()\">\n";
// 3. build pager menu (option step set to 10)
for ($rec=10; $rec < ($numusers+10); $rec+=10) {
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
$form .= "</select> records per page :: \n".
"Search user: <input type =\"text\" name=\"search\" size=\"20\" maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
"</form>\n";
echo $form;
// 4. build "previous records" link
if($s > 0)
$prev = "<a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s - $l) .
"\">".($s - $l +1)."-".$s."</a> | ";
// 5. build "next records" link
if($numusers > ($s + $l))
$next = " | <a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s + $l) .
"\">".($s + $l + 1)."-".($s + 2 * $l)."</a>";
// 6. last step: print navigation bar
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next." (sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
// Get user data
$userdata = $this->LoadAll("select name, email, signuptime from ".$this->config["table_prefix"]."users ".$where." order by ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// 1. print table header
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <tr>\n".
" <th><a href=\"".$page.(($sort == "name" && $d == "asc")? "?l=".$l."&sort=name&d=desc" : "?l=".$l."&sort=name&d=asc")."\">Name</a></th>\n".
" <th><a href=\"".$page.(($sort == "email" && $d == "asc")? "?l=".$l."&sort=email&d=desc" : "?l=".$l."&sort=email&d=asc")."\">Email</a></th>\n".
" <th><a href=\"".$page.(($sort == "signuptime" && $d == "desc")? "?l=".$l."&sort=signuptime&d=asc" : "?l=".$l."")."\">Signup Date/Time</a></th>\n".
" </tr>\n";
// 2. print user table
foreach($userdata as $user) {
// get number n of owned pages
$num = $this->LoadSingle("select count(*) as n from ".$this->config["table_prefix"]."pages where owner='".$user["name"]."' AND latest = 'Y'");
// get number m of modified pages
$numchanges = $this->LoadSingle("select count(*) as m from ".$this->config["table_prefix"]."pages where user='".$user["name"]."'");
// get number q of comments
$numcomments = $this->LoadSingle("select count(*) as q from ".$this->config["table_prefix"]."comments where user='".$user["name"]."'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"]."</td>\n <td>(".$user["signuptime"].")</td>\n <td><center />"."(<a href=\"".$page."?user=".$user["name"]."&action=owned\">".$num["n"]."</a>)"."</td>\n <td><center />(<a href=\"".$page."?user=".$user["name"]."&action=changes\">".$numchanges["m"]."</a>)</td>\n <td><center />(<a href=\"".$page."?user=".$user["name"]."&action=comments\">".$numcomments["q"]."</a>)</td>\n <td><center />delete :: <a href=\"".$page."?user=".$user["name"]."&action=feedback\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
} else {
// 3. print error message for search results
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".$_POST["search"]."\"</strong></p>";
// G. Displays standard user list to non-admins
Additions:
<<[[http://skins.openformats.org/images/useradmin.jpg Screenshot]]<<::c::
Additions:
~~-**delete users** (see this [[RemovingUsers discussion]]);
Deletions:
Additions:
CategoryDevelopment
Deletions:
Additions:
%%
CategoryDevelopment
CategoryDevelopment
Deletions:
Additions:
~-displays pages owned by each user.
~-displays pages changed by each user.
~-displays pages commented by each user.
~-displays pages changed by each user.
~-displays pages commented by each user.
Deletions:
~-display pages changed by each user.
~-display pages commented by each user.
Additions:
~-//other...//
Additions:
~-##[[FeedbackActionUpgrade actions/userfeedback.php]]## (updated version of FeedbackAction);
echo $this->Action("userfeedback");
echo $this->Action("userfeedback");
Deletions:
echo $this->Action("feedback");
Additions:
<<##actions/useradmin.php##<<
Additions:
~-display pages owned by each user.
~-display pages changed by each user.
~-display pages commented by each user.
~-display pages changed by each user.
~-display pages commented by each user.
Deletions:
~-display pages changed by user.
~-display pages commented by users.
Additions:
~-feedback can be sent to single users.
~-display pages owned by user.
~-display pages changed by user.
~-display pages commented by users.
**Files needed** (//2004-09-16//):
~-##actions/useradmin.php##: see code on this page;
~-##[[FeedbackActionUpgrade actions/feedback.php]]## (updated version of FeedbackAction);
~-##[[UserPagesAction actions/userpages.php]]## (updated version of ##mypages.php##);
~-##[[UserChangesAction actions/userchanges.php]]## (updated version of ##mychanges.php##);
~-##[[UserCommentsAction actions/usercomments.php]]## (new action);
~-display pages owned by user.
~-display pages changed by user.
~-display pages commented by users.
**Files needed** (//2004-09-16//):
~-##actions/useradmin.php##: see code on this page;
~-##[[FeedbackActionUpgrade actions/feedback.php]]## (updated version of FeedbackAction);
~-##[[UserPagesAction actions/userpages.php]]## (updated version of ##mypages.php##);
~-##[[UserChangesAction actions/userchanges.php]]## (updated version of ##mychanges.php##);
~-##[[UserCommentsAction actions/usercomments.php]]## (new action);
Deletions:
~-feedback can be sent to single users. This requires an [[FeedbackActionUpgrade upgraded version]] of FeedbackAction
~-display pages owned by user. This requires an [[UserPagesAction upgraded version]] of ##mypages.php##
~-display pages changed by user. This requires an [[UserChangesAction upgraded version]] of ##mychanges.php##
~-display pages commented by users. This requires an extra action: UserCommentsAction
<< ::c::
Additions:
~-if the current user is not an administrator, then the ##lastuser.php## action is displayed
~-display pages owned by user. This requires an [[UserPagesAction upgraded version]] of ##mypages.php##
~-display pages changed by user. This requires an [[UserChangesAction upgraded version]] of ##mychanges.php##
~-display pages commented by users. This requires an extra action: UserCommentsAction
~-display pages owned by user. This requires an [[UserPagesAction upgraded version]] of ##mypages.php##
~-display pages changed by user. This requires an [[UserChangesAction upgraded version]] of ##mychanges.php##
~-display pages commented by users. This requires an extra action: UserCommentsAction
Deletions:
~-pages owned by user. This requires an [[UserPagesAction upgraded version]] of ##mypages.php##
~-pages changed by user. This requires an [[UserChangesAction upgraded version]] of ##mychanges.php##
~-pages commented by users. This requires an extra action: UserCommentsAction
Additions:
~-Display user's **owned pages** ''-- done'';
~-Display user's **comments** ''-- done''.
~-Display user's **changes** ''-- done'';
**Current features** (//2004-09-16//):
~-pages owned by user. This requires an [[UserPagesAction upgraded version]] of ##mypages.php##
~-pages changed by user. This requires an [[UserChangesAction upgraded version]] of ##mychanges.php##
~-pages commented by users. This requires an extra action: UserCommentsAction
// C. Show user owned pages
} else if ($_GET["action"] == "owned") {
echo $this->Action("userpages");
// D. Show user modified pages
} else if ($_GET["action"] == "changes") {
echo $this->Action("userchanges");
// E. Show user comments
} else if ($_GET["action"] == "comments") {
echo $this->Action("usercomments");
// F. Main screen: display user table
" <th>Owned</th>\n".
" <th>Modified</th>\n".
" <th>Comments</th>\n".
foreach($userdata as $user) {
// get number n of owned pages
// get number m of modified pages
$numchanges = $this->LoadSingle("select count(*) as m from ".$this->config["table_prefix"]."pages where user='".$user["name"]."'");
// get number q of comments
$numcomments = $this->LoadSingle("select count(*) as q from ".$this->config["table_prefix"]."comments where user='".$user["name"]."'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"]."</td>\n <td>(".$user["signuptime"].")</td>\n <td><center />"."(<a href=\"".$page."?user=".$user["name"]."&action=owned\">".$num["n"]."</a>)"."</td>\n <td><center />(<a href=\"".$page."?user=".$user["name"]."&action=changes\">".$numchanges["m"]."</a>)</td>\n <td><center />(<a href=\"".$page."?user=".$user["name"]."&action=comments\">".$numcomments["q"]."</a>)</td>\n <td><center />delete :: <a href=\"".$page."?user=".$user["name"]."&action=feedback\">feedback</a></td>\n";
// G. Displays standard user list to non-admins
~-Display user's **comments** ''-- done''.
~-Display user's **changes** ''-- done'';
**Current features** (//2004-09-16//):
~-pages owned by user. This requires an [[UserPagesAction upgraded version]] of ##mypages.php##
~-pages changed by user. This requires an [[UserChangesAction upgraded version]] of ##mychanges.php##
~-pages commented by users. This requires an extra action: UserCommentsAction
// C. Show user owned pages
} else if ($_GET["action"] == "owned") {
echo $this->Action("userpages");
// D. Show user modified pages
} else if ($_GET["action"] == "changes") {
echo $this->Action("userchanges");
// E. Show user comments
} else if ($_GET["action"] == "comments") {
echo $this->Action("usercomments");
// F. Main screen: display user table
" <th>Owned</th>\n".
" <th>Modified</th>\n".
" <th>Comments</th>\n".
foreach($userdata as $user) {
// get number n of owned pages
// get number m of modified pages
$numchanges = $this->LoadSingle("select count(*) as m from ".$this->config["table_prefix"]."pages where user='".$user["name"]."'");
// get number q of comments
$numcomments = $this->LoadSingle("select count(*) as q from ".$this->config["table_prefix"]."comments where user='".$user["name"]."'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"]."</td>\n <td>(".$user["signuptime"].")</td>\n <td><center />"."(<a href=\"".$page."?user=".$user["name"]."&action=owned\">".$num["n"]."</a>)"."</td>\n <td><center />(<a href=\"".$page."?user=".$user["name"]."&action=changes\">".$numchanges["m"]."</a>)</td>\n <td><center />(<a href=\"".$page."?user=".$user["name"]."&action=comments\">".$numcomments["q"]."</a>)</td>\n <td><center />delete :: <a href=\"".$page."?user=".$user["name"]."&action=feedback\">feedback</a></td>\n";
// G. Displays standard user list to non-admins
Deletions:
~-Display user's **comments** (requires a small modification of ##recentcomments.php##).
~-Display user's **changes** (requires a small modification of ##mychanges.php##);
**Current features** (//2004-09-15//):
// C. Main screen: display user table
" <th>Owned Pages</th>\n".
foreach($userdata as $user) {
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"]."</td>\n
<td>(".$user["signuptime"].")</td>\n <td><center />"."(".$num["n"].")"."</td>\n <td><center />delete :: <a
href=\"".$page."?user=".$user["name"]."&action=feedback\">feedback</a></td>\n";
// D. Displays standard list to normal users
Additions:
// 2. display pager form
// 3. build pager menu (option step set to 10)
// 6. last step: print navigation bar
// Get user data
// 1. print table header
// 2. print user table
// 3. print error message for search results
// D. Displays standard list to normal users
// 3. build pager menu (option step set to 10)
// 6. last step: print navigation bar
// Get user data
// 1. print table header
// 2. print user table
// 3. print error message for search results
// D. Displays standard list to normal users
Deletions:
// 3. pager step set to 10
// 6. print navigation links
// get user data
// print table header
// print user table
// displays standard list to normal users
Additions:
// C. Main screen: display user table
// Set defaults:
// Restrict query to search string
// Build pager
// Set defaults:
// Restrict query to search string
// Build pager
Deletions:
// setting defaults
// pager
Additions:
// A. Delete user (forthcoming...)
// B. Send user feedback
// B. Send user feedback
Deletions:
Additions:
// 3. pager step set to 10
for ($rec=10; $rec < ($numusers+10); $rec+=10) {
// 4. build "previous records" link
// 5. build "next records" link
// 6. print navigation links
for ($rec=10; $rec < ($numusers+10); $rec+=10) {
// 4. build "previous records" link
// 5. build "next records" link
// 6. print navigation links
Deletions:
Additions:
~-Display a pageable, sortable and searchable **list of registered users** ''-- done'';
~~-**send user feedback** ''-- done'';
~~-**send user feedback** ''-- done'';
Deletions:
~~-**send user feedback** (requires a small modification of FeedbackAction);
Additions:
~-feedback can be sent to single users. This requires an [[FeedbackActionUpgrade upgraded version]] of FeedbackAction
Deletions:
Additions:
// admin only code
<select name=\"l\" onChange=\"form.submit()\">\n";
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
"Search user: <input type =\"text\" name=\"search\" size=\"20\" maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
"</form>\n";
$prev = "<a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s - $l) .
"\">".($s - $l +1)."-".$s."</a> | ";
$next = " | <a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s + $l) .
"\">".($s + $l + 1)."-".($s + 2 * $l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next." (sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
$userdata = $this->LoadAll("select name, email, signuptime from ".$this->config["table_prefix"]."users ".$where." order by ".$sort." ".$d." limit ".$s.", ".$l);
// print table header
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <th><a href=\"".$page.(($sort == "name" && $d == "asc")? "?l=".$l."&sort=name&d=desc" : "?l=".$l."&sort=name&d=asc")."\">Name</a></th>\n".
" <th><a href=\"".$page.(($sort == "email" && $d == "asc")? "?l=".$l."&sort=email&d=desc" : "?l=".$l."&sort=email&d=asc")."\">Email</a></th>\n".
" <th><a href=\"".$page.(($sort == "signuptime" && $d == "desc")? "?l=".$l."&sort=signuptime&d=asc" : "?l=".$l."")."\">Signup Date/Time</a></th>\n".
// print user table
foreach($userdata as $user) {
$htmlout .= " <tr>\n";
$num = $this->LoadSingle("select count(*) as n from ".$this->config["table_prefix"]."pages where owner='".$user["name"]."' AND latest = 'Y'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"]."</td>\n
<td>(".$user["signuptime"].")</td>\n <td><center />"."(".$num["n"].")"."</td>\n <td><center />delete :: <a
href=\"".$page."?user=".$user["name"]."&action=feedback\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
$htmlout .= "</table>\n";
print($htmlout);
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".$_POST["search"]."\"</strong></p>";
<select name=\"l\" onChange=\"form.submit()\">\n";
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
"Search user: <input type =\"text\" name=\"search\" size=\"20\" maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
"</form>\n";
$prev = "<a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s - $l) .
"\">".($s - $l +1)."-".$s."</a> | ";
$next = " | <a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s + $l) .
"\">".($s + $l + 1)."-".($s + 2 * $l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next." (sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
$userdata = $this->LoadAll("select name, email, signuptime from ".$this->config["table_prefix"]."users ".$where." order by ".$sort." ".$d." limit ".$s.", ".$l);
// print table header
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <th><a href=\"".$page.(($sort == "name" && $d == "asc")? "?l=".$l."&sort=name&d=desc" : "?l=".$l."&sort=name&d=asc")."\">Name</a></th>\n".
" <th><a href=\"".$page.(($sort == "email" && $d == "asc")? "?l=".$l."&sort=email&d=desc" : "?l=".$l."&sort=email&d=asc")."\">Email</a></th>\n".
" <th><a href=\"".$page.(($sort == "signuptime" && $d == "desc")? "?l=".$l."&sort=signuptime&d=asc" : "?l=".$l."")."\">Signup Date/Time</a></th>\n".
// print user table
foreach($userdata as $user) {
$htmlout .= " <tr>\n";
$num = $this->LoadSingle("select count(*) as n from ".$this->config["table_prefix"]."pages where owner='".$user["name"]."' AND latest = 'Y'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"]."</td>\n
<td>(".$user["signuptime"].")</td>\n <td><center />"."(".$num["n"].")"."</td>\n <td><center />delete :: <a
href=\"".$page."?user=".$user["name"]."&action=feedback\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
$htmlout .= "</table>\n";
print($htmlout);
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".$_POST["search"]."\"</strong></p>";
Deletions:
// restrict to search query
<select name=\"l\" onChange=\"form.submit()\">\n";
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
"Search user: <input type =\"text\" name=\"search\" size=\"20\"\n
maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
"</form>\n";
$prev = "<a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s - $l) .
"\">".($s - $l +1)."-".$s."</a> | ";
$next = " | <a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s + $l) .
"\">".($s + $l + 1)."-".($s + 2 * $l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next."
(sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
$userdata = $this->LoadAll("select name, email, signuptime from ".
$this->config["table_prefix"]."users ".
$where." order by ".$sort." ".$d." limit ".$s.", ".$l);
// print table header
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <th><a href=\"".$page.(($sort == "name" && $d == "asc")?
"?l=".$l."&sort=name&d=desc" : "?l=".$l."&sort=name&d=asc")."\">Name</a></th>\n".
" <th><a href=\"".$page.(($sort == "email" && $d == "asc")?
"?l=".$l."&sort=email&d=desc" : "?l=".$l."&sort=email&d=asc")."\">Email</a></th>\n".
" <th><a href=\"".$page.(($sort == "signuptime" && $d == "desc")?
"?l=".$l."&sort=signuptime&d=asc" : "?l=".$l."")."\">Signup Date/Time</a></th>\n".
// print user table
foreach($userdata as $user) {
$htmlout .= " <tr>\n";
$num = $this->LoadSingle("select count(*) as n from ".
$this->config["table_prefix"]."pages where owner='".
$user["name"]."' AND latest = 'Y'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n
<td>".$user["email"]."</td>\n
<td>(".$user["signuptime"].")</td>\n
<td><center />"."(".$num["n"].")"."</td>\n
<td><center />delete :: <a href=\"".$page."?user=".$user["name"]."&action=feedback\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
}
$htmlout .= "</table>\n";
print($htmlout);
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".
$_POST["search"]."\"</strong></p>";
Additions:
<<
**Current features** (//2004-09-15//):
~-feedback can be sent to each user. This requires an [[FeedbackActionUpgrade upgraded version]] of FeedbackAction
**Current features** (//2004-09-15//):
~-feedback can be sent to each user. This requires an [[FeedbackActionUpgrade upgraded version]] of FeedbackAction
Deletions:
~-feedback can be sent to each user. This requires an [[FeedbackActionUpgrade upgrated version]] of FeedbackAction
Revision [1226]
Edited on 2004-09-15 18:27:27 by DarTar [User administration tool - added user feedback]Additions:
----
~-feedback can be sent to each user. This requires an [[FeedbackActionUpgrade upgrated version]] of FeedbackAction
<< ::c::
// Admin-only code
// Perform specific actions on single users
// 1. Send user feedback
if ($_GET["action"] == "feedback" || $_GET["mail"]) {
echo $this->Action("feedback");
// Main screen: displays user table
// setting defaults
// sort field
$sort = (!$_GET["sort"])? "signuptime" : $_GET["sort"];
// sort order
$d = (!$_GET["d"])? "desc" : $_GET["d"];
// start record
$s = (!$_GET["s"])? "0" : $_GET["s"];
// limit records per page
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// restrict to search query
if ($_POST["search"]) $where = "WHERE name LIKE \"%".$_POST["search"]."%\"";
echo $this->Format("==== User Administration ==== --- ---");
// pager
// 1. get total number of users
$users = $this->LoadSingle("select count(*) as n FROM ".$this->config["table_prefix"]."users ".$where);
$numusers = $users['n'];
// 2. displays pager form
$form = "<form action=\"".$page."\" method=\"post\">Show\n
<select name=\"l\" onChange=\"form.submit()\">\n";
for ($rec=10; $rec < $numusers; $rec+=10) {
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
}
$form .= "</select> records per page :: \n".
"Search user: <input type =\"text\" name=\"search\" size=\"20\"\n
maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
"</form>\n";
echo $form;
if($s > 0)
$prev = "<a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s - $l) .
"\">".($s - $l +1)."-".$s."</a> | ";
if($numusers > ($s + $l))
$next = " | <a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s + $l) .
"\">".($s + $l + 1)."-".($s + 2 * $l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next."
(sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
// get user data
$userdata = $this->LoadAll("select name, email, signuptime from ".
$this->config["table_prefix"]."users ".
$where." order by ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// print table header
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <tr>\n".
" <th><a href=\"".$page.(($sort == "name" && $d == "asc")?
"?l=".$l."&sort=name&d=desc" : "?l=".$l."&sort=name&d=asc")."\">Name</a></th>\n".
" <th><a href=\"".$page.(($sort == "email" && $d == "asc")?
"?l=".$l."&sort=email&d=desc" : "?l=".$l."&sort=email&d=asc")."\">Email</a></th>\n".
" <th><a href=\"".$page.(($sort == "signuptime" && $d == "desc")?
"?l=".$l."&sort=signuptime&d=asc" : "?l=".$l."")."\">Signup Date/Time</a></th>\n".
" <th>Owned Pages</th>\n".
" <th>Actions</th>\n".
" </tr>\n";
// print user table
foreach($userdata as $user) {
$htmlout .= " <tr>\n";
$num = $this->LoadSingle("select count(*) as n from ".
$this->config["table_prefix"]."pages where owner='".
$user["name"]."' AND latest = 'Y'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n
<td>".$user["email"]."</td>\n
<td>(".$user["signuptime"].")</td>\n
<td><center />"."(".$num["n"].")"."</td>\n
<td><center />delete :: <a href=\"".$page."?user=".$user["name"]."&action=feedback\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
}
$htmlout .= "</table>\n";
print($htmlout);
} else {
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".
$_POST["search"]."\"</strong></p>";
}
// displays standard list to normal users
~-feedback can be sent to each user. This requires an [[FeedbackActionUpgrade upgrated version]] of FeedbackAction
<< ::c::
// Admin-only code
// Perform specific actions on single users
// 1. Send user feedback
if ($_GET["action"] == "feedback" || $_GET["mail"]) {
echo $this->Action("feedback");
// Main screen: displays user table
// setting defaults
// sort field
$sort = (!$_GET["sort"])? "signuptime" : $_GET["sort"];
// sort order
$d = (!$_GET["d"])? "desc" : $_GET["d"];
// start record
$s = (!$_GET["s"])? "0" : $_GET["s"];
// limit records per page
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// restrict to search query
if ($_POST["search"]) $where = "WHERE name LIKE \"%".$_POST["search"]."%\"";
echo $this->Format("==== User Administration ==== --- ---");
// pager
// 1. get total number of users
$users = $this->LoadSingle("select count(*) as n FROM ".$this->config["table_prefix"]."users ".$where);
$numusers = $users['n'];
// 2. displays pager form
$form = "<form action=\"".$page."\" method=\"post\">Show\n
<select name=\"l\" onChange=\"form.submit()\">\n";
for ($rec=10; $rec < $numusers; $rec+=10) {
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
}
$form .= "</select> records per page :: \n".
"Search user: <input type =\"text\" name=\"search\" size=\"20\"\n
maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
"</form>\n";
echo $form;
if($s > 0)
$prev = "<a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s - $l) .
"\">".($s - $l +1)."-".$s."</a> | ";
if($numusers > ($s + $l))
$next = " | <a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s + $l) .
"\">".($s + $l + 1)."-".($s + 2 * $l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next."
(sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
// get user data
$userdata = $this->LoadAll("select name, email, signuptime from ".
$this->config["table_prefix"]."users ".
$where." order by ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// print table header
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <tr>\n".
" <th><a href=\"".$page.(($sort == "name" && $d == "asc")?
"?l=".$l."&sort=name&d=desc" : "?l=".$l."&sort=name&d=asc")."\">Name</a></th>\n".
" <th><a href=\"".$page.(($sort == "email" && $d == "asc")?
"?l=".$l."&sort=email&d=desc" : "?l=".$l."&sort=email&d=asc")."\">Email</a></th>\n".
" <th><a href=\"".$page.(($sort == "signuptime" && $d == "desc")?
"?l=".$l."&sort=signuptime&d=asc" : "?l=".$l."")."\">Signup Date/Time</a></th>\n".
" <th>Owned Pages</th>\n".
" <th>Actions</th>\n".
" </tr>\n";
// print user table
foreach($userdata as $user) {
$htmlout .= " <tr>\n";
$num = $this->LoadSingle("select count(*) as n from ".
$this->config["table_prefix"]."pages where owner='".
$user["name"]."' AND latest = 'Y'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n
<td>".$user["email"]."</td>\n
<td>(".$user["signuptime"].")</td>\n
<td><center />"."(".$num["n"].")"."</td>\n
<td><center />delete :: <a href=\"".$page."?user=".$user["name"]."&action=feedback\">feedback</a></td>\n";
$htmlout .= " </tr>\n";
}
$htmlout .= "</table>\n";
print($htmlout);
} else {
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".
$_POST["search"]."\"</strong></p>";
}
// displays standard list to normal users
Deletions:
// admin only code
// setting defaults
// sort field
$sort = (!$_GET["sort"])? "signuptime" : $_GET["sort"];
// sort order
$d = (!$_GET["d"])? "desc" : $_GET["d"];
// start record
$s = (!$_GET["s"])? "0" : $_GET["s"];
// limit records per page
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// restrict to search query
if ($_POST["search"]) $where = "WHERE name LIKE \"%".$_POST["search"]."%\"";
echo $this->Format("==== User Administration ==== --- ---");
// pager
// 1. get total number of users
$users = $this->LoadSingle("select count(*) as n FROM ".$this->config["table_prefix"]."users ".$where);
$numusers = $users['n'];
// 2. displays pager form
$form = "<form action=\"".$page."\" method=\"post\">Show\n
<select name=\"l\" onChange=\"form.submit()\">\n";
for ($rec=10; $rec < $numusers; $rec+=10) {
$selected = ($l == $rec)? "selected" : "";
$form .= "<option value=\"".$rec."\" ".$selected.">".$rec."</option>\n";
$form .= "</select> records per page :: \n".
"Search user: <input type =\"text\" name=\"search\" size=\"20\" maxlength=\"50\" value=\"".$_POST["search"]."\"/>\n".
"</form>\n";
echo $form;
if($s > 0)
$prev = "<a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s - $l) .
"\">".($s - $l +1)."-".$s."</a> | ";
if($numusers > ($s + $l))
$next = " | <a href=\"" . $page . "?l=".$l."&sort=".$sort."&d=".$d."&s=" . ($s + $l) .
"\">".($s + $l + 1)."-".($s + 2 * $l)."</a>";
echo "[Records (".$numusers."): ".$prev."<b>".($s+1)."-".($s+$l)."</b>".$next." (sorted by: <em>".$sort.", ".$d."</em> )]<br /><br />\n";
// get user data
$userdata = $this->LoadAll("select name, email, signuptime from ".$this->config["table_prefix"]."users ".
$where." order by ".$sort." ".$d." limit ".$s.", ".$l);
if ($userdata) {
// print table header
$htmlout = "<table width=\"100%\" border=\"1px\">\n".
" <tr>\n".
" <th><a href=\"".$page.(($sort == "name" && $d == "asc")? "?l=".$l."&sort=name&d=desc" : "?l=".$l."&sort=name&d=asc")."\">Name</a></th>\n".
" <th><a href=\"".$page.(($sort == "email" && $d == "asc")? "?l=".$l."&sort=email&d=desc" : "?l=".$l."&sort=email&d=asc")."\">Email</a></th>\n".
" <th><a href=\"".$page.(($sort == "signuptime" && $d == "desc")? "?l=".$l."&sort=signuptime&d=asc" : "?l=".$l."")."\">Signup Date/Time</a></th>\n".
" <th>Owned Pages</th>\n".
" <th>Actions</th>\n".
" </tr>\n";
// print user table
foreach($userdata as $user) {
$htmlout .= " <tr>\n";
$num = $this->LoadSingle("select count(*) as n from ".$this->config["table_prefix"]."pages where owner='".
$user["name"]."' AND latest = 'Y'");
$htmlout .= " <td>".$this->Link($user["name"])."</td>\n <td>".$user["email"]."</td>\n
<td>(".$user["signuptime"].")</td>\n <td><center />"."(".$num["n"].")"."</td>\n <td><center />delete :: feedback</td>\n";
$htmlout .= " </tr>\n";
}
$htmlout .= "</table>\n";
print($htmlout);
echo "<p><span class=\"error\">Sorry, there are no users matching</span> <strong>\"".
$_POST["search"]."\"</strong></p>";
Additions:
This action will enable Wikka administrators (or, in the future, users belonging to an //Admin// group) to have access to several user management functions from a single page:
Deletions:
Additions:
echo $this->Action("lastusers");
Deletions:
Additions:
%%
Deletions:
{{files}}
Additions:
%%
{{files}}
{{files}}
Deletions:
Additions:
// limit records per page
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// restrict to search query
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// restrict to search query
Deletions:
$l = (!$_POST["l"])? $_GET["l"] : $_POST["l"];
if (!$_POST["l"] && !$_GET["l"]) $l = 10;
// search query
Additions:
~-Display user's **comments** (requires a small modification of ##recentcomments.php##).
Deletions:
Additions:
~~-**send user feedback** (requires a small modification of FeedbackAction);
Deletions:
Additions:
This action enables Wikka administrators (or, in the future, users belonging to an //Admin// group) to have access to several user management functions from a single page:
Deletions:
Additions:
I've started writing some code for a user administration tool. I think this might be interesting for wikka-based projects with a large number of registered users.
This action enables Wikka administrators (or, in the future, users belonging to an //Admin// group) to have access to a large number of user management functions from a single page:
This action enables Wikka administrators (or, in the future, users belonging to an //Admin// group) to have access to a large number of user management functions from a single page:
Deletions:
This should enable Wikka administrators (or, in the future, users belonging to an //Admin// group) to have access to a large number of user management functions from a single page:
Additions:
~-Display a pageable, sortable and searchable **list of registered users**;
Deletions:
Additions:
This should enable Wikka administrators (or, in the future, users belonging to an //Admin// group) to have access to a large number of user management functions from a single page: