diff --git a/htdocs/user.class.php b/htdocs/user.class.php index 82faa374e8c..0f0b4de79b2 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -73,6 +73,7 @@ class User var $societe_id; var $fk_member; var $webcal_login; + var $phenix_login; var $datelastlogin; var $datepreviouslogin; @@ -123,7 +124,7 @@ class User // Recupere utilisateur $sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.office_phone, u.office_fax, u.user_mobile,"; - $sql.= " u.admin, u.login, u.webcal_login, u.note,"; + $sql.= " u.admin, u.login, u.webcal_login, u.phenix_login, u.note,"; $sql.= " u.pass, u.pass_crypted, u.pass_temp,"; $sql.= " u.fk_societe, u.fk_socpeople, u.fk_member, u.ldap_sid,"; $sql.= " u.statut, u.lang,"; @@ -145,7 +146,7 @@ class User { $sql .= " WHERE u.rowid = ".$this->id; } - + dolibarr_syslog("User::Fetch sql=".$sql, LOG_DEBUG); $result = $this->db->query($sql); if ($result) @@ -181,6 +182,7 @@ class User $this->datepreviouslogin = $obj->datep; $this->webcal_login = $obj->webcal_login; + $this->phenix_login = $obj->phenix_login; $this->societe_id = $obj->fk_societe; $this->contact_id = $obj->fk_socpeople; $this->fk_member = $obj->fk_member; @@ -919,29 +921,35 @@ class User dolibarr_syslog("User::update notrigger=".$notrigger.", nosyncmember=".$nosyncmember); // Nettoyage parametres - $this->nom=trim($this->nom); - $this->prenom=trim($this->prenom); - $this->fullname=trim($this->prenom." ".$this->nom); - $this->login=trim($this->login); - $this->pass=trim($this->pass); - $this->email=trim($this->email); - $this->note=trim($this->note); - $this->admin=$this->admin?$this->admin:0; - - $this->db->begin(); - - // Mise a jour autres infos + $this->nom = addslashes(trim($this->nom)); + $this->prenom = addslashes(trim($this->prenom)); + $this->fullname = $this->prenom." ".$this->nom; + $this->login = addslashes(trim($this->login)); + $this->pass = trim($this->pass); + $this->office_phone = trim($this->office_phone); + $this->office_fax = trim($this->office_fax); + $this->user_mobile = trim($this->user_mobile); + $this->email = addslashes(trim($this->email)); + $this->note = addslashes(trim($this->note)); + $this->webcal_login = addslashes(trim($this->webcal_login)); + $this->phenix_login = addslashes(trim($this->phenix_login)); + $this->admin = $this->admin?$this->admin:0; + + $this->db->begin(); + + // Mise a jour autres infos $sql = "UPDATE ".MAIN_DB_PREFIX."user SET"; - $sql.= " name = '".addslashes($this->nom)."'"; - $sql.= ", firstname = '".addslashes($this->prenom)."'"; - $sql.= ", login = '".addslashes($this->login)."'"; + $sql.= " name = '".$this->nom."'"; + $sql.= ", firstname = '".$this->prenom."'"; + $sql.= ", login = '".$this->login."'"; $sql.= ", admin = ".$this->admin; - $sql.= ", office_phone = '$this->office_phone'"; - $sql.= ", office_fax = '$this->office_fax'"; - $sql.= ", user_mobile = '$this->user_mobile'"; - $sql.= ", email = '".addslashes($this->email)."'"; - $sql.= ", webcal_login = '$this->webcal_login'"; - $sql.= ", note = '".addslashes($this->note)."'"; + $sql.= ", office_phone = '".$this->office_phone."'"; + $sql.= ", office_fax = '".$this->office_fax."'"; + $sql.= ", user_mobile = '".$this->user_mobile."'"; + $sql.= ", email = '".$this->email."'"; + $sql.= ", webcal_login = '".$this->webcal_login."'"; + $sql.= ", phenix_login = '".$this->phenix_login."'"; + $sql.= ", note = '".$this->note."'"; $sql.= " WHERE rowid = ".$this->id; dolibarr_syslog("User::update sql=".$sql); diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 82e59f82a10..79167dd7ffa 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -3,7 +3,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2006 Laurent Destailleur * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2005-2006 Regis Houssin + * Copyright (C) 2005-2007 Regis Houssin * Copyright (C) 2005 Lionel COUSTEIX * * This program is free software; you can redistribute it and/or modify @@ -142,17 +142,18 @@ if ($_POST["action"] == 'add' && $canadduser) { $edituser = new User($db); - $edituser->nom = trim($_POST["nom"]); - $edituser->prenom = trim($_POST["prenom"]); - $edituser->login = trim($_POST["login"]); - $edituser->admin = trim($_POST["admin"]); - $edituser->office_phone = trim($_POST["office_phone"]); - $edituser->office_fax = trim($_POST["office_fax"]); - $edituser->user_mobile = trim($_POST["user_mobile"]); - $edituser->email = trim($_POST["email"]); - $edituser->webcal_login = trim($_POST["webcal_login"]); - $edituser->note = trim($_POST["note"]); - $edituser->ldap_sid = trim($_POST["ldap_sid"]); + $edituser->nom = $_POST["nom"]; + $edituser->prenom = $_POST["prenom"]; + $edituser->login = $_POST["login"]; + $edituser->admin = $_POST["admin"]; + $edituser->office_phone = $_POST["office_phone"]; + $edituser->office_fax = $_POST["office_fax"]; + $edituser->user_mobile = $_POST["user_mobile"]; + $edituser->email = $_POST["email"]; + $edituser->webcal_login = $_POST["webcal_login"]; + $edituser->phenix_login = $_POST["phenix_login"]; + $edituser->note = $_POST["note"]; + $edituser->ldap_sid = $_POST["ldap_sid"]; $db->begin(); @@ -232,16 +233,17 @@ if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $caneditfield) //$edituser->oldpass_indatabase = $edituser->pass_indatabase; - $edituser->nom = trim($_POST["nom"]); - $edituser->prenom = trim($_POST["prenom"]); - $edituser->login = trim($_POST["login"]); - $edituser->pass = trim($_POST["pass"]); - $edituser->admin = trim($_POST["admin"]); - $edituser->office_phone = trim($_POST["office_phone"]); - $edituser->office_fax = trim($_POST["office_fax"]); - $edituser->user_mobile = trim($_POST["user_mobile"]); - $edituser->email = trim($_POST["email"]); - $edituser->webcal_login = trim($_POST["webcal_login"]); + $edituser->nom = $_POST["nom"]; + $edituser->prenom = $_POST["prenom"]; + $edituser->login = $_POST["login"]; + $edituser->pass = $_POST["pass"]; + $edituser->admin = $_POST["admin"]; + $edituser->office_phone = $_POST["office_phone"]; + $edituser->office_fax = $_POST["office_fax"]; + $edituser->user_mobile = $_POST["user_mobile"]; + $edituser->email = $_POST["email"]; + $edituser->webcal_login = $_POST["webcal_login"]; + $edituser->phenix_login = $_POST["phenix_login"]; $ret=$edituser->update($user); if ($ret < 0) @@ -664,12 +666,21 @@ if (($action == 'create') || ($action == 'adduserldap')) print "\n"; // Autres caractéristiques issus des autres modules + + // Module Webcalendar if ($conf->webcal->enabled) { print "".''.$langs->trans("LoginWebcal").''; print ''; } + // Module Phenix + if ($conf->phenix->enabled) + { + print "".''.$langs->trans("LoginPenix").''; + print ''; + } + print "".''; print "\n"; print ""; @@ -895,27 +906,27 @@ else print "\n"; // Tel pro - print ''.$langs->trans("PhonePro").''; - print ''.$fuser->office_phone.''; - - // Tel mobile - print ''.$langs->trans("PhoneMobile").''; - print ''.$fuser->user_mobile.''; - - // Fax - print ''.$langs->trans("Fax").''; - print ''.$fuser->office_fax.''; - - // EMail + print ''.$langs->trans("PhonePro").''; + print ''.$fuser->office_phone.''; + + // Tel mobile + print ''.$langs->trans("PhoneMobile").''; + print ''.$fuser->user_mobile.''; + + // Fax + print ''.$langs->trans("Fax").''; + print ''.$fuser->office_fax.''; + + // EMail print ''.$langs->trans("EMail").''; print ''.$fuser->email.''; print "\n"; - - // Statut - print ''.$langs->trans("Status").''; - print ''; - print $fuser->getLibStatut(4); - print ''; + + // Statut + print ''.$langs->trans("Status").''; + print ''; + print $fuser->getLibStatut(4); + print ''; print ''.$langs->trans("LastConnexion").''; print ''.dolibarr_print_date($fuser->datelastlogin,"dayhour").''; @@ -926,6 +937,8 @@ else print "\n"; // Autres caractéristiques issus des autres modules + + // Module Webcalendar if ($conf->webcal->enabled) { $langs->load("other"); @@ -933,24 +946,35 @@ else print ''.$fuser->webcal_login.' '; print "\n"; } + + // Module Phenix + if ($conf->phenix->enabled) + { + $langs->load("other"); + print ''.$langs->trans("LoginPhenix").''; + print ''.$fuser->phenix_login.' '; + print "\n"; + } + + // Module Adhérent if ($conf->adherent->enabled) { - $langs->load("members"); - print ''.$langs->trans("MemberAccount").''; - print ''; - if ($fuser->fk_member) - { - $adh=new Adherent($db); - $adh->fetch($fuser->fk_member); - $adh->ref=$adh->login; // Force to show login instead of id - print $adh->getNomUrl(1); - } - else - { - print $langs->trans("UserNotLinkedToMember"); - } - print ''; - print "\n"; + $langs->load("members"); + print ''.$langs->trans("MemberAccount").''; + print ''; + if ($fuser->fk_member) + { + $adh=new Adherent($db); + $adh->fetch($fuser->fk_member); + $adh->ref=$adh->login; // Force to show login instead of id + print $adh->getNomUrl(1); + } + else + { + print $langs->trans("UserNotLinkedToMember"); + } + print ''; + print "\n"; } print "\n"; @@ -1139,7 +1163,7 @@ else print ''; print $fuser->id; print ''; - print ''; + print ''; // Nom print "".''.$langs->trans("Name").'*'; @@ -1154,8 +1178,8 @@ else print $fuser->nom; } print ''; - - // Prenom + + // Prenom print "".''.$langs->trans("Firstname").''; print ''; if ($caneditfield && !$fuser->ldap_sid) @@ -1197,9 +1221,9 @@ else print ''; print ''; print ''; - } + } print ''; - print ''; + print ''; // Pass print ''.$langs->trans("Password").''; @@ -1285,46 +1309,46 @@ else print "\n"; // Tel pro - print "".''.$langs->trans("PhonePro").''; - print ''; - if ($caneditfield && !$fuser->ldap_sid) - { - print ''; - } - else - { - print ''; - print $fuser->office_phone; - } - print ''; - - // Tel mobile - print "".''.$langs->trans("PhoneMobile").''; - print ''; - if ($caneditfield && !$fuser->ldap_sid) - { - print ''; - } - else - { - print ''; - print $fuser->user_mobile; - } - print ''; - - // Fax - print "".''.$langs->trans("Fax").''; - print ''; - if ($caneditfield && !$fuser->ldap_sid) - { - print ''; - } - else - { - print ''; - print $fuser->office_fax; - } - print ''; + print "".''.$langs->trans("PhonePro").''; + print ''; + if ($caneditfield && !$fuser->ldap_sid) + { + print ''; + } + else + { + print ''; + print $fuser->office_phone; + } + print ''; + + // Tel mobile + print "".''.$langs->trans("PhoneMobile").''; + print ''; + if ($caneditfield && !$fuser->ldap_sid) + { + print ''; + } + else + { + print ''; + print $fuser->user_mobile; + } + print ''; + + // Fax + print "".''.$langs->trans("Fax").''; + print ''; + if ($caneditfield && !$fuser->ldap_sid) + { + print ''; + } + else + { + print ''; + print $fuser->office_fax; + } + print ''; // EMail print "".''.$langs->trans("EMail").''; @@ -1347,6 +1371,8 @@ else print ''; // Autres caractéristiques issus des autres modules + + // Module Webcalendar if ($conf->webcal->enabled) { $langs->load("other"); @@ -1356,6 +1382,17 @@ else else print $fuser->webcal_login; print ''; } + + // Module Phenix + if ($conf->phenix->enabled) + { + $langs->load("other"); + print "".''.$langs->trans("LoginPhenix").''; + print ''; + if ($caneditfield) print ''; + else print $fuser->phenix_login; + print ''; + } print ''; print '';