0) { $row = mysql_fetch_array($result); if (strnatcmp($row['expiration'], $row['now']) < 0) { // deletion of the session from the database, because it is // out-of-date $delete_query = ' DELETE FROM '.SESSIONS_TABLE.' WHERE id = \''.$page['session_id'].'\' ;'; pwg_query($delete_query); } else { $user['id'] = $row['user_id']; $user['is_the_guest'] = false; } } } if (!isset($user['id'])) { $user['id'] = $conf['guest_id']; $user['is_the_guest'] = true; } // using Apache authentication override the above user search if ($conf['apache_authentication'] and isset($_SERVER['REMOTE_USER'])) { if (!($user['id'] = get_userid($_SERVER['REMOTE_USER']))) { register_user($_SERVER['REMOTE_USER'], '', ''); $user['id'] = get_userid($_SERVER['REMOTE_USER']); } $user['is_the_guest'] = false; } $use_cache = (defined('IN_ADMIN') and IN_ADMIN) ? false : true; $user = array_merge($user, getuserdata($user['id'], $use_cache)); // properties of user guest are found in the configuration if ($user['is_the_guest']) { $user['template'] = $conf['default_template']; $user['nb_image_line'] = $conf['nb_image_line']; $user['nb_line_page'] = $conf['nb_line_page']; $user['language'] = $conf['default_language']; $user['maxwidth'] = $conf['default_maxwidth']; $user['maxheight'] = $conf['default_maxheight']; $user['recent_period'] = $conf['recent_period']; $user['expand'] = $conf['auto_expand']; $user['show_nb_comments'] = $conf['show_nb_comments']; } // calculation of the number of picture to display per page $user['nb_image_page'] = $user['nb_image_line'] * $user['nb_line_page']; ?>