|
@@ -17,7 +17,7 @@
|
|
|
|
|
|
The Initial Developer of the Original Code is
|
|
The Initial Developer of the Original Code is
|
|
Mark J Crane <[email protected]>
|
|
Mark J Crane <[email protected]>
|
|
- Portions created by the Initial Developer are Copyright (C) 2008-2012
|
|
|
|
|
|
+ Portions created by the Initial Developer are Copyright (C) 2008-2013
|
|
the Initial Developer. All Rights Reserved.
|
|
the Initial Developer. All Rights Reserved.
|
|
|
|
|
|
Contributor(s):
|
|
Contributor(s):
|
|
@@ -78,17 +78,27 @@ echo " <td align=\"center\">\n";
|
|
echo "</td>\n";
|
|
echo "</td>\n";
|
|
echo "</tr>\n";
|
|
echo "</tr>\n";
|
|
|
|
|
|
-//get the user list from the database
|
|
|
|
- $sql = "select * from v_users ";
|
|
|
|
- $sql .= "where domain_uuid = '$domain_uuid' ";
|
|
|
|
|
|
+//get the list of superadmins
|
|
|
|
+ $superadmins = superadmin_list($db);
|
|
|
|
+
|
|
|
|
+//get the users from the database
|
|
|
|
+ $sql = "select count(*) as num_rows from v_users ";
|
|
|
|
+ $sql .= "where domain_uuid = '".$_SESSION['domain_uuid']."' ";
|
|
if (strlen($field_name) > 0 && strlen($field_value) > 0) {
|
|
if (strlen($field_name) > 0 && strlen($field_value) > 0) {
|
|
$sql .= "and $field_name = '$field_value' ";
|
|
$sql .= "and $field_name = '$field_value' ";
|
|
}
|
|
}
|
|
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
|
if (strlen($order_by)> 0) { $sql .= "order by $order_by $order "; }
|
|
- $prep_statement = $db->prepare(check_sql($sql));
|
|
|
|
- $prep_statement->execute();
|
|
|
|
- $result = $prep_statement->fetchAll(PDO::FETCH_NAMED);
|
|
|
|
- $num_rows = count($result);
|
|
|
|
|
|
+ $prep_statement = $db->prepare($sql);
|
|
|
|
+ if ($prep_statement) {
|
|
|
|
+ $prep_statement->execute();
|
|
|
|
+ $row = $prep_statement->fetch(PDO::FETCH_ASSOC);
|
|
|
|
+ if ($row['num_rows'] > 0) {
|
|
|
|
+ $num_rows = $row['num_rows'];
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ $num_rows = '0';
|
|
|
|
+ }
|
|
|
|
+ }
|
|
unset ($prep_statement, $result, $sql);
|
|
unset ($prep_statement, $result, $sql);
|
|
$rows_per_page = 200;
|
|
$rows_per_page = 200;
|
|
$param = "";
|
|
$param = "";
|
|
@@ -136,26 +146,30 @@ echo " <td align=\"center\">\n";
|
|
|
|
|
|
if ($result_count > 0) {
|
|
if ($result_count > 0) {
|
|
foreach($result as $row) {
|
|
foreach($result as $row) {
|
|
- echo "<tr >\n";
|
|
|
|
- echo " <td valign='top' class='".$row_style[$c]."'>".$row['username']." </td>\n";
|
|
|
|
- echo " <td valign='top' class='".$row_style[$c]."'>";
|
|
|
|
- if ($row['user_enabled'] == 'true') {
|
|
|
|
- echo $text['option-true'];
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- echo $text['option-false'];
|
|
|
|
- }
|
|
|
|
- echo " </td>\n";
|
|
|
|
- echo " <td valign='top' align='right'>\n";
|
|
|
|
- if (permission_exists('user_edit')) {
|
|
|
|
- echo " <a href='usersupdate.php?id=".$row['user_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
|
|
|
|
- }
|
|
|
|
- if (permission_exists('user_delete')) {
|
|
|
|
- echo " <a href='userdelete.php?id=".$row['user_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
|
|
|
|
|
|
+ if (if_superadmin($superadmins, $row['user_uuid']) && !if_group("superadmin")) {
|
|
|
|
+ //hide
|
|
|
|
+ } else {
|
|
|
|
+ echo "<tr >\n";
|
|
|
|
+ echo " <td valign='top' class='".$row_style[$c]."'>".$row['username']." </td>\n";
|
|
|
|
+ echo " <td valign='top' class='".$row_style[$c]."'>";
|
|
|
|
+ if ($row['user_enabled'] == 'true') {
|
|
|
|
+ echo $text['option-true'];
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ echo $text['option-false'];
|
|
|
|
+ }
|
|
|
|
+ echo " </td>\n";
|
|
|
|
+ echo " <td valign='top' align='right'>\n";
|
|
|
|
+ if (permission_exists('user_edit')) {
|
|
|
|
+ echo " <a href='usersupdate.php?id=".$row['user_uuid']."' alt='".$text['button-edit']."'>$v_link_label_edit</a>\n";
|
|
|
|
+ }
|
|
|
|
+ if (permission_exists('user_delete')) {
|
|
|
|
+ echo " <a href='userdelete.php?id=".$row['user_uuid']."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>\n";
|
|
|
|
+ }
|
|
|
|
+ echo " </td>\n";
|
|
|
|
+ echo "</tr>\n";
|
|
|
|
+ if ($c==0) { $c=1; } else { $c=0; }
|
|
}
|
|
}
|
|
- echo " </td>\n";
|
|
|
|
- echo "</tr>\n";
|
|
|
|
- if ($c==0) { $c=1; } else { $c=0; }
|
|
|
|
} //end foreach
|
|
} //end foreach
|
|
unset($sql, $result, $row_count);
|
|
unset($sql, $result, $row_count);
|
|
} //end if results
|
|
} //end if results
|