no_update_db obsolete, will be replaced by a lock at db abstracter level in 1.0
authorx2000habouzit <x2000habouzit>
Tue, 31 Aug 2004 22:01:30 +0000 (22:01 +0000)
committerx2000habouzit <x2000habouzit>
Tue, 31 Aug 2004 22:01:30 +0000 (22:01 +0000)
htdocs/antispam.php
htdocs/routage-mail.php
include/profil/get_skill.inc.php
include/valid_aliases.inc.php
include/valid_epouses.inc.php
include/valid_photos.inc.php
include/valid_sondages.inc.php [deleted file]
include/validations.inc.php
install.d/config.xorg.inc.php
templates/routage-mail.tpl

index 7cc4e0b..d71b10f 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: antispam.php,v 1.6 2004-08-31 10:03:28 x2000habouzit Exp $
+        $Id: antispam.php,v 1.7 2004-08-31 22:01:30 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -26,8 +26,7 @@ new_skinned_page('antispam.tpl', AUTH_MDP);
 
 require("mtic.inc.php");
 
-if (isset($_REQUEST['filtre']) and isset($_REQUEST['statut_filtre'])
-        and !$no_update_bd) {
+if (isset($_REQUEST['filtre']) and isset($_REQUEST['statut_filtre'])) {
     // mise à jour du filtre
     $result = $globals->db->query("select find_in_set('drop', flags) from emails where uid = {$_SESSION['uid']} and num = 0 and find_in_set('active', flags)");
     list($filtre) = mysql_fetch_row($result);
index 5e50fb8..156f788 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: routage-mail.php,v 1.3 2004-08-31 10:03:28 x2000habouzit Exp $
+        $Id: routage-mail.php,v 1.4 2004-08-31 22:01:30 x2000habouzit Exp $
  ***************************************************************************/
 
 require("auto.prepend.inc.php");
@@ -27,7 +27,7 @@ require("email.classes.inc.php");
 
 $redirect = new Redirect();
 
-if (!$no_update_bd && isset($_REQUEST['emailop'])) {
+if (isset($_REQUEST['emailop'])) {
     if ($_REQUEST['emailop']=="retirer" && isset($_REQUEST['num'])) {
         $page->assign('retour', $redirect->delete_email($_REQUEST['num']));
     }
@@ -56,7 +56,6 @@ $page->assign('alias',$alias);
 foreach ($redirect->emails as $mail)
     $emails[] = $mail;
 $page->assign('emails',$emails);
-$page->assign('no_update_bd',$no_update_bd);
 
 $page->run();
 ?>
index cec60ab..0ebe008 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: get_skill.inc.php,v 1.2 2004-08-31 19:48:46 x2000habouzit Exp $
+        $Id: get_skill.inc.php,v 1.3 2004-08-31 22:01:31 x2000habouzit Exp $
  ***************************************************************************/
 
 
@@ -31,7 +31,7 @@ if(isset($_REQUEST['langue_op'])){
     }
 }
 
-if(isset($_REQUEST['comppros_op']) && !$no_update_bd){
+if(isset($_REQUEST['comppros_op'])){
     if($_REQUEST['comppros_op']=='retirer'){
         $globals->db->query("delete from competences_ins where uid='{$_SESSION['uid']}' and cid='{$_REQUEST['comppros_id']}'");
     } elseif($_REQUEST['comppros_op'] == 'ajouter') {
index c666b63..44b6a38 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: valid_aliases.inc.php,v 1.13 2004-08-31 11:16:48 x2000habouzit Exp $
+        $Id: valid_aliases.inc.php,v 1.14 2004-08-31 22:01:31 x2000habouzit Exp $
  ***************************************************************************/
 
 class AliasReq extends Validate {
@@ -50,9 +50,6 @@ class AliasReq extends Validate {
     function formu() { return 'include/form.valid.aliases.tpl'; }
 
     function handle_formu () {
-        global $no_update_bd;
-        if($no_update_bd) return false;
-        
         if(empty($_REQUEST['submit'])
                 || ($_REQUEST['submit']!="Accepter"    && $_REQUEST['submit']!="Refuser"))
             return false;
@@ -76,8 +73,7 @@ class AliasReq extends Validate {
     }
 
     function commit () {
-        global $no_update_bd,$globals;
-        if($no_update_bd) return false;
+        global $globals;
 
         $domain=$this->alias.'@melix.net';
         $globals->db->query("DELETE FROM groupex.aliases WHERE id=12 AND email='{$this->username}'");
index 7a36b2d..af311e9 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: valid_epouses.inc.php,v 1.12 2004-08-31 11:16:48 x2000habouzit Exp $
+        $Id: valid_epouses.inc.php,v 1.13 2004-08-31 22:01:31 x2000habouzit Exp $
  ***************************************************************************/
 
 
@@ -64,9 +64,6 @@ class EpouseReq extends Validate {
     function formu() { return 'include/form.valid.epouses.tpl'; }
 
     function handle_formu () {
-        global $no_update_bd;
-        if($no_update_bd) return false;
-        
         if(empty($_REQUEST['submit'])
                 || ($_REQUEST['submit']!="Accepter" && $_REQUEST['submit']!="Refuser"))
             return false;
@@ -94,8 +91,7 @@ class EpouseReq extends Validate {
     }
 
     function commit () {
-        global $no_update_bd, $globals;
-        if($no_update_bd) return false;
+        global $globals;
         
         $alias = ($this->epouse ? $this->alias : "");
         $globals->db->query("UPDATE auth_user_md5 set epouse='".$this->epouse."',alias='".$this->alias."' WHERE user_id=".$this->uid);
index 90a1514..5dc4f24 100644 (file)
@@ -18,7 +18,7 @@
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: valid_photos.inc.php,v 1.10 2004-08-31 11:16:48 x2000habouzit Exp $
+        $Id: valid_photos.inc.php,v 1.11 2004-08-31 22:01:31 x2000habouzit Exp $
  ***************************************************************************/
 
 
@@ -78,9 +78,6 @@ class PhotoReq extends Validate {
     function formu() { return 'include/form.valid.photos.tpl'; }
     
     function handle_formu () {
-        global $no_update_bd;
-        if($no_update_bd) return false;
-        
         if(empty($_REQUEST['submit'])
                 || ($_REQUEST['submit']!="Accepter" && $_REQUEST['submit']!="Refuser"))
             return false;
@@ -102,8 +99,7 @@ class PhotoReq extends Validate {
     }
     
     function commit () {
-        global $no_update_bd, $globals;
-        if($no_update_bd) return false;
+        global $globals;
         
         $globals->db->query("REPLACE INTO photo set uid='".$this->uid."', attachmime = '".$this->mimetype."', attach='"
             .addslashes($this->data)."', x='".$this->x."', y='".$this->y."'");
diff --git a/include/valid_sondages.inc.php b/include/valid_sondages.inc.php
deleted file mode 100644 (file)
index 8e4e2f1..0000000
+++ /dev/null
@@ -1,118 +0,0 @@
-<?php
-/***************************************************************************
- *  Copyright (C) 2003-2004 Polytechnique.org                              *
- *  http://opensource.polytechnique.org/                                   *
- *                                                                         *
- *  This program is free software; you can redistribute it and/or modify   *
- *  it under the terms of the GNU General Public License as published by   *
- *  the Free Software Foundation; either version 2 of the License, or      *
- *  (at your option) any later version.                                    *
- *                                                                         *
- *  This program is distributed in the hope that it will be useful,        *
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
- *  GNU General Public License for more details.                           *
- *                                                                         *
- *  You should have received a copy of the GNU General Public License      *
- *  along with this program; if not, write to the Free Software            *
- *  Foundation, Inc.,                                                      *
- *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
- ***************************************************************************
-        $Id: valid_sondages.inc.php,v 1.9 2004-08-31 11:16:48 x2000habouzit Exp $
- ***************************************************************************/
-
-
-class SondageReq extends Validate {
-    var $sid;
-    var $titre;
-    var $alias;
-
-    var $username;
-    var $prenom;
-    var $nom;
-    
-    function SondageReq ($_uid, $_sid, $_stamp) {
-        global $globals;
-        $this->Validate($_uid, false, 'sondage', $_stamp);
-        $this->sid = $_sid;
-        
-        $sql = $globals->db->query("SELECT username,prenom,nom FROM auth_user_md5 "
-            .   "WHERE user_id='".$this->uid."'");
-        list($this->username,$this->prenom,$this->nom) = mysql_fetch_row($sql);
-        mysql_free_result($sql);
-        $sql = $globals->db->query("SELECT titre FROM sondage.description_generale "
-            .   "WHERE ids='".$this->sid."'");
-        list($this->titre) = mysql_fetch_row($sql);
-        mysql_free_result($sql);
-        $this->alias = substr($this->titre,0,min(15,strlen($this->titre)));
-    }
-
-    function get_request($uid,$stamp) {
-        return parent::get_request($uid,'sondage',$stamp);
-    }
-
-    function formu() { return 'include/form.valid.sondages.tpl'; }
-
-    function handle_formu () {
-        global $no_update_bd,$baseurl, $globals;
-        if($no_update_bd) return false;
-        
-        if(empty($_REQUEST['submit'])
-                || ($_REQUEST['submit']!="Accepter"    && $_REQUEST['submit']!="Refuser"))
-            return false;
-        
-        if ($_REQUEST['submit']!="Refuser") {
-            $alias = stripslashes($_REQUEST['alias']);
-            if ($alias=="") {
-                return '<p class="erreur">Il faut entrer un alias pour valider ce sondage.</p>';
-            }
-            else {
-                if (strlen($alias)>15) {
-                    return "<p class='erreur'>L'alias est trop long.</p>";
-                }
-                else if (strpos($alias,"'")) {
-                    return "<p class='erreur'>L'alias ne doit pas contenir le caractère '</p>";
-                }
-                else {//on vérifie que l'alias n'existe pas déjà
-                    $resultat = $globals->db->query("select alias from sondage.description_generale ".
-                    "where alias='$alias'");
-                    if (mysql_num_rows($resultat)>0) {
-                        return "<p class='erreur'>Cet alias est déjà utilisé.</p>";
-                    }
-                }
-            }
-            $this->alias=$alias;
-        }
-
-        require_once("tpl.mailer.inc.php");
-    
-        $lien = "$baseurl/sondage/questionnaire.php?alias=".urlencode($this->alias);
-        
-        $mymail = new TplMailer('valid.sondages.tpl');
-        $mymail->assign('username', $this->username);
-        $mymail->assign('alias', $this->alias);
-        $mymail->assign('titre', '"'.str_replace('&#039;',"'",$this->titre).'"');
-
-        if($_REQUEST['submit']=="Accepter") {
-            $this->commit();
-            $mymail->assign('answer','yes');
-        } else {
-            $mymail->assign('answer','no');
-        }
-
-        $mymail->send();
-        //Suppression de la demande
-        $this->clean();
-        return "Mail envoyé";
-    }
-
-    function commit () {
-        global $no_update_bd;
-        require_once("sondage.requetes.inc.php");
-        if($no_update_bd) return false;
-
-        passer_en_prod($this->sid,$this->alias);
-    }
-}
-
-?>
index 2cfd88d..fb982fd 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: validations.inc.php,v 1.12 2004-08-31 19:48:46 x2000habouzit Exp $
+        $Id: validations.inc.php,v 1.13 2004-08-31 22:01:31 x2000habouzit Exp $
  ***************************************************************************/
 
 /* vim: set expandtab shiftwidth=4 tabstop=4 softtabstop=4 textwidth=100:
- * $Id: validations.inc.php,v 1.12 2004-08-31 19:48:46 x2000habouzit Exp $
+ * $Id: validations.inc.php,v 1.13 2004-08-31 22:01:31 x2000habouzit Exp $
  *
  */
 
@@ -133,8 +133,7 @@ class Validate {
      * cette fonction supprimme les doublons sur un couple ($user,$type) si $this->unique est vrai
      */
     function submit () {
-        global $no_update_bd, $globals;
-        if($no_update_bd) return false;
+        global $globals;
         if($this->unique)
             $globals->db->query("DELETE FROM requests WHERE user_id='".$this->uid
                     .   "' AND type='".$this->type."'");
@@ -154,8 +153,7 @@ class Validate {
      * attention, tout est supprimé si c'est un unique
      */
     function clean () {
-        global $no_update_bd, $globals;
-        if($no_update_bd) return false;
+        global $globals;
         return $globals->db->query("DELETE FROM requests WHERE user_id='".$this->uid."' AND type='".$this->type."'"
                 .($this->unique ? "" : " AND stamp='".$this->stamp."'"));
     }
index 85373f1..2997579 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: config.xorg.inc.php,v 1.4 2004-08-31 21:57:51 x2000habouzit Exp $
+        $Id: config.xorg.inc.php,v 1.5 2004-08-31 22:01:32 x2000habouzit Exp $
  ***************************************************************************/
 
-/* $Id: config.xorg.inc.php,v 1.4 2004-08-31 21:57:51 x2000habouzit Exp $ */
+/* $Id: config.xorg.inc.php,v 1.5 2004-08-31 22:01:32 x2000habouzit Exp $ */
 
 /* URL de la racine pour les mails contenant des URL (pas de slash final!) */
 if (!isset($baseurl)) $baseurl="http://dev.m4x.org";
@@ -29,7 +29,7 @@ if (!isset($baseurl)) $baseurl="http://dev.m4x.org";
 /* les parametres pour se connecter à la BDD */
 $globals->dbhost='localhost';
 $globals->dbdb = 'x4dat';
-$globals->dbuser =  $no_update_bd ? 'webro' : 'web';
+$globals->dbuser = 'web';
 $globals->dbpwd="*******";
 $globals->root="...";
 $globals->libroot="...";
index 56854bd..9079b56 100644 (file)
  *  Foundation, Inc.,                                                      *
  *  59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                *
  ***************************************************************************
-        $Id: routage-mail.tpl,v 1.4 2004-08-31 11:25:39 x2000habouzit Exp $
+        $Id: routage-mail.tpl,v 1.5 2004-08-31 22:01:32 x2000habouzit Exp $
  ***************************************************************************}
 
 {dynamic}
-{if $no_update_bd}
-<p>
-  Le site est en mode de consultation seulement, tu ne peux pas modifier tes adresses
-  de redirections.
-</p>
-{/if}
 {if $retour == $smarty.const.ERROR_INACTIVE_REDIRECTION}
   <p class="erreur">
   Tu ne peux pas avoir aucune adresse de redirection active, sinon ton adresse