<?php
namespace wcf\acp\page;
-use wcf\data\user\UserProfile;
+use wcf\data\user\User;
use wcf\page\AbstractPage;
use wcf\system\application\ApplicationHandler;
use wcf\system\cache\builder\OptionCacheBuilder;
use wcf\system\package\PackageInstallationDispatcher;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
-use wcf\util\StringUtil;
/**
* Shows the welcome page in admin control panel.
parent::assignVariables();
$usersAwaitingApproval = 0;
- if (REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_ADMIN) {
+ if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN) {
$sql = "SELECT COUNT(*)
FROM wcf".WCF_N."_user
WHERE activationCode <> 0";
*/
protected static $userOptions;
+ const REGISTER_ACTIVATION_NONE = 0;
+ const REGISTER_ACTIVATION_USER = 1;
+ const REGISTER_ACTIVATION_ADMIN = 2;
+ const REGISTER_ACTIVATION_USER_AND_ADMIN = 3; // self::REGISTER_ACTIVATION_USER + self::REGISTER_ACTIVATION_ADMIN
+
/** @noinspection PhpMissingParentConstructorInspection */
/**
* @inheritDoc
use wcf\system\request\RequestHandler;
use wcf\system\user\group\assignment\UserGroupAssignmentHandler;
use wcf\system\WCF;
-use wcf\util\CryptoUtil;
use wcf\util\UserRegistrationUtil;
/**
public function confirmEmail() {
if (empty($this->objects)) $this->readObjects();
- if (REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_ADMIN) {
+ if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN) {
$action = new UserAction($this->objects, 'update', [
'data' => [
'emailConfirmed' => null
throw new PermissionDeniedException();
}
- if (!(REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_USER)) {
+ if (!(REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER)) {
throw new IllegalLinkException();
}
const ACCESS_FOLLOWING = 2;
const ACCESS_NOBODY = 3;
- const REGISTER_ACTIVATION_NONE = 0;
- const REGISTER_ACTIVATION_USER = 1;
- const REGISTER_ACTIVATION_ADMIN = 2;
- const REGISTER_ACTIVATION_USER_AND_ADMIN = 3; // self::REGISTER_ACTIVATION_USER + self::REGISTER_ACTIVATION_ADMIN
-
/**
* @inheritDoc
*/
use wcf\data\user\User;
use wcf\data\user\UserAction;
use wcf\data\user\UserList;
-use wcf\data\user\UserProfile;
use wcf\system\email\mime\MimePartFacade;
use wcf\system\email\mime\RecipientAwareTextMimePart;
use wcf\system\email\Email;
// email
if (WCF::getSession()->getPermission('user.profile.canChangeEmail') && $this->email != WCF::getUser()->email && $this->email != WCF::getUser()->newEmail) {
- if (!(REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_USER) && mb_strtolower($this->email) == mb_strtolower(WCF::getUser()->email)) {
+ if (!(REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER) && mb_strtolower($this->email) == mb_strtolower(WCF::getUser()->email)) {
// update email
$updateParameters['email'] = $this->email;
$success[] = 'wcf.user.changeEmail.success';
}
- else if (REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_USER) {
+ else if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER) {
// get reactivation code
$activationCode = UserRegistrationUtil::getActivationCode();
namespace wcf\form;
use wcf\data\user\User;
use wcf\data\user\UserAction;
-use wcf\data\user\UserProfile;
use wcf\system\event\EventHandler;
use wcf\system\exception\IllegalLinkException;
use wcf\system\exception\NamedUserException;
use wcf\system\exception\UserInputException;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
-use wcf\util\CryptoUtil;
use wcf\util\HeaderUtil;
use wcf\util\StringUtil;
$this->saved();
// forward to index page
- if (REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_ADMIN && !$this->user->isActivated()) {
+ if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN && !$this->user->isActivated()) {
$redirectText = WCF::getLanguage()->getDynamicVariable('wcf.user.registerActivation.success.awaitAdminActivation');
}
else {
* @inheritDoc
*/
public function show() {
- if (!(REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_USER)) {
+ if (!(REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER)) {
throw new IllegalLinkException();
}
// generate activation code
$addDefaultGroups = true;
- if (!empty($this->blacklistMatches) || (REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_USER && !$registerVia3rdParty) || REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_ADMIN) {
+ if (!empty($this->blacklistMatches) || (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER && !$registerVia3rdParty) || REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN) {
$activationCode = UserRegistrationUtil::getActivationCode();
$emailConfirmCode = bin2hex(\random_bytes(20));
$this->additionalFields['activationCode'] = $activationCode;
}
// activation management
- if (REGISTER_ACTIVATION_METHOD == UserProfile::REGISTER_ACTIVATION_NONE && empty($this->blacklistMatches)) {
+ if (REGISTER_ACTIVATION_METHOD == User::REGISTER_ACTIVATION_NONE && empty($this->blacklistMatches)) {
$this->message = 'wcf.user.register.success';
UserGroupAssignmentHandler::getInstance()->checkUsers([$user->userID]);
}
- else if (REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_USER && empty($this->blacklistMatches)) {
+ else if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER && empty($this->blacklistMatches)) {
// registering via 3rdParty leads to instant activation
if ($registerVia3rdParty) {
$this->message = 'wcf.user.register.success';
$this->message = 'wcf.user.register.success.needActivation';
}
}
- else if (REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_ADMIN || !empty($this->blacklistMatches)) {
+ else if (REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_ADMIN || !empty($this->blacklistMatches)) {
$this->message = 'wcf.user.register.success.awaitActivation';
}
namespace wcf\form;
use wcf\data\user\User;
use wcf\data\user\UserAction;
-use wcf\data\user\UserProfile;
use wcf\system\email\mime\MimePartFacade;
use wcf\system\email\mime\RecipientAwareTextMimePart;
use wcf\system\email\Email;
* @inheritDoc
*/
public function show() {
- if (!(REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_USER)) {
+ if (!(REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER)) {
throw new IllegalLinkException();
}
use wcf\data\user\group\UserGroup;
use wcf\data\user\User;
use wcf\data\user\UserAction;
-use wcf\data\user\UserProfile;
use wcf\system\database\util\PreparedStatementConditionBuilder;
use wcf\system\request\LinkHandler;
use wcf\system\WCF;
*/
protected function validateResendActivationMail() {
// check permissions
- if (!WCF::getSession()->getPermission('admin.user.canEnableUser') || !(REGISTER_ACTIVATION_METHOD & UserProfile::REGISTER_ACTIVATION_USER)) {
+ if (!WCF::getSession()->getPermission('admin.user.canEnableUser') || !(REGISTER_ACTIVATION_METHOD & User::REGISTER_ACTIVATION_USER)) {
return [];
}