X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile.php;h=34f431d344a78be73f2ba8c4b60b8d093d480797;hb=972fd3c59f152b7f2d61f7aa30afc819f094e4aa;hp=e1004c9d33ec5f08bc738455be686d26dcb1377f;hpb=459e6f8179a60e4ed026e3feb2e92d1c5b0df479;p=platal.git diff --git a/modules/profile.php b/modules/profile.php index e1004c9..34f431d 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -253,9 +253,9 @@ class ProfileModule extends PLModule $page->changeTpl('profile/profile.tpl', SIMPLE); // Determines the access level at which the profile will be displayed. - if (!S::logged() || Env::v('view') == 'public') { + if (!S::logged() || !S::user()->checkPerms('directory_ax') || Env::v('view') == 'public') { $view = 'public'; - } else if (S::logged() && Env::v('view') == 'ax') { + } else if (!S::user()->checkPerms('directory_private') || Env::v('view') == 'ax') { $view = 'ax'; } else { $view = 'private'; @@ -329,11 +329,15 @@ class ProfileModule extends PLModule $this->load('page.inc.php'); $wiz->addPage('ProfileSettingGeneral', 'Général', 'general'); $wiz->addPage('ProfileSettingAddresses', 'Adresses personnelles', 'adresses'); - $wiz->addPage('ProfileSettingGroups', 'Groupes X - Binets', 'poly'); - $wiz->addPage('ProfileSettingDecos', 'Décorations - Medailles', 'deco'); $wiz->addPage('ProfileSettingJobs', 'Informations professionnelles', 'emploi'); - $wiz->addPage('ProfileSettingSkills', 'Compétences diverses', 'skill'); - $wiz->addPage('ProfileSettingMentor', 'Mentoring', 'mentor'); + if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) { + $wiz->addPage('ProfileSettingGroups', 'Groupes X - Binets', 'poly'); + } + $wiz->addPage('ProfileSettingDecos', 'Décorations - Medailles', 'deco'); + if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) { + $wiz->addPage('ProfileSettingSkills', 'Compétences diverses', 'skill'); + $wiz->addPage('ProfileSettingMentor', 'Mentoring', 'mentor'); + } $wiz->apply($page, 'profile/edit/' . $profile->hrid(), $opened_tab, $mode); if (!$profile->birthdate) { @@ -392,7 +396,8 @@ class ProfileModule extends PLModule $page->assign('prefid', $prefid); $page->assign('prefname', $prefname); $page->assign('telid', $telid); - $page->assign('tel', array()); + $phone = new Phone(); + $page->assign('tel', $phone->toFormArray()); } function handler_ajax_edu(&$page, $eduid, $class)