From 27ce6096425c6a7f4e282078693c4abc5f19d323 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 20 Jan 2008 18:56:34 +0000 Subject: [PATCH] =?UTF-8?q?Qual:=20Supprime=20module=20qui=20n'a=20jamais?= =?UTF-8?q?=20fonctionn=E9=20(pour=20cause=20il=20manque=20des=20tables).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- htdocs/bookmark4u.class.php | 161 ------------------ htdocs/conf/conf.class.php | 3 - .../includes/modules/modBookmark4u.class.php | 108 ------------ htdocs/lib/usergroups.lib.php | 4 +- htdocs/user/addon.php | 51 +----- mssql/tables/llx_bookmark4u_login.sql | 31 ---- mysql/tables/llx_bookmark4u_login.sql | 28 --- pgsql/tables/llx_bookmark4u_login.sql | 34 ---- 8 files changed, 7 insertions(+), 413 deletions(-) delete mode 100644 htdocs/bookmark4u.class.php delete mode 100644 htdocs/includes/modules/modBookmark4u.class.php delete mode 100644 mssql/tables/llx_bookmark4u_login.sql delete mode 100644 mysql/tables/llx_bookmark4u_login.sql delete mode 100644 pgsql/tables/llx_bookmark4u_login.sql diff --git a/htdocs/bookmark4u.class.php b/htdocs/bookmark4u.class.php deleted file mode 100644 index 40efb324fcd..00000000000 --- a/htdocs/bookmark4u.class.php +++ /dev/null @@ -1,161 +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. - * - * $Id$ - * $Source$ - */ - -/** - \file htdocs/bookmark4u.class.php - \brief Fichier de la classe bookmark4u - \author Rodolphe Quiedeville - \version $Revision$ -*/ - -class Bookmark4u -{ - var $db; - - var $id; - - - /** - * \brief Constructeur de la classe - * \param $DB handler accès base de données - * \param $id id de l'utilisateur (0 par défaut) - */ - function Bookmark4u(&$DB, $id=0) - { - $this->db = &$DB; - $this->id = $id; - return 1; - } - - /** - * - * - */ - function get_bk4u_uid($user) - { - $sql = "SELECT bk4u_uid FROM ".MAIN_DB_PREFIX."bookmark4u_login"; - $sql .= " WHERE fk_user =".$user->id; - - if ($this->db->query($sql)) - { - $num = $this->db->num_rows(); - - if ($num == 0) - { - $this->uid = 0; - return 0; - } - else - { - $row = $this->db->fetch_row(); - - $this->uid = $row[0]; - return 0; - } - - $this->db->free(); - } - else - { - return 1; - } - } - - /** - * - * - * - */ - function get_bk4u_login() - { - $sql = "SELECT user FROM bookmark4u.bk4u_passwd"; - $sql .= " WHERE uid =".$this->uid; - - if ($this->db->query($sql)) - { - $num = $this->db->num_rows(); - - if ($num == 0) - { - return 0; - } - else - { - $row = $this->db->fetch_row(); - - $this->login = $row[0]; - return 0; - } - - $this->db->free(); - } - else - { - return 1; - } - } - - - - /** - * \brief Créé un compte bookmark4u - * \param user Objet du user - * \return int <0 si ko, >0 si ok - */ - function create_account_from_user($user) - { - global $langs; - // \todo rendre la base et la table générique - - $sql = "INSERT INTO bookmark4u.bk4u_passwd (user, passwd, name, email, logincnt, rdate)"; - $sql .= " VALUES ('$user->login',password('$user->pass'),'$user->fullname','$user->email',0,now());"; - $resql=$this->db->query($sql); - if ($resql) - { - $this->uid = $this->db->last_insert_id("bookmark4u.bk4u_passwd"); - - $sql = "INSERT INTO ".MAIN_DB_PREFIX."bookmark4u_login"; - $sql .= " (fk_user, bk4u_uid)"; - $sql .= " VALUES ($user->id, $this->uid)"; - - $resql2=$this->db->query($sql); - if ($resql2) - { - return 1; - } - else - { - dolibarr_syslog("Bookmark4u::Create_account_from_user INSERT 2"); - $this->error=$langs->trans("UnknownError"); - return -2; - } - } - else - { - dolibarr_syslog("Bookmark4u::Create_account_from_user INSERT 1"); - $this->error=$langs->trans("UnknownError"); - return -1; - } - - } - -} -?> diff --git a/htdocs/conf/conf.class.php b/htdocs/conf/conf.class.php index 0031f9a8f07..1176df51316 100644 --- a/htdocs/conf/conf.class.php +++ b/htdocs/conf/conf.class.php @@ -154,9 +154,6 @@ class Conf // Module agenda $this->agenda->enabled=defined('MAIN_MODULE_AGENDA')?MAIN_MODULE_AGENDA:0; - // Module bookmark4u - $this->bookmark4u->enabled=defined('MAIN_MODULE_BOOKMARK4U')?MAIN_MODULE_BOOKMARK4U:0; - // Module bookmark $this->bookmark->enabled=defined('MAIN_MODULE_BOOKMARK')?MAIN_MODULE_BOOKMARK:0; diff --git a/htdocs/includes/modules/modBookmark4u.class.php b/htdocs/includes/modules/modBookmark4u.class.php deleted file mode 100644 index 75ef92f5638..00000000000 --- a/htdocs/includes/modules/modBookmark4u.class.php +++ /dev/null @@ -1,108 +0,0 @@ - - * Copyright (C) 2005-2007 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. - * - * $Id$ - */ - -/** - \defgroup bookmark4u Module bookmark4u - \brief Module pour se synchroniser avec bookmark4u -*/ - -/** - \file htdocs/includes/modules/modBookmark4u.class.php - \ingroup bookmark4u - \brief Fichier de description et activation du module Bookmark4u -*/ - -include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php"); - - -/** - \class modBookmark4u - \brief Classe de description et activation du module Bookmark4u -*/ - -class modBookmark4u extends DolibarrModules -{ - - /** - * \brief Constructeur. Definit les noms, constantes et boites - * \param DB handler d'acc�s base - */ - function modBookmark4u($DB) - { - $this->db = $DB ; - $this->numero = 59 ; - - $this->family = "technic"; - $this->name = "Bookmark4u"; - $this->description = "Ajoute fonction pour g�n�rer un compte Bookmark4u depuis un compte Dolibarr"; - - $this->version = 'development'; // 'development' or 'experimental' or 'dolibarr' or version - - $this->const_name = 'MAIN_MODULE_BOOKMARK4U'; - $this->special = 1; - $this->picto='user'; - - // Dir - $this->dirs = array(); - - // D�pendances - $this->depends = array(); - $this->requiredby = array(); - - // Config pages - $this->config_page_url = array(); - - // Constantes - $this->const = array(); - - // Boites - $this->boxes = array(); - - // Permissions - $this->rights = array(); - $this->rights_class = 'bookmark4u'; - } - - /** - * \brief Fonction appel�e lors de l'activation du module. Ins�re en base les constantes, boites, permissions du module. - * D�finit �galement les r�pertoires de donn�es � cr�er pour ce module. - */ - function init() - { - global $conf; - - $sql = array(); - - return $this->_init($sql); - } - - /** - * \brief Fonction appel�e lors de la d�sactivation d'un module. - * Supprime de la base les constantes, boites et permissions du module. - */ - function remove() - { - $sql = array(); - - return $this->_remove($sql); - } -} -?> diff --git a/htdocs/lib/usergroups.lib.php b/htdocs/lib/usergroups.lib.php index b9ec9e1657d..ede3f3e7e2a 100644 --- a/htdocs/lib/usergroups.lib.php +++ b/htdocs/lib/usergroups.lib.php @@ -63,8 +63,8 @@ function user_prepare_head($user) if ($conf->bookmark4u->enabled) { $head[$h][0] = DOL_URL_ROOT.'/user/addon.php?id='.$user->id; - $head[$h][1] = $langs->trans("Bookmark4u"); - $head[$h][2] = 'bookmark4u'; + $head[$h][1] = $langs->trans("Other"); + $head[$h][2] = 'other'; $h++; } diff --git a/htdocs/user/addon.php b/htdocs/user/addon.php index 2766cfa4673..162a068d92a 100644 --- a/htdocs/user/addon.php +++ b/htdocs/user/addon.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2005 Laurent Destailleur + * Copyright (C) 2004-2008 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 @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -27,33 +26,12 @@ */ require("./pre.inc.php"); -require_once DOL_DOCUMENT_ROOT."/bookmark4u.class.php"; require_once(DOL_DOCUMENT_ROOT."/lib/usergroups.lib.php"); $langs->load("users"); $form = new Form($db); -if ($_GET["action"] == 'create_bk4u_login') -{ - $edituser = new User($db, $_GET["id"]); - $edituser->fetch($_GET["id"]); - - $bk4u = new Bookmark4u($db); - $bk4u->get_bk4u_uid($fuser); - $result=$bk4u->create_account_from_user($edituser); - - if ($result > 0) - { - Header("Location: addon.php?id=".$_GET["id"]); - exit; - } - else - { - dolibarr_print_error($db,$bk4u->error); - exit; - } -} llxHeader("","Addon Utilisateur"); @@ -69,16 +47,13 @@ if ($_GET["id"]) $fuser = new User($db, $_GET["id"]); $fuser->fetch(); - $bk4u = new Bookmark4u($db); - $bk4u->get_bk4u_uid($fuser); - /* * Affichage onglets */ $head = user_prepare_head($fuser); - dolibarr_fiche_head($head, 'bookmark4u', $langs->trans("User")); + dolibarr_fiche_head($head, 'other', $langs->trans("User")); /* @@ -99,24 +74,8 @@ if ($_GET["id"]) print ''.$fuser->email.''; print "\n"; - - print "".''.$langs->trans("Login Bookmark4u").''; - print ''; - - if ($bk4u->uid == 0) - { - print $langs->trans("NoLogin"); - } - else - { - $bk4u->get_bk4u_login(); - print $bk4u->login; - } - - print ''; - print "\n"; - - + //... + print "\n"; print "\n"; @@ -130,7 +89,7 @@ if ($_GET["id"]) if ($user->admin) { - print ''.$langs->trans("Créer login Bookmark4u").''; +// print ''.$langs->trans("Créer login Bookmark4u").''; } print "\n"; diff --git a/mssql/tables/llx_bookmark4u_login.sql b/mssql/tables/llx_bookmark4u_login.sql deleted file mode 100644 index 9ff6a2d8b02..00000000000 --- a/mssql/tables/llx_bookmark4u_login.sql +++ /dev/null @@ -1,31 +0,0 @@ --- ============================================================================ --- Copyright (C) 2004 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$ --- $Source$ --- --- =========================================================================== - -create table llx_bookmark4u_login -( - rowid integer IDENTITY PRIMARY KEY, - fk_user integer, - bk4u_uid integer, - -); - -CREATE UNIQUE INDEX fk_user ON llx_bookmark4u_login(fk_user) diff --git a/mysql/tables/llx_bookmark4u_login.sql b/mysql/tables/llx_bookmark4u_login.sql deleted file mode 100644 index e09a93b164e..00000000000 --- a/mysql/tables/llx_bookmark4u_login.sql +++ /dev/null @@ -1,28 +0,0 @@ --- ============================================================================ --- Copyright (C) 2004 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_bookmark4u_login -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - fk_user integer, - bk4u_uid integer, - - UNIQUE INDEX(fk_user) -)type=innodb; diff --git a/pgsql/tables/llx_bookmark4u_login.sql b/pgsql/tables/llx_bookmark4u_login.sql deleted file mode 100644 index 237fba389c1..00000000000 --- a/pgsql/tables/llx_bookmark4u_login.sql +++ /dev/null @@ -1,34 +0,0 @@ --- Generated by dolibarr_mysql2pgsql --- (c) 2004, PostgreSQL Inc. --- (c) 2005, Laurent Destailleur. - --- ============================================================================ --- Copyright (C) 2004 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: llx_bookmark4u_login.sql,v 1.2 2007/12/02 21:53:28 eldy Exp --- =========================================================================== - - -create table llx_bookmark4u_login -( - rowid SERIAL PRIMARY KEY, - "fk_user" integer, - "bk4u_uid" integer, - UNIQUE(fk_user) -); - -CREATE INDEX idx_llx_bookmark4u_login_fk_user ON llx_bookmark4u_login (fk_user);