2
0
forked from Wavyzz/dolibarr

change for external module

This commit is contained in:
Regis Houssin
2011-09-03 15:27:23 +00:00
parent 084f846a0c
commit f30f2bef79
6 changed files with 18 additions and 22 deletions

View File

@@ -148,7 +148,7 @@ class Conf
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_LOGIN_METHOD$/i',$key,$reg)) elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_LOGIN_METHOD$/i',$key,$reg))
{ {
$modulename = strtolower($reg[1]); $modulename = strtolower($reg[1]);
$this->login_method_modules[] = DOL_DOCUMENT_ROOT.'/'.$modulename.'/includes/login/'; $this->login_method_modules[] = dol_buildpath('/'.$modulename.'/includes/login/');
} }
// If this is constant for hook activated by a module. Value is list of hooked tabs separated with : // If this is constant for hook activated by a module. Value is list of hooked tabs separated with :
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_HOOKS$/i',$key,$reg)) elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_HOOKS$/i',$key,$reg))

View File

@@ -130,7 +130,7 @@ class InterfaceDemo
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
} }
elseif ($action == 'USER_DISABLE') elseif ($action == 'USER_ENABLEDISABLE')
{ {
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id); dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
} }

View File

@@ -14,4 +14,7 @@ UPDATE llx_c_paper_format SET active=1 WHERE active=0;
ALTER TABLE llx_product_fournisseur_price ADD COLUMN fk_availability integer AFTER fk_product_fournisseur; ALTER TABLE llx_product_fournisseur_price ADD COLUMN fk_availability integer AFTER fk_product_fournisseur;
ALTER TABLE llx_element_element MODIFY COLUMN sourcetype varchar(32) NOT NULL; ALTER TABLE llx_element_element MODIFY COLUMN sourcetype varchar(32) NOT NULL;
ALTER TABLE llx_element_element MODIFY COLUMN targettype varchar(32) NOT NULL; ALTER TABLE llx_element_element MODIFY COLUMN targettype varchar(32) NOT NULL;
ALTER TABLE llx_user MODIFY ref_ext varchar(50);
ALTER TABLE llx_user ADD COLUMN ref_int varchar(50) AFTER ref_ext;

View File

@@ -1,7 +1,7 @@
-- ============================================================================ -- ============================================================================
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net> -- Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
-- Copyright (C) 2007-2009 Regis Houssin <regis@dolibarr.fr> -- Copyright (C) 2007-2011 Regis Houssin <regis@dolibarr.fr>
-- --
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
@@ -23,7 +23,8 @@ create table llx_user
rowid integer AUTO_INCREMENT PRIMARY KEY, rowid integer AUTO_INCREMENT PRIMARY KEY,
entity integer DEFAULT 1 NOT NULL, -- multi company id entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(30), -- reference into an external system (not used by dolibarr) ref_ext varchar(50), -- reference into an external system (not used by dolibarr)
ref_int varchar(50), -- reference into an internal system (used by dolibarr)
datec datetime, datec datetime,
tms timestamp, tms timestamp,
@@ -58,12 +59,3 @@ create table llx_user
photo varchar(255), -- filename or url of photo photo varchar(255), -- filename or url of photo
lang varchar(6) lang varchar(6)
)ENGINE=innodb; )ENGINE=innodb;
--
-- List of codes for the field entity
--
-- 0 : superadmin or global user
-- 1 : first company user
-- 2 : second company user
-- 3 : etc...
--

View File

@@ -510,7 +510,7 @@ if (! defined('NOLOGIN'))
} }
else else
{ {
if (! empty($conf->MAIN_ACTIVATE_UPDATESESSIONTRIGGER)) // We do not execute such trigger at each page load by default if (! empty($conf->global->MAIN_ACTIVATE_UPDATESESSIONTRIGGER)) // We do not execute such trigger at each page load by default
{ {
// Call triggers // Call triggers
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php"); include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");

View File

@@ -142,7 +142,8 @@ class User extends CommonObject
$sql.= " u.datelastlogin as datel,"; $sql.= " u.datelastlogin as datel,";
$sql.= " u.datepreviouslogin as datep,"; $sql.= " u.datepreviouslogin as datep,";
$sql.= " u.photo as photo,"; $sql.= " u.photo as photo,";
$sql.= " u.openid as openid"; $sql.= " u.openid as openid,";
$sql.= " u.ref_int, u.ref_ext";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
if(! empty($conf->multicompany->enabled) && $conf->entity == 1) if(! empty($conf->multicompany->enabled) && $conf->entity == 1)
@@ -176,6 +177,9 @@ class User extends CommonObject
{ {
$this->id = $obj->rowid; $this->id = $obj->rowid;
$this->ref = $obj->rowid; $this->ref = $obj->rowid;
$this->ref_int = $obj->ref_int;
$this->ref_ext = $obj->ref_ext;
$this->ldap_sid = $obj->ldap_sid; $this->ldap_sid = $obj->ldap_sid;
$this->nom = $obj->name; // TODO deprecated $this->nom = $obj->name; // TODO deprecated
@@ -602,16 +606,14 @@ class User extends CommonObject
$error=0; $error=0;
// Check parameters // Check parameters
if ($this->statut == $statut) if ($this->statut == $statut) return 0;
{ else $this->statut = $statut;
return 0;
}
$this->db->begin(); $this->db->begin();
// Desactive utilisateur // Desactive utilisateur
$sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql = "UPDATE ".MAIN_DB_PREFIX."user";
$sql.= " SET statut = ".$statut; $sql.= " SET statut = ".$this->statut;
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
$result = $this->db->query($sql); $result = $this->db->query($sql);
@@ -634,7 +636,6 @@ class User extends CommonObject
else else
{ {
$this->db->commit(); $this->db->commit();
$this->statut=$statut;
return 1; return 1;
} }
} }