Merged changes form main trunk (2.2.8, 2.2.9)
[fa-stable.git] / includes / session.inc
index 5c5ec42be41a5e208924c0a6593a7e8fedf126b5..4a92fe238f80656ff65ee56a498aa12dfed98ada 100644 (file)
@@ -174,7 +174,7 @@ include_once($path_to_root . "/includes/prefs/sysprefs.inc");
 
 ini_set('session.gc_maxlifetime', 36000); // 10hrs
 
-session_name('FrontAccounting');
+session_name('FA'.md5(dirname(__FILE__)));
 session_start();
 
 // this is to fix the "back-do-you-want-to-refresh" issue - thanx PHPFreaks
@@ -246,7 +246,9 @@ if (strstr($_SERVER['PHP_SELF'], 'logout.php') == false){
                                $Ajax->activate('_page_body');
                        exit;
                } else {
-                       $succeed = $_SESSION["wa_current_user"]->login($_POST["company_login_name"],
+
+                       $succeed = isset($db_connections[$_POST["company_login_name"]]) &&
+                               $_SESSION["wa_current_user"]->login($_POST["company_login_name"],
                                $_POST["user_name_entry_field"], md5($_POST["password"]));
                        // select full vs fallback ui mode on login
                        $_SESSION["wa_current_user"]->ui_mode = $_POST['ui_mode'];