Comparing revisions for UserAdmin

Additions:
AdminModules
>>::c::
~~-**delete users** (forthcoming: see this [[RemovingUsers discussion]]);
The code below must be saved as ##actions/useradmin.php## and used as ##""{{useradmin}}""##.
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> </th>
<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>badasswright@xxxx.xx</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>evil@xxxx.xx</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.*.simschla@xxxx.xx</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>tomparis@xxxx.xx</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>alex@xxxx.xx</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>pajoma@xxxx.xx</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>dartar@xxxx.xx</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>ken@xxxx.xx</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>sabbyart@xxxx.xx</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>KaihuaWang@xxxx.xx</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");
Deletions:
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]].
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.
~-AdminModules
~-WikkaBetaFeatures
~-UnderDevelopment
~-Are you an administrator of this site ? --- Give it a [[UserAdminTest try]]
>><<**Table of Contents:**
~-""<a href="UserAdmin#hn_Why">Why?</a>""
~-""<a href="UserAdmin#hn_Current_version">Current version</a>""
~-""<a href="UserAdmin#hn_To_do">To do</a>""
~-""<a href="UserAdmin#hn_The_code">The code</a>""
~-""<a href="UserAdmin#hn_Styling_options">Styling options</a>""<<
::c::
=== Why? ===
~~-**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''
~~~~& See DanWestUserReg. Worked for me as intended. I'd say, this function's done --MasinAlDujaili, 2007-05-21
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==
<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> </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 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>scott@xxxx.xx</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>wiebren.w@xxxx.xx</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>denny@xxxx.xx</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>wikka@xxxx.xx</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>vmvarela@xxxx.xx</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>enibevoli@xxxx.xx</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>serayamaouche@xxxx.xx</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>dstolars@xxxx.xx</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>mail-to-sophie@xxxx.xx</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>mail.matthias.schulz@xxxx.xx</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 version=== (//2005-08-31//):
##0.5##
~-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//):
===To do ===
~-mass-operations;
~-deleting/banning users;
~-integrate with other admin modules.
====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
The code has also been adapted to take advantage of the ##[[WikkaCountingRecords getCount()]]## method, which is required for the action to work.
%%(php;1)
* @version 0.5
* @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===
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">
<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 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 >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>scott@xxxx.xx</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>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>wiebren.w@xxxx.xx</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>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>denny@xxxx.xx</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>
**Alternate rows only:** ##""{{useradmin colcolor="0"}}""##
""<table summary="List of users registered on this server" border="1px" id="admin_table">
<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 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 >
<td><input type="checkbox" id=" " title="Select HypeXR"/></td>
<td><a href="http://wikka.jsnx.com/HypeXR" title=" ">HypeXR</a></td>
<td>scott@xxxx.xx</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 class="alt">
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>wiebren.w@xxxx.xx</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>
<td><input type="checkbox" id=" " title="Select DennyShimkoski"/></td>
<td><a href="http://wikka.jsnx.com/DennyShimkoski" title=" ">DennyShimkoski</a></td>
<td>denny@xxxx.xx</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>
**Colored columns only:** ##""{{useradmin rowcolor="0"}}""##
<table summary="List of users registered on this server" border="1px" id="admin_table">
<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 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>scott@xxxx.xx</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>
<td><input type="checkbox" id=" " title="Select WiebTest"/></td>
<td>WiebTest</td>
<td>wiebren.w@xxxx.xx</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>denny@xxxx.xx</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>
**Alternate rows and colored columns:** ##""{{useradmin}}""##
<table summary="List of users registered on this server" border="1px" id="admin_table">
<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 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>scott@xxxx.xx</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>wiebren.w@xxxx.xx</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>denny@xxxx.xx</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>
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki