mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-03 14:17:56 +02:00
- moved add_log out of functions_admin (this file should only be included in admin/admin-related pages)
- fixed cookie based topic tracking - added missing config variables - other minor things git-svn-id: file:///svn/phpbb/trunk@5494 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
964615eb07
commit
90385cd79a
@ -159,6 +159,7 @@
|
||||
|
||||
<fieldset class="quick" style="float: left;">
|
||||
<input type="hidden" name="action" value="add" />
|
||||
<input type="hidden" name="module_parent_id" value="{PARENT_ID}" />
|
||||
|
||||
<input type="text" name="module_langname" />
|
||||
<input class="button2" name="addmodule" type="submit" value="{L_CREATE_MODULE}" />
|
||||
|
@ -1130,7 +1130,7 @@ class acp_forums
|
||||
WHERE group_id = {$row['group_id']}";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
$cache->destroy('extensions');
|
||||
$cache->destroy('_extensions');
|
||||
|
||||
$log_action = implode('_', array($log_action_posts, $log_action_forums));
|
||||
|
||||
|
@ -532,6 +532,7 @@ class acp_modules
|
||||
'U_ACTION' => $u_action . '&parent_id=' . $parent_id,
|
||||
'NAVIGATION' => $navigation,
|
||||
'MODULE_BOX' => $module_box,
|
||||
'PARENT_ID' => $parent_id,
|
||||
'S_INSTALL_OPTIONS' => $s_install_options,
|
||||
)
|
||||
);
|
||||
|
@ -569,122 +569,52 @@ class auth_admin extends auth
|
||||
|
||||
/**
|
||||
* Get permission mask
|
||||
* This function only supports getting permissions of one type (for example a_%)
|
||||
* This function only supports getting permissions of one type (for example a_)
|
||||
*
|
||||
* @param user|forum|admin|mod_global|mod_local|custom $mode defining the permission mask to get (custom uses $auth_option and $scope)
|
||||
* @param mixed $user_id user ids to search for (a user_id or a group_id has to be specified at least)
|
||||
* @param mixed $group_id group ids to search for, return group related settings (a user_id or a group_id has to be specified at least)
|
||||
* @param mixed $forum_id forum_ids to search for. Defining a forum id also means getting local settings (required for the modes forum and mod_local)
|
||||
* @param string $auth_option if mode is 'custom' the auth_option defines the permission setting to look after
|
||||
* @param local|global $scope if mode is 'custom' the scope defines the permission scope. If local, a forum_id is additionally required
|
||||
* @param mixed $forum_id forum_ids to search for. Defining a forum id also means getting local settings
|
||||
* @param string $auth_option the auth_option defines the permission setting to look for (a_ for example)
|
||||
* @param local|global $scope the scope defines the permission scope. If local, a forum_id is additionally required
|
||||
* @param ACL_NO|ACL_UNSET|ACL_YES $acl_fill defines the mode those permissions not set are getting filled with
|
||||
*/
|
||||
function get_mask($mode, $user_id = false, $group_id = false, $forum_id = false, $auth_option = false, $scope = false, $acl_fill = ACL_NO)
|
||||
function get_mask($user_id = false, $group_id = false, $forum_id = false, $auth_option = false, $scope = false, $acl_fill = ACL_NO)
|
||||
{
|
||||
global $db;
|
||||
|
||||
$hold_ary = array();
|
||||
|
||||
switch ($mode)
|
||||
if ($auth_option === false || $scope === false)
|
||||
{
|
||||
// Custom (not known) permissions
|
||||
case 'custom':
|
||||
|
||||
if ($auth_option === false || $scope === false)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
return array();
|
||||
}
|
||||
|
||||
if ($forum_id !== false)
|
||||
{
|
||||
$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', $forum_id) : $this->acl_raw_data($user_id, $auth_option . '%', $forum_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', ($scope == 'global') ? 0 : false) : $this->acl_raw_data($user_id, $auth_option . '%', ($scope == 'global') ? 0 : false);
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
// User Permission Mask
|
||||
case 'user':
|
||||
|
||||
if ($group_id === false && $user_id === false)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, 'u_%') : $this->acl_raw_data($user_id, 'u_%');
|
||||
|
||||
$auth_option = 'u_';
|
||||
$scope = 'global';
|
||||
|
||||
break;
|
||||
|
||||
// Forum Permission Mask (User/Group based)
|
||||
case 'forum':
|
||||
|
||||
if ($forum_id === false && ($group_id === false || $user_id === false))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, 'f_%', $forum_id) : $this->acl_raw_data($user_id, 'f_%', $forum_id);
|
||||
|
||||
$auth_option = 'f_';
|
||||
$scope = 'local';
|
||||
|
||||
break;
|
||||
|
||||
// Admin Permission Mask
|
||||
case 'admin':
|
||||
|
||||
if ($group_id === false && $user_id === false)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, 'a_%') : $this->acl_raw_data($user_id, 'a_%');
|
||||
|
||||
$auth_option = 'a_';
|
||||
$scope = 'global';
|
||||
|
||||
break;
|
||||
|
||||
// Global Moderator Permission Mask
|
||||
case 'mod_global':
|
||||
|
||||
if ($group_id === false && $user_id === false)
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, 'm_%', 0) : $this->acl_raw_data($user_id, 'm_%', 0);
|
||||
|
||||
$auth_option = 'm_';
|
||||
$scope = 'global';
|
||||
|
||||
break;
|
||||
|
||||
// Moderator Permission Mask
|
||||
case 'mod_local':
|
||||
|
||||
if ($forum_id === false && ($group_id === false || $user_id === false))
|
||||
{
|
||||
return array();
|
||||
}
|
||||
|
||||
$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, 'm_%', $forum_id) : $this->acl_raw_data($user_id, 'm_%', $forum_id);
|
||||
|
||||
$auth_option = 'm_';
|
||||
$scope = 'local';
|
||||
|
||||
break;
|
||||
if ($forum_id !== false)
|
||||
{
|
||||
$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', $forum_id) : $this->acl_raw_data($user_id, $auth_option . '%', $forum_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$hold_ary = ($group_id !== false) ? $this->acl_group_raw_data($group_id, $auth_option . '%', ($scope == 'global') ? 0 : false) : $this->acl_raw_data($user_id, $auth_option . '%', ($scope == 'global') ? 0 : false);
|
||||
}
|
||||
|
||||
// Make sure hold_ary is filled with every setting (prevents missing forums/users/groups)
|
||||
$ug_id = ($group_id !== false) ? ((!is_array($group_id)) ? array($group_id) : $group_id) : ((!is_array($user_id)) ? array($user_id) : $user_id);
|
||||
$forum_ids = ($forum_id !== false) ? ((!is_array($forum_id)) ? array($forum_id) : $forum_id) : array(0);
|
||||
$forum_ids = ($forum_id !== false) ? ((!is_array($forum_id)) ? array($forum_id) : $forum_id) : (($scope == 'global') ? array(0) : array());
|
||||
|
||||
// If forum_ids is false and the scope is local we actually want to have all forums within the array
|
||||
if ($scope == 'local' && !sizeof($forum_ids))
|
||||
{
|
||||
$sql = 'SELECT forum_id
|
||||
FROM ' . FORUMS_TABLE;
|
||||
$result = $db->sql_query($sql, 120);
|
||||
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forum_ids[] = $row['forum_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
foreach ($ug_id as $_id)
|
||||
{
|
||||
@ -702,7 +632,7 @@ class auth_admin extends auth
|
||||
}
|
||||
}
|
||||
|
||||
// Now, we need to fill the gaps with ACL_NO. ;)
|
||||
// Now, we need to fill the gaps with $acl_fill. ;)
|
||||
|
||||
// Only those options we need
|
||||
$compare_options = array_diff(preg_replace('/^((?!' . $auth_option . ').+)|(' . $auth_option . ')$/', '', array_keys($this->acl_options[$scope])), array(''));
|
||||
@ -725,7 +655,7 @@ class auth_admin extends auth
|
||||
{
|
||||
// Not a "fine" solution, but at all it's a 1-dimensional
|
||||
// array_diff_key function filling the resulting array values with zeros
|
||||
// The differences get merged into $hold_ary (all permissions having ACL_NO set)
|
||||
// The differences get merged into $hold_ary (all permissions having $acl_fill set)
|
||||
$hold_ary[$ug_id][$id] = array_merge($options,
|
||||
|
||||
array_map($return_acl_fill,
|
||||
|
@ -213,7 +213,16 @@ class dbal
|
||||
}
|
||||
else
|
||||
{
|
||||
$message .= '<br /><br />' . $user->lang['SQL_ERROR_OCCURRED'];
|
||||
// If error occurs in initiating the session we need to use a pre-defined language string
|
||||
// This could happen if the connection could not be established for example (then we are not able to grab the default language)
|
||||
if (!isset($user->lang['SQL_ERROR_OCCURRED']))
|
||||
{
|
||||
$message .= '<br /><br />An sql error occurred while fetching this page. Please contact an administrator if this problem persist.';
|
||||
}
|
||||
else
|
||||
{
|
||||
$message .= '<br /><br />' . $user->lang['SQL_ERROR_OCCURRED'];
|
||||
}
|
||||
}
|
||||
|
||||
if ($this->transaction)
|
||||
|
@ -285,6 +285,14 @@ class dbal_mysql extends dbal
|
||||
*/
|
||||
function _sql_error()
|
||||
{
|
||||
if (!$this->db_connect_id)
|
||||
{
|
||||
return array(
|
||||
'message' => @mysql_error(),
|
||||
'code' => @mysql_errno()
|
||||
);
|
||||
}
|
||||
|
||||
return array(
|
||||
'message' => @mysql_error($this->db_connect_id),
|
||||
'code' => @mysql_errno($this->db_connect_id)
|
||||
|
@ -288,6 +288,14 @@ class dbal_mysql4 extends dbal
|
||||
*/
|
||||
function _sql_error()
|
||||
{
|
||||
if (!$this->db_connect_id)
|
||||
{
|
||||
return array(
|
||||
'message' => @mysql_error(),
|
||||
'code' => @mysql_errno()
|
||||
);
|
||||
}
|
||||
|
||||
return array(
|
||||
'message' => @mysql_error($this->db_connect_id),
|
||||
'code' => @mysql_errno($this->db_connect_id)
|
||||
|
@ -531,6 +531,11 @@ function markread($mode, $forum_id = false, $topic_id = false, $post_time = 0)
|
||||
|
||||
$user->set_cookie('track', serialize($tracking), time() + 31536000);
|
||||
unset($tracking);
|
||||
|
||||
if ($user->data['is_registered'])
|
||||
{
|
||||
$db->sql_query('UPDATE ' . USERS_TABLE . ' SET user_lastmark = ' . time() . " WHERE user_id = {$user->data['user_id']}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1568,6 +1573,62 @@ function parse_cfg_file($filename, $lines = false)
|
||||
return $parsed_items;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add log event
|
||||
*/
|
||||
function add_log()
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
$args = func_get_args();
|
||||
|
||||
$mode = array_shift($args);
|
||||
$reportee_id = ($mode == 'user') ? intval(array_shift($args)) : '';
|
||||
$forum_id = ($mode == 'mod') ? intval(array_shift($args)) : '';
|
||||
$topic_id = ($mode == 'mod') ? intval(array_shift($args)) : '';
|
||||
$action = array_shift($args);
|
||||
$data = (!sizeof($args)) ? '' : $db->sql_escape(serialize($args));
|
||||
|
||||
$sql_ary = array(
|
||||
'user_id' => $user->data['user_id'],
|
||||
'log_ip' => $user->ip,
|
||||
'log_time' => time(),
|
||||
'log_operation' => $action,
|
||||
'log_data' => $data,
|
||||
);
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'admin':
|
||||
$sql_ary['log_type'] = LOG_ADMIN;
|
||||
break;
|
||||
|
||||
case 'mod':
|
||||
$sql_ary += array(
|
||||
'log_type' => LOG_MOD,
|
||||
'forum_id' => $forum_id,
|
||||
'topic_id' => $topic_id
|
||||
);
|
||||
break;
|
||||
|
||||
case 'user':
|
||||
$sql_ary += array(
|
||||
'log_type' => LOG_USERS,
|
||||
'reportee_id' => $reportee_id
|
||||
);
|
||||
break;
|
||||
|
||||
case 'critical':
|
||||
$sql_ary['log_type'] = LOG_CRITICAL;
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
$db->sql_query('INSERT INTO ' . LOG_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
|
||||
}
|
||||
|
||||
/**
|
||||
* Error and message handler, call with trigger_error if reqd
|
||||
*/
|
||||
|
@ -199,12 +199,13 @@ function size_select_options($size_compare)
|
||||
/**
|
||||
* Generate list of groups
|
||||
*/
|
||||
function group_select_options($group_id)
|
||||
function group_select_options($group_id, $exclude_ids = false)
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
$sql = 'SELECT group_id, group_name, group_type
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
' . (($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE group_id NOT IN (' . implode(', ', array_map('intval', $exclude_ids)) . ')' : '') . '
|
||||
ORDER BY group_type DESC, group_name ASC';
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
@ -240,7 +241,7 @@ function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only =
|
||||
{
|
||||
$forum_rows[] = $row;
|
||||
}
|
||||
$db->sql_freeresult();
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
$rowset = array();
|
||||
@ -1855,52 +1856,6 @@ function cache_moderators()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add log event
|
||||
*/
|
||||
function add_log()
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
$args = func_get_args();
|
||||
|
||||
$mode = array_shift($args);
|
||||
$reportee_id = ($mode == 'user') ? intval(array_shift($args)) : '';
|
||||
$forum_id = ($mode == 'mod') ? intval(array_shift($args)) : '';
|
||||
$topic_id = ($mode == 'mod') ? intval(array_shift($args)) : '';
|
||||
$action = array_shift($args);
|
||||
$data = (!sizeof($args)) ? '' : $db->sql_escape(serialize($args));
|
||||
|
||||
switch ($mode)
|
||||
{
|
||||
case 'admin':
|
||||
$sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, log_ip, log_time, log_operation, log_data)
|
||||
VALUES (' . LOG_ADMIN . ', ' . $user->data['user_id'] . ", '$user->ip', " . time() . ", '$action', '$data')";
|
||||
break;
|
||||
|
||||
case 'mod':
|
||||
$sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, forum_id, topic_id, log_ip, log_time, log_operation, log_data)
|
||||
VALUES (' . LOG_MOD . ', ' . $user->data['user_id'] . ", $forum_id, $topic_id, '$user->ip', " . time() . ", '$action', '$data')";
|
||||
break;
|
||||
|
||||
case 'user':
|
||||
$sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, reportee_id, log_ip, log_time, log_operation, log_data)
|
||||
VALUES (' . LOG_USERS . ', ' . $user->data['user_id'] . ", $reportee_id, '$user->ip', " . time() . ", '$action', '$data')";
|
||||
break;
|
||||
|
||||
case 'critical':
|
||||
$sql = 'INSERT INTO ' . LOG_TABLE . ' (log_type, user_id, log_ip, log_time, log_operation, log_data)
|
||||
VALUES (' . LOG_CRITICAL . ', ' . $user->data['user_id'] . ", '$user->ip', " . time() . ", '$action', '$data')";
|
||||
break;
|
||||
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
$db->sql_query($sql);
|
||||
return;
|
||||
}
|
||||
|
||||
/**
|
||||
* View log
|
||||
*/
|
||||
|
@ -46,7 +46,7 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
// Display list of active topics for this category?
|
||||
$show_active = (isset($root_data['forum_flags']) && $root_data['forum_flags'] & 16) ? true : false;
|
||||
|
||||
if ($config['load_db_track'] && $user->data['is_registered'])
|
||||
if ($config['load_db_lastread'] && $user->data['is_registered'])
|
||||
{
|
||||
$sql_from = FORUMS_TABLE . ' f LEFT JOIN ' . FORUMS_TRACK_TABLE . ' ft ON (ft.user_id = ' . $user->data['user_id'] . ' AND ft.forum_id = f.forum_id)';
|
||||
$lastread_select = ', ft.mark_time ';
|
||||
@ -117,6 +117,10 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!$user->data['is_registered'])
|
||||
{
|
||||
$user->data['user_lastmark'] = (isset($tracking_topics['l'])) ? base_convert($tracking_topics['l'], 36, 10) + $config['board_startdate'] : 0;
|
||||
}
|
||||
$forum_tracking_info[$forum_id] = (isset($tracking_topics['f'][$forum_id])) ? base_convert($tracking_topics['f'][$forum_id], 36, 10) + $config['board_startdate'] : $user->data['user_lastmark'];
|
||||
}
|
||||
|
||||
|
@ -230,7 +230,6 @@ class messenger
|
||||
// Session doesn't exist, create it
|
||||
$user->session_begin();
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
add_log('critical', 'LOG_ERROR_' . $type, $msg);
|
||||
}
|
||||
|
||||
|
@ -274,12 +274,6 @@ function user_active_flip($user_id, $user_type, $user_actkey = false, $username
|
||||
|
||||
$auth->acl_clear_prefetch($user_id);
|
||||
|
||||
if (!function_exists('add_log'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
}
|
||||
|
||||
if ($username === false)
|
||||
{
|
||||
$sql = 'SELECT username
|
||||
@ -631,12 +625,6 @@ function user_ban($mode, $ban, $ban_len, $ban_len_other, $ban_exclude, $ban_reas
|
||||
}
|
||||
}
|
||||
|
||||
if (!function_exists('add_log'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||
}
|
||||
|
||||
// Update log
|
||||
$log_entry = ($ban_exclude) ? 'LOG_BAN_EXCLUDE_' : 'LOG_BAN_';
|
||||
add_log('admin', $log_entry . strtoupper($mode), $ban_reason, $ban_list_log);
|
||||
@ -704,12 +692,6 @@ function user_unban($mode, $ban)
|
||||
WHERE ban_id IN ($unban_sql)";
|
||||
$db->sql_query($sql);
|
||||
|
||||
if (!function_exists('add_log'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include_once($phpbb_root_path . 'includes/functions_admin.' . $phpEx);
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_UNBAN_' . strtoupper($mode), $l_unban_list);
|
||||
}
|
||||
|
||||
@ -1272,12 +1254,6 @@ function group_create($group_id, $type, $name, $desc, $group_attributes)
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
if (!function_exists('add_log'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
}
|
||||
|
||||
$log = ($group_id) ? 'LOG_GROUP_UPDATED' : 'LOG_GROUP_CREATED';
|
||||
add_log('admin', $log, $name);
|
||||
}
|
||||
@ -1341,12 +1317,6 @@ function group_delete($group_id, $group_name = false)
|
||||
WHERE group_id = $group_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
if (!function_exists('add_log'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
}
|
||||
|
||||
add_log('admin', 'LOG_GROUP_DELETE', $group_name);
|
||||
|
||||
return false;
|
||||
@ -1453,12 +1423,6 @@ function group_user_add($group_id, $user_id_ary = false, $username_ary = false,
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if (!function_exists('add_log'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
}
|
||||
|
||||
$log = ($leader) ? 'LOG_MODS_ADDED' : 'LOG_USERS_ADDED';
|
||||
|
||||
add_log('admin', $log, $group_name, implode(', ', $username_ary));
|
||||
@ -1574,12 +1538,6 @@ function group_user_del($group_id, $user_id_ary = false, $username_ary = false,
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
|
||||
if (!function_exists('add_log'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
}
|
||||
|
||||
$log = 'LOG_GROUP_REMOVE';
|
||||
|
||||
add_log('admin', $log, $group_name, implode(', ', $username_ary));
|
||||
@ -1628,12 +1586,6 @@ function group_user_attributes($action, $group_id, $user_id_ary = false, $userna
|
||||
break;
|
||||
}
|
||||
|
||||
if (!function_exists('add_log'))
|
||||
{
|
||||
global $phpbb_root_path, $phpEx;
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
}
|
||||
|
||||
// Clear permissions cache of relevant users
|
||||
$auth->acl_clear_prefetch($user_id_ary);
|
||||
|
||||
|
@ -45,7 +45,22 @@ class session
|
||||
$this->browser = (!empty($_SERVER['HTTP_USER_AGENT'])) ? $_SERVER['HTTP_USER_AGENT'] : '';
|
||||
$this->page = (!empty($_SERVER['REQUEST_URI'])) ? $_SERVER['REQUEST_URI'] . ((isset($_POST['f'])) ? 'f=' . intval($_POST['f']) : '') : '';
|
||||
$sid = substr($this->page, strpos($this->page, 'sid='), 36);
|
||||
$this->page = str_replace(array('/' . $config['script_path'] . '/', (strlen($sid) == 36 && strpos($sid, '&') === false) ? $sid : 'sid='), '', $this->page);
|
||||
|
||||
/**
|
||||
* @todo: getting away with script_path or being more strict in it's format
|
||||
*/
|
||||
$script_path = $config['script_path'];
|
||||
if ($script_path{0} != '/')
|
||||
{
|
||||
$script_path = '/' . $script_path;
|
||||
}
|
||||
|
||||
if ($script_path{(strlen($script_path)-1)} != '/')
|
||||
{
|
||||
$script_path .= '/';
|
||||
}
|
||||
|
||||
$this->page = str_replace(array($script_path, (strlen($sid) == 36 && strpos($sid, '&') === false) ? $sid : 'sid='), '', $this->page);
|
||||
|
||||
$this->cookie_data = array();
|
||||
if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u']))
|
||||
@ -930,6 +945,14 @@ class user extends session
|
||||
{
|
||||
global $phpEx;
|
||||
|
||||
// Make sure the language path is set (if the user setup did not happen it is not set)
|
||||
if (!$this->lang_path)
|
||||
{
|
||||
global $phpbb_root_path, $config;
|
||||
|
||||
$this->lang_path = $phpbb_root_path . 'language/' . $config['default_lang'] . '/';
|
||||
}
|
||||
|
||||
// $lang == $this->lang
|
||||
// $help == $this->help
|
||||
// - add appropiate variables here, name them as they are used within the language file...
|
||||
|
@ -17,7 +17,6 @@ function compose_pm($id, $mode, $action)
|
||||
global $template, $db, $auth, $user;
|
||||
global $phpbb_root_path, $phpEx, $config, $SID;
|
||||
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/message_parser.'.$phpEx);
|
||||
|
||||
|
@ -30,6 +30,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_bbcode',
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_flash', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_html', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_img', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_pm', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig_smilies', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_smilies', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_topic_notify', '1');
|
||||
@ -40,6 +41,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_flash_pm', '1
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_html_pm', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_img_pm', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_method', 'db');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_quote_pm', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_report_pm', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('auth_smilies_pm', '1');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_filesize', '6144');
|
||||
@ -147,6 +149,7 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_pass_chars', '
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_author_chars', '3');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_search_chars', '3');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('override_user_style', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pass_complex', '.*');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_edit_time', '0');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_boxes', '4');
|
||||
INSERT INTO phpbb_config (config_name, config_value) VALUES ('pm_max_msgs', '50');
|
||||
|
@ -14,7 +14,6 @@ define('IN_PHPBB', true);
|
||||
$phpbb_root_path = './';
|
||||
$phpEx = substr(strrchr(__FILE__, '.'), 1);
|
||||
include($phpbb_root_path . 'common.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_admin.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
|
||||
include($phpbb_root_path . 'includes/functions_display.' . $phpEx);
|
||||
include($phpbb_root_path . 'includes/message_parser.'.$phpEx);
|
||||
|
@ -76,7 +76,7 @@ switch ($mode)
|
||||
}
|
||||
|
||||
login_box("index.$phpEx$SID");
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'logout':
|
||||
if ($user->data['user_id'] != ANONYMOUS)
|
||||
@ -89,11 +89,11 @@ switch ($mode)
|
||||
|
||||
$message = $user->lang['LOGOUT_REDIRECT'] . '<br /><br />' . sprintf($user->lang['RETURN_PAGE'], '<a href="' . "{$phpbb_root_path}index.$phpEx$SID" . '">', '</a> ');
|
||||
trigger_error($message);
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'terms_of_use':
|
||||
case 'privacy_statement':
|
||||
break;
|
||||
break;
|
||||
|
||||
case 'delete_cookies':
|
||||
// Delete Cookies with dynamic names (do NOT delete poll cookies)
|
||||
@ -127,7 +127,7 @@ switch ($mode)
|
||||
confirm_box(false, 'DELETE_COOKIES', '');
|
||||
}
|
||||
redirect("index.$phpEx$SID");
|
||||
break;
|
||||
break;
|
||||
}
|
||||
|
||||
// Only registered users can go beyond this point
|
||||
|
@ -56,9 +56,6 @@ if ($user->data['is_registered'])
|
||||
$sql_from .= ' LEFT JOIN ' . FORUMS_WATCH_TABLE . ' fw ON (fw.forum_id = f.forum_id AND fw.user_id = ' . $user->data['user_id'] . ')';
|
||||
$lastread_select .= ', fw.notify_status';
|
||||
}
|
||||
else
|
||||
{
|
||||
}
|
||||
|
||||
$sql = "SELECT f.* $lastread_select
|
||||
FROM $sql_from
|
||||
|
Loading…
x
Reference in New Issue
Block a user