- Try to avoid the unreadable {"..."|url} modifier, use {rel}/. -MC
- Use a real .conf file, and no more .php's for configuration. -MC
- Adds include/conf.d and the glob modifier. -MC
+ - Make raw access to POST/GET/... disappear. -MC
* Distribution :
- Do not modify PHP include path from auto.prepend.inc.php. -SHK
- New skin : openweb. -MC
- No more annoying submit button, onclick is used to submit. -MC
- This is the first autonom module of the site ! -MC
+
+ * Stats :
+ - Better y-range for graphs. -MC
* WebRedirect (was: Carva) : now standalone. -MC
$uid = Session::getInt('uid');
$pass = Env::get('smtppass1');
+$log = Env::getMixed('log');
if ( Env::get('op') == "Valider" && Env::get('smtppass1') == Env::get('smtppass2') && strlen($pass) >= 6 ) {
$globals->db->query("update auth_user_md5 set smtppass = '$pass' where user_id = $uid");
- $_SESSION['log']->log("passwd_ssl");
$page->trig('Mot de passe enregistré');
+ $log->log("passwd_ssl");
} elseif (Env::get('op') == "Supprimer") {
$globals->db->query("update auth_user_md5 set smtppass = '' where user_id = $uid");
- $_SESSION['log']->log("passwd_del");
$page->trig('Compte SMTP et NNTP supprimé');
+ $log->log("passwd_del");
}
-$result = $globals->db->query("select IF(smtppass != '', 'actif', '') from auth_user_md5 where user_id = ".$_SESSION['uid']);
+$result = $globals->db->query("select IF(smtppass != '', 'actif', '') from auth_user_md5 where user_id = ".$uid);
list($actif) = mysql_fetch_row($result);
mysql_free_result($result);
'smtp' => 'serveur sécurisé d\'envoi de mails',
'nntp' => 'serveur des forums de discussion');
$ret = Array();
- foreach($flags as $flag)
+ foreach ($flags as $flag) {
$ret[] = $trad[$flag];
+ }
return implode(', ',$ret);
}
-if (isset($_REQUEST['cp_id']))
- $res=$globals->db->query("select UNIX_TIMESTAMP(debut) AS debut, TIME_FORMAT(duree,'%kh%i') AS duree, resume, description, services from coupures where id='{$_REQUEST['cp_id']}'");
-else
- $res="";
-if(($res)&&($cp = mysql_fetch_assoc($res))) {
+if (Env::has('cp_id')) {
+ $res = $globals->db->query("SELECT UNIX_TIMESTAMP(debut) AS debut,
+ TIME_FORMAT(duree,'%kh%i') AS duree,
+ resume, description, services
+ FROM coupures
+ WHERE id = ".Env::getInt('cp_id'));
+ $cp = @mysql_fetch_assoc($res);
+}
+
+if($cp) {
$cp['lg_services'] = serv_to_str($cp['services']);
$page->assign_by_ref('cp',$cp);
} else {
***************************************************************************/
require_once("xorg.inc.php");
-new_skinned_page('index.tpl',AUTH_COOKIE);
-
-// genere le graph de l'evolution du nombre d'inscrits dans une promotion
-
-$promo = (isset($_REQUEST['promo']) ? intval($_REQUEST["promo"]) : $_SESSION["promo"]);
+new_skinned_page('index.tpl', AUTH_COOKIE);
+$promo = Env::getInt('promo', Session::getInt('promo'));
//nombre de jours sur le graph
$JOURS=364;
//Genere le graphique à la volée avec GNUPLOT
header( "Content-type: image/png");
-$gnuplot="gnuplot <<EOF\n";
-$param1="set term png small color\nset size 640/480\nset xdata time\nset timefmt \"%d/%m/%y\"\n";
-$param2="set format x \"%m/%y\"\nset yr [".round($init_nb*0.90,0).":]\n";
-$title="set title \"Nombre d'inscrits de la promotion ".$promo."\"\n";
-$plot="plot \"-\" using 1:2 title 'inscrits' with lines;\n".$inscrits."e\nEOF\n";
-$plot_command=$gnuplot.$param1.$param2.$title.$plot;
+$ymin = round($init_nb*0.95,0);
+$ymax = round($total *1.05,0);
+
+$gnuplot = <<<EOF2
+gnuplot <<EOF
+
+set term png small color
+set size 640/480
+set xdata time
+set timefmt "%d/%m/%y"
+
+set format x "%m/%y"
+set yr [$ymin:$ymax]
+
+set title "Nombre d'inscrits de la promotion $promo."
+
+plot "-" using 1:2 title 'inscrits' with lines;
+{$inscrits}e
+EOF
+EOF2;
-passthru($plot_command);
+passthru($gnuplot);
?>
require_once("xorg.inc.php");
new_skinned_page("stats/stats_promo.tpl", AUTH_COOKIE);
-$promo = isset($_REQUEST["promo"]) ? intval($_REQUEST["promo"]) : $_SESSION["promo"];
+$promo = Env::getInt('promo', Session::getInt('promo'));
$page->assign('promo',$promo);
$page->run();
+
?>