{event name='changeEmailFields'}
- {if REGISTER_ACTIVATION_METHOD == 1 && $__wcf->getUser()->reactivationCode != 0}
+ {if REGISTER_ACTIVATION_METHOD & 1 && $__wcf->getUser()->reactivationCode != 0}
<dl>
<dt></dt>
<dd>
{include file='header' __disableAds=true}
-{if $__wcf->user->userID && $__wcf->user->activationCode}<p class="info" role="status">{lang}wcf.user.registerActivation.info{/lang}</p>{/if}
+{if $__wcf->user->userID && !$__wcf->user->isEmailConfirmed()}<p class="info" role="status">{lang}wcf.user.registerActivation.info{/lang}</p>{/if}
{include file='formError'}
<dl{if $errorField == 'activationCode'} class="formError"{/if}>
<dt><label for="activationCode">{lang}wcf.user.activationCode{/lang}</label></dt>
<dd>
- <input type="text" id="activationCode" maxlength="9" name="activationCode" value="{@$activationCode}" required class="medium">
+ <input type="text" id="activationCode" maxlength="40" name="activationCode" value="{@$activationCode}" required class="medium">
{if $errorField == 'activationCode'}
<small class="innerError">
{if $errorType == 'invalid'}{lang}wcf.user.activationCode.error.invalid{/lang}{/if}
{if $__wcf->session->getPermission('admin.user.canDisableAvatar')}<li><a href="#" class="jsButtonUserDisableAvatar">{lang}wcf.user.{if $user->disableAvatar}enable{else}disable{/if}Avatar{/lang}</a></li>{/if}
{if $__wcf->session->getPermission('admin.user.canDisableSignature')}<li><a href="#" class="jsButtonUserDisableSignature">{lang}wcf.user.{if $user->disableSignature}enable{else}disable{/if}Signature{/lang}</a></li>{/if}
{if MODULE_USER_COVER_PHOTO && $__wcf->session->getPermission('admin.user.canDisableCoverPhoto')}<li><a href="#" class="jsButtonUserDisableCoverPhoto">{lang}wcf.user.{if $user->disableCoverPhoto}enable{else}disable{/if}CoverPhoto{/lang}</a></li>{/if}
- {if $__wcf->session->getPermission('admin.user.canEnableUser')}<li><a href="#" class="jsButtonUserEnable">{lang}wcf.acp.user.{if $user->activationCode}enable{else}disable{/if}{/lang}</a></li>{/if}
+ {if $__wcf->session->getPermission('admin.user.canEnableUser')}<li><a href="#" class="jsButtonUserEnable">{lang}wcf.acp.user.{if $user->isActivated())}enable{else}disable{/if}{/lang}</a></li>{/if}
{if $__wcf->session->getPermission('admin.general.canUseAcp') && $__wcf->session->getPermission('admin.user.canEditUser')}<li><a href="{link controller='UserEdit' object=$user isACP=true}{/link}" class="jsUserInlineEditor">{lang}wcf.user.edit{/lang}</a></li>{/if}
{/if}
<p class="info" role="status">{lang}wcf.page.availableUpdates{/lang}</p>
{/if}
- {if $__wcf->user->activationCode && REGISTER_ACTIVATION_METHOD == 1 && $templateName != 'registerActivation' && $templateName != 'register' && $templateName != 'redirect' && $__wcf->user->getBlacklistMatches()|empty}
+ {* user needs email confirmation to be activated *}
+ {if !$__wcf->user->isEmailConfirmed() && !$__wcf->user->isActivated() && REGISTER_ACTIVATION_METHOD & 1 && $templateName != 'registerActivation' && $templateName != 'register' && $templateName != 'redirect' && $__wcf->user->getBlacklistMatches()|empty}
<p class="warning" role="status">{lang}wcf.user.register.needActivation{/lang}</p>
{/if}
+ {* user needs admin activation *}
+ {if $__wcf->user->isEmailConfirmed() && REGISTER_ACTIVATION_METHOD & 2 && !$__wcf->user->isActivated() && $templateName != 'registerActivation' && $templateName != 'register' && $templateName != 'redirect' && $__wcf->user->getBlacklistMatches()|empty}
+ <p class="warning" role="status">{lang}wcf.user.register.needAdminActivation{/lang}</p>
+ {/if}
+
+ {* user needs email activation w/o beeing disabled *}
+ {if !$__wcf->user->isEmailConfirmed() && REGISTER_ACTIVATION_METHOD & 1 && $__wcf->user->isActivated() && $templateName != 'registerActivation' && $templateName != 'register' && $templateName != 'redirect' && $__wcf->user->getBlacklistMatches()|empty}
+ <p class="warning" role="status">{lang}wcf.user.register.needEmailConfirmation{/lang}</p>
+ {/if}
+
{hascontent}
{content}
{foreach from=$__wcf->getNoticeHandler()->getVisibleNotices() item='notice'}
/**
* activation code
- * @var integer
+ * @var string
*/
public $activationCode = '';
$this->user = new User($userID);
if ($this->user->userID) $this->username = $this->user->username;
}
- if (!empty($_GET['a'])) $this->activationCode = intval($_GET['a']);
+ if (!empty($_GET['a'])) $this->activationCode = StringUtil::trim($_GET['a']);
}
/**
$this->username = StringUtil::trim($_POST['username']);
$this->user = User::getUserByUsername($this->username);
}
- if (isset($_POST['activationCode'])) $this->activationCode = intval($_POST['activationCode']);
+ if (isset($_POST['activationCode'])) $this->activationCode = StringUtil::trim($_POST['activationCode']);
}
/**
throw new UserInputException('username', 'notFound');
}
- // user is already enabled
+ // user email is already confirmed
if ($this->user->isEmailConfirmed()) {
throw new NamedUserException(WCF::getLanguage()->get('wcf.user.registerActivation.error.userAlreadyEnabled'));
}
// check given activation code
- if (\hash_equals($this->activationCode, $this->user->emailConfirmed)) {
+ if (!\hash_equals($this->activationCode, $this->user->emailConfirmed)) {
throw new UserInputException('activationCode', 'invalid');
}
$this->saved();
// forward to index page
- HeaderUtil::delayedRedirect(LinkHandler::getInstance()->getLink(), WCF::getLanguage()->getDynamicVariable('wcf.user.registerActivation.success'), 10);
+ if (REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_ADMIN && !$this->user->isActivated()) {
+ $redirectText = WCF::getLanguage()->getDynamicVariable('wcf.user.registerActivation.success.awaitAdminActivation');
+ }
+ else {
+ $redirectText = WCF::getLanguage()->getDynamicVariable('wcf.user.registerActivation.success');
+ }
+
+ HeaderUtil::delayedRedirect(LinkHandler::getInstance()->getLink(), $redirectText, 10);
exit;
}
<item name="wcf.user.registerActivation"><![CDATA[Registrierung abschließen]]></item>
<item name="wcf.user.registerActivation.error.userAlreadyEnabled"><![CDATA[Dieser Benutzer ist bereits freigeschaltet.]]></item>
<item name="wcf.user.registerActivation.success"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Benutzerkonto wurde erfolgreich freigeschaltet.]]></item>
+ <item name="wcf.user.registerActivation.success.awaitAdminActivation"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Deine{else}Ihre{/if} E-Mail-Adresse wurde erfolgreich freigeschaltet. {if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Benutzerkonto muss nun noch von einem Administrator freigeschaltet werden.]]></item>
<item name="wcf.user.activationCode.error.invalid"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Du hast{else}Sie haben{/if} einen ungültigen Aktivierungscode eingegeben. {if LANGUAGE_USE_INFORMAL_VARIANT}Klicke auf den unten stehenden Link, falls du einen neuen Aktivierungscode anfordern möchtest.{else}Klicken Sie auf den unten stehenden Link, falls Sie einen neuen Aktivierungscode anfordern möchten.{/if}]]></item>
<item name="wcf.user.registerNewActivationCode.email.description"><![CDATA[Optional {if LANGUAGE_USE_INFORMAL_VARIANT}kannst du{else}können Sie{/if} hier eine neue E-Mail-Adresse eintragen, an die der neue Aktivierungscode gesendet werden soll. {if LANGUAGE_USE_INFORMAL_VARIANT}Lasse{else}Lassen Sie{/if} dieses Feld frei, wenn der Aktivierungscode an die bestehende Adresse geschickt werden soll.]]></item>
<item name="wcf.user.newActivationCode.success"><![CDATA[Eine E-Mail mit dem neuen Aktivierungscode wurde an {$email} versendet.]]></item>
Sie sich{/if} bitte an den Administrator unter: {@MAIL_ADMIN_ADDRESS}. Wenn {if LANGUAGE_USE_INFORMAL_VARIANT}du
dich{else}Sie
sich{/if} nicht bei uns registriert {if LANGUAGE_USE_INFORMAL_VARIANT}hast{else}haben{/if}, dann {if LANGUAGE_USE_INFORMAL_VARIANT}kannst du{else}können Sie{/if} diese E-Mail ignorieren.]]></item>
+ <item name="wcf.user.register.needAdminActivation"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Dein{else}Ihr{/if} Benutzerkonto muss noch von einem Administrator freigeschaltet werden, um den vollen Funktionsumfang dieser Seite nutzen zu können.]]></item>
+ <item name="wcf.user.register.needEmailConfirmation"><![CDATA[{if LANGUAGE_USE_INFORMAL_VARIANT}Deine{else}Ihre{/if} E-Mail-Adresse muss noch aktiviert werden. <a href="{link controller='RegisterActivation'}{/link}">Aktivieren Sie jetzt Ihre E-Mail-Adresse</a>]]></item>
<!-- Success Messages -->
<item name="wcf.user.register.success"><![CDATA[Vielen Dank für die Registrierung, {$user->username}. {if LANGUAGE_USE_INFORMAL_VARIANT}Deine{else}Ihre{/if} Registrierung ist hiermit vollständig abgeschlossen.]]></item>
<item name="wcf.user.register.success.needActivation"><![CDATA[Vielen Dank für die Registrierung, {$user->username}.<br>
<item name="wcf.user.registerActivation"><![CDATA[Complete Registration]]></item>
<item name="wcf.user.registerActivation.error.userAlreadyEnabled"><![CDATA[The user is already activated.]]></item>
<item name="wcf.user.registerActivation.success"><![CDATA[The user account has been activated.]]></item>
+ <item name="wcf.user.registerActivation.success.awaitAdminActivation"><![CDATA[{The email address has been activated. Now your account must be activated by an administrator.]]></item>
<item name="wcf.user.activationCode.error.invalid"><![CDATA[You have provided an invalid activation code. Click the link below if you wish to request a new activation code.]]></item>
<item name="wcf.user.registerNewActivationCode.email.description"><![CDATA[You can provide a different email address or leave it empty to send the code to the same email address again.]]></item>
<item name="wcf.user.newActivationCode.success"><![CDATA[The activation code has been sent to “{$email}”.]]></item>
If you have trouble confirming your email address, please contact the
administrator at: {@MAIL_ADMIN_ADDRESS}. Please ignore this email if you did
not register with us.]]></item>
+ <item name="wcf.user.register.needAdminActivation"><![CDATA[Your account must be activated by an administrator in order to use the full scope of the website.]]></item>
+ <item name="wcf.user.register.needEmailConfirmation"><![CDATA[Your email address is not activated yet. <a href="{link controller='RegisterActivation'}{/link}">Activate now your email address</a>.]]></item>
<!-- Success Messages -->
<item name="wcf.user.register.success"><![CDATA[Thank you for registering, {$user->username}.<br>
Your registration is now completed.]]></item>