From 016dbd39ee6535bb8099a9b2a2d3ed31305e951f Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 23 Oct 2015 15:24:47 +0200 Subject: [PATCH] Fix sql phpunit regression --- htdocs/install/mysql/migration/3.9.0-4.0.0.sql | 2 -- htdocs/install/mysql/tables/llx_user.sql | 2 +- htdocs/user/class/user.class.php | 10 +++++++--- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index 231b89ee507..accf65266c1 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -86,5 +86,3 @@ CREATE TABLE IF NOT EXISTS llx_establishment ( status tinyint DEFAULT 1 ) ENGINE=InnoDB; -ALTER TABLE llx_user ADD COLUMN employee tinyint DEFAULT 0 AFTER ref_int; - diff --git a/htdocs/install/mysql/tables/llx_user.sql b/htdocs/install/mysql/tables/llx_user.sql index c9673ceb360..e1fc421c911 100644 --- a/htdocs/install/mysql/tables/llx_user.sql +++ b/htdocs/install/mysql/tables/llx_user.sql @@ -26,7 +26,7 @@ create table llx_user ref_ext varchar(50), -- reference into an external system (not used by dolibarr) ref_int varchar(50), -- reference into an internal system (deprecated) - employee tinyint DEFAULT 0, -- 1 if user is an employee + employee tinyint DEFAULT 1, -- 1 if user is an employee datec datetime, tms timestamp, diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 066da9c18da..ae56be28aec 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -126,13 +126,17 @@ class User extends CommonObject { $this->db = $db; - // Preference utilisateur + // User preference $this->liste_limit = 0; $this->clicktodial_loaded = 0; + // For cache usage $this->all_permissions_are_loaded = 0; - $this->admin=0; - + + // Force some default values + $this->admin = 0; + $this->employee = 1; + $this->conf = new stdClass(); $this->rights = new stdClass(); $this->rights->user = new stdClass();