zikula-modules / Avatar

A Zikula module to organize users avatars, incl. support for Gravatar
https://zikula.de
13 stars 5 forks source link

Error when uploading avatars. #12

Closed hvorragend closed 11 years ago

hvorragend commented 12 years ago

Created by @Boddah here: https://github.com/zikula-modules/Avatar/issues/1


Hi,

Everytime i attempt to upload an avatar in My Account / Avatar Management I get the following error:

Sorry! Invalid authorisation key ('authkey'). This is probably either because you pressed the 'Back' button to return to a >page which does not allow that, or else because the page's authorisation key expired due to prolonged inactivity. Please >refresh the page and try again.

The avatar directory is writeable by the web server, I've tried changing the Avatar settings to not resize images, but to no avail. I've done some reading around and there seems to be some other people who have run into this error with other modules and it seems to relate to the Security settings, but I'm not having any luck whatsoever sorting it out.

Does anyone have any insight, or think they may be able to help solve this issue? Running Zikula 1.3.2.

hvorragend commented 12 years ago

Comment by @Guite in the original ticket:

  1. in _templates/Avatar_useruploadform.htm replace

    <input type="hidden" name="authid" value="{insert name="csrftoken" module="Avatar"}" />

by

    <input type="hidden" name="csrftoken" value="{insert name='csrftoken'}" />
  1. in lib/Avatar/Controller/User.php replace

    if (!SecurityUtil::confirmAuthKey()) {
       return LogUtil::registerAuthidError();
    }

by

    $this->checkCsrfToken();

This should do it :-)