<?php
/***************************************************************************
- * Copyright (C) 2003-2011 Polytechnique.org *
+ * Copyright (C) 2003-2014 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
if (!$user->hasProfile()) {
return PL_NOT_FOUND;
} else {
- $profile = $user->profile();
+ $profile = $user->profile(false,0,Visibility::get(Visibility::VIEW_ADMIN));
}
} else {
- $profile = Profile::get($hrpid);
+ $profile = Profile::get($hrpid,0,Visibility::get(Visibility::VIEW_ADMIN));
}
if (!$profile) {
}
// Determines the access level at which the profile will be displayed.
+ // Note: VIEW_HIDDEN can NOT be selected. The admins who want to read
+ // information need to use the "edit profile" pages instead.
if (Env::v('view') == 'public') {
$view = Visibility::VIEW_PUBLIC;
} else if (Env::v('view') == 'ax') {
if (!$user->ax_id) {
$page->kill("Le matricule AX de {$user->hrid()} est inconnu");
}
- http_redirect("http://www.polytechniciens.com/?page=AX_FICHE_ANCIEN&ancc_id=" . $user->ax_id);
+ http_redirect("http://kx.polytechniciens.com/?page=AX_FICHE_ANCIEN&ancc_id=" . $user->ax_id);
}
function handler_p_edit($page, $hrpid = null, $opened_tab = null, $mode = null, $success = null)
$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)) {
+ $viewPrivate = S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE);
+ if ($viewPrivate) {
$wiz->addPage('ProfilePageGroups', 'Groupes X - Binets', 'poly');
}
$wiz->addPage('ProfilePageDecos', 'Décorations - Medailles', 'deco');
- if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE)) {
+ if ($viewPrivate) {
$wiz->addPage('ProfilePageMentor', 'Mentoring', 'mentor');
}
- if (S::user()->checkPerms(User::PERM_DIRECTORY_PRIVATE) && $profile->isDeltatenEnabled(Profile::DELTATEN_OLD)) {
+ if ($viewPrivate && $profile->isDeltatenEnabled(Profile::DELTATEN_OLD)) {
$wiz->addPage('ProfilePageDeltaten', 'Opération N N-10', 'deltaten');
}
$wiz->apply($page, 'profile/edit/' . $profile->hrid(), $opened_tab, $mode);
$page->setTitle('Mon Profil');
$page->assign('hrpid', $profile->hrid());
+ $page->assign('viewPrivate', $viewPrivate);
+ $page->assign('isMe', S::user()->isMyProfile($profile));
if (isset($success) && $success) {
$page->trigSuccess('Ton profil a bien été mis à jour.');
}
function handler_education_js($page)
{
- pl_cached_content_headers("text/javascript", "utf-8");
+ pl_cached_dynamic_content_headers('text/javascript', 'utf-8');
$page->changeTpl('profile/education.js.tpl', NO_SKIN);
require_once 'education.func.inc.php';
}
pl_content_headers("text/html");
$page->changeTpl('profile/adresses.address.tpl', NO_SKIN);
$page->assign('i', $id);
- $page->assign('address', array());
+ $page->assign('address', array('mail' => true));
$page->assign('profile', Profile::get($pid));
$page->assign('isMe', true);
$page->assign('geocoding_removal', true);
return PL_NOT_FOUND;
}
+ // Referent view are logged.
+ if (S::logged()) {
+ S::logger()->log('view_referent', $pf->hrid());
+ }
+
$page->assign_by_ref('profile', $pf);
// Retrieves referents' countries.
}
}
-// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8:
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8:
?>