WCF.ACP.User.SendNewPasswordHandler.init();
{/if}
- require(['WoltLabSuite/Core/Acp/Ui/User/Editor'], function (AcpUiUserList) {
+ require(['Language', 'WoltLabSuite/Core/Acp/Ui/User/Editor'], function (Language, AcpUiUserList) {
+ Language.addObject({
+ 'wcf.acp.user.action.sendNewPassword.confirmMessage': '{lang}wcf.acp.user.action.sendNewPassword.confirmMessage{/lang}'
+ });
+
AcpUiUserList.init();
});
<ul class="dropdownMenu">
{event name='dropdownItems'}
+ {if $user->userID !== $__wcf->user->userID}
+ <li><a href="{link controller='UserMail' id=$user->userID}{/link}">{lang}wcf.acp.user.action.sendMail{/lang}</a></li>
+
+ {if $user->accessible && $__wcf->session->getPermission('admin.user.canEditPassword')}
+ <li><a href="#" class="jsSendNewPassword">{lang}wcf.acp.user.action.sendNewPassword{/lang}</a></li>
+ {/if}
+ {/if}
+
{if $user->deletable}
<li class="dropdownDivider"></li>
<li><a href="#" class="jsDispatchDelete">{lang}wcf.global.button.delete{/lang}</a></li>
* @module WoltLabSuite/Core/Acp/Ui/User/Editor
* @since 3.1
*/
-define(['Ajax', 'Core', 'Ui/SimpleDropdown'], function(Ajax, Core, UiSimpleDropdown) {
+define(['Ajax', 'Core', 'EventHandler', 'Language', 'Ui/SimpleDropdown'], function(Ajax, Core, EventHandler, Language, UiSimpleDropdown) {
"use strict";
/**
editLink.click();
});
}
+
+ var sendNewPassword = elBySel('.jsSendNewPassword', dropdownMenu);
+ if (sendNewPassword !== null) {
+ sendNewPassword.addEventListener(WCF_CLICK_EVENT, function (event) {
+ event.preventDefault();
+
+ // emulate clipboard selection
+ EventHandler.fire('com.woltlab.wcf.clipboard', 'com.woltlab.wcf.user', {
+ data: {
+ actionName: 'com.woltlab.wcf.user.sendNewPassword',
+ parameters: {
+ confirmMessage: Language.get('wcf.acp.user.action.sendNewPassword.confirmMessage'),
+ objectIDs: [userId]
+ }
+ },
+ responseData: {
+ actionName: 'com.woltlab.wcf.user.sendNewPassword',
+ objectIDs: [userId]
+ }
+ });
+ });
+ }
},
/**
hasItem = true;
}
}
+ },
+
+ _sendNewPassword: function (userId) {
+
}
};
});
*/
public $text = '';
+ /**
+ * single user id
+ * @var integer
+ */
+ public $userID = 0;
+
/**
* list of user ids
* @var integer[]
public function readParameters() {
parent::readParameters();
+ if (isset($_GET['id'])) $this->userID = intval($_GET['id']);
+
$this->activeMenuItem = ($this->action == 'all' ? 'wcf.acp.menu.link.user.mail' : ($this->action == 'group' ? 'wcf.acp.menu.link.group.mail' : 'wcf.acp.menu.link.user.management'));
}
if (empty($_POST)) {
// get marked user ids
if (empty($this->action)) {
- // get type id
- $objectTypeID = ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user');
- if ($objectTypeID === null) {
- throw new SystemException("Unknown clipboard item type 'com.woltlab.wcf.user'");
+ if ($this->userID) {
+ // single user mail form
+ $this->userIDs = [$this->userID];
}
-
- // get user ids
- $users = ClipboardHandler::getInstance()->getMarkedItems($objectTypeID);
- if (empty($users)) {
- throw new IllegalLinkException();
+ else {
+ // get type id
+ $objectTypeID = ClipboardHandler::getInstance()->getObjectTypeID('com.woltlab.wcf.user');
+ if ($objectTypeID === null) {
+ throw new SystemException("Unknown clipboard item type 'com.woltlab.wcf.user'");
+ }
+
+ // get user ids
+ $users = ClipboardHandler::getInstance()->getMarkedItems($objectTypeID);
+ if (empty($users)) {
+ throw new IllegalLinkException();
+ }
+
+ // load users
+ $this->userIDs = array_keys($users);
}
-
- // load users
- $this->userIDs = array_keys($users);
}
$this->from = MAIL_FROM_ADDRESS;
<item name="wcf.acp.user.bulkProcessing.success"><![CDATA[Die gewählte Aktion wurde auf {#$affectedObjectCount} Benutzer ausgeführt.]]></item>
<item name="wcf.acp.user.bulkProcessing.warning"><![CDATA[Die Massenbearbeitung von Benutzern führt die unten ausgewählte Aktion <b>ohne zusätzliche Sicherheitsabfrage</b> bei allen Benutzern aus, die unter die eingestellten Bedingungen fallen.]]></item>
<item name="wcf.acp.user.profileMenu.sort"><![CDATA[Benutzerprofil-Menü Sortierung]]></item>
+ <item name="wcf.acp.user.action.sendMail"><![CDATA[E-Mail senden]]></item>
+ <item name="wcf.acp.user.action.sendNewPassword"><![CDATA[Neues Passwort zusenden]]></item>
+ <item name="wcf.acp.user.action.sendNewPassword.confirmMessage"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Willst du{else}Wollen Sie{/if} diesem Benutzer wirklich ein neues Kennwort zusenden?]]></item>
</category>
<category name="wcf.acp.worker">
<item name="wcf.acp.user.bulkProcessing.success"><![CDATA[The selected action has been executed and affected {#$affectedObjectCount} user{if $affectedObjectCount != 1}s{/if}.]]></item>
<item name="wcf.acp.user.bulkProcessing.warning"><![CDATA[Heads up! The bulk processing executes all actions below on all users matching the selected conditions without any further confirmation prompt!]]></item>
<item name="wcf.acp.user.profileMenu.sort"><![CDATA[User Profile Menu Show Order]]></item>
+ <item name="wcf.acp.user.action.sendMail"><![CDATA[Send Email]]></item>
+ <item name="wcf.acp.user.action.sendNewPassword"><![CDATA[Send New Password]]></item>
+ <item name="wcf.acp.user.action.sendNewPassword.confirmMessage"><![CDATA[Do you really want to send a new password to this user?]]></item>
</category>
<category name="wcf.acp.worker">