X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fprofile.php;h=e200bd53d002b2b22f5de2617ae53dcda531c7ba;hb=15d26d450f109e27b8fad7839d98ebae788147e7;hp=c7807864c79c8f7335bdf0f77bfa954d8bd1ab2f;hpb=d89a495539357b3ad30f7b891bd23d1805355a52;p=platal.git diff --git a/modules/profile.php b/modules/profile.php index c780786..e200bd5 100644 --- a/modules/profile.php +++ b/modules/profile.php @@ -25,15 +25,15 @@ class ProfileModule extends PLModule { return array( 'photo' => $this->make_hook('photo', AUTH_PUBLIC), - 'photo/change' => $this->make_hook('photo_change', AUTH_MDP, 'user'), + 'photo/change' => $this->make_hook('photo_change', AUTH_PASSWD, 'user'), 'fiche.php' => $this->make_hook('fiche', AUTH_PUBLIC), 'profile' => $this->make_hook('profile', AUTH_PUBLIC), 'profile/private' => $this->make_hook('profile', AUTH_COOKIE, 'user'), 'profile/ax' => $this->make_hook('ax', AUTH_COOKIE, 'admin,edit_directory'), - 'profile/edit' => $this->make_hook('p_edit', AUTH_MDP, 'user'), + 'profile/edit' => $this->make_hook('p_edit', AUTH_PASSWD, 'user'), 'profile/ajax/address' => $this->make_hook('ajax_address', AUTH_COOKIE, 'user', NO_AUTH), - 'profile/ajax/address/del' => $this->make_hook('ajax_address_del', AUTH_MDP, 'user'), + 'profile/ajax/address/del' => $this->make_hook('ajax_address_del', AUTH_PASSWD, 'user'), 'profile/ajax/tel' => $this->make_hook('ajax_tel', AUTH_COOKIE, 'user', NO_AUTH), 'profile/ajax/edu' => $this->make_hook('ajax_edu', AUTH_COOKIE, 'user', NO_AUTH), 'profile/ajax/medal' => $this->make_hook('ajax_medal', AUTH_COOKIE, 'user', NO_AUTH), @@ -57,17 +57,17 @@ class ProfileModule extends PLModule 'groupes-x/logo' => $this->make_hook('xnetlogo', AUTH_PUBLIC), 'vcard' => $this->make_hook('vcard', AUTH_COOKIE, 'user', NO_HTTPS), - 'admin/binets' => $this->make_hook('admin_binets', AUTH_MDP, 'admin'), - 'admin/medals' => $this->make_hook('admin_medals', AUTH_MDP, 'admin'), - 'admin/education' => $this->make_hook('admin_education', AUTH_MDP, 'admin'), - 'admin/education_field' => $this->make_hook('admin_education_field', AUTH_MDP, 'admin'), - 'admin/education_degree' => $this->make_hook('admin_education_degree', AUTH_MDP, 'admin'), - 'admin/education_degree_set' => $this->make_hook('admin_education_degree_set', AUTH_MDP, 'admin'), - 'admin/sections' => $this->make_hook('admin_sections', AUTH_MDP, 'admin'), - 'admin/networking' => $this->make_hook('admin_networking', AUTH_MDP, 'admin'), - 'admin/trombino' => $this->make_hook('admin_trombino', AUTH_MDP, 'admin'), - 'admin/corps_enum' => $this->make_hook('admin_corps_enum', AUTH_MDP, 'admin'), - 'admin/corps_rank' => $this->make_hook('admin_corps_rank', AUTH_MDP, 'admin'), + 'admin/binets' => $this->make_hook('admin_binets', AUTH_PASSWD, 'admin'), + 'admin/medals' => $this->make_hook('admin_medals', AUTH_PASSWD, 'admin'), + 'admin/education' => $this->make_hook('admin_education', AUTH_PASSWD, 'admin'), + 'admin/education_field' => $this->make_hook('admin_education_field', AUTH_PASSWD, 'admin'), + 'admin/education_degree' => $this->make_hook('admin_education_degree', AUTH_PASSWD, 'admin'), + 'admin/education_degree_set' => $this->make_hook('admin_education_degree_set', AUTH_PASSWD, 'admin'), + 'admin/sections' => $this->make_hook('admin_sections', AUTH_PASSWD, 'admin'), + 'admin/networking' => $this->make_hook('admin_networking', AUTH_PASSWD, 'admin'), + 'admin/trombino' => $this->make_hook('admin_trombino', AUTH_PASSWD, 'admin'), + 'admin/corps_enum' => $this->make_hook('admin_corps_enum', AUTH_PASSWD, 'admin'), + 'admin/corps_rank' => $this->make_hook('admin_corps_rank', AUTH_PASSWD, 'admin'), ); } @@ -301,7 +301,7 @@ class ProfileModule extends PLModule { global $globals; - if (in_array($hrpid, array('general', 'adresses', 'emploi', 'poly', 'deco', 'skill', 'mentor', 'deltaten'))) { + if (in_array($hrpid, array('general', 'adresses', 'emploi', 'poly', 'deco', 'mentor', 'deltaten'))) { $aux = $opened_tab; $opened_tab = $hrpid; $hrpid = $aux; @@ -333,7 +333,6 @@ class ProfileModule extends PLModule } $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'); } if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE) && $profile->isDeltatenEnabled(Profile::DELTATEN_OLD)) { @@ -427,8 +426,12 @@ class ProfileModule extends PLModule { pl_content_headers("text/html"); $page->changeTpl('profile/deco.medal.tpl', NO_SKIN); + list($valid, $has_levels) = XDB::fetchOneRow("SELECT NOT FIND_IN_SET('validation', flags), FIND_IN_SET('has_levels', flags) + FROM profile_medal_enum + WHERE id = {?}", + $id); $page->assign('id', $i); - $page->assign('medal', array('id' => $id, 'grade' => 0, 'valid' => 0)); + $page->assign('medal', array('id' => $id, 'grade' => 0, 'valid' => $valid, 'has_levels' => $has_levels)); } function handler_ajax_job($page, $id, $pid)