fix admin_session "bug"

git-svn-id: file:///svn/phpbb/trunk@5083 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen 2005-01-27 18:59:38 +00:00
parent 7253ee19ca
commit b57ccb8cb9
7 changed files with 18 additions and 16 deletions

View file

@ -34,7 +34,7 @@ if ($user->data['user_id'] == ANONYMOUS)
}
// Have they authenticated (again) as an admin for this session?
if (!isset($user->data['session_admin']))
if (!$user->data['session_admin'])
{
login_box('', $user->lang['LOGIN_ADMIN_CONFIRM'], $user->lang['LOGIN_ADMIN_SUCCESS'], true, false);
}

View file

@ -1442,7 +1442,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
if (!defined('HEADER_INC'))
{
if (defined('IN_ADMIN') && !empty($user->data['session_admin']))
if (defined('IN_ADMIN') && $user->data['session_admin'])
{
adm_page_header('', '', false);
}
@ -1456,7 +1456,7 @@ function msg_handler($errno, $msg_text, $errfile, $errline)
$msg_title = (!isset($msg_title)) ? $user->lang['INFORMATION'] : ((!empty($user->lang[$msg_title])) ? $user->lang[$msg_title] : $msg_title);
$display_header = (!isset($display_header)) ? false : (bool) $display_header;
if (defined('IN_ADMIN') && !empty($user->data['session_admin']))
if (defined('IN_ADMIN') && $user->data['session_admin'])
{
adm_page_message($msg_title, $msg_text, $display_header);
adm_page_footer();
@ -1524,7 +1524,7 @@ function page_header($page_title = '')
// Get users online list ... if required
$l_online_users = $online_userlist = $l_online_record = '';
if (!empty($config['load_online']) && !empty($config['load_online_time']))
if ($config['load_online'] && $config['load_online_time'])
{
$userlist_ary = $userlist_visible = array();
$logged_visible_online = $logged_hidden_online = $guests_online = $prev_user_id = 0;
@ -1650,6 +1650,10 @@ function page_header($page_title = '')
$l_online_time = ($config['load_online_time'] == 1) ? 'VIEW_ONLINE_TIME' : 'VIEW_ONLINE_TIMES';
$l_online_time = sprintf($user->lang[$l_online_time], $config['load_online_time']);
}
else
{
$l_online_time = '';
}
$l_privmsgs_text = $l_privmsgs_text_unread = '';
$s_privmsg_new = false;

View file

@ -94,14 +94,14 @@ class custom_profile
$cp_data[$row['field_ident']] = $this->get_profile_field($row);
// get_profile_field returns an array with values for TEXT fields.
if(is_array($cp_data[$row['field_ident']]))
if (is_array($cp_data[$row['field_ident']]))
{
// Contains the original text without bbcode processing etc
$check_value = $cp_data[$row['field_ident']]['submitted'];
foreach($cp_data[$row['field_ident']] as $key => $value)
foreach ($cp_data[$row['field_ident']] as $key => $value)
{
if($key != 'submitted')
if ($key != 'submitted')
{
$cp_data[$key] = $value;
}
@ -223,7 +223,7 @@ class custom_profile
$user_fields[$row['user_id']][$ident]['value'] = $value;
$user_fields[$row['user_id']][$ident]['data'] = $this->profile_cache[$ident];
}
else if($i = strpos($ident, '_bbcode'))
else if ($i = strpos($ident, '_bbcode'))
{
// Add extra data (bbcode_uid and bbcode_bitfield) to the data for this profile field.
// TODO: Maybe we should try to make this a bit more generic (not limited to bbcode)?
@ -316,7 +316,6 @@ class custom_profile
break;
case FIELD_DROPDOWN:
print_r($field_data['field_novalue']);
if ($field_value == $field_data['field_novalue'] && $field_data['field_required'])
{
return 'FIELD_REQUIRED';
@ -538,7 +537,7 @@ class custom_profile
global $user;
$value = $this->get_var('', $profile_row, $profile_row['lang_default_value'], $preview);
if($preview == false)
if ($preview == false)
{
$message_parser = new parse_message();
$message_parser->message = $value;

View file

@ -358,7 +358,7 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
$ip_2_counter = ($ip_1_counter == $ip_range_explode[1]) ? $ip_range_explode[2] : 0;
$ip_2_end = ($ip_1_counter < $ip_1_end) ? 254 : $ip_range_explode[6];
if($ip_2_counter == 0 && $ip_2_end == 254)
if ($ip_2_counter == 0 && $ip_2_end == 254)
{
$ip_2_counter = 256;
$ip_2_fragment = 256;
@ -1025,7 +1025,7 @@ function avatar_upload($data, &$error)
$realfilename = $data['user_id'] . '_' . str_replace($bad_chars, '_', $realname) . '.' . $filetype;
if(!$php_move($filename, $phpbb_root_path . $config['avatar_path'] . '/' . $realfilename))
if (!$php_move($filename, $phpbb_root_path . $config['avatar_path'] . '/' . $realfilename))
{
@unlink($filename);
$error[] = $user->lang['AVATAR_NOT_UPLOADED'];

View file

@ -660,7 +660,7 @@ class parse_message extends bbcode_firstpass
$this->message = preg_replace($match, $replace, trim($this->message));
// Message length check. -1 disables this check completely, even allows empty messsages.
if($config['max_' . $mode . '_chars'] != -1)
if ($config['max_' . $mode . '_chars'] != -1)
{
$msg_len = ($mode == 'post') ? strlen($this->message) : strlen(preg_replace('#\[\/?[a-z\*\+\-]+(=[\S]+)?\]#is', ' ', $this->message));

View file

@ -357,7 +357,7 @@ class session
$db->sql_query($sql);
// Reset some basic data immediately
$this->session_id = $this->data['username'] = '';
$this->session_id = $this->data['username'] = $this->data['user_permissions'] = '';
$this->data['user_id'] = ANONYMOUS;
$this->data['session_admin'] = 0;

View file

@ -163,7 +163,6 @@ class template
$this->files[$handle] = $phpbb_root_path . 'styles/' . $user->theme['secondary']['template_path'] . '/template/' . $this->filename[$handle];
}
$str = '';
if ($user->theme[$this->tpl]['template_storedb'])
{
$sql = 'SELECT * FROM ' . STYLES_TPLDATA_TABLE . '