From: x2000habouzit Date: Sat, 2 Oct 2004 15:34:53 +0000 (+0000) Subject: simplifications X-Git-Tag: xorg/old~1457 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=773cdcaf0d72f709e8ee37ea86d1fb7a4d5e78c2;p=platal.git simplifications --- diff --git a/scripts/cron/checkdb.php b/scripts/cron/checkdb.php index f2d87d8..9794a56 100755 --- a/scripts/cron/checkdb.php +++ b/scripts/cron/checkdb.php @@ -19,21 +19,15 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: checkdb.php,v 1.2 2004-10-02 15:28:11 x2000habouzit Exp $ + $Id: checkdb.php,v 1.3 2004-10-02 15:34:53 x2000habouzit Exp $ ***************************************************************************/ /* * verifie qu'il n'y a pas d'incoherences dans les tables de jointures * - * $Id: checkdb.php,v 1.2 2004-10-02 15:28:11 x2000habouzit Exp $ + * $Id: checkdb.php,v 1.3 2004-10-02 15:34:53 x2000habouzit Exp $ */ -ini_set("include_path","/usr/share/php"); - -require("../../include/xorg.misc.inc.php"); -require("../../include/config.xorg.inc.php"); -mysql_connect($globals->dbhost,$globals->dbuser,$globals->dbpwd); -mysql_select_db($globals->dbdb); - +require('./connect.db.inc.php'); require("Console/Getopt.php"); function check($sql, $commentaire='') { diff --git a/scripts/cron/clean.php b/scripts/cron/clean.php index 54fe871..1cd6bf3 100755 --- a/scripts/cron/clean.php +++ b/scripts/cron/clean.php @@ -19,12 +19,10 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: clean.php,v 1.2 2004-10-02 15:28:11 x2000habouzit Exp $ + $Id: clean.php,v 1.3 2004-10-02 15:34:53 x2000habouzit Exp $ ***************************************************************************/ -require("../../include/xorg.misc.inc.php"); -require("../../include/config.xorg.inc.php"); -mysql_connect($globals->dbhost,$globals->dbuser,$globals->dbpwd); -mysql_select_db($globals->dbdb); + +require('./connect.db.inc.php'); function query ($sql) { mysql_query($sql); diff --git a/scripts/cron/connect.db.inc.php b/scripts/cron/connect.db.inc.php new file mode 100644 index 0000000..ece77f6 --- /dev/null +++ b/scripts/cron/connect.db.inc.php @@ -0,0 +1,29 @@ +dbhost,$globals->dbuser,$globals->dbpwd); +mysql_select_db($globals->dbdb); +?> diff --git a/scripts/cron/cron_validations.php b/scripts/cron/cron_validations.php index 30f4c67..bc8f087 100755 --- a/scripts/cron/cron_validations.php +++ b/scripts/cron/cron_validations.php @@ -19,24 +19,19 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: cron_validations.php,v 1.1 2004-10-02 15:28:11 x2000habouzit Exp $ + $Id: cron_validations.php,v 1.2 2004-10-02 15:34:53 x2000habouzit Exp $ ***************************************************************************/ /* vim: set sw=4 ts=4 sts=4 tw=100: * vérifie qu'il n'y a pas de validations en cours, et maile si c'est le cas * - * $Id: cron_validations.php,v 1.1 2004-10-02 15:28:11 x2000habouzit Exp $ + * $Id: cron_validations.php,v 1.2 2004-10-02 15:34:53 x2000habouzit Exp $ */ $M_PERIOD = "INTERVAL 3 HOUR"; // période d'envoi des mails de 3h $R_PERIOD = "INTERVAL 6 HOUR"; // période de réponse moyenne de 6h -ini_set("include_path","/usr/share/php"); -require("../../include/xorg.misc.inc.php"); -require("../../include/config.xorg.inc.php"); require("../../../diogenes/lib/diogenes.mailer.inc.php"); - -mysql_connect($globals->dbhost,$globals->dbuser,$globals->dbpwd); -mysql_select_db($globals->dbdb); +require('./connect.db.inc.php'); $sql = mysql_query("SELECT count(stamp), sum(stamp < NOW() - $M_PERIOD), sum(stamp < NOW() - $R_PERIOD) FROM x4dat.requests"); list($nb,$nbold,$nbveryold) = mysql_fetch_row($sql); diff --git a/scripts/cron/recherche.php b/scripts/cron/recherche.php index 38a551b..d45536a 100644 --- a/scripts/cron/recherche.php +++ b/scripts/cron/recherche.php @@ -19,14 +19,10 @@ * Foundation, Inc., * * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * *************************************************************************** - $Id: recherche.php,v 1.3 2004-10-02 15:02:06 x2000habouzit Exp $ + $Id: recherche.php,v 1.4 2004-10-02 15:34:53 x2000habouzit Exp $ ***************************************************************************/ -require("../../include/xorg.misc.inc.php"); -require("../../include/config.xorg.inc.php"); - -mysql_connect($globals->dbhost,$globals->dbuser,$globals->dbpwd); -mysql_select_db($globals->dbdb); +require('./connect.db.inc.php'); $result = mysql_query("SELECT matricule,nom1,nom2,nom3,prenom1,prenom2,promo FROM recherche");