1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-12 03:34:04 +02:00

Permission related updates ... is still not final but is getting there ... faster than British Rail too

git-svn-id: file:///svn/phpbb/trunk@2943 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen
2002-10-08 20:11:59 +00:00
parent 64aee6d171
commit 1d0e4ee436
40 changed files with 891 additions and 1213 deletions

View File

@@ -26,95 +26,88 @@ include($phpbb_root_path . 'common.'.$phpEx);
include($phpbb_root_path . 'includes/bbcode.'.$phpEx);
include($phpbb_root_path . 'includes/functions_posting.'.$phpEx);
//
// Start session management
//
$userdata = $session->start();
$auth->acl($userdata);
//
$user = new user($userdata);
// End session management
//
$session->configure($userdata);
//
// Define initial vars
//
if ( isset($HTTP_POST_VARS['mode']) || isset($HTTP_GET_VARS['mode']) )
if ( isset($_POST['mode']) || isset($_GET['mode']) )
{
$mode = ( isset($HTTP_POST_VARS['mode']) ) ? $HTTP_POST_VARS['mode'] : $HTTP_GET_VARS['mode'];
$mode = ( isset($_POST['mode']) ) ? $_POST['mode'] : $_GET['mode'];
}
else
{
$mode = '';
}
if ( isset($HTTP_POST_VARS['search_keywords']) || isset($HTTP_GET_VARS['search_keywords']) )
if ( isset($_POST['search_keywords']) || isset($_GET['search_keywords']) )
{
$search_keywords = ( isset($HTTP_POST_VARS['search_keywords']) ) ? $HTTP_POST_VARS['search_keywords'] : $HTTP_GET_VARS['search_keywords'];
$search_keywords = ( isset($_POST['search_keywords']) ) ? $_POST['search_keywords'] : $_GET['search_keywords'];
}
else
{
$search_keywords = '';
}
if ( isset($HTTP_POST_VARS['search_author']) || isset($HTTP_GET_VARS['search_author']))
if ( isset($_POST['search_author']) || isset($_GET['search_author']))
{
$search_author = ( isset($HTTP_POST_VARS['search_author']) ) ? $HTTP_POST_VARS['search_author'] : $HTTP_GET_VARS['search_author'];
$search_author = ( isset($_POST['search_author']) ) ? $_POST['search_author'] : $_GET['search_author'];
}
else
{
$search_author = '';
}
$search_id = ( isset($HTTP_GET_VARS['search_id']) ) ? $HTTP_GET_VARS['search_id'] : '';
$search_id = ( isset($_GET['search_id']) ) ? $_GET['search_id'] : '';
$show_results = ( isset($HTTP_POST_VARS['show_results']) ) ? $HTTP_POST_VARS['show_results'] : 'posts';
$show_results = ( isset($_POST['show_results']) ) ? $_POST['show_results'] : 'posts';
if ( isset($HTTP_POST_VARS['search_terms']) )
if ( isset($_POST['search_terms']) )
{
$search_terms = ( $HTTP_POST_VARS['search_terms'] == 'all' ) ? 1 : 0;
$search_terms = ( $_POST['search_terms'] == 'all' ) ? 1 : 0;
}
else
{
$search_terms = 0;
}
if ( isset($HTTP_POST_VARS['search_fields']) )
if ( isset($_POST['search_fields']) )
{
$search_fields = ( $HTTP_POST_VARS['search_fields'] == 'all' ) ? 1 : 0;
$search_fields = ( $_POST['search_fields'] == 'all' ) ? 1 : 0;
}
else
{
$search_fields = 0;
}
$return_chars = ( isset($HTTP_POST_VARS['return_chars']) ) ? intval($HTTP_POST_VARS['return_chars']) : 200;
$return_chars = ( isset($_POST['return_chars']) ) ? intval($_POST['return_chars']) : 200;
$search_cat = ( isset($HTTP_POST_VARS['search_cat']) ) ? intval($HTTP_POST_VARS['search_cat']) : -1;
$search_forum = ( isset($HTTP_POST_VARS['search_forum']) ) ? intval($HTTP_POST_VARS['search_forum']) : -1;
$search_cat = ( isset($_POST['search_cat']) ) ? intval($_POST['search_cat']) : -1;
$search_forum = ( isset($_POST['search_forum']) ) ? intval($_POST['search_forum']) : -1;
$sort_by = ( isset($HTTP_POST_VARS['sort_by']) ) ? intval($HTTP_POST_VARS['sort_by']) : 0;
$sort_by = ( isset($_POST['sort_by']) ) ? intval($_POST['sort_by']) : 0;
if ( isset($HTTP_POST_VARS['sort_dir']) )
if ( isset($_POST['sort_dir']) )
{
$sort_dir = ( $HTTP_POST_VARS['sort_dir'] == 'DESC' ) ? 'DESC' : 'ASC';
$sort_dir = ( $_POST['sort_dir'] == 'DESC' ) ? 'DESC' : 'ASC';
}
else
{
$sort_dir = 'DESC';
}
if ( !empty($HTTP_POST_VARS['search_time']) || !empty($HTTP_GET_VARS['search_time']))
if ( !empty($_POST['search_time']) || !empty($_GET['search_time']))
{
$search_time = time() - ( ( ( !empty($HTTP_POST_VARS['search_time']) ) ? intval($HTTP_POST_VARS['search_time']) : intval($HTTP_GET_VARS['search_time']) ) * 86400 );
$search_time = time() - ( ( ( !empty($_POST['search_time']) ) ? intval($_POST['search_time']) : intval($_GET['search_time']) ) * 86400 );
}
else
{
$search_time = 0;
}
$start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) : 0;
$start = ( isset($_GET['start']) ) ? intval($_GET['start']) : 0;
$sort_by_types = array($lang['Sort_Time'], $lang['Sort_Post_Subject'], $lang['Sort_Topic_Title'], $lang['Sort_Author'], $lang['Sort_Forum']);
@@ -324,7 +317,7 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
$auth_sql = '';
if ( $search_forum != -1 )
{
if ( !$auth->get_acl($search_forum, 'forum', 'read') )
if ( !$auth->acl_get($search_forum, 'forum', 'read') )
{
message_die(MESSAGE, $lang['No_searchable_forums']);
}
@@ -338,7 +331,7 @@ if ( $search_keywords != '' || $search_author != '' || $search_id )
$auth_sql = "f.cat_id = $search_cat";
}
/*
$auth_ary = $auth->get_acl();
$auth_ary = $auth->acl_get();
@reset($auth_ary);
$allowed_forum_sql = '';
@@ -1164,7 +1157,7 @@ $result = $db->sql_query($sql);
$s_forums = '';
while( $row = $db->sql_fetchrow($result) )
{
if ( $auth->get_acl($row['forum_id'], 'forum', 'read') )
if ( $auth->acl_get($row['forum_id'], 'forum', 'read') )
{
$s_forums .= '<option value="' . $row['forum_id'] . '">' . $row['forum_name'] . '</option>';
if ( empty($list_cat[$row['cat_id']]) )