}
_ajaxSuccess(data: DatabaseObjectActionResponse): void {
- if (data.objectIDs.includes(this.userId)) {
- switch (data.actionName) {
- case "enable":
- this.userDataElement.dataset.enabled = "true";
- this.button.textContent = this.button.dataset.disableMessage!;
- break;
-
- case "disable":
- this.userDataElement.dataset.enabled = "false";
- this.button.textContent = this.button.dataset.enableMessage!;
- break;
-
- default:
- throw new Error("Unreachable");
+ data.objectIDs.forEach((objectId) => {
+ if (~~objectId == this.userId) {
+ switch (data.actionName) {
+ case "enable":
+ this.userDataElement.dataset.enabled = "true";
+ this.button.textContent = this.button.dataset.disableMessage!;
+ break;
+
+ case "disable":
+ this.userDataElement.dataset.enabled = "false";
+ this.button.textContent = this.button.dataset.enableMessage!;
+ break;
+
+ default:
+ throw new Error("Unreachable");
+ }
}
- }
+ });
UiNotification.show();
},
title: Language.get("wcf.acp.user.ban.sure"),
},
- source: `<div class="section">
- <dl>
- <dt><label for="userBanReason">${Language.get("wcf.acp.user.banReason")}</label></dt>
- <dd>
- <textarea id="userBanReason" cols="40" rows="3" class=""></textarea>
- <small>${Language.get("wcf.acp.user.banReason.description")}</small>
- </dd>
- </dl>
- <dl>
- <dt></dt>
- <dd>
- <label for="userBanNeverExpires">
- <input type="checkbox" name="userBanNeverExpires" id="userBanNeverExpires" checked="">
- ${Language.get("wcf.acp.user.ban.neverExpires")}
- </label>
- </dd>
- </dl>
- <dl id="userBanExpiresSettings" style="display: none;">
- <dt>
- <label for="userBanExpires">${Language.get("wcf.acp.user.ban.expires")}</label>
- </dt>
- <dd>
- <div class="inputAddon">
- <input type="date"
- name="userBanExpires"
- id="userBanExpires"
- class="medium"
- min="${new Date(window.TIME_NOW * 1000).toISOString()}"
- data-ignore-timezone="true"
- />
- </div>
- <small>${Language.get("wcf.acp.user.ban.expires.description")}</small>
- </dd>
- </dl>
- </div>
- <div class="formSubmit dialogFormSubmit">
- <button class="buttonPrimary formSubmitButton" accesskey="s">${Language.get(
- "wcf.global.button.submit",
- )}</button>
- </div>`,
+ source: `
+<div class="section">
+ <dl>
+ <dt><label for="userBanReason">${Language.get("wcf.acp.user.banReason")}</label></dt>
+ <dd>
+ <textarea id="userBanReason" cols="40" rows="3" class=""></textarea>
+ <small>${Language.get("wcf.acp.user.banReason.description")}</small>
+ </dd>
+ </dl>
+ <dl>
+ <dt></dt>
+ <dd>
+ <label for="userBanNeverExpires">
+ <input type="checkbox" name="userBanNeverExpires" id="userBanNeverExpires" checked="">
+ ${Language.get("wcf.acp.user.ban.neverExpires")}
+ </label>
+ </dd>
+ </dl>
+ <dl id="userBanExpiresSettings" style="display: none;">
+ <dt>
+ <label for="userBanExpires">${Language.get("wcf.acp.user.ban.expires")}</label>
+ </dt>
+ <dd>
+ <div class="inputAddon">
+ <input type="date"
+ name="userBanExpires"
+ id="userBanExpires"
+ class="medium"
+ min="${new Date(window.TIME_NOW * 1000).toISOString()}"
+ data-ignore-timezone="true"
+ />
+ </div>
+ <small>${Language.get("wcf.acp.user.ban.expires.description")}</small>
+ </dd>
+ </dl>
+</div>
+<div class="formSubmit dialogFormSubmit">
+ <button class="buttonPrimary formSubmitButton" accesskey="s">${Language.get(
+ "wcf.global.button.submit",
+ )}</button>
+</div>`,
};
}
}
}
_ajaxSuccess(data: DatabaseObjectActionResponse): void {
- if (data.objectIDs.includes(this.userId)) {
- switch (data.actionName) {
- case "confirmEmail":
- this.userDataElement.dataset.emailConfirmed = "true";
- this.button.textContent = this.button.dataset.unconfirmEmailMessage!;
- break;
-
- case "unconfirmEmail":
- this.userDataElement.dataset.emailConfirmed = "false";
- this.button.textContent = this.button.dataset.confirmEmailMessage!;
- break;
-
- default:
- throw new Error("Unreachable");
+ data.objectIDs.forEach((objectId) => {
+ if (~~objectId == this.userId) {
+ switch (data.actionName) {
+ case "confirmEmail":
+ this.userDataElement.dataset.emailConfirmed = "true";
+ this.button.textContent = this.button.dataset.unconfirmEmailMessage!;
+ break;
+
+ case "unconfirmEmail":
+ this.userDataElement.dataset.emailConfirmed = "false";
+ this.button.textContent = this.button.dataset.confirmEmailMessage!;
+ break;
+
+ default:
+ throw new Error("Unreachable");
+ }
}
- }
+ });
UiNotification.show();
}
{if $user->userID !== $__wcf->user->userID}
{if $__wcf->session->getPermission('admin.user.canEnableUser')}
<li>
- <a {*
- *}href="#" {*
- *}class="jsEnable" {*
- *}data-enable-message="{lang}wcf.acp.user.enable{/lang}" {*
- *}data-disable-message="{lang}wcf.acp.user.disable{/lang}"{*
+ <a href="#" {*
+ *}class="jsEnable" {*
+ *}data-enable-message="{lang}wcf.acp.user.enable{/lang}" {*
+ *}data-disable-message="{lang}wcf.acp.user.disable{/lang}"{*
*}>
{lang}wcf.acp.user.{if !$user->activationCode}disable{else}enable{/if}{/lang}
</a>
{/if}
{if $__wcf->session->getPermission('admin.user.canExportGdprData')}
- <li
+ <li>
<a {*
*}href="{link controller='UserExportGdpr' id=$user->userID}{/link}"{*
*}>
</div>
</li>
<script data-relocate="true">
- require(['Language',
- 'WoltLabSuite/Core/Acp/Ui/User/Editor',
- 'WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Handler',
- 'WoltLabSuite/Core/Acp/Ui/User/Action/DisableAction',
- 'WoltLabSuite/Core/Acp/Ui/User/Action/SendNewPasswordAction',
- 'WoltLabSuite/Core/Acp/Ui/User/Action/ToggleConfirmEmailAction',
- 'WoltLabSuite/Core/Controller/Clipboard',
- ],
- function (
- Language,
- AcpUiUserList,
- AcpUserContentRemoveHandler,
- DisableAction,
- SendNewPasswordAction,
- ToggleConfirmEmailAction,
- Clipboard
- ) {
+ require([
+ 'WoltLabSuite/Core/Language',
+ 'WoltLabSuite/Core/Acp/Ui/User/Editor',
+ 'WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Handler',
+ 'WoltLabSuite/Core/Acp/Ui/User/Action/DisableAction',
+ 'WoltLabSuite/Core/Acp/Ui/User/Action/SendNewPasswordAction',
+ 'WoltLabSuite/Core/Acp/Ui/User/Action/ToggleConfirmEmailAction',
+ 'WoltLabSuite/Core/Controller/Clipboard',
+ ], (
+ Language,
+ AcpUiUserList,
+ AcpUserContentRemoveHandler,
+ DisableAction,
+ SendNewPasswordAction,
+ ToggleConfirmEmailAction,
+ Clipboard
+ ) => {
Language.addObject({
'wcf.acp.user.sendNewPassword.workerTitle': '{jslang}wcf.acp.user.sendNewPassword.workerTitle{/jslang}',
'wcf.acp.user.action.sendNewPassword.confirmMessage': '{jslang}wcf.acp.user.action.sendNewPassword.confirmMessage{/jslang}',
WCF.ACP.User.SendNewPasswordHandler.init();
{/if}
- require(['Language', 'WoltLabSuite/Core/Acp/Ui/User/Editor', 'WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Clipboard'], function (Language, AcpUiUserList, AcpUserContentRemoveClipboard) {
+ require(['Language', 'WoltLabSuite/Core/Acp/Ui/User/Editor', 'WoltLabSuite/Core/Acp/Ui/User/Content/Remove/Clipboard'], function (Language, AcpUiUserList, { AcpUserContentRemoveClipboard }) {
Language.addObject({
'wcf.acp.user.action.sendNewPassword.confirmMessage': '{jslang}wcf.acp.user.action.sendNewPassword.confirmMessage{/jslang}',
});
new AcpUiUserList();
- new AcpUserContentRemoveClipboard.default();
+ new AcpUserContentRemoveClipboard();
});
{event name='javascriptInit'}
};
}
_ajaxSuccess(data) {
- if (data.objectIDs.includes(this.userId)) {
- switch (data.actionName) {
- case "enable":
- this.userDataElement.dataset.enabled = "true";
- this.button.textContent = this.button.dataset.disableMessage;
- break;
- case "disable":
- this.userDataElement.dataset.enabled = "false";
- this.button.textContent = this.button.dataset.enableMessage;
- break;
- default:
- throw new Error("Unreachable");
+ data.objectIDs.forEach((objectId) => {
+ if (~~objectId == this.userId) {
+ switch (data.actionName) {
+ case "enable":
+ this.userDataElement.dataset.enabled = "true";
+ this.button.textContent = this.button.dataset.disableMessage;
+ break;
+ case "disable":
+ this.userDataElement.dataset.enabled = "false";
+ this.button.textContent = this.button.dataset.enableMessage;
+ break;
+ default:
+ throw new Error("Unreachable");
+ }
}
- }
+ });
UiNotification.show();
EventHandler.fire("com.woltlab.wcf.acp.user", "refresh", {
userIds: [this.userId],
},
title: Language.get("wcf.acp.user.ban.sure"),
},
- source: `<div class="section">
- <dl>
- <dt><label for="userBanReason">${Language.get("wcf.acp.user.banReason")}</label></dt>
- <dd>
- <textarea id="userBanReason" cols="40" rows="3" class=""></textarea>
- <small>${Language.get("wcf.acp.user.banReason.description")}</small>
- </dd>
- </dl>
- <dl>
- <dt></dt>
- <dd>
- <label for="userBanNeverExpires">
- <input type="checkbox" name="userBanNeverExpires" id="userBanNeverExpires" checked="">
- ${Language.get("wcf.acp.user.ban.neverExpires")}
- </label>
- </dd>
- </dl>
- <dl id="userBanExpiresSettings" style="display: none;">
- <dt>
- <label for="userBanExpires">${Language.get("wcf.acp.user.ban.expires")}</label>
- </dt>
- <dd>
- <div class="inputAddon">
- <input type="date"
- name="userBanExpires"
- id="userBanExpires"
- class="medium"
- min="${new Date(window.TIME_NOW * 1000).toISOString()}"
- data-ignore-timezone="true"
- />
- </div>
- <small>${Language.get("wcf.acp.user.ban.expires.description")}</small>
- </dd>
- </dl>
- </div>
- <div class="formSubmit dialogFormSubmit">
- <button class="buttonPrimary formSubmitButton" accesskey="s">${Language.get("wcf.global.button.submit")}</button>
- </div>`,
+ source: `
+<div class="section">
+ <dl>
+ <dt><label for="userBanReason">${Language.get("wcf.acp.user.banReason")}</label></dt>
+ <dd>
+ <textarea id="userBanReason" cols="40" rows="3" class=""></textarea>
+ <small>${Language.get("wcf.acp.user.banReason.description")}</small>
+ </dd>
+ </dl>
+ <dl>
+ <dt></dt>
+ <dd>
+ <label for="userBanNeverExpires">
+ <input type="checkbox" name="userBanNeverExpires" id="userBanNeverExpires" checked="">
+ ${Language.get("wcf.acp.user.ban.neverExpires")}
+ </label>
+ </dd>
+ </dl>
+ <dl id="userBanExpiresSettings" style="display: none;">
+ <dt>
+ <label for="userBanExpires">${Language.get("wcf.acp.user.ban.expires")}</label>
+ </dt>
+ <dd>
+ <div class="inputAddon">
+ <input type="date"
+ name="userBanExpires"
+ id="userBanExpires"
+ class="medium"
+ min="${new Date(window.TIME_NOW * 1000).toISOString()}"
+ data-ignore-timezone="true"
+ />
+ </div>
+ <small>${Language.get("wcf.acp.user.ban.expires.description")}</small>
+ </dd>
+ </dl>
+</div>
+<div class="formSubmit dialogFormSubmit">
+ <button class="buttonPrimary formSubmitButton" accesskey="s">${Language.get("wcf.global.button.submit")}</button>
+</div>`,
};
}
}
};
}
_ajaxSuccess(data) {
- if (data.objectIDs.includes(this.userId)) {
- switch (data.actionName) {
- case "confirmEmail":
- this.userDataElement.dataset.emailConfirmed = "true";
- this.button.textContent = this.button.dataset.unconfirmEmailMessage;
- break;
- case "unconfirmEmail":
- this.userDataElement.dataset.emailConfirmed = "false";
- this.button.textContent = this.button.dataset.confirmEmailMessage;
- break;
- default:
- throw new Error("Unreachable");
+ data.objectIDs.forEach((objectId) => {
+ if (~~objectId == this.userId) {
+ switch (data.actionName) {
+ case "confirmEmail":
+ this.userDataElement.dataset.emailConfirmed = "true";
+ this.button.textContent = this.button.dataset.unconfirmEmailMessage;
+ break;
+ case "unconfirmEmail":
+ this.userDataElement.dataset.emailConfirmed = "false";
+ this.button.textContent = this.button.dataset.confirmEmailMessage;
+ break;
+ default:
+ throw new Error("Unreachable");
+ }
}
- }
+ });
UiNotification.show();
}
}