This commit is contained in:
fhenry 2013-05-04 09:06:32 +02:00
commit bdb81803bd
6 changed files with 36 additions and 36 deletions

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
*
* This program is free software; you can redistribute it and/or modify

View File

@ -410,7 +410,7 @@ class Conf
$this->maxfilesize = (empty($this->global->MAIN_UPLOAD_DOC) ? 0 : $this->global->MAIN_UPLOAD_DOC * 1024);
// Define list of limited modules
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='facture,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later.
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,facture,commande,fournisseur,contact,propal,projet,contrat,societe,ficheinter,expedition,agenda'; // '' means 'all'. Note that contact is added here as it should be a module later.
// Timeouts
if (empty($this->global->MAIN_USE_CONNECT_TIMEOUT)) $this->global->MAIN_USE_CONNECT_TIMEOUT=10;

View File

@ -186,9 +186,9 @@ function show_array_actions_to_do($max=5)
$sql.= " s.nom as sname, s.rowid, s.client";
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,";
$sql.= " ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ")";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
$sql.= " WHERE c.id = a.fk_action";
$sql.= " AND a.entity = ".$conf->entity;
$sql.= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep2 > '".$db->idate($now)."'))";
@ -285,9 +285,9 @@ function show_array_last_actions_done($max=5)
$sql.= " s.rowid, s.nom as sname, s.client";
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,";
$sql.= " ".MAIN_DB_PREFIX."actioncomm as a";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.=")";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON a.fk_soc = s.rowid";
$sql.= " WHERE c.id = a.fk_action";
$sql.= " AND a.entity = ".$conf->entity;
$sql.= " AND (a.percent >= 100 OR (a.percent = -1 AND a.datep2 <= '".$db->idate($now)."'))";

View File

@ -1,26 +1,26 @@
README (english)
---------------------------------------------
Decription of htdocs/core/login directory
---------------------------------------------
This directory contains files that handle way to validate passwords.
If you want to add a new password checker function, just add a file in
this directory that follow example of already existing files.
This file must be called for example :
functions_mypasschecker.php
Edit function name to call it:
check_user_mypasschecker
Change code of this function to return true if couple
$usertotest / $passwordtotest is ok for you.
Then, you must edit you conf.php file to change the value of
$dolibarr_main_authentication
parameter to set it to :
mypasschecker
Once this is done, when you log in to Dolibarr, the function
check_user_mypasschecker in this file is called.
If the function return true and login exists, login is accepted.
README (english)
---------------------------------------------
Decription of htdocs/core/login directory
---------------------------------------------
This directory contains files that handle way to validate passwords.
If you want to add a new password checker function, just add a file in
this directory that follow example of already existing files.
This file must be called for example :
functions_mypasschecker.php
Edit function name to call it:
check_user_mypasschecker
Change code of this function to return true if couple
$usertotest / $passwordtotest is ok for you.
Then, you must edit you conf.php file to change the value of
$dolibarr_main_authentication
parameter to set it to :
mypasschecker
Once this is done, when you log in to Dolibarr, the function
check_user_mypasschecker in this file is called.
If the function return true and login exists, login is accepted.

View File

@ -150,11 +150,11 @@ if (! empty($dolibarr_main_document_root_alt))
// Define DOL_MAIN_URL_ROOT and DOL_URL_ROOT
$tmp='';
$found=0;
$real_dolibarr_main_document_root=str_replace('\\','/',realpath($dolibarr_main_document_root));
$pathroot=$_SERVER["DOCUMENT_ROOT"];
$paths=explode('/',str_replace('\\','/',$_SERVER["SCRIPT_NAME"]));
$real_dolibarr_main_document_root=str_replace('\\','/',realpath($dolibarr_main_document_root)); // A) Ex: C:/xxx/dolibarr/htdocs
$pathroot=$_SERVER["DOCUMENT_ROOT"]; // B) Ex: C:/Program Files/wamp/www/
$paths=explode('/',str_replace('\\','/',$_SERVER["SCRIPT_NAME"])); // C) Ex: /dolibarr/htdocs/admin/system/phpinfo.php
$concatpath='';
foreach($paths as $tmppath)
foreach($paths as $tmppath) // We check to find (B+start of C)=A
{
if ($tmppath) $concatpath.='/'.$tmppath;
//print $_SERVER["SCRIPT_NAME"].'-'.$pathroot.'-'.$concatpath.'-'.$real_dolibarr_main_document_root.'-'.realpath($pathroot.$concatpath).'<br>';

View File

@ -63,6 +63,7 @@ if ($user->id == $id && (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user-
$feature2='';
$canreaduser=1;
}
$result = restrictedArea($user, 'user', $id, '&user', $feature2);
if ($user->id <> $id && ! $canreaduser) accessforbidden();
@ -268,8 +269,7 @@ print '</table><br>';
if ($user->admin) print info_admin($langs->trans("WarningOnlyPermissionOfActivatedModules"), 0, 1).'<br>';
// Show warning about external users
print showModulesExludedForExternal($modules).'<br>'."\n";
print "<br>\n";
if (empty($user->societe_id)) print showModulesExludedForExternal($modules).'<br><br>'."\n";
// For multicompany transversal mode
if (! empty($conf->multicompany->enabled) && ! empty($conf->multicompany->transverse_mode))