commit 09a80de47f613d62fb1937cec965aa6764d0b99f
parent e96b1998646cc8cd601b41bd361ba20845aeb9b3
Author: dankert <devnull@localhost>
Date: Wed, 10 Nov 2004 23:44:02 +0100
Benutzen der Session-Klasse
Diffstat:
2 files changed, 8 insertions(+), 20 deletions(-)
diff --git a/functions/db.inc.php b/functions/db.inc.php
@@ -29,8 +29,9 @@ function table_names()
global $conf;
global $SESS;
- if ( isset($SESS['dbid']) )
- $conf_db_prefix = $conf['database_'.$SESS['dbid']]['prefix'];
+ $db = Session::getDatabase();
+ if ( is_object( $db ) )
+ $conf_db_prefix = $db->conf['prefix'];
else $conf_db_prefix = '';
$t['t_include'] = $conf_db_prefix.'include';
@@ -60,17 +61,8 @@ function table_names()
function db_connection()
{
- global $SESS,
- $conf,
- $db;
- if ( !isset($db) )
- {
- $db = new DB( $conf['database_'.$SESS['dbid']] );
- $db->setFetchMode( DB_FETCHMODE_ASSOC );
- }
-
- return( $db );
+ return Session::getDatabase();
}
//extract( table_names() );
diff --git a/functions/language.inc.php b/functions/language.inc.php
@@ -27,17 +27,13 @@
*/
function lang( $text )
{
- global $SESS;
+ $lang = &Session::getLanguage();
$text = strtoupper($text);
- if ( isset( $SESS['lang'][$text] ) )
- {
- return $SESS['lang'][$text];
- }
+ if ( isset( $lang[$text] ) )
+ return $lang[$text];
else
- {
return( '?'.$text.'?' );
- }
}
@@ -73,7 +69,7 @@ function language_read( $l='' )
$l = language_from_http();
Logger::debug( 'reading language file: '.$l );
- $SESS['lang'] = parse_ini_file( "./language/$l.ini.$conf_php" );
+ Session::setLanguage( parse_ini_file( "./language/$l.ini.$conf_php" ) );
}
?>
\ No newline at end of file