diff options
author | rvelices <rv-github@modusoptimus.com> | 2006-10-20 02:17:53 +0000 |
---|---|---|
committer | rvelices <rv-github@modusoptimus.com> | 2006-10-20 02:17:53 +0000 |
commit | eaacbc7b2d224524eac6def04e9b721949afd4b8 (patch) | |
tree | 76fd94a28037ffc5ff5bafa037e411c0306ea4f0 /include/functions.inc.php | |
parent | dbadd4defb870c09664ea4178951d72f5d2ada3b (diff) |
- put back config['session_length'] disappeared in r1493 but has always been
used in the code (generates mysql errors on session garbage collector)
- fix auto_login (die mysql when session timed out, but user has remember)
- when a user reconnects from identification.php, the remember cookie was not
deleted
- fix all redirect warnings/errors (many changes - mainly in common.inc.php
and user.inc.php)
- reduced $conf['remember_me_length'] to 60 days, because now at each auto
login the 60 days countdown restarts
git-svn-id: http://piwigo.org/svn/trunk@1568 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/functions.inc.php')
-rw-r--r-- | include/functions.inc.php | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/include/functions.inc.php b/include/functions.inc.php index d23c55fa8..2e7a47b4b 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -584,8 +584,16 @@ function redirect( $url , $msg = '', $refresh_time = 0) { global $user, $template, $lang_info, $conf, $lang, $t2, $page, $debug; - if (!isset($lang_info)) { + if (!isset($lang_info)) + { + $user = build_user( $conf['guest_id'], true); include_once(get_language_filepath('common.lang.php')); + list($tmpl, $thm) = explode('/', $conf['default_template']); + $template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl, $thm); + } + else + { + $template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template'], $user['theme']); } if (empty($msg)) @@ -602,26 +610,6 @@ function redirect( $url , $msg = '', $refresh_time = 0) $url_link = $url; $title = 'redirection'; - unset($template); - if ( isset($user['template']) ) - { - $template = new Template(PHPWG_ROOT_PATH.'template/'.$user['template']); - } - else - { - list($tmpl, $thm) = explode('/', $conf['default_template']); - global $themeconf; - include( - PHPWG_ROOT_PATH - .'template/'.$tmpl - .'/theme/'.$thm - .'/themeconf.inc.php' - ); - $template = new Template(PHPWG_ROOT_PATH.'template/'.$tmpl); - $user['is_the_guest']=true; - $user['id']=$conf['guest_id']; - } - $template->set_filenames( array( 'redirect' => 'redirect.tpl' ) ); include( PHPWG_ROOT_PATH.'include/page_header.php' ); @@ -921,9 +909,9 @@ function str_translate_to_ascii7bits($str) */ function get_themeconf($key) { - global $themeconf; + global $template; - return isset($themeconf[$key]) ? $themeconf[$key] : ''; + return $template->get_themeconf($key); } /** |