From 75d8d9108e80b4b12c54281b08c8f236fda6c498 Mon Sep 17 00:00:00 2001 From: x2000habouzit Date: Tue, 31 Aug 2004 22:01:30 +0000 Subject: [PATCH] no_update_db obsolete, will be replaced by a lock at db abstracter level in 1.0 --- htdocs/antispam.php | 5 +- htdocs/routage-mail.php | 5 +- include/profil/get_skill.inc.php | 4 +- include/valid_aliases.inc.php | 8 +-- include/valid_epouses.inc.php | 8 +-- include/valid_photos.inc.php | 8 +-- include/valid_sondages.inc.php | 118 --------------------------------------- include/validations.inc.php | 10 ++-- install.d/config.xorg.inc.php | 6 +- templates/routage-mail.tpl | 8 +-- 10 files changed, 20 insertions(+), 160 deletions(-) delete mode 100644 include/valid_sondages.inc.php diff --git a/htdocs/antispam.php b/htdocs/antispam.php index 7cc4e0b..d71b10f 100644 --- a/htdocs/antispam.php +++ b/htdocs/antispam.php @@ -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); diff --git a/htdocs/routage-mail.php b/htdocs/routage-mail.php index 5e50fb8..156f788 100644 --- a/htdocs/routage-mail.php +++ b/htdocs/routage-mail.php @@ -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(); ?> diff --git a/include/profil/get_skill.inc.php b/include/profil/get_skill.inc.php index cec60ab..0ebe008 100644 --- a/include/profil/get_skill.inc.php +++ b/include/profil/get_skill.inc.php @@ -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') { diff --git a/include/valid_aliases.inc.php b/include/valid_aliases.inc.php index c666b63..44b6a38 100644 --- a/include/valid_aliases.inc.php +++ b/include/valid_aliases.inc.php @@ -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}'"); diff --git a/include/valid_epouses.inc.php b/include/valid_epouses.inc.php index 7a36b2d..af311e9 100644 --- a/include/valid_epouses.inc.php +++ b/include/valid_epouses.inc.php @@ -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); diff --git a/include/valid_photos.inc.php b/include/valid_photos.inc.php index 90a1514..5dc4f24 100644 --- a/include/valid_photos.inc.php +++ b/include/valid_photos.inc.php @@ -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 index 8e4e2f1..0000000 --- a/include/valid_sondages.inc.php +++ /dev/null @@ -1,118 +0,0 @@ -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 '

Il faut entrer un alias pour valider ce sondage.

'; - } - else { - if (strlen($alias)>15) { - return "

L'alias est trop long.

"; - } - else if (strpos($alias,"'")) { - return "

L'alias ne doit pas contenir le caractère '

"; - } - 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 "

Cet alias est déjà utilisé.

"; - } - } - } - $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(''',"'",$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); - } -} - -?> diff --git a/include/validations.inc.php b/include/validations.inc.php index 2cfd88d..fb982fd 100644 --- a/include/validations.inc.php +++ b/include/validations.inc.php @@ -18,11 +18,11 @@ * 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."'")); } diff --git a/install.d/config.xorg.inc.php b/install.d/config.xorg.inc.php index 85373f1..2997579 100644 --- a/install.d/config.xorg.inc.php +++ b/install.d/config.xorg.inc.php @@ -18,10 +18,10 @@ * 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="..."; diff --git a/templates/routage-mail.tpl b/templates/routage-mail.tpl index 56854bd..9079b56 100644 --- a/templates/routage-mail.tpl +++ b/templates/routage-mail.tpl @@ -17,16 +17,10 @@ * 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} -

- Le site est en mode de consultation seulement, tu ne peux pas modifier tes adresses - de redirections. -

-{/if} {if $retour == $smarty.const.ERROR_INACTIVE_REDIRECTION}

Tu ne peux pas avoir aucune adresse de redirection active, sinon ton adresse -- 2.1.4