easier user privilege editor, misc js cleanups
This commit is contained in:
parent
c38c2b69c9
commit
5917a8e4a7
26
backend.php
26
backend.php
|
@ -3984,6 +3984,8 @@
|
||||||
$line["last_login"] = date(get_pref($link, 'SHORT_DATE_FORMAT'),
|
$line["last_login"] = date(get_pref($link, 'SHORT_DATE_FORMAT'),
|
||||||
strtotime($line["last_login"]));
|
strtotime($line["last_login"]));
|
||||||
|
|
||||||
|
$access_level_names = array(0 => "User", 10 => "Administrator");
|
||||||
|
|
||||||
/* if ($uid == $_SESSION["uid"]) {
|
/* if ($uid == $_SESSION["uid"]) {
|
||||||
|
|
||||||
print "<td align='center'><input disabled=\"true\" type=\"checkbox\"
|
print "<td align='center'><input disabled=\"true\" type=\"checkbox\"
|
||||||
|
@ -4005,7 +4007,7 @@
|
||||||
$line["email"] . "</td>";
|
$line["email"] . "</td>";
|
||||||
|
|
||||||
print "<td><a href=\"javascript:editUser($uid);\">" .
|
print "<td><a href=\"javascript:editUser($uid);\">" .
|
||||||
$line["access_level"] . "</td>";
|
$access_level_names[$line["access_level"]] . "</td>";
|
||||||
|
|
||||||
} else if ($uid != $edit_uid) {
|
} else if ($uid != $edit_uid) {
|
||||||
|
|
||||||
|
@ -4014,7 +4016,7 @@
|
||||||
|
|
||||||
print "<td>".$line["login"]."</td>";
|
print "<td>".$line["login"]."</td>";
|
||||||
print "<td>".$line["email"]."</td>";
|
print "<td>".$line["email"]."</td>";
|
||||||
print "<td>".$line["access_level"]."</td>";
|
print "<td>".$access_level_names[$line["access_level"]]."</td>";
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -4027,9 +4029,23 @@
|
||||||
print "<td><input id=\"iedit_email\" value=\"".$line["email"].
|
print "<td><input id=\"iedit_email\" value=\"".$line["email"].
|
||||||
"\"></td>";
|
"\"></td>";
|
||||||
|
|
||||||
print "<td><input id=\"iedit_ulevel\" value=\"".$line["access_level"].
|
// print "<td><input id=\"iedit_ulevel\" value=\"".$line["access_level"].
|
||||||
"\"></td>";
|
// "\"></td>";
|
||||||
|
|
||||||
|
print "<td>";
|
||||||
|
print "<select id=\"iedit_ulevel\">";
|
||||||
|
foreach (array_keys($access_level_names) as $al) {
|
||||||
|
if ($al == $line["access_level"]) {
|
||||||
|
$selected = "selected";
|
||||||
|
} else {
|
||||||
|
$selected = "";
|
||||||
|
}
|
||||||
|
print "<option $selected id=\"$al\">" .
|
||||||
|
$access_level_names[$al] . "</option>";
|
||||||
|
}
|
||||||
|
print "</select>";
|
||||||
|
print "</td>";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print "<td>".$line["last_login"]."</td>";
|
print "<td>".$line["last_login"]."</td>";
|
||||||
|
|
28
functions.js
28
functions.js
|
@ -870,18 +870,22 @@ function leading_zero(p) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function center_element(e) {
|
function center_element(e) {
|
||||||
var c_width = document.body.clientWidth;
|
|
||||||
var c_height = document.body.clientHeight;
|
|
||||||
|
|
||||||
var c_scroll = document.body.scrollTop;
|
try {
|
||||||
|
var c_width = document.body.clientWidth;
|
||||||
var e_width = e.clientWidth;
|
var c_height = document.body.clientHeight;
|
||||||
var e_height = e.clientHeight;
|
|
||||||
|
|
||||||
var set_y = (c_height / 2) + c_scroll - (e_height / 2);
|
|
||||||
var set_x = (c_width / 2) - (e_width / 2);
|
|
||||||
|
|
||||||
e.style.top = set_y + "px";
|
|
||||||
e.style.left = set_x + "px";
|
|
||||||
|
|
||||||
|
var c_scroll = document.body.scrollTop;
|
||||||
|
|
||||||
|
var e_width = e.clientWidth;
|
||||||
|
var e_height = e.clientHeight;
|
||||||
|
|
||||||
|
var set_y = (c_height / 2) + c_scroll - (e_height / 2);
|
||||||
|
var set_x = (c_width / 2) - (e_width / 2);
|
||||||
|
|
||||||
|
e.style.top = set_y + "px";
|
||||||
|
e.style.left = set_x + "px";
|
||||||
|
} catch (e) {
|
||||||
|
exception_error("center_element", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
6
prefs.js
6
prefs.js
|
@ -153,7 +153,6 @@ function infobox_callback() {
|
||||||
box.innerHTML=xmlhttp.responseText;
|
box.innerHTML=xmlhttp.responseText;
|
||||||
if (shadow) {
|
if (shadow) {
|
||||||
shadow.style.display = "block";
|
shadow.style.display = "block";
|
||||||
center_element(shadow);
|
|
||||||
} else {
|
} else {
|
||||||
box.style.display = "block";
|
box.style.display = "block";
|
||||||
}
|
}
|
||||||
|
@ -899,7 +898,10 @@ function userEditSave() {
|
||||||
}
|
}
|
||||||
|
|
||||||
var login = document.getElementById("iedit_ulogin").value;
|
var login = document.getElementById("iedit_ulogin").value;
|
||||||
var level = document.getElementById("iedit_ulevel").value;
|
var level = document.getElementById("iedit_ulevel");
|
||||||
|
|
||||||
|
level = level[level.selectedIndex].id;
|
||||||
|
|
||||||
var email = document.getElementById("iedit_email").value;
|
var email = document.getElementById("iedit_email").value;
|
||||||
|
|
||||||
if (login.length == 0) {
|
if (login.length == 0) {
|
||||||
|
|
|
@ -555,6 +555,8 @@ div.helpResponse {
|
||||||
background-image : url("images/shadow.png");
|
background-image : url("images/shadow.png");
|
||||||
position : absolute;
|
position : absolute;
|
||||||
width : 30%;
|
width : 30%;
|
||||||
|
left : 35%;
|
||||||
|
top : 30%;
|
||||||
z-index : 3;
|
z-index : 3;
|
||||||
display : none;
|
display : none;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue