<label><input type="radio" id="userMergeMode" name="userMergeMode" value="1" {if $userMergeMode == 1}checked="checked" {/if}/> {lang}wcf.acp.dataImport.configure.settings.userMergeMode.1{/lang}</label>
<label><input type="radio" name="userMergeMode" value="2" {if $userMergeMode == 2}checked="checked" {/if}/> {lang}wcf.acp.dataImport.configure.settings.userMergeMode.2{/lang}</label>
<label><input type="radio" name="userMergeMode" value="3" {if $userMergeMode == 3}checked="checked" {/if}/> {lang}wcf.acp.dataImport.configure.settings.userMergeMode.3{/lang}</label>
+ <label><input type="radio" name="userMergeMode" value="4" {if $userMergeMode == 4}checked="checked" {/if}/> {lang}wcf.acp.dataImport.configure.settings.userMergeMode.4{/lang}</label>
</dd>
</dl>
}
// validate user merge mode
- if ($this->userMergeMode < 1 || $this->userMergeMode > 3) {
+ if ($this->userMergeMode < 1 || $this->userMergeMode > 4) {
$this->userMergeMode = 2;
}
}
CLIWCF::getReader()->println('1) '.WCF::getLanguage()->get('wcf.acp.dataImport.configure.settings.userMergeMode.1'));
CLIWCF::getReader()->println('2) '.WCF::getLanguage()->get('wcf.acp.dataImport.configure.settings.userMergeMode.2').' (*)');
CLIWCF::getReader()->println('3) '.WCF::getLanguage()->get('wcf.acp.dataImport.configure.settings.userMergeMode.3'));
+ CLIWCF::getReader()->println('4) '.WCF::getLanguage()->get('wcf.acp.dataImport.configure.settings.userMergeMode.4'));
CLIWCF::getReader()->println(WCF::getLanguage()->getDynamicVariable('wcf.acp.dataImport.cli.selection', array(
'minSelection' => 1,
- 'maxSelection' => 3
+ 'maxSelection' => 4
)));
while (true) {
$this->userMergeMode = CLIWCF::getReader()->readLine('> ');
if ($this->userMergeMode === null) exit;
- if ($this->userMergeMode != intval($this->userMergeMode) || $this->userMergeMode < 1 || $this->userMergeMode > 3) {
+ if ($this->userMergeMode != intval($this->userMergeMode) || $this->userMergeMode < 1 || $this->userMergeMode > 4) {
$this->userMergeMode = 2;
}
*/
public function import($oldID, array $data, array $additionalData = array()) {
// resolve duplicates
- $existingUser = User::getUserByUsername($data['username']);
- if ($existingUser->userID) {
- if (ImportHandler::getInstance()->getUserMergeMode() == 1 || (ImportHandler::getInstance()->getUserMergeMode() == 3 && mb_strtolower($existingUser->email) != mb_strtolower($data['email']))) {
- // rename user
- $data['username'] = self::resolveDuplicate($data['username']);
- }
- else {
+ if (ImportHandler::getInstance()->getUserMergeMode() == 4) {
+ $existingUser = User::getUserByEmail($data['email']);
+ if ($existingUser->userID) {
// merge user
ImportHandler::getInstance()->saveNewID('com.woltlab.wcf.user', $oldID, $existingUser->userID);
-
+
return 0;
}
}
+ else {
+ $existingUser = User::getUserByUsername($data['username']);
+ if ($existingUser->userID) {
+ if (ImportHandler::getInstance()->getUserMergeMode() == 1 || (ImportHandler::getInstance()->getUserMergeMode() == 3 && mb_strtolower($existingUser->email) != mb_strtolower($data['email']))) {
+ // rename user
+ $data['username'] = self::resolveDuplicate($data['username']);
+ }
+ else {
+ // merge user
+ ImportHandler::getInstance()->saveNewID('com.woltlab.wcf.user', $oldID, $existingUser->userID);
+
+ return 0;
+ }
+ }
+ }
// check existing user id
if (is_numeric($oldID)) {
<br /><strong>{$exception->getMessage()}<br />{$exception->getErrorDesc()}</strong>]]></item>
<item name="wcf.acp.dataImport.configure.fileSystem.path.error"><![CDATA[Es wurde keine Installation unter dem angegeben Pfad gefunden.]]></item>
<item name="wcf.acp.dataImport.configure.settings"><![CDATA[Einstellungen]]></item>
- <item name="wcf.acp.dataImport.configure.settings.userMergeMode"><![CDATA[Verhalten bei sich überschneidenden Benutzernamen]]></item>
+ <item name="wcf.acp.dataImport.configure.settings.userMergeMode"><![CDATA[Verhalten bei sich überschneidenden Benutzeraccounts]]></item>
<item name="wcf.acp.dataImport.configure.settings.userMergeMode.1"><![CDATA[Benutzeraccounts umbennen]]></item>
- <item name="wcf.acp.dataImport.configure.settings.userMergeMode.2"><![CDATA[Benutzeraccounts zusammenlegen]]></item>
- <item name="wcf.acp.dataImport.configure.settings.userMergeMode.3"><![CDATA[Benutzeraccounts zusammenlegen, wenn auch die E-Mail-Adresse identisch ist]]></item>
+ <item name="wcf.acp.dataImport.configure.settings.userMergeMode.2"><![CDATA[Benutzeraccounts mit identischen Namen zusammenlegen]]></item>
+ <item name="wcf.acp.dataImport.configure.settings.userMergeMode.3"><![CDATA[Benutzeraccounts mit identischen Namen und E-Mail-Adressen zusammenlegen]]></item>
+ <item name="wcf.acp.dataImport.configure.settings.userMergeMode.4"><![CDATA[Benutzeraccounts mit identischen E-Mail-Adressen zusammenlegen]]></item>
<item name="wcf.acp.dataImport.data.com.woltlab.wcf.user"><![CDATA[Benutzer]]></item>
<item name="wcf.acp.dataImport.data.com.woltlab.wcf.user.group"><![CDATA[Benutzergruppen]]></item>
<item name="wcf.acp.dataImport.data.com.woltlab.wcf.user.option"><![CDATA[Benutzerprofilfelder]]></item>
<br /><strong>{$exception->getMessage()}<br />{$exception->getErrorDesc()}</strong>]]></item>
<item name="wcf.acp.dataImport.configure.fileSystem.path.error"><![CDATA[Unable to find a valid installation with the given path.]]></item>
<item name="wcf.acp.dataImport.configure.settings"><![CDATA[Settings]]></item>
- <item name="wcf.acp.dataImport.configure.settings.userMergeMode"><![CDATA[Conflicting Usernames]]></item>
+ <item name="wcf.acp.dataImport.configure.settings.userMergeMode"><![CDATA[TOOD: Verhalten bei sich überschneidenden Benutzeraccounts]]></item>
<item name="wcf.acp.dataImport.configure.settings.userMergeMode.1"><![CDATA[Rename users]]></item>
- <item name="wcf.acp.dataImport.configure.settings.userMergeMode.2"><![CDATA[Merge users]]></item>
- <item name="wcf.acp.dataImport.configure.settings.userMergeMode.3"><![CDATA[Merge users if email address is equal]]></item>
+ <item name="wcf.acp.dataImport.configure.settings.userMergeMode.2"><![CDATA[TOOD: Benutzeraccounts mit identischen Namen zusammenlegen]]></item>
+ <item name="wcf.acp.dataImport.configure.settings.userMergeMode.3"><![CDATA[TOOD: Benutzeraccounts mit identischen Namen und E-Mail-Adressen zusammenlegen]]></item>
+ <item name="wcf.acp.dataImport.configure.settings.userMergeMode.4"><![CDATA[TOOD: Benutzeraccounts mit identischen E-Mail-Adressen zusammenlegen]]></item>
<item name="wcf.acp.dataImport.data.com.woltlab.wcf.user"><![CDATA[User]]></item>
<item name="wcf.acp.dataImport.data.com.woltlab.wcf.user.group"><![CDATA[User groups]]></item>
<item name="wcf.acp.dataImport.data.com.woltlab.wcf.user.option"><![CDATA[User profile fields]]></item>