{include file='userNotice'}
+{include file='formErrorSecurityToken'}
+
{if $__wcf->user->disableAvatar}
<p class="error">{lang}wcf.user.avatar.error.disabled{/lang}</p>
{/if}
{if !$__wcf->user->disableAvatar}
<div class="formSubmit">
<input type="submit" value="{lang}wcf.global.button.submit{/lang}" accesskey="s" />
+ {@SECURITY_TOKEN_INPUT_TAG}
</div>
{/if}
</form>
--- /dev/null
+{if $errorField}
+ {if ($errorField|is_array && $errorField[__securityToken]|isset) || $errorField == '__securityToken'}
+ <p class="error">{lang}wcf.global.form.error.securityToken{/lang}</p>
+ {/if}
+{/if}
\ No newline at end of file
<?php
namespace wcf\form;
-use wcf\system\exception\IllegalLinkException;
+use wcf\system\exception\UserInputException;
use wcf\system\WCF;
/**
* Extends AbstractForm by a function to validate a given security token.
- * A missing or invalid token will be result in a throw of a IllegalLinkException.
+ * A missing or invalid token will be result in a throw of a UserInputException.
*
* @author Marcel Werk
* @copyright 2001-2013 WoltLab GmbH
*/
abstract class AbstractSecureForm extends AbstractForm {
/**
- * @see wcf\form\IForm::readFormParameters()
+ * @see wcf\form\IForm::validate()
*/
- public function readFormParameters() {
- parent::readFormParameters();
+ public function validate() {
+ parent::validate();
- // check security token
$this->checkSecurityToken();
}
*/
protected function checkSecurityToken() {
if (!isset($_POST['t']) || !WCF::getSession()->checkSecurityToken($_POST['t'])) {
- throw new IllegalLinkException();
+ throw new UserInputException('__securityToken');
}
}
}