aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/settings/avatar.php
blob: 067e346bbc3df54de967529fe6ba0894a5a542dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php

class Settings_AvatarController extends AuthenticatedController
{
    public function before_filter(&$action, &$args)
    {
        parent::before_filter($action, $args);

        if (!$GLOBALS['perm']->have_profile_perm('user', User::findCurrent()->id)) {
            throw new AccessDeniedException(_('Sie dürfen dieses Profil nicht bearbeiten'));
        }
    }
    public function index_action()
    {
        PageLayout::setTitle(_('Profilbild anpassen'));
        Navigation::activateItem('/profile/edit/avatar');
        $this->user_id = User::findCurrent()->id;
        $avatar = Avatar::getAvatar($this->user_id);
        $this->avatar_url = $avatar->getURL(Avatar::NORMAL);
    }
}