Skip to content

Commit

Permalink
First implementation of the new permissions system in CMS.
Browse files Browse the repository at this point in the history
New auth system enabled in all files even if not fully implemented everywhere.
CMS functions to manage permissions and roles almost completed.
Some extra bugs fixed.
  • Loading branch information
MightyGorgon committed Sep 23, 2011
1 parent 4320fb7 commit d164727
Show file tree
Hide file tree
Showing 208 changed files with 4,729 additions and 691 deletions.
2 changes: 1 addition & 1 deletion acronyms.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
10 changes: 5 additions & 5 deletions adm/admin_bbcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@

if($data['bbcode_tag'] == '')
{
trigger_error($lang['BBCODES_NO_BBCODES_INPUT'] . adm_back_link($page_action), E_USER_WARNING);
trigger_error($lang['BBCODES_NO_BBCODES_INPUT'] . page_back_link($page_action), E_USER_WARNING);
}

if (substr($data['bbcode_tag'], -1) === '=')
Expand All @@ -116,22 +116,22 @@

if (!preg_match('%\\[' . $test . '[^]]*].*?\\[/' . $test . ']%s', $data['bbcode_match']))
{
trigger_error($lang['BBCODE_OPEN_ENDED_TAG'] . adm_back_link($page_action), E_USER_WARNING);
trigger_error($lang['BBCODE_OPEN_ENDED_TAG'] . page_back_link($page_action), E_USER_WARNING);
}

if (strlen($data['bbcode_tag']) > 16)
{
trigger_error($lang['BBCODE_TAG_TOO_LONG'] . adm_back_link($page_action), E_USER_WARNING);
trigger_error($lang['BBCODE_TAG_TOO_LONG'] . page_back_link($page_action), E_USER_WARNING);
}

if (strlen($data['bbcode_match']) > 4000)
{
trigger_error($lang['BBCODE_TAG_DEF_TOO_LONG'] . adm_back_link($page_action), E_USER_WARNING);
trigger_error($lang['BBCODE_TAG_DEF_TOO_LONG'] . page_back_link($page_action), E_USER_WARNING);
}

if (strlen($data['bbcode_helpline']) > 255)
{
trigger_error($lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($page_action), E_USER_WARNING);
trigger_error($lang['BBCODE_HELPLINE_TOO_LONG'] . page_back_link($page_action), E_USER_WARNING);
}

if(($data['bbcode_match'] == '') && ($data['bbcode_tpl'] == ''))
Expand Down
7 changes: 7 additions & 0 deletions adm/admin_board_clearcache.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@
message_die(GENERAL_MESSAGE, $meta_tag . $message);
}

// Clean also data in global cache
$cache_data = array('config', 'config_plugins', 'config_plugins_config', 'config_style', 'newest_user');
foreach ($cache_data as $cache_data_section)
{
$cache->destroy($cache_data_section);
}

// Make sure cron is unlocked... just to make sure that it didn't hang somewhere in time... :-)
set_config('cron_lock', '0');
set_config('cron_lock_hour', 0);
Expand Down
1 change: 0 additions & 1 deletion adm/admin_cms_auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@

$template->set_filenames(array('body' => ADM_TPL . 'user_select_body.tpl'));
$template->assign_vars(array(
'L_FIND_USERNAME' => $lang['Find_username'],
'U_SEARCH_USER' => append_sid('../' . CMS_PAGE_SEARCH . '?mode=searchuser')
)
);
Expand Down
1 change: 0 additions & 1 deletion adm/admin_groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@
'L_GROUP_RANK' => $lang['group_rank'],
'L_GROUP_COLOR' => $lang['group_color'],
'L_GROUP_LEGEND' => $lang['group_legend'],
'L_FIND_USERNAME' => $lang['Find_username'],
'L_GROUP_STATUS' => $lang['group_status'],
'L_GROUP_OPEN' => $lang['group_open'],
'L_GROUP_CLOSED' => $lang['group_closed'],
Expand Down
1 change: 0 additions & 1 deletion adm/admin_pa_ug_auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,6 @@
if ($mode == 'user' || $mode == 'glob_user')
{
$template->assign_vars(array(
'L_FIND_USERNAME' => $lang['Find_username'],

'U_SEARCH_USER' => append_sid('../' . CMS_PAGE_SEARCH . '?mode=searchuser')
)
Expand Down
13 changes: 0 additions & 13 deletions adm/admin_plugins.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,6 @@

define('THIS_PAGE', 'admin_plugins.' . PHP_EXT);

// NEW AUTH - BEGIN
// To be removed when auth integration has been completed!
if (!class_exists('auth'))
{
@include(IP_ROOT_PATH . 'includes/class_auth.' . PHP_EXT);
}
if (empty($auth))
{
$auth = new auth();
$auth->acl($user->data);
}
// NEW AUTH - END

// FORM CLASS - BEGIN
include(IP_ROOT_PATH . 'includes/class_form.' . PHP_EXT);
$class_form = new class_form();
Expand Down
1 change: 0 additions & 1 deletion adm/admin_postcount.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
'L_USER_EXPLAIN' => $lang['Post_count_explain'],
'L_USER_SELECT' => $lang['Select_a_User'],
'L_LOOK_UP' => $lang['Look_up_user'],
'L_FIND_USERNAME' => $lang['Find_username'],

'U_SEARCH_USER' => append_sid('./../' . CMS_PAGE_SEARCH . '?mode=searchuser'),

Expand Down
6 changes: 0 additions & 6 deletions adm/admin_prune_users_loop.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@

@set_time_limit(180);

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$user->setup();
// End session management

if ($user->data['user_level'] != ADMIN)
{
message_die(GENERAL_ERROR, $lang['Not_Authorized']);
Expand Down
1 change: 0 additions & 1 deletion adm/admin_ug_auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -970,7 +970,6 @@ function check_auth($type, $key, $u_access, $is_admin)
if ($mode == 'user')
{
$template->assign_vars(array(
'L_FIND_USERNAME' => $lang['Find_username'],
'U_SEARCH_USER' => append_sid('../' . CMS_PAGE_SEARCH . '?mode=searchuser')
)
);
Expand Down
1 change: 0 additions & 1 deletion adm/admin_user_ban.php
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@
'L_UNBAN_EMAIL_EXPLAIN' => $lang['Unban_email_explain'],
'L_USERNAME' => $lang['Username'],
'L_LOOK_UP' => $lang['Look_up_User'],
'L_FIND_USERNAME' => $lang['Find_username'],

'U_SEARCH_USER' => append_sid(IP_ROOT_PATH . CMS_PAGE_SEARCH . '?mode=searchuser'),
'S_UNBAN_USERLIST_SELECT' => $select_userlist,
Expand Down
2 changes: 0 additions & 2 deletions adm/admin_user_bantron.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,6 @@
{
$template->assign_block_vars('username_row', array(
'L_USERNAME' => $lang['Username'],
'L_FIND_USERNAME' => $lang['Find_username'],
'U_SEARCH_USER' => append_sid(IP_ROOT_PATH . CMS_PAGE_SEARCH . '?mode=searchuser'),
'USERNAME' => $row['username']
)
Expand Down Expand Up @@ -465,7 +464,6 @@

$template->assign_block_vars('username_row', array(
'L_USERNAME' => $lang['Username'],
'L_FIND_USERNAME' => $lang['Find_username'],
'U_SEARCH_USER' => append_sid(IP_ROOT_PATH . CMS_PAGE_SEARCH . '?mode=searchuser')
)
);
Expand Down
4 changes: 2 additions & 2 deletions adm/admin_userlist.php
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
$group_name = $group_name_row['group_name'];

$script_name = preg_replace('/^\/?(.*?)\/?$/', "\\1", trim($config['script_path']));
$script_name = ($script_name != '') ? $script_name . '/groupcp.' . PHP_EXT : 'groupcp.' . PHP_EXT;
$script_name = (($script_name != '') ? $script_name . '/' : '') . CMS_PAGE_GROUP_CP;
$server_name = trim($config['server_name']);
$server_protocol = ($config['cookie_secure']) ? 'https://' : 'http://';
$server_port = ($config['server_port'] <> 80) ? ':' . trim($config['server_port']) . '/' : '/';
Expand Down Expand Up @@ -594,7 +594,7 @@
'GROUP_NAME' => $group_row['group_name'],
'GROUP_COLOR' => 'style="font-weight: bold; text-decoration: none;' . (($group_row['group_color'] != '') ? ('color: ' . $group_row['group_color'] . ';') : '') . '"',
'GROUP_STATUS' => $group_status,
'U_GROUP' => append_sid(IP_ROOT_PATH . 'groupcp.' . PHP_EXT . '?' . POST_GROUPS_URL . '=' . $group_row['group_id'])
'U_GROUP' => append_sid(IP_ROOT_PATH . CMS_PAGE_GROUP_CP . '?' . POST_GROUPS_URL . '=' . $group_row['group_id'])
)
);
$g++;
Expand Down
1 change: 0 additions & 1 deletion adm/admin_users.php
Original file line number Diff line number Diff line change
Expand Up @@ -1881,7 +1881,6 @@
'L_USER_EXPLAIN' => $lang['User_admin_explain'],
'L_USER_SELECT' => $lang['Select_a_User'],
'L_LOOK_UP' => $lang['Look_up_user'],
'L_FIND_USERNAME' => $lang['Find_username'],

'U_SEARCH_USER' => append_sid('../' . CMS_PAGE_SEARCH . '?mode=searchuser'),

Expand Down
2 changes: 1 addition & 1 deletion adm/cookie.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion adm/ip_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion adm/pagestart.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion ajax_chat.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion ajax_shoutbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// Start session management
$user->session_begin(false);
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion ajax_upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_allpics.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_avatar.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
4 changes: 2 additions & 2 deletions album_cat.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down Expand Up @@ -193,7 +193,7 @@
{
for ($j = 0; $j < sizeof($grouprows); $j++)
{
$group_link = '<a href="' . append_sid('groupcp.' . PHP_EXT . '?'. POST_GROUPS_URL . '=' . $grouprows[$j]['group_id']) . '">' . $grouprows[$j]['group_name'] . '</a>';
$group_link = '<a href="' . append_sid(CMS_PAGE_GROUP_CP . '?'. POST_GROUPS_URL . '=' . $grouprows[$j]['group_id']) . '">' . $grouprows[$j]['group_name'] . '</a>';

$moderators_list .= ($moderators_list == '') ? $group_link : ', ' . $group_link;
}
Expand Down
2 changes: 1 addition & 1 deletion album_comment_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_comment_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_download.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_hotornot.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_modcp.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_nuffload_pbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_otf.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_otf_thumbnail.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_personal_cat_admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
2 changes: 1 addition & 1 deletion album_personal_index.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// Start session management
$user->session_begin();
//$auth->acl($user->data);
$auth->acl($user->data);
$user->setup();
// End session management

Expand Down
Loading

0 comments on commit d164727

Please sign in to comment.