use wcf\data\user\User;
use wcf\data\user\UserAction;
use wcf\system\database\DatabaseException;
+use wcf\system\language\LanguageFactory;
use wcf\system\WCF;
use wcf\util\StringUtil;
// merge user
ImportHandler::getInstance()->saveNewID('com.woltlab.wcf.user', $oldID, $existingUser->userID);
- return $existingUser->userID;
+ return 0;
}
}
}
}
+ // handle languages
+ $languageIDs = array();
+ if (isset($additionalData['languages'])) {
+ foreach ($additionalData['languages'] as $languageCode) {
+ $language = LanguageFactory::getInstance()->getLanguageByCode($languageCode);
+ if ($language !== null) $languageIDs[] = $language->languageID;
+ }
+ }
+
// create user
$action = new UserAction(array(), 'create', array(
'data' => $data,
'groups' => $groupIDs,
- 'options' => $userOptions
+ 'options' => $userOptions,
+ 'languages' => $languageIDs
));
$returnValues = $action->executeAction();