all globals things goes in $globals
authorx2000habouzit <x2000habouzit>
Sun, 21 Nov 2004 23:35:30 +0000 (23:35 +0000)
committerx2000habouzit <x2000habouzit>
Sun, 21 Nov 2004 23:35:30 +0000 (23:35 +0000)
YOUR config.xorg.inc.php is obsolete, please see ~x2000habouzit/config.xorg.inc.php !

12 files changed:
htdocs/admin/homonymes.php
htdocs/inscription/step3.php
htdocs/inscription/step4.php
htdocs/marketing/relance.php
htdocs/marketing/utilisateurs_marketing.php
htdocs/paiement/cyberpaiement.inc.php
htdocs/recovery.php
htdocs/x.php
include/xorg.common.inc.php
include/xorg.globals.inc.php.in
include/xorg.page.inc.php
scripts/cron/send_notifs.php

index b494746..121ce7e 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: homonymes.php,v 1.8 2004-11-16 21:02:45 x2000habouzit Exp $
+        $Id: homonymes.php,v 1.9 2004-11-21 23:35:31 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -47,7 +47,7 @@ if ($target) {
 
 $page->assign('op',$op);
 $page->assign('target',$target);
-$page->assign('baseurl',$baseurl);
+$page->assign('baseurl',$globals->baseurl);
 
 // on a un $target valide, on prepare les mails
 if ($target) {
index 20e936f..546a4fc 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: step3.php,v 1.3 2004-11-01 17:27:07 x2002marichez Exp $
+        $Id: step3.php,v 1.4 2004-11-21 23:35:31 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -78,7 +78,7 @@ $mymail = new TplMailer('inscrire.mail.tpl');
 $mymail->assign('forlife',$forlife);
 $mymail->assign('lemail',$_REQUEST['email']);
 $mymail->assign('pass_clair',$pass_clair);
-$mymail->assign('baseurl',$baseurl);
+$mymail->assign('baseurl',$globals->baseurl);
 $mymail->assign('ins_id',$ins_id);
 $mymail->assign('subj',$forlife."@polytechnique.org");
 $mymail->send();
index 65c2f62..5af0e05 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: step4.php,v 1.15 2004-11-20 19:07:00 x2000chevalier Exp $
+        $Id: step4.php,v 1.16 2004-11-21 23:35:31 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -145,6 +145,6 @@ if (!empty($_REQUEST['ref'])) {
 } else
     $page->assign('error',ERROR_REF);
 
-$page->assign('dev',(isset($site_dev) && $site_dev)?1:0);
+$page->assign('dev',$globals->debug);
 $page->run();
 ?>
index 89c14d6..13f69ff 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: relance.php,v 1.4 2004-11-15 09:22:15 x2000habouzit Exp $
+        $Id: relance.php,v 1.5 2004-11-21 23:35:32 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -52,7 +52,7 @@ if (isset($_POST["relancer"]) && isset($_POST["relancer"]) != "") {
             $mymail->assign('fdate',$fdate);
             $mymail->assign('lusername',$lusername);
             $mymail->assign('nveau_pass',$nveau_pass);
-            $mymail->assign('baseurl',$baseurl);
+            $mymail->assign('baseurl',$globals->baseurl);
             $mymail->assign('lins_id',$lins_id);
             
             $mymail->assign('lemail',$lemail);
index 3df3e2d..b5f7ca7 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: utilisateurs_marketing.php,v 1.10 2004-11-18 14:43:27 x2000habouzit Exp $
+        $Id: utilisateurs_marketing.php,v 1.11 2004-11-21 23:35:32 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -106,7 +106,7 @@ switch ($_REQUEST["submit"]) {
        $mymail->assign('from', $_REQUEST["from"]);
        $mymail->assign('to', stripslashes($_REQUEST["mail"]));
        $mymail->assign('femme', $femme);
-       $mymail->assign('baseurl', $baseurl);
+       $mymail->assign('baseurl', $globals->baseurl);
        $mymail->assign('user_id', $user_id);
        $mymail->assign('num_users', $num_users);
        $mymail->assign('mailorg', $mailorg);
index 6f9677a..cbf82ec 100644 (file)
@@ -1,12 +1,12 @@
 <?php
 
-global $baseurl,$ref_flags,$fullref,$montant,$ref_text,$ref,$ref_mail;
+global $globals,$ref_flags,$fullref,$montant,$ref_text,$ref,$ref_mail;
 
 // on construit l'adresse de retour pour le robot de la banque
-$roboturl = str_replace("https://","http://",$baseurl)."/paiement/cyberpaiement_retour.php?uid={$_SESSION['uid']}&amp;CHAMPBPX";
+$roboturl = str_replace("https://","http://",$globals->baseurl)."/paiement/cyberpaiement_retour.php?uid={$_SESSION['uid']}&amp;CHAMPBPX";
 
 // on construit l'adresse de retour pour l'utilisateur
-$returnurl = "$baseurl/";
+$returnurl = $globals->baseurl."/";
 if (! isset($_COOKIE[session_name()]))
     $returnurl .= "?".SID;
 
index efdd8f5..34f977c 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: recovery.php,v 1.8 2004-11-18 15:35:35 x2000habouzit Exp $
+        $Id: recovery.php,v 1.9 2004-11-21 23:35:30 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -76,7 +76,7 @@ if (isset($_REQUEST['login']) and isset($_REQUEST['birth']))  {
        $mymail->addTo($emails);
        $mymail->setSubject('Ton certificat d\'authentification');
         $mymail->setTxtBody("Visite la page suivante qui expire dans six heures :
-$baseurl/tmpPWD.php?certificat=$url
+{$globals->baseurl}/tmpPWD.php?certificat=$url
 
 Si en cliquant dessus tu n'y arrives pas, copie intégralement l'adresse dans la barre de ton navigateur.
 
index 8e4eca1..00ebd40 100644 (file)
@@ -21,6 +21,6 @@
 
 require("auto.prepend.inc.php");
 new_skinned_page('x.tpl', AUTH_PUBLIC);
-$page->assign('baseurl',$baseurl);
+$page->assign('baseurl',$globals->baseurl);
 $page->run();
 ?>
index 6140e2d..808a757 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: xorg.common.inc.php,v 1.7 2004-11-21 21:36:02 x2000habouzit Exp $
+    $Id: xorg.common.inc.php,v 1.8 2004-11-21 23:35:32 x2000habouzit Exp $
  ***************************************************************************/
 
+// {{{ defines
+
 $i=0;
 define("AUTH_PUBLIC", $i++);
 define("AUTH_COOKIE", $i++);
@@ -35,19 +37,26 @@ define('SKIN_COMPATIBLE_ID',1);
 define('SKINNED', 0);
 define('NO_SKIN', 1);
 
-// import class definitions
-require("diogenes.database.inc.php");
-require("xorg.globals.inc.php");
-require("xorg/session.inc.php");
+// }}}
+// {{{ import class definitions
+
+require_once("xorg.globals.inc.php");
 
 $globals = new XorgGlobals;
 require("config.xorg.inc.php");
 
+// }}}
+// {{{ start session + database connection
+
 session_start();
 
 // connect to database
 $globals->dbconnect();
-$conn = $globals->db->connect_id;
-if($site_dev)
+if ($globals->debug) {
     $globals->db->trace_on();
+}
+
+//}}}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
 ?>
index 6c43218..7aaa9b9 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: xorg.globals.inc.php.in,v 1.1 2004-11-21 20:40:57 x99laine Exp $
+    $Id: xorg.globals.inc.php.in,v 1.2 2004-11-21 23:35:32 x2000habouzit Exp $
  ***************************************************************************/
 
-require("diogenes.core.globals.inc.php");
+require_once("diogenes.core.globals.inc.php");
+require_once("diogenes.database.inc.php");
+require_once("xorg/session.inc.php");
 
-class XorgGlobals extends DiogenesCoreGlobals {
-    var $page = 'XorgPage';
+// {{{ class XorgGlobals
+
+class XorgGlobals extends DiogenesCoreGlobals
+{
+    var $page    = 'XorgPage';
     var $session = 'XorgSession';
 
     /** The x.org version */
     var $version = "@VERSION@";
+    var $debug   = false;
 
-    var $dbdb = 'x4dat';
-    var $table_auth = 'auth_user_md5';
-    var $table_log_actions = 'logger.actions';
+    /** db params */
+    var $dbdb               = 'x4dat';
+    var $dbhost             = 'localhost';
+    var $dbuser             = 'x4dat';
+    var $dbpwd              = 'x4dat';
+    
+    var $table_auth         = 'auth_user_md5';
+    var $table_log_actions  = 'logger.actions';
     var $table_log_sessions = 'logger.sessions';
-    var $table_log_events = 'logger.events';
+    var $table_log_events   = 'logger.events';
 
     /** logger */
-    var $tauth = array('native'=>"auth_user_md5");
+    var $tauth  = array('native'=>"auth_user_md5");
     var $tlabel = array('native'=>"X.Org");
 
+    /** paths */
+    var $baseurl   = "http://localhost/xorg";
+    var $root      = "/usr/share/xorg";
+    var $spoolroot = "/var/spool/xorg";
+
     /** recherche */
     var $public_max_search_results = 25;
-    var $search_results_per_page = 20;
+    var $search_results_per_page   = 20;
 }
+
+// }}}
+
+// vim:set et sw=4 sts=4 sws=4 foldmethod=marker:
 ?>
index f3c6367..a2fb1a9 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-    $Id: xorg.page.inc.php,v 1.50 2004-11-21 17:31:25 x2000habouzit Exp $
+    $Id: xorg.page.inc.php,v 1.51 2004-11-21 23:35:32 x2000habouzit Exp $
  ***************************************************************************/
 
 require_once("diogenes.core.page.inc.php");
@@ -31,7 +31,7 @@ require_once("diogenes.core.page.inc.php");
  * @category XOrgCore
  * @package  XOrgCore
  * @author   Jeremy Lainé <jeremy.laine@polytechnique.org>
- * @version  $Id: xorg.page.inc.php,v 1.50 2004-11-21 17:31:25 x2000habouzit Exp $
+ * @version  $Id: xorg.page.inc.php,v 1.51 2004-11-21 23:35:32 x2000habouzit Exp $
  * @access   public
  * @see      DiogenesCorePage
  */
@@ -47,7 +47,7 @@ class XorgPage extends DiogenesCorePage
 
     function XorgPage($tpl, $type=SKINNED)
     {
-        global $site_dev, $globals;
+        global $globals;
 
        $this->setLang();
 
@@ -60,7 +60,7 @@ class XorgPage extends DiogenesCorePage
 
 
         $this->config_overwrite  = false;
-        $this->compile_check     = !empty($site_dev);
+        $this->compile_check     = !empty($globals->debug);
         $this->caching          = ($type == SKINNED);
        if ($type == SKINNED) {
            $this->register_modifier('escape_html', 'escape_html');
@@ -81,7 +81,7 @@ class XorgPage extends DiogenesCorePage
         if (empty($_SESSION['session']))
             $_SESSION['session'] = new XorgSession;
 
-        $this->assign('site_dev',$site_dev);
+        $this->assign('site_dev',$globals->debug);
         $this->doAuth();
     }
 
@@ -121,7 +121,7 @@ class XorgPage extends DiogenesCorePage
 
     function run($append_to_id="")
     {
-        global $baseurl, $site_dev, $globals, $TIME_BEGIN;
+        global $globals, $TIME_BEGIN;
         if ($this->_page_type == NO_SKIN) {
             $this->display($this->_tpl);
         } else {
@@ -129,9 +129,9 @@ class XorgPage extends DiogenesCorePage
                 $this->caching=false;
             }
             $id = $this->make_id($append_to_id);
-            if ($site_dev) {
+            if ($globals->debug) {
                 $this->assign('db_trace', $globals->db->trace_format($this, 'database-debug.tpl'));
-                $this->assign('validate', urlencode($baseurl.'/valid.html'));
+                $this->assign('validate', urlencode($globals->baseurl.'/valid.html'));
 
                $result = $this->fetch('skin/'.$_SESSION['skin'], $id);
                $total_time = sprintf('Temps total: %.02fs<br />', microtime_float() - $TIME_BEGIN);
@@ -144,7 +144,9 @@ class XorgPage extends DiogenesCorePage
                    if (preg_match("/^X-W3C-Validator-Errors: (\d+)$/", $h, $m)) {
                        if ($m[1]) {
                            echo str_replace("@HOOK@",
-                               "$total_time<span class='erreur'><a href='http://validator.w3.org/check?uri=$baseurl/valid.html&amp;ss=1#result'>{$m[1]} ERREUR(S) !!!</a></span><br />", $result);
+                               "$total_time<span class='erreur'><a href='http://validator.w3.org/check?uri="
+                                .$globals->baseurl."/valid.html&amp;ss=1#result'>{$m[1]} ERREUR(S) !!!</a></span><br />",
+                                $result);
                        } else {
                            echo str_replace("@HOOK@", "$total_time", $result);
                        }
index a6e1019..d277fae 100755 (executable)
@@ -19,7 +19,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: send_notifs.php,v 1.4 2004-11-17 11:20:14 x2000habouzit Exp $
+        $Id: send_notifs.php,v 1.5 2004-11-21 23:35:33 x2000habouzit Exp $
  ***************************************************************************/
 
 require('./connect.db.inc.php');
@@ -34,7 +34,7 @@ foreach($all->_data as $u) {
           .  "  Voici les évènements survenus dans la semaine écoulée,\n"
          .  "et depuis ta dernière visite sur le site.\n\n"
          .  "Tu trouveras les mêmes informations sur la page :\n"
-         .  "    $baseurl/carnet/panel.php\n\n";
+         .  "    {$globals->baseurl}/carnet/panel.php\n\n";
     $text .= "------------------------------------------------------------\n\n";
     foreach($u['data'] as $cid=>$d) {
        $text .= "  {$all->_cats[$cid]['mail']} :\n\n";
@@ -48,7 +48,7 @@ foreach($all->_data as $u) {
            . "Tu recois ce mail car tu as activé la notification\n"
           . "automatique par mail des évènements que tu surveilles.\n\n"
           . "Tu peux changer cette option sur :\n"
-          . "    $baseurl/carnet/notifs.php\n\n"
+          . "    {$globals->baseurl}/carnet/notifs.php\n\n"
           . "-- \n"
           . "L'équipe de Polytechnique.org";