forked from Wavyzz/dolibarr
change for external module
This commit is contained in:
@@ -148,7 +148,7 @@ class Conf
|
||||
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_LOGIN_METHOD$/i',$key,$reg))
|
||||
{
|
||||
$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 :
|
||||
elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_HOOKS$/i',$key,$reg))
|
||||
|
||||
@@ -130,7 +130,7 @@ class InterfaceDemo
|
||||
{
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -15,3 +15,6 @@ ALTER TABLE llx_product_fournisseur_price ADD COLUMN fk_availability integer AFT
|
||||
|
||||
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_user MODIFY ref_ext varchar(50);
|
||||
ALTER TABLE llx_user ADD COLUMN ref_int varchar(50) AFTER ref_ext;
|
||||
@@ -1,7 +1,7 @@
|
||||
-- ============================================================================
|
||||
-- Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
-- 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
|
||||
-- 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,
|
||||
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,
|
||||
tms timestamp,
|
||||
@@ -58,12 +59,3 @@ create table llx_user
|
||||
photo varchar(255), -- filename or url of photo
|
||||
lang varchar(6)
|
||||
)ENGINE=innodb;
|
||||
|
||||
--
|
||||
-- List of codes for the field entity
|
||||
--
|
||||
-- 0 : superadmin or global user
|
||||
-- 1 : first company user
|
||||
-- 2 : second company user
|
||||
-- 3 : etc...
|
||||
--
|
||||
@@ -510,7 +510,7 @@ if (! defined('NOLOGIN'))
|
||||
}
|
||||
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
|
||||
include_once(DOL_DOCUMENT_ROOT . "/core/class/interfaces.class.php");
|
||||
|
||||
@@ -142,7 +142,8 @@ class User extends CommonObject
|
||||
$sql.= " u.datelastlogin as datel,";
|
||||
$sql.= " u.datepreviouslogin as datep,";
|
||||
$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";
|
||||
|
||||
if(! empty($conf->multicompany->enabled) && $conf->entity == 1)
|
||||
@@ -177,6 +178,9 @@ class User extends CommonObject
|
||||
$this->id = $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->nom = $obj->name; // TODO deprecated
|
||||
$this->lastname = $obj->name;
|
||||
@@ -602,16 +606,14 @@ class User extends CommonObject
|
||||
$error=0;
|
||||
|
||||
// Check parameters
|
||||
if ($this->statut == $statut)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
if ($this->statut == $statut) return 0;
|
||||
else $this->statut = $statut;
|
||||
|
||||
$this->db->begin();
|
||||
|
||||
// Desactive utilisateur
|
||||
$sql = "UPDATE ".MAIN_DB_PREFIX."user";
|
||||
$sql.= " SET statut = ".$statut;
|
||||
$sql.= " SET statut = ".$this->statut;
|
||||
$sql.= " WHERE rowid = ".$this->id;
|
||||
$result = $this->db->query($sql);
|
||||
|
||||
@@ -634,7 +636,6 @@ class User extends CommonObject
|
||||
else
|
||||
{
|
||||
$this->db->commit();
|
||||
$this->statut=$statut;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user