User bulk processing overhaul
authorMarcel Werk <burntime@woltlab.com>
Sat, 11 May 2013 18:22:40 +0000 (20:22 +0200)
committerMarcel Werk <burntime@woltlab.com>
Sat, 11 May 2013 18:22:40 +0000 (20:22 +0200)
com.woltlab.wcf/acpMenu.xml
wcfsetup/install/files/acp/templates/userBulkProcessing.tpl [new file with mode: 0644]
wcfsetup/install/files/acp/templates/usersMassProcessing.tpl [deleted file]
wcfsetup/install/files/lib/acp/form/UserBulkProcessingForm.class.php [new file with mode: 0644]
wcfsetup/install/files/lib/acp/form/UsersMassProcessingForm.class.php [deleted file]
wcfsetup/install/lang/de.xml
wcfsetup/install/lang/en.xml

index 09dad4fbc5c1d1c1a10582db749a317aa0a51f31..e2f5f25089f6313d43ed05dff2bff21d567cb432 100644 (file)
                        <showorder>2</showorder>
                </acpmenuitem>
                
-               <acpmenuitem name="wcf.acp.menu.link.user.massProcessing">
-                       <controller><![CDATA[wcf\acp\form\UsersMassProcessingForm]]></controller>
+               <acpmenuitem name="wcf.acp.menu.link.user.bulkProcessing">
+                       <controller><![CDATA[wcf\acp\form\UserBulkProcessingForm]]></controller>
                        <parent>wcf.acp.menu.link.user.management.additional</parent>
                        <permissions>admin.user.canEditUser,admin.user.canDeleteUser,admin.user.canMailUser</permissions>
                        <showorder>1</showorder>
diff --git a/wcfsetup/install/files/acp/templates/userBulkProcessing.tpl b/wcfsetup/install/files/acp/templates/userBulkProcessing.tpl
new file mode 100644 (file)
index 0000000..6b51ae3
--- /dev/null
@@ -0,0 +1,291 @@
+{include file='header' pageTitle='wcf.acp.user.bulkProcessing'}
+
+<script type="text/javascript">
+       //<![CDATA[
+       $(function() {
+               function toggleContainer(value) {
+                       for (var $name in $targetContainers) {
+                               if ($name === value) {
+                                       $targetContainers[$name].show();
+                               }
+                               else {
+                                       $targetContainers[$name].hide();
+                               }
+                       }
+               }
+               
+               var $targetContainers = { };
+               $('input[name=action]').each(function(index, input) {
+                       var $input = $(input);
+                       var $value = $input.prop('value');
+                       
+                       if (!$targetContainers[$value]) {
+                               var $container = $('#' + $.wcfEscapeID($value + 'Div'));
+                               if ($container.length) {
+                                       $targetContainers[$value] = $container;
+                               }
+                       }
+                       
+                       $input.change(function(event) {
+                               toggleContainer($(event.currentTarget).prop('value'));
+                       });
+               });
+               
+               function setFileType(newType) {
+                       if (newType === 'csv') {
+                               $('#separatorDiv').show().next().show();
+                       }
+                       else {
+                               $('#separatorDiv').hide().next().hide();
+                       }
+               }
+               
+               $('input[name=fileType]').each(function(index, input) {
+                       var $input = $(input);
+                       
+                       $input.change(function(event) {
+                               setFileType($input.prop('value'));
+                       });
+               });
+               
+               toggleContainer('{@$action}');
+               setFileType('{@$fileType}');
+               
+               new WCF.Search.User($('#username'), function(data) {
+                       $('#username').val(data.label);
+                       return false;
+               }, false);
+               WCF.TabMenu.init();
+       });
+       //]]>
+</script>
+
+<header class="boxHeadline">
+       <h1>{lang}wcf.acp.user.bulkProcessing{/lang}</h1>
+</header>
+
+{if $errorField}
+       <p class="error">{lang}wcf.global.form.error{/lang}</p>
+{/if}
+
+<p class="warning">{lang}wcf.acp.user.bulkProcessing.warning{/lang}</p>
+
+{if $affectedUsers|isset}
+       <p class="success">{lang}wcf.acp.user.bulkProcessing.success{/lang}</p>
+{/if}
+
+<div class="contentNavigation">
+       {hascontent}
+               <nav>
+                       <ul>
+                               {content}
+                                       {event name='contentNavigationButtons'}
+                               {/content}
+                       </ul>
+               </nav>
+       {/hascontent}
+</div>
+
+<form method="post" action="{link controller='UserBulkProcessing'}{/link}">
+       <div class="tabMenuContainer" data-active="{$activeTabMenuItem}" data-store="activeTabMenuItem">
+               <nav class="tabMenu">
+                       <ul>
+                               <li><a href="{@$__wcf->getAnchor('conditions')}">{lang}wcf.acp.user.search.conditions{/lang}</a></li>
+                               
+                               {if $options|count}
+                                       <li><a href="{@$__wcf->getAnchor('profile')}">{lang}wcf.acp.user.search.conditions.profile{/lang}</a></li>
+                               {/if}
+                               
+                               <li><a href="{@$__wcf->getAnchor('action')}">{lang}wcf.acp.user.bulkProcessing.action{/lang}</a></li>
+                               {event name='tabMenuTabs'}
+                       </ul>
+               </nav>
+       
+               <div id="conditions" class="container containerPadding tabMenuContainer tabMenuContent">
+                       <fieldset>
+                               <legend>{lang}wcf.acp.user.search.conditions.general{/lang}</legend>
+                               
+                               <dl>
+                                       <dt><label for="username">{lang}wcf.user.username{/lang}</label></dt>
+                                       <dd>
+                                               <input type="text" id="username" name="username" value="{$username}" autofocus="autofocus" class="medium" />
+                                       </dd>
+                               </dl>
+                               
+                               {if $__wcf->session->getPermission('admin.user.canEditMailAddress')}
+                                       <dl>
+                                               <dt><label for="email">{lang}wcf.user.email{/lang}</label></dt>
+                                               <dd>
+                                                       <input type="email" id="email" name="email" value="{$email}" class="medium" />
+                                               </dd>
+                                       </dl>
+                               {/if}
+                               
+                               {if $availableGroups|count}
+                                       <dl>
+                                               <dt><label>{lang}wcf.acp.user.groups{/lang}</label></dt>
+                                               <dd>
+                                                       {htmlCheckboxes options=$availableGroups name='groupIDArray' selected=$groupIDArray}
+                                                       
+                                                       <label class="marginTop"><input type="checkbox" name="invertGroupIDs" value="1" {if $invertGroupIDs == 1}checked="checked" {/if}/> {lang}wcf.acp.user.groups.invertSearch{/lang}</label>
+                                               </dd>
+                                       </dl>
+                               {/if}
+                               
+                               {if $availableLanguages|count > 1}
+                                       <dl>
+                                               <dt><label>{lang}wcf.user.language{/lang}</label></dt>
+                                               <dd>
+                                                       {htmlCheckboxes options=$availableLanguages name='languageIDArray' selected=$languageIDArray disableEncoding=true}
+                                               </dd>
+                                       </dl>
+                               {/if}
+                               
+                               {event name='generalFields'}
+                       </fieldset>
+               </div>
+               
+               {if $options|count}
+                       <div id="profile" class="container containerPadding tabMenuContainer tabMenuContent">
+                               <fieldset>
+                                       <legend>{lang}wcf.acp.user.search.conditions.profile{/lang}</legend>
+                       
+                                       {include file='optionFieldList' langPrefix='wcf.user.option.'}
+                               </fieldset>
+                       </div>
+               {/if}
+       
+               <div id="action" class="container containerPadding tabMenuContainer tabMenuContent">
+                       <fieldset{if $errorField == 'action'} class="formError"{/if}>
+                               <legend>{lang}wcf.acp.user.bulkProcessing.action{/lang}</legend>
+                               
+                               <dl>
+                                       <dd>
+                                               {if $__wcf->session->getPermission('admin.user.canMailUser')}
+                                                       <label><input type="radio" name="action" value="sendMail" {if $action == 'sendMail'}checked="checked" {/if}/> {lang}wcf.acp.user.sendMail{/lang}</label>
+                                                       <label><input type="radio" name="action" value="exportMailAddress" {if $action == 'exportMailAddress'}checked="checked" {/if}/> {lang}wcf.acp.user.exportEmailAddress{/lang}</label>
+                                               {/if}
+                                               {if $__wcf->session->getPermission('admin.user.canEditUser')}
+                                                       <label><input type="radio" name="action" value="assignToGroup" {if $action == 'assignToGroup'}checked="checked" {/if}/> {lang}wcf.acp.user.assignToGroup{/lang}</label>
+                                               {/if}
+                                               {if $__wcf->session->getPermission('admin.user.canDeleteUser')}
+                                                       <label><input type="radio" name="action" value="delete" {if $action == 'delete'}checked="checked" {/if}/> {lang}wcf.acp.user.delete{/lang}</label>
+                                               {/if}
+                                               
+                                               {event name='additionalActions'}
+                                               
+                                               {if $errorField == 'action'}
+                                                       <small class="innerError">
+                                                               {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
+                                                       </small>
+                                               {/if}
+                                       </dd>
+                               </dl>
+                       </fieldset>
+                       
+                       <div id="sendMailDiv">
+                               <fieldset>
+                                       <legend>{lang}wcf.acp.user.sendMail.mail{/lang}</legend>
+                                       
+                                       <dl{if $errorField == 'from'} class="formError"{/if}>
+                                               <dt><label for="from">{lang}wcf.acp.user.sendMail.from{/lang}</label></dt>
+                                               <dd>
+                                                       <input type="email" id="from" name="from" value="{$from}" class="medium" />
+                                                       {if $errorField == 'from'}
+                                                               <small class="innerError">
+                                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
+                                                               </small>
+                                                       {/if}
+                                                       <small>{lang}wcf.acp.user.sendMail.from.description{/lang}</small>
+                                               </dd>
+                                       </dl>
+                                       
+                                       <dl{if $errorField == 'subject'} class="formError"{/if}>
+                                               <dt><label for="subject">{lang}wcf.acp.user.sendMail.subject{/lang}</label></dt>
+                                               <dd>
+                                                       <input type="text" id="subject" name="subject" value="{$subject}" class="long" />
+                                                       {if $errorField == 'subject'}
+                                                               <small class="innerError">
+                                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
+                                                               </small>
+                                                       {/if}
+                                                       <small>{lang}wcf.acp.user.sendMail.subject.description{/lang}</small>
+                                               </dd>
+                                       </dl>
+                                       
+                                       <dl{if $errorField == 'text'} class="formError"{/if}>
+                                               <dt><label for="text">{lang}wcf.acp.user.sendMail.text{/lang}</label></dt>
+                                               <dd>
+                                                       <textarea id="text" name="text" rows="15" cols="40">{$text}</textarea>
+                                                       {if $errorField == 'text'}
+                                                               <small class="innerError" class="long">
+                                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
+                                                               </small>
+                                                       {/if}
+                                                       <small>{lang}wcf.acp.user.sendMail.text.description{/lang}</small>
+                                               </dd>
+                                       </dl>
+                                       
+                                       <dl>
+                                               <dd>
+                                                       <label for="enableHTML"><input type="checkbox" id="enableHTML" name="enableHTML" value="1"{if $enableHTML == 1} checked="checked"{/if}/> {lang}wcf.acp.user.sendMail.enableHTML{/lang}</label>
+                                               </dd>
+                                       </dl>
+                               </fieldset>
+                       </div>
+                       
+                       <div id="exportMailAddressDiv">
+                               <fieldset>
+                                       <legend>{lang}wcf.acp.user.exportEmailAddress.format{/lang}</legend>
+                                       
+                                       <dl>
+                                               <dt><label>{lang}wcf.acp.user.exportEmailAddress.fileType{/lang}</label></dt>
+                                               <dd>
+                                                       <label><input type="radio" name="fileType" value="csv" {if $fileType == 'csv'}checked="checked" {/if}/> {lang}wcf.acp.user.exportEmailAddress.fileType.csv{/lang}</label>
+                                                       <label><input type="radio" name="fileType" value="xml" {if $fileType == 'xml'}checked="checked" {/if}/> {lang}wcf.acp.user.exportEmailAddress.fileType.xml{/lang}</label>
+                                               </dd>
+                                       </dl>
+                                       
+                                       <dl id="separatorDiv">
+                                               <dt><label for="separator">{lang}wcf.acp.user.exportEmailAddress.separator{/lang}</label></dt>
+                                               <dd>
+                                                       <input type="text" id="separator" name="separator" value="{$separator}" class="medium" />
+                                               </dd>
+                                       </dl>
+                                       
+                                       <dl id="textSeparatorDiv">
+                                               <dt><label for="textSeparator">{lang}wcf.acp.user.exportEmailAddress.textSeparator{/lang}</label></dt>
+                                               <dd>
+                                                       <input type="text" id="textSeparator" name="textSeparator" value="{$textSeparator}" class="medium" />
+                                               </dd>
+                                       </dl>
+                               </fieldset>
+                       </div>
+                       
+                       <div id="assignToGroupDiv">
+                               <fieldset>
+                                       <legend>{lang}wcf.acp.user.groups{/lang}</legend>
+                                       
+                                       <dl>
+                                               <dd{if $errorField == 'assignToGroupIDArray'} class="formError"{/if}>
+                                                       {htmlCheckboxes options=$availableGroups name=assignToGroupIDArray selected=$assignToGroupIDArray}
+                                                       {if $errorField == 'assignToGroupIDArray'}
+                                                               <small class="innerError">
+                                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
+                                                               </small>
+                                                       {/if}
+                                               </dd>
+                                       </dl>
+                               </fieldset>
+                       </div>
+                       
+                       {event name='actionSettings'}
+               </div>
+       </div>
+       
+       <div class="formSubmit">
+               <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
+       </div>
+</form>
+
+{include file='footer'}
diff --git a/wcfsetup/install/files/acp/templates/usersMassProcessing.tpl b/wcfsetup/install/files/acp/templates/usersMassProcessing.tpl
deleted file mode 100644 (file)
index 5725649..0000000
+++ /dev/null
@@ -1,292 +0,0 @@
-{include file='header' pageTitle='wcf.acp.user.massProcessing'}
-
-<script type="text/javascript">
-       //<![CDATA[
-       $(function() {
-               function toggleContainer(value) {
-                       for (var $name in $targetContainers) {
-                               if ($name === value) {
-                                       $targetContainers[$name].show();
-                               }
-                               else {
-                                       $targetContainers[$name].hide();
-                               }
-                       }
-               }
-               
-               var $targetContainers = { };
-               $('input[name=action]').each(function(index, input) {
-                       var $input = $(input);
-                       var $value = $input.prop('value');
-                       
-                       if (!$targetContainers[$value]) {
-                               var $container = $('#' + $.wcfEscapeID($value + 'Div'));
-                               if ($container.length) {
-                                       $targetContainers[$value] = $container;
-                               }
-                       }
-                       
-                       $input.change(function(event) {
-                               toggleContainer($(event.currentTarget).prop('value'));
-                       });
-               });
-               
-               function setFileType(newType) {
-                       if (newType === 'csv') {
-                               $('#separatorDiv').show().next().show();
-                       }
-                       else {
-                               $('#separatorDiv').hide().next().hide();
-                       }
-               }
-               
-               $('input[name=fileType]').each(function(index, input) {
-                       var $input = $(input);
-                       
-                       $input.change(function(event) {
-                               setFileType($input.prop('value'));
-                       });
-               });
-               
-               toggleContainer('{@$action}');
-               setFileType('{@$fileType}');
-               
-               new WCF.Search.User($('#username'), function(data) {
-                       $('#username').val(data.label);
-                       return false;
-               }, false);
-               WCF.TabMenu.init();
-       });
-       //]]>
-</script>
-
-<header class="boxHeadline">
-       <h1>{lang}wcf.acp.user.massProcessing{/lang}</h1>
-</header>
-
-{if $errorField}
-       <p class="error">{lang}wcf.global.form.error{/lang}</p>
-{/if}
-
-<p class="warning">{lang}wcf.acp.user.massProcessing.warning{/lang}</p>
-
-{if $affectedUsers|isset}
-       <p class="success">{lang}wcf.acp.user.massProcessing.success{/lang}</p>
-{/if}
-
-<div class="contentNavigation">
-       {hascontent}
-               <nav>
-                       <ul>
-                               {content}
-                                       {event name='contentNavigationButtons'}
-                               {/content}
-                       </ul>
-               </nav>
-       {/hascontent}
-</div>
-
-<form method="post" action="{link controller='UsersMassProcessing'}{/link}">
-       <div class="container containerPadding marginTop">
-               <fieldset>
-                       <legend>{lang}wcf.acp.user.search.conditions.general{/lang}</legend>
-                       
-                       <dl>
-                               <dt><label for="username">{lang}wcf.user.username{/lang}</label></dt>
-                               <dd>
-                                       <input type="text" id="username" name="username" value="{$username}" autofocus="autofocus" class="medium" />
-                               </dd>
-                       </dl>
-                       
-                       {if $__wcf->session->getPermission('admin.user.canEditMailAddress')}
-                               <dl>
-                                       <dt><label for="email">{lang}wcf.user.email{/lang}</label></dt>
-                                       <dd>
-                                               <input type="email" id="email" name="email" value="{$email}" class="medium" />
-                                       </dd>
-                               </dl>
-                       {/if}
-                       
-                       {if $availableGroups|count}
-                               <dl>
-                                       <dt><label>{lang}wcf.acp.user.groups{/lang}</label></dt>
-                                       <dd>
-                                               {htmlCheckboxes options=$availableGroups name='groupIDArray' selected=$groupIDArray}
-                                               
-                                               <label class="marginTop"><input type="checkbox" name="invertGroupIDs" value="1" {if $invertGroupIDs == 1}checked="checked" {/if}/> {lang}wcf.acp.user.groups.invertSearch{/lang}</label>
-                                       </dd>
-                               </dl>
-                       {/if}
-                       
-                       {if $availableLanguages|count > 1}
-                               <dl>
-                                       <dt><label>{lang}wcf.user.language{/lang}</label></dt>
-                                       <dd>
-                                               {htmlCheckboxes options=$availableLanguages name='languageIDArray' selected=$languageIDArray disableEncoding=true}
-                                       </dd>
-                               </dl>
-                       {/if}
-                       
-                       {event name='generalFields'}
-               </fieldset>
-               
-               {event name='fieldsets'}
-               
-               {hascontent}
-                       <div class="tabMenuContainer">
-                               <nav class="tabMenu">
-                                       <ul>
-                                               {content}
-                                                       {if $options|count}
-                                                               <li><a href="{@$__wcf->getAnchor('profile')}">{lang}wcf.acp.user.search.conditions.profile{/lang}</a></li>
-                                                       {/if}
-                                                       
-                                                       {event name='tabMenuTabs'}
-                                               {/content}
-                                       </ul>
-                               </nav>
-                               
-                               {if $options|count}
-                                       <fieldset id="profile" class="container containerPadding tabMenuContent hidden">
-                                               {include file='optionFieldList' langPrefix='wcf.user.option.'}
-                                       </fieldset>
-                               {/if}
-                               
-                               {event name='tabMenuContents'}
-                       </div>
-               {/hascontent}
-       </div>
-       
-       <div class="container containerPadding marginTop">
-               <fieldset{if $errorField == 'action'} class="formError"{/if}>
-                       <legend>{lang}wcf.acp.user.massProcessing.action{/lang}</legend>
-                       
-                       <dl>
-                               <dd>
-                                       {if $__wcf->session->getPermission('admin.user.canMailUser')}
-                                               <label><input type="radio" name="action" value="sendMail" {if $action == 'sendMail'}checked="checked" {/if}/> {lang}wcf.acp.user.sendMail{/lang}</label>
-                                               <label><input type="radio" name="action" value="exportMailAddress" {if $action == 'exportMailAddress'}checked="checked" {/if}/> {lang}wcf.acp.user.exportEmailAddress{/lang}</label>
-                                       {/if}
-                                       {if $__wcf->session->getPermission('admin.user.canEditUser')}
-                                               <label><input type="radio" name="action" value="assignToGroup" {if $action == 'assignToGroup'}checked="checked" {/if}/> {lang}wcf.acp.user.assignToGroup{/lang}</label>
-                                       {/if}
-                                       {if $__wcf->session->getPermission('admin.user.canDeleteUser')}
-                                               <label><input type="radio" name="action" value="delete" {if $action == 'delete'}checked="checked" {/if}/> {lang}wcf.acp.user.delete{/lang}</label>
-                                       {/if}
-                                       
-                                       {event name='additionalActions'}
-                                       
-                                       {if $errorField == 'action'}
-                                               <small class="innerError">
-                                                       {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                               </small>
-                                       {/if}
-                               </dd>
-                       </dl>
-               </fieldset>
-               
-               <div id="sendMailDiv">
-                       <fieldset>
-                               <legend>{lang}wcf.acp.user.sendMail.mail{/lang}</legend>
-                               
-                               <dl{if $errorField == 'from'} class="formError"{/if}>
-                                       <dt><label for="from">{lang}wcf.acp.user.sendMail.from{/lang}</label></dt>
-                                       <dd>
-                                               <input type="email" id="from" name="from" value="{$from}" class="medium" />
-                                               {if $errorField == 'from'}
-                                                       <small class="innerError">
-                                                               {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                       </small>
-                                               {/if}
-                                               <small>{lang}wcf.acp.user.sendMail.from.description{/lang}</small>
-                                       </dd>
-                               </dl>
-                               
-                               <dl{if $errorField == 'subject'} class="formError"{/if}>
-                                       <dt><label for="subject">{lang}wcf.acp.user.sendMail.subject{/lang}</label></dt>
-                                       <dd>
-                                               <input type="text" id="subject" name="subject" value="{$subject}" class="long" />
-                                               {if $errorField == 'subject'}
-                                                       <small class="innerError">
-                                                               {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                       </small>
-                                               {/if}
-                                               <small>{lang}wcf.acp.user.sendMail.subject.description{/lang}</small>
-                                       </dd>
-                               </dl>
-                               
-                               <dl{if $errorField == 'text'} class="formError"{/if}>
-                                       <dt><label for="text">{lang}wcf.acp.user.sendMail.text{/lang}</label></dt>
-                                       <dd>
-                                               <textarea id="text" name="text" rows="15" cols="40">{$text}</textarea>
-                                               {if $errorField == 'text'}
-                                                       <small class="innerError" class="long">
-                                                               {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                       </small>
-                                               {/if}
-                                               <small>{lang}wcf.acp.user.sendMail.text.description{/lang}</small>
-                                       </dd>
-                               </dl>
-                               
-                               <dl>
-                                       <dd>
-                                               <label for="enableHTML"><input type="checkbox" id="enableHTML" name="enableHTML" value="1"{if $enableHTML == 1} checked="checked"{/if}/> {lang}wcf.acp.user.sendMail.enableHTML{/lang}</label>
-                                       </dd>
-                               </dl>
-                       </fieldset>
-               </div>
-               
-               <div id="exportMailAddressDiv">
-                       <fieldset>
-                               <legend>{lang}wcf.acp.user.exportEmailAddress.format{/lang}</legend>
-                               
-                               <dl>
-                                       <dt><label>{lang}wcf.acp.user.exportEmailAddress.fileType{/lang}</label></dt>
-                                       <dd>
-                                               <label><input type="radio" name="fileType" value="csv" {if $fileType == 'csv'}checked="checked" {/if}/> {lang}wcf.acp.user.exportEmailAddress.fileType.csv{/lang}</label>
-                                               <label><input type="radio" name="fileType" value="xml" {if $fileType == 'xml'}checked="checked" {/if}/> {lang}wcf.acp.user.exportEmailAddress.fileType.xml{/lang}</label>
-                                       </dd>
-                               </dl>
-                               
-                               <dl id="separatorDiv">
-                                       <dt><label for="separator">{lang}wcf.acp.user.exportEmailAddress.separator{/lang}</label></dt>
-                                       <dd>
-                                               <input type="text" id="separator" name="separator" value="{$separator}" class="medium" />
-                                       </dd>
-                               </dl>
-                               
-                               <dl id="textSeparatorDiv">
-                                       <dt><label for="textSeparator">{lang}wcf.acp.user.exportEmailAddress.textSeparator{/lang}</label></dt>
-                                       <dd>
-                                               <input type="text" id="textSeparator" name="textSeparator" value="{$textSeparator}" class="medium" />
-                                       </dd>
-                               </dl>
-                       </fieldset>
-               </div>
-               
-               <div id="assignToGroupDiv">
-                       <fieldset>
-                               <legend>{lang}wcf.acp.user.groups{/lang}</legend>
-                               
-                               <dl>
-                                       <dd{if $errorField == 'assignToGroupIDArray'} class="formError"{/if}>
-                                               {htmlCheckboxes options=$availableGroups name=assignToGroupIDArray selected=$assignToGroupIDArray}
-                                               {if $errorField == 'assignToGroupIDArray'}
-                                                       <small class="innerError">
-                                                               {if $errorType == 'empty'}{lang}wcf.global.form.error.empty{/lang}{/if}
-                                                       </small>
-                                               {/if}
-                                       </dd>
-                               </dl>
-                       </fieldset>
-               </div>
-               
-               {event name='actionSettings'}
-       </div>
-       
-       <div class="formSubmit">
-               <input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
-       </div>
-</form>
-
-{include file='footer'}
diff --git a/wcfsetup/install/files/lib/acp/form/UserBulkProcessingForm.class.php b/wcfsetup/install/files/lib/acp/form/UserBulkProcessingForm.class.php
new file mode 100644 (file)
index 0000000..9a42489
--- /dev/null
@@ -0,0 +1,429 @@
+<?php
+namespace wcf\acp\form;
+use wcf\data\user\group\UserGroup;
+use wcf\data\user\User;
+use wcf\data\user\UserEditor;
+use wcf\form\AbstractForm;
+use wcf\system\database\util\PreparedStatementConditionBuilder;
+use wcf\system\event\EventHandler;
+use wcf\system\exception\PermissionDeniedException;
+use wcf\system\exception\UserInputException;
+use wcf\system\language\LanguageFactory;
+use wcf\system\menu\acp\ACPMenu;
+use wcf\system\request\LinkHandler;
+use wcf\system\user\storage\UserStorageHandler;
+use wcf\system\WCF;
+use wcf\system\WCFACP;
+use wcf\util\ArrayUtil;
+use wcf\util\StringUtil;
+
+/**
+ * Shows the user bulk processing form.
+ * 
+ * @author     Marcel Werk
+ * @copyright  2001-2013 WoltLab GmbH
+ * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
+ * @package    com.woltlab.wcf
+ * @subpackage acp.form
+ * @category   Community Framework
+ */
+class UserBulkProcessingForm extends UserOptionListForm {
+       /**
+        * @see wcf\page\AbstractPage::$neededPermissions
+        */
+       public $neededPermissions = array('admin.user.canEditUser', 'admin.user.canDeleteUser', 'admin.user.canMailUser');
+       
+       /**
+        * searched username
+        * @var string
+        */
+       public $username = '';
+       
+       /**
+        * searched email adress
+        * @var string
+        */
+       public $email = '';
+       
+       /**
+        * ids of the searched user group ids
+        * @var array<integer>
+        */
+       public $groupIDArray = array();
+       
+       /**
+        * ids of the users' languages
+        * @var array<integer>
+        */
+       public $languageIDArray = array();
+       
+       /**
+        * indicates if the user may not be in the user groups with the selected
+        * ids
+        * @var integer
+        */
+       public $invertGroupIDs = 0;
+       
+       // assign to group
+       public $assignToGroupIDArray = array();
+       
+       // export mail address
+       public $fileType = 'csv';
+       public $separator = ',';
+       public $textSeparator = '"';
+       
+       // send mail
+       public $subject = '';
+       public $text = '';
+       public $from = '';
+       public $enableHTML = 0;
+       
+       // data
+       public $availableGroups = array();
+       public $options = array();
+       public $availableActions = array('sendMail', 'exportMailAddress', 'assignToGroup', 'delete');
+       public $affectedUsers = 0;
+       
+       /**
+        * conditions builder object
+        * @var wcf\system\database\condition\PreparedStatementConditionBuilder
+        */
+       public $conditions = null;
+       
+       /**
+        * options of the active category
+        * @var array
+        */
+       public $activeOptions = array();
+       
+       /**
+        * @see wcf\form\IForm::readFormParameters()
+        */
+       public function readFormParameters() {
+               parent::readFormParameters();
+               
+               if (isset($_POST['username'])) $this->username = StringUtil::trim($_POST['username']);
+               if (isset($_POST['email'])) $this->email = StringUtil::trim($_POST['email']);
+               if (isset($_POST['groupIDArray']) && is_array($_POST['groupIDArray'])) $this->groupIDArray = ArrayUtil::toIntegerArray($_POST['groupIDArray']);
+               if (isset($_POST['languageIDArray']) && is_array($_POST['languageIDArray'])) $this->languageIDArray = ArrayUtil::toIntegerArray($_POST['languageIDArray']);
+               if (isset($_POST['invertGroupIDs'])) $this->invertGroupIDs = intval($_POST['invertGroupIDs']);
+               // assign to group
+               if (isset($_POST['assignToGroupIDArray']) && is_array($_POST['assignToGroupIDArray'])) $this->assignToGroupIDArray = ArrayUtil::toIntegerArray($_POST['assignToGroupIDArray']);
+               // export mail address
+               if (isset($_POST['fileType']) && $_POST['fileType'] == 'xml') $this->fileType = $_POST['fileType'];
+               if (isset($_POST['separator'])) $this->separator = $_POST['separator'];
+               if (isset($_POST['textSeparator'])) $this->textSeparator = $_POST['textSeparator'];
+               // send mail
+               if (isset($_POST['subject'])) $this->subject = StringUtil::trim($_POST['subject']);
+               if (isset($_POST['text'])) $this->text = StringUtil::trim($_POST['text']);
+               if (isset($_POST['from'])) $this->from = StringUtil::trim($_POST['from']);
+               if (isset($_POST['enableHTML'])) $this->enableHTML = intval($_POST['enableHTML']);
+       }
+       
+       /**
+        * @see wcf\form\IForm::validate()
+        */
+       public function validate() {
+               AbstractForm::validate();
+               
+               // action
+               if (!in_array($this->action, $this->availableActions)) {
+                       throw new UserInputException('action');
+               }
+               
+               // assign to group
+               if ($this->action == 'assignToGroup') {
+                       if (empty($this->assignToGroupIDArray)) {
+                               throw new UserInputException('assignToGroupIDArray');
+                       }
+               }
+               
+               // send mail
+               if ($this->action == 'sendMail') {
+                       if (empty($this->subject)) {
+                               throw new UserInputException('subject');
+                       }
+                       
+                       if (empty($this->text)) {
+                               throw new UserInputException('text');
+                       }
+                       
+                       if (empty($this->from)) {
+                               throw new UserInputException('from');
+                       }
+               }
+       }
+       
+       /**
+        * @see wcf\form\IForm::save()
+        */
+       public function save() {
+               parent::save();
+               
+               // build conditions
+               $this->conditions = new PreparedStatementConditionBuilder();
+               
+               // static fields
+               if (!empty($this->username)) {
+                       $this->conditions->add("user.username LIKE ?", array('%'.addcslashes($this->username, '_%').'%'));
+               }
+               if (!empty($this->email)) {
+                       $this->conditions->add("user.email LIKE ?", array('%'.addcslashes($this->email, '_%').'%'));
+               }
+               if (!empty($this->groupIDArray)) {
+                       $this->conditions->add("user.userID ".($this->invertGroupIDs == 1 ? 'NOT ' : '')."IN (SELECT userID FROM wcf".WCF_N."_user_to_group WHERE groupID IN (?))", array($this->groupIDArray));
+               }
+               if (!empty($this->languageIDArray)) {
+                       $this->conditions->add("user.languageID IN (?)", array($this->languageIDArray));
+               }
+               
+               // dynamic fields
+               foreach ($this->activeOptions as $name => $option) {
+                       $value = isset($this->values[$option['optionName']]) ? $this->values[$option['optionName']] : null;
+                       $this->getTypeObject($option['optionType'])->getCondition($this->conditions, $option, $value);
+               }
+               
+               // call buildConditions event
+               EventHandler::getInstance()->fireAction($this, 'buildConditions');
+               
+               // execute action
+               switch ($this->action) {
+                       case 'sendMail':
+                               WCF::getSession()->checkPermissions(array('admin.user.canMailUser'));
+                               // get user ids
+                               $userIDArray = array();
+                               $sql = "SELECT          user.userID
+                                       FROM            wcf".WCF_N."_user user
+                                       LEFT JOIN       wcf".WCF_N."_user_option_value option_value
+                                       ON              (option_value.userID = user.userID)".
+                                       $this->conditions;
+                               $statement = WCF::getDB()->prepareStatement($sql);
+                               $statement->execute($this->conditions->getParameters());
+                               while ($row = $statement->fetchArray()) {
+                                       $userIDArray[] = $row['userID'];
+                                       $this->affectedUsers++;
+                               }
+                               
+                               // save config in session
+                               $userMailData = WCF::getSession()->getVar('userMailData');
+                               if ($userMailData === null) $userMailData = array();
+                               $mailID = count($userMailData);
+                               $userMailData[$mailID] = array(
+                                       'action' => '',
+                                       'userIDs' => implode(',', $userIDArray),
+                                       'groupIDs' => '',
+                                       'subject' => $this->subject,
+                                       'text' => $this->text,
+                                       'from' => $this->from,
+                                       'enableHTML' => $this->enableHTML
+                               );
+                               WCF::getSession()->register('userMailData', $userMailData);
+                               $this->saved();
+                               
+                               $url = LinkHandler::getInstance()->getLink('UserMail', array('id' => $mailID));
+                               
+                               // show worker template
+                               WCF::getTPL()->assign(array(
+                                       'pageTitle' => WCF::getLanguage()->get('wcf.acp.user.sendMail'),
+                                       'url' => $url
+                               ));
+                               WCF::getTPL()->display('worker');
+                               exit;
+                       break;
+                       
+                       case 'exportMailAddress':
+                               WCF::getSession()->checkPermissions(array('admin.user.canMailUser'));
+                               // send content type
+                               header('Content-Type: text/'.$this->fileType.'; charset=UTF-8');
+                               header('Content-Disposition: attachment; filename="export.'.$this->fileType.'"');
+                               
+                               if ($this->fileType == 'xml') {
+                                       echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<addresses>\n";
+                               }
+                               
+                               // count users
+                               $sql = "SELECT          COUNT(*) AS count
+                                       FROM            wcf".WCF_N."_user user
+                                       LEFT JOIN       wcf".WCF_N."_user_option_value option_value
+                                       ON              (option_value.userID = user.userID)
+                                       ".$this->conditions;
+                               $statement = WCF::getDB()->prepareStatement($sql);
+                               $statement->execute($this->conditions->getParameters());
+                               $count = $statement->fetchArray();
+                               
+                               // get users
+                               $sql = "SELECT          user.email
+                                       FROM            wcf".WCF_N."_user user
+                                       LEFT JOIN       wcf".WCF_N."_user_option_value option_value
+                                       ON              (option_value.userID = user.userID)
+                                       ".$this->conditions."
+                                       ORDER BY        user.email";
+                               $statement = WCF::getDB()->prepareStatement($sql);
+                               $statement->execute($this->conditions->getParameters());
+                               
+                               $i = 0;
+                               while ($row = $statement->fetchArray()) {
+                                       if ($this->fileType == 'xml') echo "<address><![CDATA[".StringUtil::escapeCDATA($row['email'])."]]></address>\n";
+                                       else echo $this->textSeparator . $row['email'] . $this->textSeparator . ($i < $count['count'] ? $this->separator : '');
+                                       $i++;
+                                       $this->affectedUsers++;
+                               }
+                               
+                               if ($this->fileType == 'xml') {
+                                       echo "</addresses>";
+                               }
+                               $this->saved();
+                               exit;
+                       break;
+                       
+                       case 'assignToGroup':
+                               WCF::getSession()->checkPermissions(array('admin.user.canEditUser'));
+                               
+                               $_this = $this;
+                               $userIDArray = $this->fetchUsers(function($userID, array $userData) use ($_this) {
+                                       $user = new UserEditor(new User(null, $userData));
+                                       $user->addToGroups($_this->assignToGroupIDArray, false, false);
+                               });
+                               
+                               UserStorageHandler::getInstance()->reset($userIDArray, 'groupIDs', 1);
+                       break;
+                       
+                       case 'delete':
+                               WCF::getSession()->checkPermissions(array('admin.user.canDeleteUser'));
+                               
+                               $userIDArray = $this->fetchUsers();
+                               
+                               UserEditor::deleteUsers($userIDArray);
+                       break;
+               }
+               $this->saved();
+               
+               WCF::getTPL()->assign('affectedUsers', $this->affectedUsers);
+       }
+       
+       /**
+        * Fetches a list of users.
+        * 
+        * @param       mixed           $loopFunction
+        * @return      array<integer>
+        */
+       protected function fetchUsers($loopFunction = null) {
+               // select users
+               $sql = "SELECT          user.*
+                       FROM            wcf".WCF_N."_user user
+                       LEFT JOIN       wcf".WCF_N."_user_option_value option_value
+                       ON              (option_value.userID = user.userID)
+                       ".$this->conditions;
+               $statement = WCF::getDB()->prepareStatement($sql);
+               $statement->execute($this->conditions->getParameters());
+               
+               $users = array();
+               while ($row = $statement->fetchArray()) {
+                       $users[$row['userID']] = $row;
+               }
+               
+               // select group ids
+               $conditions = new PreparedStatementConditionBuilder();
+               $conditions->add("userID = ?", array(array_keys($users)));
+               
+               $sql = "SELECT  userID, groupID
+                       FROM    wcf".WCF_N."_user_to_group
+                       ".$conditions;
+               $statement = WCF::getDB()->prepareStatement($sql);
+               $statement->execute($conditions->getParameters());
+               
+               $groupIDs = array();
+               while ($row = $statement->fetchArray()) {
+                       if (!isset($groupIDs[$row['userID']])) {
+                               $groupIDs[$row['userID']] = array();
+                       }
+                       
+                       $groupIDs[$row['userID']][] = $row['groupID'];
+               }
+               
+               foreach ($users as $userID => $userData) {
+                       if (!UserGroup::isAccessibleGroup($groupIDs[$userID])) {
+                               throw new PermissionDeniedException();
+                       }
+                       
+                       if ($loopFunction !== null) {
+                               $loopFunction($userID, $userData);
+                       }
+                       
+                       $userIDArray[] = $userID;
+                       $this->affectedUsers++;
+               }
+               
+               return $userIDArray;
+       }
+       
+       /**
+        * @see wcf\page\IPage::readData()
+        */
+       public function readData() {
+               parent::readData();
+               
+               if (empty($_POST)) {
+                       if (MAIL_USE_FORMATTED_ADDRESS) {
+                               $this->from = MAIL_FROM_NAME.' <'.MAIL_FROM_ADDRESS.'>';
+                       }
+                       else {
+                               $this->from = MAIL_FROM_ADDRESS;
+                       }
+               }
+               
+               $this->availableGroups = $this->getAvailableGroups();
+               
+               foreach ($this->activeOptions as $name => $option) {
+                       if (isset($this->values[$name])) {
+                               $this->activeOptions[$name]['optionValue'] = $this->values[$name];
+                       }
+               }
+               
+               $this->options = $this->optionHandler->getCategoryOptions('profile');
+       }
+       
+       /**
+        * @see wcf\page\IPage::assignVariables()
+        */
+       public function assignVariables() {
+               parent::assignVariables();
+               
+               WCF::getTPL()->assign(array(
+                       'username' => $this->username,
+                       'email' => $this->email,
+                       'groupIDArray' => $this->groupIDArray,
+                       'languageIDArray' => $this->languageIDArray,
+                       'invertGroupIDs' => $this->invertGroupIDs,
+                       'availableGroups' => $this->availableGroups,
+                       'availableLanguages' => LanguageFactory::getInstance()->getLanguages(),
+                       'options' => $this->options,
+                       'availableActions' => $this->availableActions,
+                       // assign to group
+                       'assignToGroupIDArray' => $this->assignToGroupIDArray,
+                       // export mail address
+                       'separator' => $this->separator,
+                       'textSeparator' => $this->textSeparator,
+                       'fileType' => $this->fileType,
+                       // send mail
+                       'subject' => $this->subject,
+                       'text' => $this->text,
+                       'from' => $this->from,
+                       'enableHTML' => $this->enableHTML
+               ));
+       }
+       
+       /**
+        * @see wcf\form\IForm::show()
+        */
+       public function show() {
+               // set active menu item
+               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.user.bulkProcessing');
+               
+               // check master password
+               WCFACP::checkMasterPassword();
+               
+               // show form
+               parent::show();
+       }
+}
diff --git a/wcfsetup/install/files/lib/acp/form/UsersMassProcessingForm.class.php b/wcfsetup/install/files/lib/acp/form/UsersMassProcessingForm.class.php
deleted file mode 100644 (file)
index 2bdffc3..0000000
+++ /dev/null
@@ -1,429 +0,0 @@
-<?php
-namespace wcf\acp\form;
-use wcf\data\user\group\UserGroup;
-use wcf\data\user\User;
-use wcf\data\user\UserEditor;
-use wcf\form\AbstractForm;
-use wcf\system\database\util\PreparedStatementConditionBuilder;
-use wcf\system\event\EventHandler;
-use wcf\system\exception\PermissionDeniedException;
-use wcf\system\exception\UserInputException;
-use wcf\system\language\LanguageFactory;
-use wcf\system\menu\acp\ACPMenu;
-use wcf\system\request\LinkHandler;
-use wcf\system\user\storage\UserStorageHandler;
-use wcf\system\WCF;
-use wcf\system\WCFACP;
-use wcf\util\ArrayUtil;
-use wcf\util\StringUtil;
-
-/**
- * Shows the users mass processing form.
- * 
- * @author     Marcel Werk
- * @copyright  2001-2012 WoltLab GmbH
- * @license    GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package    com.woltlab.wcf
- * @subpackage acp.form
- * @category   Community Framework
- */
-class UsersMassProcessingForm extends UserOptionListForm {
-       /**
-        * @see wcf\page\AbstractPage::$neededPermissions
-        */
-       public $neededPermissions = array('admin.user.canEditUser', 'admin.user.canDeleteUser', 'admin.user.canMailUser');
-       
-       /**
-        * searched username
-        * @var string
-        */
-       public $username = '';
-       
-       /**
-        * searched email adress
-        * @var string
-        */
-       public $email = '';
-       
-       /**
-        * ids of the searched user group ids
-        * @var array<integer>
-        */
-       public $groupIDArray = array();
-       
-       /**
-        * ids of the users' languages
-        * @var array<integer>
-        */
-       public $languageIDArray = array();
-       
-       /**
-        * indicates if the user may not be in the user groups with the selected
-        * ids
-        * @var integer
-        */
-       public $invertGroupIDs = 0;
-       
-       // assign to group
-       public $assignToGroupIDArray = array();
-       
-       // export mail address
-       public $fileType = 'csv';
-       public $separator = ',';
-       public $textSeparator = '"';
-       
-       // send mail
-       public $subject = '';
-       public $text = '';
-       public $from = '';
-       public $enableHTML = 0;
-       
-       // data
-       public $availableGroups = array();
-       public $options = array();
-       public $availableActions = array('sendMail', 'exportMailAddress', 'assignToGroup', 'delete');
-       public $affectedUsers = 0;
-       
-       /**
-        * conditions builder object
-        * @var wcf\system\database\condition\PreparedStatementConditionBuilder
-        */
-       public $conditions = null;
-       
-       /**
-        * options of the active category
-        * @var array
-        */
-       public $activeOptions = array();
-       
-       /**
-        * @see wcf\form\IForm::readFormParameters()
-        */
-       public function readFormParameters() {
-               parent::readFormParameters();
-               
-               if (isset($_POST['username'])) $this->username = StringUtil::trim($_POST['username']);
-               if (isset($_POST['email'])) $this->email = StringUtil::trim($_POST['email']);
-               if (isset($_POST['groupIDArray']) && is_array($_POST['groupIDArray'])) $this->groupIDArray = ArrayUtil::toIntegerArray($_POST['groupIDArray']);
-               if (isset($_POST['languageIDArray']) && is_array($_POST['languageIDArray'])) $this->languageIDArray = ArrayUtil::toIntegerArray($_POST['languageIDArray']);
-               if (isset($_POST['invertGroupIDs'])) $this->invertGroupIDs = intval($_POST['invertGroupIDs']);
-               // assign to group
-               if (isset($_POST['assignToGroupIDArray']) && is_array($_POST['assignToGroupIDArray'])) $this->assignToGroupIDArray = ArrayUtil::toIntegerArray($_POST['assignToGroupIDArray']);
-               // export mail address
-               if (isset($_POST['fileType']) && $_POST['fileType'] == 'xml') $this->fileType = $_POST['fileType'];
-               if (isset($_POST['separator'])) $this->separator = $_POST['separator'];
-               if (isset($_POST['textSeparator'])) $this->textSeparator = $_POST['textSeparator'];
-               // send mail
-               if (isset($_POST['subject'])) $this->subject = StringUtil::trim($_POST['subject']);
-               if (isset($_POST['text'])) $this->text = StringUtil::trim($_POST['text']);
-               if (isset($_POST['from'])) $this->from = StringUtil::trim($_POST['from']);
-               if (isset($_POST['enableHTML'])) $this->enableHTML = intval($_POST['enableHTML']);
-       }
-       
-       /**
-        * @see wcf\form\IForm::validate()
-        */
-       public function validate() {
-               AbstractForm::validate();
-               
-               // action
-               if (!in_array($this->action, $this->availableActions)) {
-                       throw new UserInputException('action');
-               }
-               
-               // assign to group
-               if ($this->action == 'assignToGroup') {
-                       if (empty($this->assignToGroupIDArray)) {
-                               throw new UserInputException('assignToGroupIDArray');
-                       }
-               }
-               
-               // send mail
-               if ($this->action == 'sendMail') {
-                       if (empty($this->subject)) {
-                               throw new UserInputException('subject');
-                       }
-                       
-                       if (empty($this->text)) {
-                               throw new UserInputException('text');
-                       }
-                       
-                       if (empty($this->from)) {
-                               throw new UserInputException('from');
-                       }
-               }
-       }
-       
-       /**
-        * @see wcf\form\IForm::save()
-        */
-       public function save() {
-               parent::save();
-               
-               // build conditions
-               $this->conditions = new PreparedStatementConditionBuilder();
-               
-               // static fields
-               if (!empty($this->username)) {
-                       $this->conditions->add("user.username LIKE ?", array('%'.addcslashes($this->username, '_%').'%'));
-               }
-               if (!empty($this->email)) {
-                       $this->conditions->add("user.email LIKE ?", array('%'.addcslashes($this->email, '_%').'%'));
-               }
-               if (!empty($this->groupIDArray)) {
-                       $this->conditions->add("user.userID ".($this->invertGroupIDs == 1 ? 'NOT ' : '')."IN (SELECT userID FROM wcf".WCF_N."_user_to_group WHERE groupID IN (?))", array($this->groupIDArray));
-               }
-               if (!empty($this->languageIDArray)) {
-                       $this->conditions->add("user.languageID IN (?)", array($this->languageIDArray));
-               }
-               
-               // dynamic fields
-               foreach ($this->activeOptions as $name => $option) {
-                       $value = isset($this->values[$option['optionName']]) ? $this->values[$option['optionName']] : null;
-                       $this->getTypeObject($option['optionType'])->getCondition($this->conditions, $option, $value);
-               }
-               
-               // call buildConditions event
-               EventHandler::getInstance()->fireAction($this, 'buildConditions');
-               
-               // execute action
-               switch ($this->action) {
-                       case 'sendMail':
-                               WCF::getSession()->checkPermissions(array('admin.user.canMailUser'));
-                               // get user ids
-                               $userIDArray = array();
-                               $sql = "SELECT          user.userID
-                                       FROM            wcf".WCF_N."_user user
-                                       LEFT JOIN       wcf".WCF_N."_user_option_value option_value
-                                       ON              (option_value.userID = user.userID)".
-                                       $this->conditions;
-                               $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute($this->conditions->getParameters());
-                               while ($row = $statement->fetchArray()) {
-                                       $userIDArray[] = $row['userID'];
-                                       $this->affectedUsers++;
-                               }
-                               
-                               // save config in session
-                               $userMailData = WCF::getSession()->getVar('userMailData');
-                               if ($userMailData === null) $userMailData = array();
-                               $mailID = count($userMailData);
-                               $userMailData[$mailID] = array(
-                                       'action' => '',
-                                       'userIDs' => implode(',', $userIDArray),
-                                       'groupIDs' => '',
-                                       'subject' => $this->subject,
-                                       'text' => $this->text,
-                                       'from' => $this->from,
-                                       'enableHTML' => $this->enableHTML
-                               );
-                               WCF::getSession()->register('userMailData', $userMailData);
-                               $this->saved();
-                               
-                               $url = LinkHandler::getInstance()->getLink('UserMail', array('id' => $mailID));
-                               
-                               // show worker template
-                               WCF::getTPL()->assign(array(
-                                       'pageTitle' => WCF::getLanguage()->get('wcf.acp.user.sendMail'),
-                                       'url' => $url
-                               ));
-                               WCF::getTPL()->display('worker');
-                               exit;
-                       break;
-                       
-                       case 'exportMailAddress':
-                               WCF::getSession()->checkPermissions(array('admin.user.canMailUser'));
-                               // send content type
-                               header('Content-Type: text/'.$this->fileType.'; charset=UTF-8');
-                               header('Content-Disposition: attachment; filename="export.'.$this->fileType.'"');
-                               
-                               if ($this->fileType == 'xml') {
-                                       echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<addresses>\n";
-                               }
-                               
-                               // count users
-                               $sql = "SELECT          COUNT(*) AS count
-                                       FROM            wcf".WCF_N."_user user
-                                       LEFT JOIN       wcf".WCF_N."_user_option_value option_value
-                                       ON              (option_value.userID = user.userID)
-                                       ".$this->conditions;
-                               $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute($this->conditions->getParameters());
-                               $count = $statement->fetchArray();
-                               
-                               // get users
-                               $sql = "SELECT          user.email
-                                       FROM            wcf".WCF_N."_user user
-                                       LEFT JOIN       wcf".WCF_N."_user_option_value option_value
-                                       ON              (option_value.userID = user.userID)
-                                       ".$this->conditions."
-                                       ORDER BY        user.email";
-                               $statement = WCF::getDB()->prepareStatement($sql);
-                               $statement->execute($this->conditions->getParameters());
-                               
-                               $i = 0;
-                               while ($row = $statement->fetchArray()) {
-                                       if ($this->fileType == 'xml') echo "<address><![CDATA[".StringUtil::escapeCDATA($row['email'])."]]></address>\n";
-                                       else echo $this->textSeparator . $row['email'] . $this->textSeparator . ($i < $count['count'] ? $this->separator : '');
-                                       $i++;
-                                       $this->affectedUsers++;
-                               }
-                               
-                               if ($this->fileType == 'xml') {
-                                       echo "</addresses>";
-                               }
-                               $this->saved();
-                               exit;
-                       break;
-                       
-                       case 'assignToGroup':
-                               WCF::getSession()->checkPermissions(array('admin.user.canEditUser'));
-                               
-                               $_this = $this;
-                               $userIDArray = $this->fetchUsers(function($userID, array $userData) use ($_this) {
-                                       $user = new UserEditor(new User(null, $userData));
-                                       $user->addToGroups($_this->assignToGroupIDArray, false, false);
-                               });
-                               
-                               UserStorageHandler::getInstance()->reset($userIDArray, 'groupIDs', 1);
-                       break;
-                       
-                       case 'delete':
-                               WCF::getSession()->checkPermissions(array('admin.user.canDeleteUser'));
-                               
-                               $userIDArray = $this->fetchUsers();
-                               
-                               UserEditor::deleteUsers($userIDArray);
-                       break;
-               }
-               $this->saved();
-               
-               WCF::getTPL()->assign('affectedUsers', $this->affectedUsers);
-       }
-       
-       /**
-        * Fetches a list of users.
-        * 
-        * @param       mixed           $loopFunction
-        * @return      array<integer>
-        */
-       protected function fetchUsers($loopFunction = null) {
-               // select users
-               $sql = "SELECT          user.*
-                       FROM            wcf".WCF_N."_user user
-                       LEFT JOIN       wcf".WCF_N."_user_option_value option_value
-                       ON              (option_value.userID = user.userID)
-                       ".$this->conditions;
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($this->conditions->getParameters());
-               
-               $users = array();
-               while ($row = $statement->fetchArray()) {
-                       $users[$row['userID']] = $row;
-               }
-               
-               // select group ids
-               $conditions = new PreparedStatementConditionBuilder();
-               $conditions->add("userID = ?", array(array_keys($users)));
-               
-               $sql = "SELECT  userID, groupID
-                       FROM    wcf".WCF_N."_user_to_group
-                       ".$conditions;
-               $statement = WCF::getDB()->prepareStatement($sql);
-               $statement->execute($conditions->getParameters());
-               
-               $groupIDs = array();
-               while ($row = $statement->fetchArray()) {
-                       if (!isset($groupIDs[$row['userID']])) {
-                               $groupIDs[$row['userID']] = array();
-                       }
-                       
-                       $groupIDs[$row['userID']][] = $row['groupID'];
-               }
-               
-               foreach ($users as $userID => $userData) {
-                       if (!UserGroup::isAccessibleGroup($groupIDs[$userID])) {
-                               throw new PermissionDeniedException();
-                       }
-                       
-                       if ($loopFunction !== null) {
-                               $loopFunction($userID, $userData);
-                       }
-                       
-                       $userIDArray[] = $userID;
-                       $this->affectedUsers++;
-               }
-               
-               return $userIDArray;
-       }
-       
-       /**
-        * @see wcf\page\IPage::readData()
-        */
-       public function readData() {
-               parent::readData();
-               
-               if (empty($_POST)) {
-                       if (MAIL_USE_FORMATTED_ADDRESS) {
-                               $this->from = MAIL_FROM_NAME.' <'.MAIL_FROM_ADDRESS.'>';
-                       }
-                       else {
-                               $this->from = MAIL_FROM_ADDRESS;
-                       }
-               }
-               
-               $this->availableGroups = $this->getAvailableGroups();
-               
-               foreach ($this->activeOptions as $name => $option) {
-                       if (isset($this->values[$name])) {
-                               $this->activeOptions[$name]['optionValue'] = $this->values[$name];
-                       }
-               }
-               
-               $this->options = $this->optionHandler->getCategoryOptions('profile');
-       }
-       
-       /**
-        * @see wcf\page\IPage::assignVariables()
-        */
-       public function assignVariables() {
-               parent::assignVariables();
-               
-               WCF::getTPL()->assign(array(
-                       'username' => $this->username,
-                       'email' => $this->email,
-                       'groupIDArray' => $this->groupIDArray,
-                       'languageIDArray' => $this->languageIDArray,
-                       'invertGroupIDs' => $this->invertGroupIDs,
-                       'availableGroups' => $this->availableGroups,
-                       'availableLanguages' => LanguageFactory::getInstance()->getLanguages(),
-                       'options' => $this->options,
-                       'availableActions' => $this->availableActions,
-                       // assign to group
-                       'assignToGroupIDArray' => $this->assignToGroupIDArray,
-                       // export mail address
-                       'separator' => $this->separator,
-                       'textSeparator' => $this->textSeparator,
-                       'fileType' => $this->fileType,
-                       // send mail
-                       'subject' => $this->subject,
-                       'text' => $this->text,
-                       'from' => $this->from,
-                       'enableHTML' => $this->enableHTML
-               ));
-       }
-       
-       /**
-        * @see wcf\form\IForm::show()
-        */
-       public function show() {
-               // set active menu item
-               ACPMenu::getInstance()->setActiveMenuItem('wcf.acp.menu.link.user.massProcessing');
-               
-               // check master password
-               WCFACP::checkMasterPassword();
-               
-               // show form
-               parent::show();
-       }
-}
index f691b0725a10492f8ba5b4ceb42f8bc53e00b414..f5935f2f824aa6b28d77ca8936066650fd5a05f3 100644 (file)
                <item name="wcf.acp.menu.link.user.list"><![CDATA[Benutzer auflisten]]></item>
                <item name="wcf.acp.menu.link.user.mail"><![CDATA[E-Mail an alle Benutzer]]></item>
                <item name="wcf.acp.menu.link.user.management"><![CDATA[Benutzer]]></item>
-               <item name="wcf.acp.menu.link.user.massProcessing"><![CDATA[Benutzer-Massenbearbeitung]]></item>
+               <item name="wcf.acp.menu.link.user.bulkProcessing"><![CDATA[Benutzer-Massenbearbeitung]]></item>
                <item name="wcf.acp.menu.link.user.search"><![CDATA[Benutzer suchen]]></item>
                <item name="wcf.acp.menu.link.user.option"><![CDATA[Benutzerprofilfelder]]></item>
                <item name="wcf.acp.menu.link.user.option.list"><![CDATA[Benutzerprofilfelder auflisten]]></item>
                <item name="wcf.acp.user.list"><![CDATA[Benutzer]]></item>
                <item name="wcf.acp.user.list.all"><![CDATA[Alle Benutzer]]></item>
                <item name="wcf.acp.user.list.count"><![CDATA[{#$items} Benutzer]]></item>
-               <item name="wcf.acp.user.massProcessing"><![CDATA[Benutzer-Massenbearbeitung]]></item>
-               <item name="wcf.acp.user.massProcessing.action"><![CDATA[Aktion]]></item>
-               <item name="wcf.acp.user.massProcessing.conditions"><![CDATA[Bedingungen]]></item>
-               <item name="wcf.acp.user.massProcessing.success"><![CDATA[Die gewählte Aktion wurde erfolgreich auf {#$affectedUsers} Benutzer ausgeführt.]]></item>
-               <item name="wcf.acp.user.massProcessing.warning"><![CDATA[Die Massenbearbeitung von Benutzern führt die unten ausgewählte Aktion <b>ohne zusätzliche Sicherheitsabfrage</b> auf alle Benutzer aus, die unter die eingestellten Bedingungen fallen. Die Bearbeitungen können unter Umständen sehr rechenintensiv werden und sollten deshalb möglichst nur dann ausgeführt werden, wenn sich die Seite im Wartungsmodus befindet! Die Veränderungen können nicht rückgängig gemacht werden. Bitte benutzen Sie diese Funktion mit der nötigen Vorsicht!]]></item>
+               <item name="wcf.acp.user.bulkProcessing"><![CDATA[Benutzer-Massenbearbeitung]]></item>
+               <item name="wcf.acp.user.bulkProcessing.action"><![CDATA[Aktion]]></item>
+               <item name="wcf.acp.user.bulkProcessing.conditions"><![CDATA[Bedingungen]]></item>
+               <item name="wcf.acp.user.bulkProcessing.success"><![CDATA[Die gewählte Aktion wurde erfolgreich auf {#$affectedUsers} 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> auf alle Benutzer aus, die unter die eingestellten Bedingungen fallen. Die Bearbeitungen können unter Umständen sehr rechenintensiv werden und sollten deshalb möglichst nur dann ausgeführt werden, wenn sich die Seite im Wartungsmodus befindet! Die Veränderungen können nicht rückgängig gemacht werden. Bitte benutzen Sie diese Funktion mit der nötigen Vorsicht!]]></item>
                <item name="wcf.acp.user.search"><![CDATA[Benutzer suchen]]></item>
                <item name="wcf.acp.user.search.conditions.general"><![CDATA[Allgemein]]></item>
                <item name="wcf.acp.user.search.conditions.profile"><![CDATA[Profil]]></item>
index 0e2729538cfbc24c285a5c71baaffa4d4344f890..535f2532e88c2bdc239288cbe30f54c51992d69e 100644 (file)
                <item name="wcf.acp.menu.link.user.list"><![CDATA[List Users]]></item>
                <item name="wcf.acp.menu.link.user.mail"><![CDATA[Email Users]]></item>
                <item name="wcf.acp.menu.link.user.management"><![CDATA[Users]]></item>
-               <item name="wcf.acp.menu.link.user.massProcessing"><![CDATA[Bulk Processing]]></item>
+               <item name="wcf.acp.menu.link.user.bulkProcessing"><![CDATA[Bulk Processing]]></item>
                <item name="wcf.acp.menu.link.user.search"><![CDATA[Search Users]]></item>
                <item name="wcf.acp.menu.link.user.option"><![CDATA[Custom User Fields]]></item>
                <item name="wcf.acp.menu.link.user.option.list"><![CDATA[List Custom User Fields]]></item>
                <item name="wcf.acp.user.list"><![CDATA[Users]]></item>
                <item name="wcf.acp.user.list.all"><![CDATA[All Users]]></item>
                <item name="wcf.acp.user.list.count"><![CDATA[{#$items} Users]]></item>
-               <item name="wcf.acp.user.massProcessing"><![CDATA[Bulk Processing]]></item>
-               <item name="wcf.acp.user.massProcessing.action"><![CDATA[Actions]]></item>
-               <item name="wcf.acp.user.massProcessing.conditions"><![CDATA[Conditions]]></item>
-               <item name="wcf.acp.user.massProcessing.success"><![CDATA[Executed action affected {#$affectedUsers} user{if $affectedUsers != 1}s{/if}.]]></item>
-               <item name="wcf.acp.user.massProcessing.warning"><![CDATA[Heads up! The bulk processing executes all actions below without any further confirmation prompt! Processing can be fairly slow if many users are affected by your conditions, it is recommended to enable “Maintenance Mode” in first place. Any change cannot be undone, please be careful!]]></item>
+               <item name="wcf.acp.user.bulkProcessing"><![CDATA[Bulk Processing]]></item>
+               <item name="wcf.acp.user.bulkProcessing.action"><![CDATA[Actions]]></item>
+               <item name="wcf.acp.user.bulkProcessing.conditions"><![CDATA[Conditions]]></item>
+               <item name="wcf.acp.user.bulkProcessing.success"><![CDATA[Executed action affected {#$affectedUsers} user{if $affectedUsers != 1}s{/if}.]]></item>
+               <item name="wcf.acp.user.bulkProcessing.warning"><![CDATA[Heads up! The bulk processing executes all actions below without any further confirmation prompt! Processing can be fairly slow if many users are affected by your conditions, it is recommended to enable “Maintenance Mode” in first place. Any change cannot be undone, please be careful!]]></item>
                <item name="wcf.acp.user.search"><![CDATA[Search Users]]></item>
                <item name="wcf.acp.user.search.conditions.general"><![CDATA[General]]></item>
                <item name="wcf.acp.user.search.conditions.profile"><![CDATA[Profile]]></item>