Cannot configure mbox-helper and banana's spool root anymore.
[platal.git] / modules / profile.php
index d7cd55f..26a5046 100644 (file)
@@ -92,7 +92,6 @@ class ProfileModule extends PLModule
 
         // Retrieve the photo and its mime type.
         if ($req && S::logged()) {
-            include 'validations.inc.php';
             $myphoto = PhotoReq::get_request($profile->id());
             $photo = PlImage::fromData($myphoto->data, $myphoto->mimetype);
         } else {
@@ -179,8 +178,6 @@ class ProfileModule extends PLModule
         $page->changeTpl('profile/trombino.tpl');
         $page->assign('hrpid', $profile->hrid());
 
-        require_once('validations.inc.php');
-
         $trombi_x = '/home/web/trombino/photos' . $profile->promo() . '/' . $profile->hrid() . '.jpg';
         if (Env::has('upload')) {
             S::assert_xsrf_token();
@@ -327,13 +324,17 @@ class ProfileModule extends PLModule
         $wiz->addUserData('profile', $profile);
         $wiz->addUserData('owner', $profile->owner());
         $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');
+        $wiz->addPage('ProfilePageGeneral', 'Général', 'general');
+        $wiz->addPage('ProfilePageAddresses', 'Adresses personnelles', 'adresses');
+        $wiz->addPage('ProfilePageJobs', 'Informations professionnelles', 'emploi');
+        if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) {
+            $wiz->addPage('ProfilePageGroups', 'Groupes X - Binets', 'poly');
+        }
+        $wiz->addPage('ProfilePageDecos', 'Décorations - Medailles', 'deco');
+        if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) {
+            $wiz->addPage('ProfilePageSkills', 'Compétences diverses', 'skill');
+            $wiz->addPage('ProfilePageMentor', 'Mentoring', 'mentor');
+        }
         $wiz->apply($page, 'profile/edit/' . $profile->hrid(), $opened_tab, $mode);
 
         if (!$profile->birthdate) {
@@ -392,7 +393,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)