To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit 4a78a5d8 authored by Reto Da Forno's avatar Reto Da Forno

diplayed user properties changed and confirm popup added for user activation in user management

parent a05ab572
......@@ -77,20 +77,22 @@
echo '<h1>Admin User Management</h1>';
/* Get all users from the database and display them in the table. */
$db = db_connect();
$sql = "SELECT serv_users_key, lastname, firstname, username, email, is_active, use_daq, UNIX_TIMESTAMP(create_time) as create_time_ts, DATE_FORMAT(create_time,'%d.%m.%Y') as create_date, last_login from tbl_serv_users";
$sql = "SELECT serv_users_key, lastname, firstname, username, email, is_active, use_daq, quota_runtime, quota_tests, is_admin, UNIX_TIMESTAMP(create_time) as create_time_ts, DATE_FORMAT(create_time,'%d.%m.%Y') as create_date, last_login from tbl_serv_users";
$rs = mysql_query($sql) or flocklab_die('Cannot get users from database because: ' . mysql_error());
$nrows = mysql_num_rows($rs);
mysql_close($db);
?>
<form name="resadd" method="post" action="admin_group_reservation.php">
<form name="resadd" method="post" action="#">
<table id="res_overview" class="tablesorter" style="display:none">
<thead>
<tr>
<th width="80px">Username</th>
<th width="80px">First name</th>
<th width="70px">First name</th>
<th width="80px">Last name</th>
<th width="140px">E-Mail</th>
<th width="100px">Create date</th>
<th width="50px">Create date</th>
<th width="50px">Quota</th>
<th width="30px">Role</th>
<th width="20px">active</th>
<th width="20px">daq</th>
</tr>
......@@ -110,7 +112,9 @@ echo '<h1>Admin User Management</h1>';
echo "<td>" . htmlentities($row['lastname']) . "</td>";
echo "<td>" . htmlentities($row['email']) . "</td>";
echo '<td><span style="display:none">'.$row['create_time_ts'].'</span>' . htmlentities($row['create_date']) . "</td>";
echo '<td><span style="display:none">'.$row['is_active'].'</span><form action="admin_user_management.php" method="post"><input name="is_active" type="checkbox" ' . ($row['is_active']==1?' checked="true"':'') . '><input type="hidden" name="user_id" value ="'.$row['serv_users_key'].'"></form></td>';
echo "<td>" . (string)$row['quota_tests'] . " / " . (string)$row['quota_runtime'] . "min</td>";
echo "<td>" . (string)$row['is_admin'] . "</td>";
echo '<td><span style="display:none">'.$row['is_active'].'</span><form action="admin_user_management.php" method="post"><input name="is_active" type="checkbox" onclick="if(this.checked) { if(!confirm(\'Active this user? An email will be sent.\')) { return false; } }" ' . ($row['is_active']==1?' checked="true"':'') . '><input type="hidden" name="user_id" value ="'.$row['serv_users_key'].'"></form></td>';
echo '<td><span style="display:none">'.$row['use_daq'].'</span><form action="admin_user_management.php" method="post"><input name="use_daq" type="checkbox" ' . ($row['use_daq']==1?' checked="true"':'') . '><input type="hidden" name="user_id" value ="'.$row['serv_users_key'].'"></form></td>';
echo "</tr>";
}
......
......@@ -10,9 +10,7 @@
*/
?>
<?php
//echo dirname(__FILE__)."/../../testmanagement/user.ini";
$CONFIG = parse_ini_file(dirname(__FILE__)."/../../../testmanagement/user.ini", true);
$sessiondir = '/tmp/flocklab_sessions';
if (!file_exists ($CONFIG['session']['dir']))
mkdir ($CONFIG['session']['dir']);
session_save_path($CONFIG['session']['dir']);
......
......@@ -56,7 +56,10 @@ background-color:#7A991A;
<script type="text/javascript">
$.urlParam = function(name){
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
return results[1] || 0;
if (results != null) {
return results[1];
}
return 0;
}
var force;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment