use wcf\system\application\ApplicationHandler;
use wcf\system\cache\builder\CoreObjectCacheBuilder;
use wcf\system\cronjob\CronjobScheduler;
+use wcf\system\exception\AJAXException;
use wcf\system\exception\IPrintableException;
+use wcf\system\exception\NamedUserException;
use wcf\system\exception\PermissionDeniedException;
use wcf\system\exception\SystemException;
use wcf\system\language\LanguageFactory;
throw new PermissionDeniedException();
}
}
+
+ // handle banned users
+ if (WCF::getUser()->userID && WCF::getUser()->banned) {
+ if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')) {
+ throw new AJAXException(WCF::getLanguage()->getDynamicVariable('wcf.user.error.isBanned'), AJAXException::INSUFFICIENT_PERMISSIONS);
+ }
+ else {
+ throw new NamedUserException(WCF::getLanguage()->getDynamicVariable('wcf.user.error.isBanned'));
+ }
+ }
}
/**
// handle offline mode
if (!$isACPRequest && defined('OFFLINE') && OFFLINE) {
if (!WCF::getSession()->getPermission('admin.general.canViewPageDuringOfflineMode') && !$this->activeRequest->isAvailableDuringOfflineMode()) {
- if (isset($_SERVER['X-Requested-With']) && ($_SERVER['X-Requested-With'] == 'XMLHttpRequest')) {
+ if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest')) {
throw new AJAXException(WCF::getLanguage()->get('wcf.ajax.error.permissionDenied'), AJAXException::INSUFFICIENT_PERMISSIONS);
}
else {
<item name="wcf.user.option.error.tooLong"><![CDATA[Der eingegebene Text ist zu lang.]]></item>
<item name="wcf.user.option.error.tooShort"><![CDATA[Der eingegebene Text ist zu kurz.]]></item>
<item name="wcf.user.option.error.validationFailed"><![CDATA[Sie haben einen ungültigen Inhalt eingegeben.]]></item>
+ <item name="wcf.user.error.isBanned"><![CDATA[Ihr Benutzeraccount wurde gesperrt{if $__wcf->user->banReason}: {@$__wcf->user->banReason|htmlspecialchars|nl2br}{else}.{/if}]]></item>
</category>
</language>
<item name="wcf.user.option.error.tooLong"><![CDATA[Entered text is too long.]]></item>
<item name="wcf.user.option.error.tooShort"><![CDATA[Entered text is too short.]]></item>
<item name="wcf.user.option.error.validationFailed"><![CDATA[Entered text is invalid.]]></item>
+ <item name="wcf.user.error.isBanned"><![CDATA[Your user account has been banned{if $__wcf->user->banReason}: {@$__wcf->user->banReason|htmlspecialchars|nl2br}{else}.{/if}]]></item>
</category>
</language>
languageID INT(10) NOT NULL DEFAULT 0,
registrationDate INT(10) NOT NULL DEFAULT 0,
styleID INT(10) NOT NULL DEFAULT 0,
+ banned TINYINT(1) NOT NULL DEFAULT 0,
+ banReason MEDIUMTEXT NULL,
KEY username (username),
KEY registrationDate (registrationDate),