From 77f138710c5d068d9d4cbef2c6e9255722896987 Mon Sep 17 00:00:00 2001
From: Regis Houssin <regis@dolibarr.fr>
Date: Wed, 29 Dec 2010 19:20:20 +0000
Subject: [PATCH] Fix: better solution with new system

---
 htdocs/lib/functions.lib.php | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php
index 2294778722f..3ec3b690eee 100644
--- a/htdocs/lib/functions.lib.php
+++ b/htdocs/lib/functions.lib.php
@@ -72,18 +72,8 @@ function GETPOST($paramname,$check='',$method=0)
  */
 function dol_getprefix()
 {
-    // Add real path in session name
-    $realpath='';
-    if (preg_match('/^([^.]+)\/htdocs\//i', realpath($_SERVER["SCRIPT_FILENAME"]), $regs)) $realpath = isset($regs[1])?$regs[1]:'';
-    if (defined('DOL_DOCUMENT_ROOT_ALT') && DOL_DOCUMENT_ROOT_ALT)
-    {
-        $realpath='';
-        // Warning, using alt feature is a security hole because path is not in session name, so being authenticated into an instance allow access on another
-        // FIXME The fix is to use only "root url" like the one defined into $dolibarr_main_url_root
-    }
-    //print "x".$realpath."-".$_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]."-".md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"]);
-    //return md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].$realpath);
-    return md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].$realpath);
+    //print  "prefix=".$_SERVER["SERVER_NAME"]."-".$_SERVER["DOCUMENT_ROOT"]."-".DOL_DOCUMENT_ROOT;
+    return md5($_SERVER["SERVER_NAME"].$_SERVER["DOCUMENT_ROOT"].DOL_DOCUMENT_ROOT);
 }
 
 /**
-- 
GitLab