diff --git a/htdocs/adherents/XML-RPC.functions.php b/htdocs/adherents/XML-RPC.functions.php index 0b5af22b3ab..ff7324ca429 100644 --- a/htdocs/adherents/XML-RPC.functions.php +++ b/htdocs/adherents/XML-RPC.functions.php @@ -10,6 +10,9 @@ This code is Open Source, released under terms similar to the Artistic License. Read the license at http://www.keithdevens.com/software/license/ Note: this code requires version 4.1.0 or higher of PHP. + +Adaptation pour fonctionnner en PHP 5.0 + */ function & XML_serialize(&$data, $level = 0, $prior_key = NULL){ @@ -80,7 +83,7 @@ class XML { $this->parser = xml_parser_create(); xml_parser_set_option ($this->parser, XML_OPTION_CASE_FOLDING, 0); - xml_set_object($this->parser, &$this); + xml_set_object($this->parser, $this); xml_set_element_handler($this->parser, "open", "close"); xml_set_character_data_handler($this->parser, "data"); # register_shutdown_function(array(&$this, 'destruct')); @@ -133,7 +136,7 @@ class XML { $this->parent[$key] = array(); $this->parent = &$this->parent[$key]; - array_unshift($this->parents, &$this->parent); + array_unshift($this->parents, $this->parent); } function data($parser, $data){ @@ -156,7 +159,7 @@ class XML { function & XML_unserialize(&$xml){ $xml_parser = new XML(); - $data = &$xml_parser->parse(&$xml); + $data = &$xml_parser->parse($xml); $xml_parser->destruct(); return $data; } @@ -165,7 +168,7 @@ function & XMLRPC_parse(&$request){ if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_parse', "
Received the following raw request:
" . XMLRPC_show($request, 'print_r', true)); } - $data = &XML_unserialize(&$request); + $data = &XML_unserialize($request); if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_parse', "Returning the following parsed request:
" . XMLRPC_show($data, 'print_r', true)); } @@ -187,7 +190,7 @@ function & XMLRPC_prepare($data, $type = NULL){ if(array_key_exists("$n type", $data)){ $type = $data["$n type"]; } - $temp[$n] = XMLRPC_prepare(&$data[$n], $type); + $temp[$n] = XMLRPC_prepare($data[$n], $type); } } }else{ #it's a struct @@ -202,7 +205,7 @@ function & XMLRPC_prepare($data, $type = NULL){ if(array_key_exists("$key type", $data)){ $type = $data["$key type"]; } - $temp[] = array('name' => $key, 'value' => XMLRPC_prepare(&$value, $type)); + $temp[] = array('name' => $key, 'value' => XMLRPC_prepare($value, $type)); } } } @@ -244,12 +247,12 @@ function & XMLRPC_adjustValue(&$current_node){ if(is_array($temp) and array_key_exists(0, $temp)){ $count = count($temp); for($n=0;$n<$count;$n++){ - $temp2[$n] = &XMLRPC_adjustValue(&$temp[$n]); + $temp2[$n] = &XMLRPC_adjustValue($temp[$n]); } $temp = &$temp2; }else{ - $temp2 = &XMLRPC_adjustValue(&$temp); - $temp = array(&$temp2); + $temp2 = &XMLRPC_adjustValue($temp); + $temp = array($temp2); #I do the temp assignment because it avoids copying, # since I can put a reference in the array #PHP's reference model is a bit silly, and I can't just say: @@ -267,12 +270,12 @@ function & XMLRPC_adjustValue(&$current_node){ $count = count($temp); for($n=0;$n<$count;$n++){ #echo "Passing name {$temp[$n][name]}. Value is: " . show($temp[$n][value], var_dump, true) . "Received the following response:
\n\n" . XMLRPC_show($response, 'print_r', true) . "Which was serialized into the following data:
\n\n" . XMLRPC_show($data, 'print_r', true)); } if(isset($data['methodResponse']['fault'])){ - $return = array(false, XMLRPC_adjustValue(&$data['methodResponse']['fault']['value'])); + $return = array(false, XMLRPC_adjustValue($data['methodResponse']['fault']['value'])); if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_request', "Returning:
\n\n" . XMLRPC_show($return, 'var_dump', true)); } return $return; }else{ - $return = array(true, XMLRPC_adjustValue(&$data['methodResponse']['params']['param']['value'])); + $return = array(true, XMLRPC_adjustValue($data['methodResponse']['params']['param']['value'])); if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_request', "Returning:
\n\n" . XMLRPC_show($return, 'var_dump', true)); } @@ -407,7 +410,7 @@ function XMLRPC_request($site, $location, $methodName, $params = NULL, $user_age function XMLRPC_response($return_value, $server = NULL){ $data["methodResponse"]["params"]["param"]["value"] = &$return_value; - $return = XML_serialize(&$data); + $return = XML_serialize($data); if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_response', "Received the following data to return:
\n\n" . XMLRPC_show($return_value, 'print_r', true)); diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index c5638df0cae..9770e6f8137 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -1,6 +1,7 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo Probleme d'insertion : ".$db->error();
@@ -89,8 +90,13 @@ if ($HTTP_POST_VARS["action"] == 'cotisation')
$action = "edit";
}
-if ($HTTP_POST_VARS["action"] == 'add')
+if ($_POST["action"] == 'add')
{
+ $type=$_POST["type"];
+ if(!isset($type) || $type==''){
+ $error+=1;
+ $errmsg .="Le type d'adhérent n'est pas renseigné. Vous devez configurer les types d'adhérents avant de pouvoir les ajouter.
\n";
+ }
$login=$_POST["login"];
// test si le login existe deja
if(!isset($login) || $login==''){
@@ -147,8 +153,8 @@ if ($HTTP_POST_VARS["action"] == 'add')
$adh->note = $note;
$adh->pays = $pays;
$adh->typeid = $type;
- $adh->commentaire = $HTTP_POST_VARS["comment"];
- $adh->morphy = $HTTP_POST_VARS["morphy"];
+ $adh->commentaire = $_POST["comment"];
+ $adh->morphy = $_POST["morphy"];
foreach($_POST as $key => $value){
if (ereg("^options_",$key)){
@@ -167,7 +173,7 @@ if ($HTTP_POST_VARS["action"] == 'add')
//$dateop="$reyear$remonth$reday";
$amount=$cotisation;
$acct=new Account($db,ADHERENT_BANK_ACCOUNT);
- $insertid=$acct->addline($dateop, $HTTP_POST_VARS["operation"], $HTTP_POST_VARS["label"], $amount, $HTTP_POST_VARS["num_chq"],ADHERENT_BANK_CATEGORIE);
+ $insertid=$acct->addline($dateop, $_POST["operation"], $_POST["label"], $amount, $_POST["num_chq"],ADHERENT_BANK_CATEGORIE);
if ($insertid == '')
{
print "
Probleme d'insertion : ".$db->error(); @@ -193,14 +199,14 @@ if ($HTTP_POST_VARS["action"] == 'add') } } -if ($HTTP_POST_VARS["action"] == 'confirm_delete' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_delete' && $_POST["confirm"] == yes) { $adh = new Adherent($db); $adh->delete($rowid); Header("Location: liste.php"); } -if ($HTTP_POST_VARS["action"] == 'confirm_valid' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_valid' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->validate($user->id); @@ -226,7 +232,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_valid' && $HTTP_POST_VARS["confirm"] = } -if ($HTTP_POST_VARS["action"] == 'confirm_resign' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_resign' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->resiliate($user->id); @@ -247,7 +253,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_resign' && $HTTP_POST_VARS["confirm"] llxHeader(); -if ($HTTP_POST_VARS["action"] == 'confirm_add_glasnost' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_add_glasnost' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->fetch($rowid); @@ -264,7 +270,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_add_glasnost' && $HTTP_POST_VARS["conf } } -if ($HTTP_POST_VARS["action"] == 'confirm_del_glasnost' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_del_glasnost' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->fetch($rowid); @@ -281,7 +287,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_del_glasnost' && $HTTP_POST_VARS["conf } } -if ($HTTP_POST_VARS["action"] == 'confirm_del_spip' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_del_spip' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->fetch($rowid); @@ -290,7 +296,7 @@ if ($HTTP_POST_VARS["action"] == 'confirm_del_spip' && $HTTP_POST_VARS["confirm" } } -if ($HTTP_POST_VARS["action"] == 'confirm_add_spip' && $HTTP_POST_VARS["confirm"] == yes) +if ($_POST["action"] == 'confirm_add_spip' && $_POST["confirm"] == yes) { $adh = new Adherent($db, $rowid); $adh->fetch($rowid); @@ -309,7 +315,7 @@ if ($errmsg != '') { print '
| Erreur dans l\'execution du formulaire | '; - print "
|---|
| $errmsg |
| $errmsg |
| [Nouvel attribut] | "; - -/* - * Case 2 - */ - -print "- | "; - -/* - * Case 3 - */ -print "- | "; - -/* - * Case 4 - */ - -print "- | "; - -print "
"; + /* + * Barre d'actions + * + */ + print '
| [Nouveau Type] | '; - -/* - * Case 2 - */ - -print "- | "; - -/* - * Case 3 - */ -print "- | "; - -/* - * Case 4 - */ - -print "- | "; - -print "
"; + /* + * Barre d'actions + * + */ + print '