'carnet/notifs' => $this->make_hook('notifs', AUTH_COOKIE),
'carnet/contacts' => $this->make_hook('contacts', AUTH_COOKIE),
- 'carnet/contacts/pdf' => $this->make_hook('pdf', AUTH_COOKIE, 'user', NO_HTTPS),
+ 'carnet/contacts/pdf' => $this->make_hook('pdf', AUTH_COOKIE),
+ 'carnet/contacts/vcard' => $this->make_hook('vcard', AUTH_COOKIE),
'carnet/contacts/ical' => $this->make_hook('ical', AUTH_PUBLIC, 'user', NO_HTTPS),
- 'carnet/contacts/vcard' => $this->make_hook('vcard', AUTH_COOKIE, 'user', NO_HTTPS),
'carnet/rss' => $this->make_hook('rss', AUTH_PUBLIC, 'user', NO_HTTPS),
);
private function getSinglePromotion(PlPage &$page, $promo)
{
if (!ctype_digit($promo) || $promo < 1920 || $promo > date('Y')) {
- $page->trigError('Promotion invalide : ' . $promo);
+ $page->trigError('Promotion invalide : ' . $promo . '.');
return null;
}
return (int)$promo;
return null;
}
if ($promo1 > $promo2) {
- $page->trigError("Intervale non valide : " . $promo);
+ $page->trigError('Intervalle non valide : ' . $promo . '.');
return null;
}
$array = array();
$page->setTitle('Mes contacts');
$this->_add_rss_link($page);
- $uid = S::v('uid');
+ $uid = S::i('uid');
$user = Env::v('user');
// For XSRF protection, checks both the normal xsrf token, and the special RSS token.
if (($user = User::get(Env::v('user')))) {
if (XDB::execute("DELETE FROM contacts
WHERE uid = {?} AND contact = {?}", $uid, $user->id())) {
- $page->trigSuccess("Contact retiré !");
+ $page->trigSuccess("Contact retiré !");
}
}
break;
if (($user = User::get(Env::v('user')))) {
if (XDB::execute("REPLACE INTO contacts (uid, contact)
VALUES ({?}, {?})", $uid, $user->id())) {
- $page->trigSuccess('Contact ajouté !');
+ $page->trigSuccess('Contact ajouté !');
} else {
- $page->trigWarning('Contact déjà dans la liste !');
+ $page->trigWarning('Contact déjà dans la liste !');
}
}
break;
}
- $search = false;
+/* $search = false;
if ($action == 'search') {
$action = $subaction;
$subaction = $ssaction;
$search = true;
}
if ($search && trim(Env::v('quick'))) {
- require_once 'userset.inc.php';
$base = 'carnet/contacts/search';
Platal::load('search', 'classes.inc.php');
} else {
$base = 'carnet/contacts';
$view = new UserSet("INNER JOIN contacts AS c2 ON (u.user_id = c2.contact)", " c2.uid = $uid ");
- }
+ }*/
+
+ require_once 'userset.inc.php';
+ $user = S::user();
+ $view = new UserSet(new UFC_Contact($user));
$view->addMod('minifiche', 'Mini-fiches', true);
$view->addMod('trombi', 'Trombinoscope', false, array('with_admin' => false, 'with_promo' => true));
$view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'carnet/contacts/search'));
- $view->apply($base, $page, $action, $subaction);
- if ($action != 'geoloc' || ($search && !$ssaction) || (!$search && !$subaction)) {
- $page->changeTpl('carnet/mescontacts.tpl');
- }
+ $view->apply('carnet/contacts', $page, $action, $subaction);
+ //if ($action != 'geoloc' || ($search && !$ssaction) || (!$search && !$subaction)) {
+ $page->changeTpl('carnet/mescontacts.tpl');
+ //}
}
function handler_pdf(&$page, $arg0 = null, $arg1 = null)
}
$page->assign('events', $annivs);
- header('Content-Type: text/calendar; charset=utf-8');
+ pl_content_headers("text/calendar");
}
function handler_vcard(&$page, $photos = null)