diff --git a/htdocs/adherent.class.php b/htdocs/adherent.class.php
index b14b514f7c5..f9741b74fba 100644
--- a/htdocs/adherent.class.php
+++ b/htdocs/adherent.class.php
@@ -39,6 +39,9 @@ class Adherent
var $statut;
var $login;
var $pass;
+ var $naiss;
+ var $photo;
+ var $public;
var $errorstr;
/*
@@ -50,6 +53,8 @@ class Adherent
$this->db = $DB ;
$this->id = $id;
$this->statut = -1;
+ // l'adherent n'est pas public par defaut
+ $this->public = 0;
}
/*
*
@@ -215,6 +220,9 @@ class Adherent
$sql .= ",email='".$this->email."'";
$sql .= ",login='".$this->login."'";
$sql .= ",pass='".$this->pass."'";
+ $sql .= ",naiss='".$this->naiss."'";
+ $sql .= ",photo='".$this->photo."'";
+ $sql .= ",public='".$this->public."'";
$sql .= ",statut=".$this->statut;
$sql .= ",fk_adherent_type=".$this->typeid;
$sql .= ",morphy='".$this->morphy."'";
@@ -275,7 +283,7 @@ class Adherent
*/
Function fetch($rowid)
{
- $sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, d.statut, d.adresse, d.cp, d.ville, d.pays, d.note, d.email, d.login, d.pass, d.fk_adherent_type, d.morphy, t.libelle as type";
+ $sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, d.statut, d.public, d.adresse, d.cp, d.ville, d.pays, d.note, d.email, d.login, d.pass, d.naiss, d.photo, d.fk_adherent_type, d.morphy, t.libelle as type";
$sql .= ",".$this->db->pdate("d.datefin")." as datefin";
$sql .= " FROM llx_adherent as d, llx_adherent_type as t";
$sql .= " WHERE d.rowid = $rowid AND d.fk_adherent_type = t.rowid";
@@ -291,6 +299,7 @@ class Adherent
$this->typeid = $obj->fk_adherent_type;
$this->type = $obj->type;
$this->statut = $obj->statut;
+ $this->public = $obj->public;
$this->date = $obj->datedon;
$this->prenom = stripslashes($obj->prenom);
$this->nom = stripslashes($obj->nom);
@@ -301,6 +310,8 @@ class Adherent
$this->email = stripslashes($obj->email);
$this->login = stripslashes($obj->login);
$this->pass = stripslashes($obj->pass);
+ $this->naiss = stripslashes($obj->naiss);
+ $this->photo = stripslashes($obj->photo);
$this->pays = stripslashes($obj->pays);
$this->datefin = $obj->datefin;
$this->commentaire = stripslashes($obj->note);
diff --git a/htdocs/adherents/edit.php b/htdocs/adherents/edit.php
index 97d12d2b19b..6267947d751 100644
--- a/htdocs/adherents/edit.php
+++ b/htdocs/adherents/edit.php
@@ -48,6 +48,8 @@ if ($action == 'update')
$adh->email = $HTTP_POST_VARS["email"];
$adh->login = $HTTP_POST_VARS["login"];
$adh->pass = $HTTP_POST_VARS["pass"];
+ $adh->naiss = $HTTP_POST_VARS["naiss"];
+ $adh->photo = $HTTP_POST_VARS["photo"];
$adh->date = mktime(12, 0 , 0, $remonth, $reday, $reyear);
$adh->note = $HTTP_POST_VARS["note"];
$adh->pays = $HTTP_POST_VARS["pays"];
@@ -104,7 +106,7 @@ if ($rowid)
print '
Commentaires ';
print 'Personne '.$adh->morphy.' ';
- print '';
+ print ' ';
print nl2br($adh->commentaire).' ';
print 'Prénom '.$adh->prenom.' ';
@@ -118,6 +120,8 @@ if ($rowid)
print 'Email '.$adh->email.' ';
print 'Login '.$adh->login.' ';
print 'Password '.$adh->pass.' ';
+ print 'Date de naissance Format AAAA-MM-JJ '.$adh->naiss.' ';
+ print 'URL Photo '.$adh->photo.' ';
print "\n";
@@ -146,7 +150,7 @@ if ($rowid)
$htmls->select_array("morphy", $morphys, $adh->morphy);
print "";
- print '';
+ print ' ';
print ' ';
print 'Prénom ';
@@ -162,6 +166,8 @@ if ($rowid)
print 'Email ';
print 'Login ';
print 'Password ';
+ print 'Date de naissance Format AAAA-MM-JJ ';
+ print 'URL photo ';
print '';
print ' ';
print ' ';
diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php
index 566b61ee656..a4737cf00b6 100644
--- a/htdocs/adherents/fiche.php
+++ b/htdocs/adherents/fiche.php
@@ -55,6 +55,8 @@ if ($HTTP_POST_VARS["action"] == 'add')
$adh->email = $email;
$adh->login = $login;
$adh->pass = $pass;
+ $adh->naiss = $naiss;
+ $adh->photo = $photo;
$adh->note = $note;
$adh->pays = $pays;
$adh->typeid = $type;
@@ -137,7 +139,7 @@ if ($action == 'create') {
$htmls->select_array("morphy", $morphys);
print " \n";
- print ' ';
+ print ' ';
print 'Prénom ';
@@ -154,6 +156,8 @@ if ($action == 'create') {
print 'Email ';
print 'Login ';
print 'Password ';
+ print 'Date de Naissance Format AAAA-MM-JJ ';
+ print 'Url photo ';
print "Date de cotisation \n";
print_date_select();
@@ -274,7 +278,7 @@ if ($rowid > 0)
print ' Personne '.$adh->morphy.' ';
- print '';
+ print ' ';
print nl2br($adh->commentaire).' ';
print 'Prénom '.$adh->prenom.' ';
@@ -289,6 +293,8 @@ if ($rowid > 0)
print 'Email '.$adh->email.' ';
print 'Login '.$adh->login.' ';
print 'Pass '.$adh->pass.' ';
+ print 'Date de Naissance '.$adh->naiss.' ';
+ print 'URL Photo '.$adh->photo.' ';
print "\n";
diff --git a/htdocs/adherents/public/new.php b/htdocs/adherents/public/new.php
index a1283ad7761..8b405ec2b82 100644
--- a/htdocs/adherents/public/new.php
+++ b/htdocs/adherents/public/new.php
@@ -29,6 +29,7 @@ require("../../paiement.class.php");
$db = new Db();
$errmsg='';
$num=0;
+$error=0;
if ($HTTP_POST_VARS["action"] == 'add')
{
@@ -38,11 +39,38 @@ if ($HTTP_POST_VARS["action"] == 'add')
if ($result) {
$num = $db->num_rows();
}
-
- if (isset($email) && $email != '' && ereg('@',$email) && !$num){
+ if (!isset($nom) || !isset($prenom) || $prenom=='' || $nom==''){
+ $error+=1;
+ $errmsg .="Nom et Prenom obligatoires \n";
+ }
+ if (!isset($email) || $email == '' || !ereg('@',$email)){
+ $error+=1;
+ $errmsg .="Adresse Email invalide \n";
+ }
+ if ($num !=0){
+ $error+=1;
+ $errmsg .="Login deja utilise. Veuillez en changer \n";
+ }
+ if (!isset($pass1) || !isset($pass2) || $pass1 == '' || $pass2 == '' || $pass1!=$pass2){
+ $error+=1;
+ $errmsg .="Password invalide \n";
+ }
+ if (isset($naiss) && $nais !=''){
+ if (!ereg("^\d\d\d\d\-\d\d\-\d\d",$naiss)){
+ $error+=1;
+ $errmsg .="Date de naissance invalide (Format AAAA-MM-JJ) \n";
+ }
+ }
+ if (isset($public)){
+ $public=1;
+ }else{
+ $public=0;
+ }
+ if (!$error){
// email a peu pres correct et le login n'existe pas
$adh = new Adherent($db);
$adh->statut = -1;
+ $adh->public = $public;
$adh->prenom = $prenom;
$adh->nom = $nom;
$adh->societe = $societe;
@@ -51,7 +79,9 @@ if ($HTTP_POST_VARS["action"] == 'add')
$adh->ville = $ville;
$adh->email = $email;
$adh->login = $login;
- $adh->pass = $pass;
+ $adh->pass = $pass1;
+ $adh->naiss = $naiss;
+ $adh->photo = $photo;
$adh->note = $note;
$adh->pays = $pays;
$adh->typeid = $type;
@@ -69,13 +99,6 @@ if ($HTTP_POST_VARS["action"] == 'add')
mail($email,"Votre adhesion sur http://$SERVER_NAME/",$mesg);
Header("Location: new.php?action=added");
}
- }else{
- if ($num !=0){
- $errmsg .="Login deja utilise. Veuillez en changer \n";
- }
- if (!isset($email) || $email == '' || !ereg('@',$email)){
- $errmsg .="Adresse Email invalide \n";
- }
}
}
@@ -90,14 +113,25 @@ llxHeader();
if (isset($action) && $action== 'added'){
- print "Nouvel Adhérent ajouté. En attente de validation \n";
+ print '';
+ print "Nouvel Adhérent ajouté. En attente de validation \n";
+ print '
';
}
if ($errmsg != ''){
- print "$errmsg \n";
+ print '';
+
+ print 'Erreur dans le formulaire ';
+ print "$errmsg \n";
+ // print "$errmsg \n";
+ print '
';
}
print_titre("Nouvel adhérent");
-print "Les login et password vous serviront a editer vos coordonnees ulterieurement \n";
+print '';
+print ' Les champs Commencant par un * sont obligatoire';
+print ' Les champs Commencant par un * seront affiche sur la liste publique des membres. Si vous ne souhaite pas cela DECOCHEZ la case public ci dessous';
+print " Les login et password vous serviront a editer vos coordonnees ulterieurement \n";
+print " \n";
print "