diff --git a/ChangeLog b/ChangeLog index e1fa982cffe..19a0d6f2c9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,13 +4,15 @@ English Dolibarr ChangeLog ***** ChangeLog for 2.8 compared to 2.7 ***** For users: +- New: task #9935: Can edit accountancy code. - New: Add an option to make users email reuired. - New: Module notification can send mail on order or proposal validation. - New: Can use any antivirus on file upload. - New: A customer can also be a prospect. -- New: task #9802 : Can link an action to a project. -- New: Initial sold can be conciliated. -- New: task #9935: Can edit accountancy code. +- New: task #9802 : Can link an action to a project and use project to + filter agenda. +- New: Project can be set on contract creation. +- New: Initial sold can be conciliated on bank module. - New: Add a default errors-to email for emailing module. - New: Can filter on user on stock movement list. - New: When creating a third party from a member, it is set as a new @@ -34,6 +36,7 @@ For developers: - Qual: Reorganize /dev directory. - Qual: Change the way items are linked together. - New: Modules can add their own tab on projects cards. +- Qual: The login page now use a template in /core/template/login.tpl.php. ***** ChangeLog for 2.7.1 compared to 2.7 ***** diff --git a/htdocs/compta/bank/bplc.php b/htdocs/compta/bank/bplc.php deleted file mode 100644 index cb48238ac51..00000000000 --- a/htdocs/compta/bank/bplc.php +++ /dev/null @@ -1,107 +0,0 @@ - - * Copyright (C) 2004 Laurent Destailleur - * - * 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. - */ - -/** - * \file htdocs/compta/bank/bplc.php - * \ingroup banque - * \brief Page of BPLC transactions - * \version $Id$ - */ - -require("./pre.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/lib/bank.lib.php"); - -// Security check -restrictedArea($user,'banque'); - - -/* - * View - */ - -llxHeader(); - -if ($page == -1) { $page = 0 ; } - -$offset = $conf->liste_limit * $page ; -$pageprev = $page - 1; -$pagenext = $page + 1; - -print_barre_liste("Transactions BPLC", $page, "bplc.php"); - -print ""; -print ""; -print ""; -print ""; -print ""; -print ""; -print ""; -print "\n"; - -$sql = "SELECT ipclient, - num_transaction, - date_transaction, - heure_transaction, - num_autorisation, - cle_acceptation, - code_retour, - ref_commande"; - -$sql .= " FROM ".MAIN_DB_PREFIX."transaction_bplc"; - -$resql = $db->query($sql); -if ($resql) -{ - $var=True; - $num = $db->num_rows($resql); - $i = 0; $total = 0; - - $sep = 0; - - while ($i < $num) - { - $objp = $db->fetch_object($resql); - - print ""; - - $type = substr($objp->ref_commande, strlen($objp->ref_commande) - 2 ); - $id = substr($objp->ref_commande, 0 , strlen($objp->ref_commande) - 2 ); - - if ($type == 10) - { - print ''; - } - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - $i++; - } - $db->free($resql); -} -print "
R�f. commandeip clientNum. transactionDateHeureNum autorisationcl� acceptationcode retour
'.$objp->ref_commande.'$objp->ipclient$objp->num_transaction$objp->date_transaction$objp->heure_transaction$objp->num_autorisation$objp->cle_acceptation$objp->code_retour
"; - -$db->close(); - -llxFooter('$Date$ - $Revision$'); -?> diff --git a/htdocs/compta/bank/pre.inc.php b/htdocs/compta/bank/pre.inc.php index 7e8ea90453a..2c96ff17cc2 100644 --- a/htdocs/compta/bank/pre.inc.php +++ b/htdocs/compta/bank/pre.inc.php @@ -44,7 +44,7 @@ function llxHeader($head = "") $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE entity = ".$conf->entity; $sql.= " AND clos = 0"; - + $resql = $db->query($sql); if ($resql) { @@ -80,11 +80,6 @@ function llxHeader($head = "") $menu->add_submenu(DOL_URL_ROOT."/compta/bank/virement.php",$langs->trans("BankTransfers"),1,$user->rights->banque->transfer); } - if ($conf->global->COMPTA_ONLINE_PAYMENT_BPLC) - { - $menu->add(DOL_URL_ROOT."/compta/bank/bplc.php","Transactions BPLC"); - } - // Gestion cheques if ($conf->facture->enabled && $conf->banque->enabled) { diff --git a/htdocs/compta/paiement/cheque/pre.inc.php b/htdocs/compta/paiement/cheque/pre.inc.php index 220206d8099..aef8fe5682e 100644 --- a/htdocs/compta/paiement/cheque/pre.inc.php +++ b/htdocs/compta/paiement/cheque/pre.inc.php @@ -44,7 +44,7 @@ function llxHeader($head = "", $title="") $sql.= " FROM ".MAIN_DB_PREFIX."bank_account"; $sql.= " WHERE entity = ".$conf->entity; $sql.= " AND clos = 0"; - + $resql = $db->query($sql); if ($resql) { @@ -81,11 +81,6 @@ function llxHeader($head = "", $title="") $menu->add_submenu(DOL_URL_ROOT."/compta/bank/virement.php",$langs->trans("BankTransfers"),1,$user->rights->banque->transfer); } - if ($conf->global->COMPTA_ONLINE_PAYMENT_BPLC) - { - $menu->add(DOL_URL_ROOT."/compta/bank/bplc.php","Transactions BPLC"); - } - // Gestion cheques if ($conf->facture->enabled && $conf->banque->enabled) { diff --git a/htdocs/document.php b/htdocs/document.php index 563959eee47..12262052f8a 100644 --- a/htdocs/document.php +++ b/htdocs/document.php @@ -36,7 +36,7 @@ $original_file = isset($_GET["file"])?$_GET["file"]:''; $modulepart = isset($_GET["modulepart"])?$_GET["modulepart"]:''; $urlsource = isset($_GET["urlsource"])?$_GET["urlsource"]:''; -// Pour autre que bittorrent, on charge environnement + info issus de logon comme le user +// Pour autre que bittorrent, on charge environnement + info issus de logon (comme le user) if (($modulepart == 'bittorrent') && ! defined("NOLOGIN")) define("NOLOGIN",1); if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1'); diff --git a/htdocs/install/mysql/tables/llx_transaction_bplc.sql b/htdocs/install/mysql/tables/llx_transaction_bplc.sql deleted file mode 100644 index 85d4ec6467c..00000000000 --- a/htdocs/install/mysql/tables/llx_transaction_bplc.sql +++ /dev/null @@ -1,34 +0,0 @@ --- =================================================================== --- Copyright (C) 2001-2002 Rodolphe Quiedeville --- --- 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$ --- =================================================================== - -create table llx_transaction_bplc -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - tms timestamp, - ipclient varchar(20), - num_transaction varchar(10), - date_transaction varchar(10), - heure_transaction varchar(10), - num_autorisation varchar(10), - cle_acceptation varchar(5), - code_retour integer, - ref_commande integer - -)type=innodb; diff --git a/htdocs/public/agenda/agendaexport.php b/htdocs/public/agenda/agendaexport.php index 17de07683fd..8a9731b4bd6 100644 --- a/htdocs/public/agenda/agendaexport.php +++ b/htdocs/public/agenda/agendaexport.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2008-2010 Laurent Destailleur * * 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 @@ -23,12 +23,13 @@ * \version $Id$ */ -// This is to make Dolibarr working with Plesk -set_include_path($_SERVER['DOCUMENT_ROOT'].'/htdocs'); +define("NOLOGIN",1); // This means this output page does not require to be logged. -require("../../master.inc.php"); +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/actioncomm.class.php'); +// Security check +if (! $conf->agenda->enabled) accessforbidden('',1,1,1); $mainmenu=isset($_GET["mainmenu"])?$_GET["mainmenu"]:""; $leftmenu=isset($_GET["leftmenu"])?$_GET["leftmenu"]:""; @@ -51,10 +52,6 @@ if (! empty($_GET["logind"])) $filters['logind']=$_GET["logind"]; function llxHeader() { print 'Export agenda cal'; } function llxFooter() { print ''; } -// Security check -if (! $conf->agenda->enabled) - accessforbidden(); - // Check config if (empty($conf->global->MAIN_AGENDA_XCAL_EXPORTKEY)) diff --git a/htdocs/public/bplc/bplc.php b/htdocs/public/bplc/bplc.php deleted file mode 100644 index eeb138dfb94..00000000000 --- a/htdocs/public/bplc/bplc.php +++ /dev/null @@ -1,87 +0,0 @@ - - * Copyright (C) 2009 Laurent Destailleur - * - * 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. - */ - -/** - * \ingroup banque - * \brief Gestion du retour du systeme de Cyberpaiement - * Cette page est appellee par le serveur de la BPLC lors de - * l'utilisation au systeme RSTS. - * \version $Id$ - */ - -require("../../master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/public/bplc/retourbplc.class.php"); -require_once(DOL_DOCUMENT_ROOT."/don.class.php"); - -// Define lang object automatically using browser language -$langs->setDefaultLang('auto'); - -// Security check -if (empty($conf->banque->enabled)) accessforbidden('',1,1,1); - - -$retbplc = new Retourbplc($db); - -$retbplc->num_compte = $conf->bplc->num_compte; - -$retbplc->montant = $CHAMP201; -$retbplc->num_contrat = $CHAMP002; -$retbplc->ref_commande = $CHAMP200; -$retbplc->ipclient = $CHAMP105; -$retbplc->num_transaction = $CHAMP901; -$retbplc->date_transaction = $CHAMP902; -$retbplc->heure_transaction = $CHAMP903; -$retbplc->num_autorisation = $CHAMP904; -$retbplc->cle_acceptation = $CHAMP905; -$retbplc->code_retour = $CHAMP906; - -$retbplc->ref_commande = $CHAMP200; - -/* - * Insertion de la transaction dans la base - */ - -$return = $retbplc->insertdb(); - - -$don_id = substr($retbplc->ref_commande, 0, strlen($retbplc->ref_commande) -2); -print $don_id; - -if($return) -{ - if ($retbplc->check_key($retbplc->cle_acceptation)) - { - - - /* - * Validation de la commande - * - */ - - $don = new Don($db); - - $don_id = strstr($retbplc->ref_commande, 0, strlen($retbplc->ref_commande) -2); - - // 5 correspond au paiement en ligne voir table llx_c_paiement - - $don->set_paye($don_id, 5); - - } - -} diff --git a/htdocs/public/bplc/cyberpaiement.class.php b/htdocs/public/bplc/cyberpaiement.class.php deleted file mode 100644 index d8d804eb948..00000000000 --- a/htdocs/public/bplc/cyberpaiement.class.php +++ /dev/null @@ -1,239 +0,0 @@ - - * - * 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. - */ - -/** - * \version $Id$ - */ - -/* Classe de gestion du systeme de paiement de la banque Populaire - * de Lorraine et Champagne - * http://www.cyberpaiement.tm.fr/ - */ - -class Cyberpaiement -{ - - function Cyberpaiement($conf) - /* - * Initialisation des valeurs par d�faut - */ - { - - /* Num�ro abonn� Internet : 6 chiffres */ - - $this->champ000 = $conf->bplc->numabonne; - - /* Code activit� commercant : 4 chiffres */ - - $this->champ001 = $conf->bplc->code_activite; - - /* Num�ro de contrat : 10 chiffres */ - - $this->champ002 = $conf->bplc->num_contrat; - - /* Type de paiement */ - - $this->champ003 = $conf->bplc->typepaiement; - - /* Nom du serveur commercant, champ purement informatif */ - - $this->champ004 = trim($conf->bplc->nom_serveur); - - /* Url du CGI de retour */ - - $this->champ005 = $conf->bplc->cgi_retour; - - /* Nom du commercant */ - - $this->champ006 = $conf->bplc->nom_commercant; - - /* url retour */ - - $this->champ007 = $conf->bplc->url_retour; - - /* Email confirmation commercant*/ - - $this->champ008 = trim($conf->bplc->email_commercant); - - /* Devise : EUR*/ - - $this->champ202 = $conf->bplc->devise; - - /* Adh�rent : 01 */ - - $this->champ900 = $conf->bplc->adherent; - - - /* *********************************************** */ - /* Initialisation � vide des valeurs qui ne seront */ - /* pas transmises */ - /* *********************************************** */ - - $this->champ100 = "."; - $this->champ101 = "."; - $this->champ102 = "."; - $this->champ103 = "."; - $this->champ104 = "."; - $this->champ106 = "."; - $this->champ107 = "."; - $this->champ108 = "."; - $this->champ109 = "."; - $this->champ110 = "."; - - - } - - /* ********************** */ - /* */ - /* Client */ - /* */ - /* ********************** */ - - function set_client($nom,$prenom,$email,$societe='') - { - /* Nom */ - - $this->champ100 = $nom; - - /* Prenom */ - - $this->champ101 = $prenom; - - /* Soci�t� */ - if (strlen(trim($societe))) - { - $this->champ102 = $societe; - } - /* T�l�phone */ - if (strlen(trim($telephone))) - { - $this->champ103 = $telephone; - } - - /* Adresse email */ - - $this->champ104 = trim($email); - - /* Fax */ - if (strlen(trim($fax))) - { - $this->champ106 = $fax; - } - - /* Adresse num�ro et rue */ - if (strlen(trim($adresse))) - { - $this->champ107 = $adresse; - } - - /* Ville */ - if (strlen(trim($ville))) - { - $this->champ108 = $ville; - } - - /* Code Postal */ - if (strlen(trim($cp))) - { - $this->champ109 = trim($cp); - } - - /* Code Pays : purement Informatif */ - if (strlen(trim($pays))) - { - $this->champ110 = trim($pays); - } - } - /* ********************** */ - /* */ - /* Commande */ - /* */ - /* ********************** */ - - function set_commande($ref, $montant) - { - /* R�f�rence */ - - $this->champ200 = $ref; - - /* Montant */ - - $this->champ201 = $montant; - } - /* - * - * - * - */ - function print_hidden() - { - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - print ''; - print "\n"; - } - /* - * - * - * - */ - -} -?> diff --git a/htdocs/public/bplc/index.php b/htdocs/public/bplc/index.php deleted file mode 100644 index 79aab388f44..00000000000 --- a/htdocs/public/bplc/index.php +++ /dev/null @@ -1,31 +0,0 @@ - - * - * 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. - */ - -/** - * \file htdocs/public/bplc/index.php - * \ingroup core - * \brief A redirect page to an error - * \author Laurent Destailleur - * \version $Id$ - */ - -require("../../master.inc.php"); - -header("Location: ".DOL_URL_ROOT.'/public/error-404.php'); - -?> diff --git a/htdocs/public/bplc/merci_code.php b/htdocs/public/bplc/merci_code.php deleted file mode 100644 index 17d8c6b58de..00000000000 --- a/htdocs/public/bplc/merci_code.php +++ /dev/null @@ -1,59 +0,0 @@ - - * - * 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. - */ - -/** - * \file htdocs/public/bplc/merci_code.php - * \ingroup banque - * \brief File to offer a way to make a payment by BPLC - * \version $Id$ - */ - -require("../../master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/public/bplc/retourbplc.class.php"); -require_once(DOL_DOCUMENT_ROOT."/don.class.php"); - -// Define lang object automatically using browser language -$langs->setDefaultLang('auto'); - -// Security check -if (empty($conf->banque->enabled)) accessforbidden('',1,1,1); - - -if ($conf->don->onlinepayment) -{ - require(DOL_DOCUMENT_ROOT."public/bplc/cyberpaiement.class.php"); - - $cyberp = new Cyberpaiement($conf); - - print "
bplc->url."\" method=\"post\">\n"; - - $cyberp->set_client($_POST["nom"], - $_POST["prenom"], - $_POST["email"], - $_POST["societe"]); - - $cyberp->set_commande($ref_commande ."10", - $_POST["montant"]); - - $cyberp->print_hidden(); - - - - print ""; - print "
"; -} diff --git a/htdocs/public/bplc/retourbplc.class.php b/htdocs/public/bplc/retourbplc.class.php deleted file mode 100644 index c40615db286..00000000000 --- a/htdocs/public/bplc/retourbplc.class.php +++ /dev/null @@ -1,288 +0,0 @@ - - * - * 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. - * - * Classe de gestion du retour RSTS du systeme de paiement en ligne - * CyberPaiement (TM) de la Banque Populaire de Lorraine - * - * Certaine fonction de cette classe existe de base dans PHP4 mais ont ete - * re-ecrites ici pour le support de PHP3 - */ - -/** - * \version $Id$ - */ - -class Retourbplc -{ - var $db; - - var $ipclient; - var $montant; - var $num_compte; - var $ref_commande; - var $num_contrat; - var $num_transaction; - var $date_transaction; - var $heure_transaction; - var $num_autorisation; - var $cle_acceptation; - var $code_retour; - - var $ref_commande; - - /* - * Initialisation des valeurs par d�faut - */ - - function Retourbplc($db) - { - $this->db = $db; - } - - /** - * \brief Insertion dans la base de donn�e de la transaction - * - */ - - function insertdb() - { - - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."transaction_bplc"; - $sql .= " (ipclient, - num_transaction, - date_transaction, - heure_transaction, - num_autorisation, - cle_acceptation, - code_retour, - ref_commande)"; - - $sql .= " VALUES ('$this->ipclient', - '$this->num_transaction', - '$this->date_transaction', - '$this->heure_transaction', - '$this->num_autorisation', - '$this->cle_acceptation', - $this->code_retour, - $this->ref_commande)"; - - $result = $this->db->query($sql); - - if ($result) - { - return $this->db->last_insert_id(MAIN_DB_PREFIX."transaction_bplc"); - } - else - { - print $this->db->error(); - print "


$sql

"; - return 0; - } - } - - /** - * \brief Verification de la validit�e de la cl� - * - */ - - function check_key($key) - { - - $A = $this->montant; - $B = $this->num_contrat; - $C = $this->num_transaction; - $D = $this->ref_commande; - $E = $this->num_compte; - - /* - * Etape 1 - * - */ - $A1 = $A . $E; - $B1 = $B . $E; - $C1 = $C . $E; - $D1 = $D . $E; - - $map = range(0, 9); - - $L1= $this->cle_luhn($A1, $map); - - $L2= $this->cle_luhn($B1, $map); - - $L3= $this->cle_luhn($C1, $map); - - $L4= $this->cle_luhn($D1, $map); - /* - * Etape 2 - * - */ - - $N1 = $L1 . $L2 . $L3 . $L4; - $N0 = $L1 + $L2 + $L3 + $L4; - - $C5 = $this->corres($N0); - /* - * Comparaison - * - */ - - if ($key == $this->calcul_pos($N1,$N0, $C5)) - { - return 1; - } - else - { - return 0; - } - } - - /** - * \brief Table de correspondance de l'algorithme de Luhn - * - */ - - function corres($value) - { - $map[0] = 0; - - for ($i = 65 ; $i < 91 ; $i++) - { - $map[$i-64] = chr($i); - } - - for ($i = 0 ; $i < 10 ; $i++) - { - $map[27+$i] = $i; - } - - return $map[$value]; - - } - - /** - * \brief Calcul de la cle de Luhn - * - */ - function cle_luhn($cle, $map) - { - $buffer = $this->array_reverse($cle); - - $totalVal = 0; - $flip = 1; - - reset ($buffer); - - while (list($key, $posVal) = each ($buffer)) - { - - if (!isset($map[$posVal])){ - return FALSE; - } - - $posVal = $map[$posVal]; - - if ( $flip = !$flip) - { - $posVal *= 2; - } - - while ($posVal>0) - { - $totalVal += $posVal % 10; - $posVal = floor($posVal / 10); - } - } - - return substr($totalVal, strlen($totalVal)-1, 1); - } - /** - * \brief Postion de C5 dans N0 - * - * - */ - - function calcul_pos($N1, $N0, $C5) - { - if ($N0 >= 0 && $N0 <= 6) - { - /* cl� = 2 premiers de N0 . C5 . 2 derniers de N0 */ - - $cle = substr($N1,0,2) . $C5 . substr($N1,2,2); - - } - elseif ($N0 >= 7 && $N0 <= 14) - { - /* cl� = 4 premiers de N0 . C5 */ - - $cle = substr($N1,0,4) . $C5; - - } - elseif ($N0 >= 15 && $N0 <= 21) - { - /* cl� = premier de N1 . C5 . 3 derniers de N1 */ - - $cle = substr($N1,0,1) . $C5 . substr($N1,1,3); - - } - elseif ($N0 >= 22 && $N0 <= 29) - { - /* cl� = C5 . 4 derniers de N1 */ - - $cle = $C5 . substr($N1,0,4); - - } - elseif ($N0 >= 30 && $N0 <= 36) - { - /* cl� = 3 premiers de N1 . C5 . dernier de N1 */ - - $cle = substr($N1,0,3) . $C5 . substr($N1,1,1); - - } - else - { - $cle = "ERREUR"; - } - - return $cle; - - } - - /** - * \brief Retournement du tableau - * - */ - - function array_reverse($string) - { - - $len = strlen($string); - - $i = $len; - $j = 0; - $rever = array(); - while ($i > 0) - { - $rever[$j]= substr($string, $i-1, 1); - $i = $i - 1; - $j = $j + 1; - } - - return $rever; - } -} -?> diff --git a/htdocs/public/bplc/testretour.php b/htdocs/public/bplc/testretour.php deleted file mode 100644 index 1de9dab051b..00000000000 --- a/htdocs/public/bplc/testretour.php +++ /dev/null @@ -1,50 +0,0 @@ - - * - * 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. - */ - -/** - * \file htdocs/public/bplc/testretour.php - * \ingroup banque - * \brief Page to test the back link page bplc.php - * \version $Id$ - */ - -require("../../master.inc.php"); - -// Define lang object automatically using browser language -$langs->setDefaultLang('auto'); - -// Security check -if (empty($conf->banque->enabled)) accessforbidden('',1,1,1); - -?> -
- - - - - - - - - - - - - - -
diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 6705656a7db..5794f5e0c8c 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -25,10 +25,9 @@ * \version $Id$ */ -require("../../master.inc.php"); +define("NOLOGIN",1); // This means this output page does not require to be logged. -$langcode=(empty($_GET["lang"])?'auto':$_GET["lang"]); -$langs->setDefaultLang($langcode); +require("../../main.inc.php"); $langs->load("main"); $langs->load("other"); diff --git a/htdocs/public/donations/donateurs_code.php b/htdocs/public/donations/donateurs_code.php index a0213586ef7..61d6b72733d 100644 --- a/htdocs/public/donations/donateurs_code.php +++ b/htdocs/public/donations/donateurs_code.php @@ -23,11 +23,10 @@ * \version $Id$ */ -require("../../master.inc.php"); -require_once(DOL_DOCUMENT_ROOT ."/don.class.php"); +define("NOLOGIN",1); // This means this output page does not require to be logged. -// Define lang object automatically using browser language -$langs->setDefaultLang('auto'); +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT ."/don.class.php"); // Security check if (empty($conf->don->enabled)) accessforbidden('',1,1,1); diff --git a/htdocs/public/donations/therm.php b/htdocs/public/donations/therm.php index d5156255f78..76589351bd7 100644 --- a/htdocs/public/donations/therm.php +++ b/htdocs/public/donations/therm.php @@ -24,13 +24,12 @@ * \version $Id$ */ -require("../../master.inc.php"); +define("NOLOGIN",1); // This means this output page does not require to be logged. + +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/images.lib.php"); require_once(DOL_DOCUMENT_ROOT."/don.class.php"); -// Define lang object automatically using browser language -$langs->setDefaultLang('auto'); - // Security check if (empty($conf->don->enabled)) accessforbidden('',1,1,1); diff --git a/htdocs/public/members/index.php b/htdocs/public/members/index.php index aa963ad8b9b..e98ec22c97b 100644 --- a/htdocs/public/members/index.php +++ b/htdocs/public/members/index.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2009-2010 Laurent Destailleur * * 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 diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index e1ec93b908a..6d8fc1305b0 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -25,15 +25,14 @@ * \version $Id$ */ -require("../../master.inc.php"); +define("NOLOGIN",1); // This means this output page does not require to be logged. + +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php"); require_once(DOL_DOCUMENT_ROOT."/html.form.class.php"); -// Define lang object automatically using browser language -$langs->setDefaultLang('auto'); - // Security check if (empty($conf->adherent->enabled)) accessforbidden('',1,1,1); diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index 2e098befe43..80f383b1264 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -25,14 +25,13 @@ * \version $Id$ */ -require("../../master.inc.php"); +define("NOLOGIN",1); // This means this output page does not require to be logged. + +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php"); require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php"); -// Define lang object automatically using browser language -$langs->setDefaultLang('auto'); - // Security check if (empty($conf->adherent->enabled)) accessforbidden('',1,1,1); diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index aadeef14eab..61fd6e365e4 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -25,10 +25,9 @@ * \version $Id$ */ -require("../../master.inc.php"); +define("NOLOGIN",1); // This means this output page does not require to be logged. -// Define lang object automatically using browser language -$langs->setDefaultLang('auto'); +require("../../main.inc.php"); // Security check if (empty($conf->adherent->enabled)) accessforbidden('',1,1,1); diff --git a/htdocs/public/paybox/newpayment.php b/htdocs/public/paybox/newpayment.php index b2944148c53..ad5381e8087 100644 --- a/htdocs/public/paybox/newpayment.php +++ b/htdocs/public/paybox/newpayment.php @@ -26,12 +26,16 @@ * \version $Id$ */ -// Init session. Name of session is specific to Dolibarr instance. -$sessionname='DOLSESSID_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]); -$sessiontimeout='DOLSESSTIMEOUT_'.md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]); -if (! empty($_COOKIE[$sessiontimeout])) ini_set('session.gc_maxlifetime',$_COOKIE[$sessiontimeout]); -session_name($sessionname); -session_start(); +define("NOLOGIN",1); // This means this output page does not require to be logged. + +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/paybox/paybox.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/product.class.php"); + +// Security check +if (empty($conf->paybox->enabled)) accessforbidden('',1,1,1); // Creation d'un jeton contre les failles CSRF $token = md5(uniqid(mt_rand(),TRUE)); // Genere un hash d'un nombre aleatoire @@ -48,18 +52,6 @@ if (isset($_POST['token']) && isset($_SESSION['token'])) } } -require("../../master.inc.php"); -require_once(DOL_DOCUMENT_ROOT."/paybox/paybox.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); -require_once(DOL_DOCUMENT_ROOT."/product.class.php"); - -$langcode=(empty($_GET["lang"])?'auto':$_GET["lang"]); -$langs->setDefaultLang($langcode); - -// Security check -if (empty($conf->paybox->enabled)) accessforbidden('',1,1,1); - $langs->load("main"); $langs->load("other"); $langs->load("paybox"); diff --git a/htdocs/public/paybox/paymentko.php b/htdocs/public/paybox/paymentko.php index e4936d5f819..61301a23ac4 100644 --- a/htdocs/public/paybox/paymentko.php +++ b/htdocs/public/paybox/paymentko.php @@ -25,13 +25,12 @@ * \version $Id$ */ -require("../../master.inc.php"); +define("NOLOGIN",1); // This means this output page does not require to be logged. + +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/paybox/paybox.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); -$langcode=(empty($_GET["lang"])?'auto':$_GET["lang"]); -$langs->setDefaultLang($langcode); - // Security check if (empty($conf->paybox->enabled)) accessforbidden('',1,1,1); diff --git a/htdocs/public/paybox/paymentok.php b/htdocs/public/paybox/paymentok.php index 2ceb00000de..9a2b0717f47 100644 --- a/htdocs/public/paybox/paymentok.php +++ b/htdocs/public/paybox/paymentok.php @@ -25,13 +25,12 @@ * \version $Id$ */ -require("../../master.inc.php"); +define("NOLOGIN",1); // This means this output page does not require to be logged. + +require("../../main.inc.php"); require_once(DOL_DOCUMENT_ROOT."/paybox/paybox.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); -$langcode=(empty($_GET["lang"])?'auto':$_GET["lang"]); -$langs->setDefaultLang($langcode); - // Security check if (empty($conf->paybox->enabled)) accessforbidden('',1,1,1);