'admin/validate/answers' => $this->make_hook('validate_answers', AUTH_MDP, 'admin'),
'admin/wiki' => $this->make_hook('wiki', AUTH_MDP, 'admin'),
'admin/ipwatch' => $this->make_hook('ipwatch', AUTH_MDP, 'admin'),
+ 'admin/icons' => $this->make_hook('icons', AUTH_MDP, 'admin'),
);
}
require_once("user.func.inc.php");
if (S::has('suid')) {
- $page->kill("déjà en SUID !!!");
+ $page->kill("déjà en SUID !!!");
}
if (Env::has('user_id')) {
ORDER BY u.promo,u.nom,u.prenom');
$page->assign('diffs', $res->fetchAllAssoc());
- // gens à l'ax mais pas chez nous
+ // gens à l'ax mais pas chez nous
$res = XDB::query(
'SELECT ia.promo,ia.nom,ia.nom_patro,ia.prenom
FROM identification_ax as ia
WHERE u.nom IS NULL');
$page->assign('mank', $res->fetchAllAssoc());
- // gens chez nous et pas à l'ax
+ // gens chez nous et pas à l'ax
$res = XDB::query('SELECT promo,nom,prenom FROM auth_user_md5 WHERE matricule_ax IS NULL');
$page->assign('plus', $res->fetchAllAssoc());
}
}
}
- function handler_validate(&$page, $action = 'list', $id = null) {
+ function handler_validate(&$page, $action = 'list', $id = null)
+ {
$page->changeTpl('admin/valider.tpl');
$page->assign('xorg_title','Polytechnique.org - Administration - Valider une demande');
$page->addCssLink('nl.css');
- require_once("validations.inc.php");
+ $page->addJsLink('ajax.js');
+ require_once("validations.inc.php");
+
if ($action == 'edit' and !is_null($id)) {
$page->assign('preview_id', $id);
$page->assign('vit', new ValidateIterator());
}
+
function handler_validate_answers(&$page, $action = 'list', $id = null) {
$page->assign('xorg_title','Polytechnique.org - Administration - Réponses automatiques de validation');
$page->assign('title', 'Gestion des réponses automatiques');
$table_editor->apply($page, $action, $id);
}
- function handler_wiki(&$page, $action='list')
+ function handler_wiki(&$page, $action='list', $wikipage='', $wikipage2='')
{
require_once 'wiki.inc.php';
}
}
}
+
+ if ($action == 'delete' && $wikipage != '') {
+ if (wiki_delete_page($wikipage)) {
+ $page->trig("La page ".$wikipage." a été supprimée.");
+ } else {
+ $page->trig("Impossible de supprimer la page ".$wikipage.".");
+ }
+ }
+
+ if ($action == 'rename' && $wikipage != '' && $wikipage2 != '' && $wikipage != $wikipage2) {
+ if ($changedLinks = wiki_rename_page($wikipage, $wikipage2)) {
+ $s = 'La page <em>'.$wikipage.'</em> a été déplacée en <em>'.$wikipage2.'</em>.';
+ if (is_numeric($changedLinks)) {
+ $s .= $changedLinks.' lien'.(($changedLinks>1)?'s ont été modifiés.':' a été modifié.');
+ }
+ $page->trig($s);
+ } else {
+ $page->trig("Impossible de déplacer la page ".$wikipage);
+ }
+ }
$perms = wiki_perms_options();
$page->changeTpl('admin/wiki.tpl');
+ $page->addJsLink('jquery.js');
$page->assign('wiki_pages', $wiki_tree);
$page->assign('perms_opts', $perms);
}
$page->changeTpl('admin/ipwatcher.tpl');
$states = array('safe' => 'Ne pas surveiller',
- 'unsafe' => 'Surveiller les inscription',
+ 'unsafe' => 'Surveiller les inscriptions',
'dangerous' => 'Surveiller tous les accès',
'ban' => 'Bannir cette adresse');
$page->assign('states', $states);
$page->assign('ip', $props);
}
}
+
+ function handler_icons(&$page)
+ {
+ $page->changeTpl('admin/icons.tpl');
+ $dh = opendir('../htdocs/images/icons');
+ if (!$dh) {
+ $page->trig('Dossier des icones introuvables.');
+ }
+ $icons = array();
+ while (($file = readdir($dh)) !== false) {
+ if (strlen($file) > 4 && substr($file,-4) == '.gif') {
+ array_push($icons, substr($file, 0, -4));
+ }
+ }
+ sort($icons);
+ $page->assign('icons', $icons);
+ }
}
// vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: