From bf420e07b6a8ed6d0a42cdaef5f3f70ad58ce7fc Mon Sep 17 00:00:00 2001
From: marknl <marknl@ispconfig3>
Date: Fri, 26 Aug 2011 09:17:19 -0400
Subject: [PATCH] FS#1516 - Text color for input fields 

---
 interface/lib/app.inc.php |   17 ++++++++++++-----
 1 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/interface/lib/app.inc.php b/interface/lib/app.inc.php
index 6465c41..0690d5d 100644
--- a/interface/lib/app.inc.php
+++ b/interface/lib/app.inc.php
@@ -75,6 +75,11 @@
 
 		$this->uses('auth,plugin,functions');
 	}
+	
+	public function __destruct() {
+		session_write_close();
+		if(isset($this->db)) $this->db->closeConn();
+	}
 
 	public function uses($classes) {
 		$cl = explode(',', $classes);
@@ -157,13 +162,15 @@
 
 	/** Translates strings in current language */
 	public function lng($text) {
+		global $conf;
 		if($this->_language_inc != 1) {
+			$language = (isset($_SESSION['s']['language']))?$_SESSION['s']['language']:$conf['language'];
 			//* loading global Wordbook
-			$this->load_language_file('/lib/lang/'.$_SESSION['s']['language'].'.lng');
+			$this->load_language_file('lib/lang/'.$language.'.lng');
 			//* Load module wordbook, if it exists
-			if(isset($_SESSION['s']['module']['name']) && isset($_SESSION['s']['language'])) {
-				$lng_file = '/web/'.$_SESSION['s']['module']['name'].'/lib/lang/'.$_SESSION['s']['language'].'.lng';
-				if(!file_exists(ISPC_ROOT_PATH.$lng_file)) $lng_file = '/web/'.$_SESSION['s']['module']['name'].'/lib/lang/en.lng';
+			if(isset($_SESSION['s']['module']['name'])) {
+				$lng_file = 'web/'.$_SESSION['s']['module']['name'].'/lib/lang/'.$language.'.lng';
+				if(!file_exists(ISPC_ROOT_PATH.'/'.$lng_file)) $lng_file = '/web/'.$_SESSION['s']['module']['name'].'/lib/lang/en.lng';
 				$this->load_language_file($lng_file);
 			}
 			$this->_language_inc = 1;
@@ -183,7 +190,7 @@
 		$filename = ISPC_ROOT_PATH.'/'.$filename;
 		if(substr($filename,-4) != '.lng') $this->error('Language file has wrong extension.');
 		if(file_exists($filename)) {
-			@include_once($filename);
+			@include($filename);
 			if(is_array($wb)) {
 				if(is_array($this->_wb)) {
 					$this->_wb = array_merge($this->_wb,$wb);

--
Gitblit v1.9.1