mirror of https://github.com/BOINC/boinc.git
Added ops page to manage special users (from Christian Beer)
svn path=/trunk/boinc/; revision=5555
This commit is contained in:
parent
e40f6d3e48
commit
77411a83ab
|
@ -25462,3 +25462,13 @@ Rom 3 Mar 2005
|
|||
|
||||
win_build/installerv2/
|
||||
< numerous files and folders >
|
||||
|
||||
Bruce 3 March 2005
|
||||
- Added ops page for managing special users (from Christian Beer)
|
||||
|
||||
html/
|
||||
ops/
|
||||
index.php
|
||||
manage_special_users.php
|
||||
manage_special_users_action.php
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ echo "
|
|||
<li><a href=\"update_uotd.php\">Update user of the day</a> (Should run as cron-job)
|
||||
<li><a href=\"create_account_form.php\">Create account</a>
|
||||
<li><a href=\"cancel_wu_form.php\">Cancel workunits</a>
|
||||
<li><a href=\"manage_special_users.php\">Manage special users</a>
|
||||
|
||||
</ul>
|
||||
</table>
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
<?php
|
||||
$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit
|
||||
|
||||
require_once('../inc/forum.inc');
|
||||
require_once('../inc/util_ops.inc');
|
||||
|
||||
db_init();
|
||||
|
||||
admin_page_head('Manage special users');
|
||||
|
||||
start_table("align=\"center\"");
|
||||
row1("Current special users", '9');
|
||||
|
||||
echo "<tr><td>User</td>";
|
||||
for($i=0;$i<=6;$i++) {
|
||||
echo "<td width=\"15\">" . $special_user_bitfield[$i] . "</td>\n";
|
||||
}
|
||||
echo "</tr>";
|
||||
|
||||
$result = mysql_query("SELECT prefs.userid, prefs.special_user, user.name
|
||||
FROM forum_preferences as prefs, user
|
||||
WHERE special_user > '0' and prefs.userid=user.id");
|
||||
for($i=1;$i<=mysql_num_rows($result);$i++){
|
||||
$foo = mysql_fetch_object($result);
|
||||
echo "<tr><form action=\"manage_special_users_action.php\" method=\"POST\">\n";
|
||||
echo "<input type=\"hidden\" name=\"userid\" value=\"$foo->userid\"
|
||||
<td>$foo->name</td>";
|
||||
for ($j=0;$j<=6;$j++) {
|
||||
$bit = substr($foo->special_user, $j, 1);
|
||||
echo "<td><input type=\"checkbox\" name=\"".$j."\" value=\"1\"";
|
||||
if ($bit == 1) {
|
||||
echo " checked=\"checked\"";
|
||||
}
|
||||
echo "></td>\n";
|
||||
}
|
||||
echo "<td><input type=\"submit\" value=\"Update\"></form></td>";
|
||||
echo "</tr>\n";
|
||||
}
|
||||
|
||||
echo "<tr><form action=\"manage_special_users_action.php\" method=\"POST\">\n";
|
||||
echo "<td>Add UserID:<input type=\"text\" name=\"userid\" size=\"6\"></td>";
|
||||
|
||||
for ($j=0;$j<=6;$j++) {
|
||||
echo "<td><input type=\"checkbox\" name=\"".$j."\" value=\"1\"";
|
||||
echo "></td>\n";
|
||||
}
|
||||
echo "<td><input type=\"submit\" value=\"Update\"></form></td>";
|
||||
echo "</tr>\n";
|
||||
|
||||
|
||||
end_table();
|
||||
|
||||
admin_page_tail();
|
||||
|
||||
?>
|
|
@ -0,0 +1,38 @@
|
|||
<?php
|
||||
$cvs_version_tracker[]="\$Id$"; //Generated automatically - do not edit
|
||||
|
||||
require_once("../inc/db_ops.inc");
|
||||
require_once("../inc/util_ops.inc");
|
||||
|
||||
db_init();
|
||||
|
||||
admin_page_head("Manage special users action");
|
||||
|
||||
$bitset = '';
|
||||
|
||||
for ($i=0;$i<=6;$i++) {
|
||||
if (post_int($i, TRUE) == '1') {
|
||||
$bitset = str_pad($bitset, $i+1, '1');
|
||||
} else {
|
||||
$bitset = str_pad($bitset, $i+1, '0');
|
||||
}
|
||||
}
|
||||
if ($bitset == "0000000") $bitset = '';
|
||||
$userid = post_int("userid");
|
||||
|
||||
$query = "UPDATE forum_preferences SET special_user='$bitset' WHERE userid='$userid'";
|
||||
mysql_query($query);
|
||||
|
||||
if (mysql_affected_rows() == 1) {
|
||||
echo "<center><h2>Success</h2>";
|
||||
} else {
|
||||
echo "<center><h2>Failure</h2>";
|
||||
}
|
||||
|
||||
echo "Query was: $query</center>";
|
||||
|
||||
//echo "<br><a href=\"manage_special_users.php\">Manage users</a>";
|
||||
|
||||
admin_page_tail();
|
||||
|
||||
?>
|
Loading…
Reference in New Issue