';
x += '
';
x += '
';
x += '
' + username + ' ' + msg + '
' + groups + ' ' + lastAccess + ' ' + permissions;
@@ -9975,13 +9975,6 @@
function showUserAlertDialogEx(button, userid) { meshserver.send({ action: 'notifyuser', userid: decodeURIComponent(userid), msg: Q('d2notifyText').value }); }
- function doemail(e, addr) {
- if (xxdialogMode) return false;
- haltEvent(e);
- window.open('mailto:' + addr);
- return false;
- }
-
function p4batchAccountCreate() {
if (xxdialogMode) return;
var x = "Create many accounts at once by importing a JSON file with the following format:" + '[\r\n {"user":"x1","pass":"x","email":"x1@x"},\r\n {"user":"x2","pass":"x","resetNextLogin":true}\r\n] ';
@@ -10633,8 +10626,9 @@
//
var currentUser = null;
- function gotoUser(userid, force) {
+ function gotoUser(userid, force, event) {
if (xxdialogMode && !force) return;
+ if ((event != null) && (event.originalTarget != null) && (event.originalTarget.href != null)) return;
var user = currentUser = users[decodeURIComponent(userid)];
if (user == null) { setDialogMode(0); go(4); return; }
QH('p30userName', user.name);
@@ -10657,13 +10651,17 @@
var email = user.email?EscapeHtml(user.email):'' + "Not set" + ' ', everify = '';
if (serverinfo.emailcheck) { everify = ((user.emailVerified == true) ? '✓ ' : '✗ '); }
if (user.name.toLowerCase() != user._id.split('/')[2]) { x += addDeviceAttribute("User Identifier", user._id.split('/')[2]); }
- if (((features & 0x200000) == 0) && ((user.siteadmin != 0xFFFFFFFF) || (userinfo.siteadmin == 0xFFFFFFFF))) { // If we are not site admin, we can't change a admin email.
- x += addDeviceAttribute("Email", everify + '' + email + ' ');
+ if (((user.siteadmin != 0xFFFFFFFF) || (userinfo.siteadmin == 0xFFFFFFFF))) { // If we are not site admin, we can't change a admin email.
+ x += addDeviceAttribute("Email", everify + email + ' ' + ' ');
} else {
- x += addDeviceAttribute("Email", everify + email + ' ');
+ x += addDeviceAttribute("Email", everify + email + ' ');
}
- if (user.phone != null) { x += addDeviceAttribute("Phone Number", user.phone); }
- x += addDeviceAttribute("Server Rights", premsg + '' + msg.join(', ') + ' ');
+
+ if ((features & 0x02000000) || (user.phone != null)) { // If SMS is enabled on the server or user has a phone number
+ x += addDeviceAttribute("Phone Number", (user.phone?user.phone:('' + "None" + ' ')) + ' ');
+ }
+
+ x += addDeviceAttribute("Server Rights", premsg + msg.join(', ') + ' ');
if (user.quota) x += addDeviceAttribute("Server Quota", EscapeHtml(parseInt(user.quota) / 1024) + ' k');
x += addDeviceAttribute("Creation", printDateTime(new Date(user.creation * 1000)));
if (user.login) x += addDeviceAttribute("Last Login", printDateTime(new Date(user.login * 1000)));
@@ -10756,6 +10754,25 @@
}
}
+ function p30editPhone() {
+ if (xxdialogMode) return;
+ var x = '';
+ setDialogMode(2, "Phone Notifications", 3, p30editPhoneEx, x, 'verifyPhone');
+ Q('d2phoneinput').focus();
+ p30editPhoneValidate();
+ }
+
+ function p30editPhoneValidate(x) {
+ var ok = (Q('d2phoneinput').value == '') || (isPhoneNumber(Q('d2phoneinput').value));
+ QE('idx_dlgOkButton', ok);
+ if ((x == 1) && ok) { dialogclose(1); }
+ }
+
+ // Send to the server the user's new phone number
+ function p30editPhoneEx() { meshserver.send({ action: 'edituser', id: currentUser._id, phone: Q('d2phoneinput').value }); }
+
// Display the user's email change dialog box
function p30showUserEmailChangeDialog(event) {
if (xxdialogMode) return false;