$site = "";
}
if (S::has_perms()) {
+ $dom = XDB::iterator('SELECT *
+ FROM group_dom
+ ORDER BY nom');
+ $page->assign('dom', $dom);
+ $page->assign('super', true);
+
if (Post::v('mail_domain') && (strstr(Post::v('mail_domain'), '.') === false)) {
$page->trigError('Le domaine doit être un FQDN (aucune modification effectuée) !!!');
return;
}
+ if (Post::t('nom') == '' || Post::t('diminutif') == '') {
+ $page->trigError('Ni le nom ni le diminutif du groupe ne peuvent être vide.');
+ return;
+ }
XDB::execute(
"UPDATE groups
SET nom={?}, diminutif={?}, cat={?}, dom={?},
pl_redirect('../'.Post::v('diminutif', $globals->asso('diminutif')).'/edit');
}
-
- if (S::admin()) {
- $dom = XDB::iterator('SELECT * FROM group_dom ORDER BY nom');
- $page->assign('dom', $dom);
- $page->assign('super', true);
- }
}
function handler_mail(&$page)
{
global $globals;
- if ($action == 'search') {
- http_redirect("https://www.polytechnique.org/search/adv?rechercher=Chercher&groupex={$globals->asso('id')}"
- . "&cityid=" . Env::v('cityid') . "&mapid=" . Env::v('mapid'));
- } else if ($action == 'geoloc' || $action == 'trombi') {
- $view = new UserSet();
+ if ($action == 'trombi') {
+ __autoload('userset');
+ if ($action == 'trombi') {
+ $view = new ProfileSet(new UFC_Group($globals->asso('id')));
+ } else {
+ $view = new UserSet(new UFC_Group($globals->asso('id')));
+ }
$view->addMod('trombi', 'Trombinoscope');
- // TODO: Reactivate when the new map is completed.
- // $view->addMod('geoloc', 'Planisphère', false, array('with_annu' => 'annuaire/search'));
$view->apply('annuaire', $page, $action, $subaction);
- if ($action == 'geoloc' && $subaction) {
- return;
- }
+ $page->changeTpl('xnetgrp/annuaire.tpl');
+ return;
}
- $page->changeTpl('xnetgrp/annuaire.tpl');
+ $page->changeTpl('xnetgrp/annuaire.tpl');
$sort = Env::s('order', 'directory_name');
$ofs = Env::i('offset');
if ($ofs < 0) {
WHERE a.alias = {?}",
$login);
if ($res->numRows() == 0) {
- // TODO: replace this call to a removed function.
- $x = get_not_registered_user($login);
- if (!$x) {
- $page->trigError("Le login $login ne correspond à aucun X.");
+ $accounts = User::getPendingAccounts($login);
+ if (!$accounts) {
+ $page->trigError("L'identifiant $login ne correspond à aucun X.");
return false;
- } else if (count($x) > 1) {
- $page->trigError("Le login $login correspond a plusieurs camarades.");
+ } else if (count($accounts) > 1) {
+ $page->trigError("L'identifiant $login correspond à plusieurs camarades.");
return false;
}
- $uid = $x[0]['uid'];
+ $uid = $accounts[0]['uid'];
$sub = false;
} else {
list($uid, $login) = $res->fetchOneRow();