mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-05 23:25:30 +02:00
- fixing some bugs
- removed file_exists calls for auth plugins since they need to be there once set up git-svn-id: file:///svn/phpbb/trunk@6228 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
48a48aa86d
commit
b15a3111be
@ -213,10 +213,32 @@ class acp_permissions
|
||||
switch ($action)
|
||||
{
|
||||
case 'delete':
|
||||
// All users/groups selected?
|
||||
$all_users = (isset($_POST['all_users'])) ? true : false;
|
||||
$all_groups = (isset($_POST['all_groups'])) ? true : false;
|
||||
|
||||
if ($all_users || $all_groups)
|
||||
{
|
||||
$items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
|
||||
|
||||
if ($all_users && sizeof($items['user_ids']))
|
||||
{
|
||||
$user_id = $items['user_ids'];
|
||||
}
|
||||
else if ($all_groups && sizeof($items['group_ids']))
|
||||
{
|
||||
$group_id = $items['group_ids'];
|
||||
}
|
||||
}
|
||||
|
||||
if (sizeof($user_id) || sizeof($group_id))
|
||||
{
|
||||
$this->remove_permissions($mode, $permission_type, $auth_admin, $user_id, $group_id, $forum_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
trigger_error($user->lang['NO_USER_GROUP_SELECTED'] . adm_back_link($this->u_action));
|
||||
}
|
||||
break;
|
||||
|
||||
case 'apply_permissions':
|
||||
@ -346,99 +368,30 @@ class acp_permissions
|
||||
continue 2;
|
||||
}
|
||||
|
||||
$sql_forum_id = ($permission_scope == 'global') ? 'AND a.forum_id = 0' : ((sizeof($forum_id)) ? 'AND a.forum_id IN (' . implode(', ', $forum_id) . ')' : 'AND a.forum_id <> 0');
|
||||
$sql_permission_option = "AND o.auth_option LIKE '" . $db->sql_escape($permission_type) . "%'";
|
||||
|
||||
$sql = $db->sql_build_query('SELECT_DISTINCT', array(
|
||||
'SELECT' => 'u.username, u.user_regdate, u.user_id',
|
||||
|
||||
'FROM' => array(
|
||||
USERS_TABLE => 'u',
|
||||
ACL_OPTIONS_TABLE => 'o',
|
||||
ACL_USERS_TABLE => 'a'
|
||||
),
|
||||
|
||||
'LEFT_JOIN' => array(
|
||||
array(
|
||||
'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'),
|
||||
'ON' => 'a.auth_role_id = r.role_id'
|
||||
)
|
||||
),
|
||||
|
||||
'WHERE' => "(a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id)
|
||||
$sql_permission_option
|
||||
$sql_forum_id
|
||||
AND u.user_id = a.user_id",
|
||||
|
||||
'ORDER_BY' => 'u.username, u.user_regdate ASC'
|
||||
));
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$s_defined_user_options = '';
|
||||
$defined_user_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$s_defined_user_options .= '<option value="' . $row['user_id'] . '">' . $row['username'] . '</option>';
|
||||
$defined_user_ids[] = $row['user_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = $db->sql_build_query('SELECT_DISTINCT', array(
|
||||
'SELECT' => 'g.group_type, g.group_name, g.group_id',
|
||||
|
||||
'FROM' => array(
|
||||
GROUPS_TABLE => 'g',
|
||||
ACL_OPTIONS_TABLE => 'o',
|
||||
ACL_GROUPS_TABLE => 'a'
|
||||
),
|
||||
|
||||
'LEFT_JOIN' => array(
|
||||
array(
|
||||
'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'),
|
||||
'ON' => 'a.auth_role_id = r.role_id'
|
||||
)
|
||||
),
|
||||
|
||||
'WHERE' => "(a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id)
|
||||
$sql_permission_option
|
||||
$sql_forum_id
|
||||
AND g.group_id = a.group_id",
|
||||
|
||||
'ORDER_BY' => 'g.group_type DESC, g.group_name ASC'
|
||||
));
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$s_defined_group_options = '';
|
||||
$defined_group_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$s_defined_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
|
||||
$defined_group_ids[] = $row['group_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
$items = $this->retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type);
|
||||
|
||||
// Now we check the users... because the "all"-selection is different here (all defined users/groups)
|
||||
$all_users = (isset($_POST['all_users'])) ? true : false;
|
||||
$all_groups = (isset($_POST['all_groups'])) ? true : false;
|
||||
|
||||
if ($all_users && sizeof($defined_user_ids))
|
||||
if ($all_users && sizeof($items['user_ids']))
|
||||
{
|
||||
$user_id = $defined_user_ids;
|
||||
$user_id = $items['user_ids'];
|
||||
continue 2;
|
||||
}
|
||||
|
||||
if ($all_groups && sizeof($defined_group_ids))
|
||||
if ($all_groups && sizeof($items['group_ids']))
|
||||
{
|
||||
$group_id = $defined_group_ids;
|
||||
$group_id = $items['group_ids'];
|
||||
continue 2;
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_SELECT_USERGROUP' => ($victim == 'usergroup') ? true : false,
|
||||
'S_SELECT_USERGROUP_VIEW' => ($victim == 'usergroup_view') ? true : false,
|
||||
'S_DEFINED_USER_OPTIONS' => $s_defined_user_options,
|
||||
'S_DEFINED_GROUP_OPTIONS' => $s_defined_group_options,
|
||||
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $defined_group_ids),
|
||||
'S_DEFINED_USER_OPTIONS' => $items['user_ids_options'],
|
||||
'S_DEFINED_GROUP_OPTIONS' => $items['group_ids_options'],
|
||||
'S_ADD_GROUP_OPTIONS' => group_select_options(false, $items['group_ids']),
|
||||
'U_FIND_USERNAME' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=searchuser&form=add_user&field=username'))
|
||||
);
|
||||
|
||||
@ -1117,6 +1070,92 @@ class acp_permissions
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get already assigned users/groups
|
||||
*/
|
||||
function retrieve_defined_user_groups($permission_scope, $forum_id, $permission_type)
|
||||
{
|
||||
global $db, $user;
|
||||
|
||||
$sql_forum_id = ($permission_scope == 'global') ? 'AND a.forum_id = 0' : ((sizeof($forum_id)) ? 'AND a.forum_id IN (' . implode(', ', $forum_id) . ')' : 'AND a.forum_id <> 0');
|
||||
$sql_permission_option = "AND o.auth_option LIKE '" . $db->sql_escape($permission_type) . "%'";
|
||||
|
||||
$sql = $db->sql_build_query('SELECT_DISTINCT', array(
|
||||
'SELECT' => 'u.username, u.user_regdate, u.user_id',
|
||||
|
||||
'FROM' => array(
|
||||
USERS_TABLE => 'u',
|
||||
ACL_OPTIONS_TABLE => 'o',
|
||||
ACL_USERS_TABLE => 'a'
|
||||
),
|
||||
|
||||
'LEFT_JOIN' => array(
|
||||
array(
|
||||
'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'),
|
||||
'ON' => 'a.auth_role_id = r.role_id'
|
||||
)
|
||||
),
|
||||
|
||||
'WHERE' => "(a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id)
|
||||
$sql_permission_option
|
||||
$sql_forum_id
|
||||
AND u.user_id = a.user_id",
|
||||
|
||||
'ORDER_BY' => 'u.username, u.user_regdate ASC'
|
||||
));
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$s_defined_user_options = '';
|
||||
$defined_user_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$s_defined_user_options .= '<option value="' . $row['user_id'] . '">' . $row['username'] . '</option>';
|
||||
$defined_user_ids[] = $row['user_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = $db->sql_build_query('SELECT_DISTINCT', array(
|
||||
'SELECT' => 'g.group_type, g.group_name, g.group_id',
|
||||
|
||||
'FROM' => array(
|
||||
GROUPS_TABLE => 'g',
|
||||
ACL_OPTIONS_TABLE => 'o',
|
||||
ACL_GROUPS_TABLE => 'a'
|
||||
),
|
||||
|
||||
'LEFT_JOIN' => array(
|
||||
array(
|
||||
'FROM' => array(ACL_ROLES_DATA_TABLE => 'r'),
|
||||
'ON' => 'a.auth_role_id = r.role_id'
|
||||
)
|
||||
),
|
||||
|
||||
'WHERE' => "(a.auth_option_id = o.auth_option_id OR r.auth_option_id = o.auth_option_id)
|
||||
$sql_permission_option
|
||||
$sql_forum_id
|
||||
AND g.group_id = a.group_id",
|
||||
|
||||
'ORDER_BY' => 'g.group_type DESC, g.group_name ASC'
|
||||
));
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$s_defined_group_options = '';
|
||||
$defined_group_ids = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$s_defined_group_options .= '<option' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="sep"' : '') . ' value="' . $row['group_id'] . '">' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>';
|
||||
$defined_group_ids[] = $row['group_id'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
return array(
|
||||
'group_ids' => $defined_group_ids,
|
||||
'group_ids_options' => $s_defined_group_options,
|
||||
'user_ids' => $defined_user_ids,
|
||||
'user_ids_options' => $s_defined_user_options
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -707,74 +707,70 @@ class auth
|
||||
global $config, $db, $user, $phpbb_root_path, $phpEx;
|
||||
|
||||
$method = trim(basename($config['auth_method']));
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
|
||||
if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
||||
$method = 'login_' . $method;
|
||||
if (function_exists($method))
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
$login = $method($username, $password);
|
||||
|
||||
$method = 'login_' . $method;
|
||||
if (function_exists($method))
|
||||
// If the auth module wants us to create an empty profile do so and then treat the status as LOGIN_SUCCESS
|
||||
if ($login['status'] == LOGIN_SUCCESS_CREATE_PROFILE)
|
||||
{
|
||||
$login = $method($username, $password);
|
||||
|
||||
// If the auth module wants us to create an empty profile do so and then treat the status as LOGIN_SUCCESS
|
||||
if ($login['status'] == LOGIN_SUCCESS_CREATE_PROFILE)
|
||||
// we are going to use the user_add function so include functions_user.php if it wasn't defined yet
|
||||
if (!function_exists('user_add'))
|
||||
{
|
||||
// we are going to use the user_add function so include functions_user.php if it wasn't defined yet
|
||||
if (!function_exists('user_add'))
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
}
|
||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
}
|
||||
|
||||
user_add($login['user_row'], (isset($login['cp_data'])) ? $login['cp_data'] : false);
|
||||
user_add($login['user_row'], (isset($login['cp_data'])) ? $login['cp_data'] : false);
|
||||
|
||||
$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE username = '" . $db->sql_escape($username) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE username = '" . $db->sql_escape($username) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (!$row)
|
||||
{
|
||||
return array(
|
||||
'status' => LOGIN_ERROR_EXTERNAL_AUTH,
|
||||
'error_msg' => 'AUTH_NO_PROFILE_CREATED',
|
||||
'user_row' => array('user_id' => ANONYMOUS),
|
||||
);
|
||||
}
|
||||
|
||||
$login = array(
|
||||
'status' => LOGIN_SUCCESS,
|
||||
'error_msg' => false,
|
||||
'user_row' => $row,
|
||||
if (!$row)
|
||||
{
|
||||
return array(
|
||||
'status' => LOGIN_ERROR_EXTERNAL_AUTH,
|
||||
'error_msg' => 'AUTH_NO_PROFILE_CREATED',
|
||||
'user_row' => array('user_id' => ANONYMOUS),
|
||||
);
|
||||
}
|
||||
|
||||
// If login succeeded, we will log the user in... else we pass the login array through...
|
||||
if ($login['status'] == LOGIN_SUCCESS)
|
||||
$login = array(
|
||||
'status' => LOGIN_SUCCESS,
|
||||
'error_msg' => false,
|
||||
'user_row' => $row,
|
||||
);
|
||||
}
|
||||
|
||||
// If login succeeded, we will log the user in... else we pass the login array through...
|
||||
if ($login['status'] == LOGIN_SUCCESS)
|
||||
{
|
||||
$result = $user->session_create($login['user_row']['user_id'], $admin, $autologin, $viewonline);
|
||||
|
||||
// Successful session creation
|
||||
if ($result === true)
|
||||
{
|
||||
$result = $user->session_create($login['user_row']['user_id'], $admin, $autologin, $viewonline);
|
||||
|
||||
// Successful session creation
|
||||
if ($result === true)
|
||||
{
|
||||
return array(
|
||||
'status' => LOGIN_SUCCESS,
|
||||
'error_msg' => false,
|
||||
'user_row' => $login['user_row'],
|
||||
);
|
||||
}
|
||||
|
||||
return array(
|
||||
'status' => LOGIN_BREAK,
|
||||
'error_msg' => $result,
|
||||
'status' => LOGIN_SUCCESS,
|
||||
'error_msg' => false,
|
||||
'user_row' => $login['user_row'],
|
||||
);
|
||||
}
|
||||
|
||||
return $login;
|
||||
return array(
|
||||
'status' => LOGIN_BREAK,
|
||||
'error_msg' => $result,
|
||||
'user_row' => $login['user_row'],
|
||||
);
|
||||
}
|
||||
|
||||
return $login;
|
||||
}
|
||||
|
||||
trigger_error('Authentication method not found', E_USER_ERROR);
|
||||
|
@ -136,8 +136,8 @@ define('FIELD_DATE', 6);
|
||||
// Table names
|
||||
define('ACL_GROUPS_TABLE', $table_prefix . 'acl_groups');
|
||||
define('ACL_OPTIONS_TABLE', $table_prefix . 'acl_options');
|
||||
define('ACL_ROLES_TABLE', $table_prefix . 'acl_roles');
|
||||
define('ACL_ROLES_DATA_TABLE', $table_prefix . 'acl_roles_data');
|
||||
define('ACL_ROLES_TABLE', $table_prefix . 'acl_roles');
|
||||
define('ACL_USERS_TABLE', $table_prefix . 'acl_users');
|
||||
define('ATTACHMENTS_TABLE', $table_prefix . 'attachments');
|
||||
define('BANLIST_TABLE', $table_prefix . 'banlist');
|
||||
@ -146,10 +146,6 @@ define('BOOKMARKS_TABLE', $table_prefix . 'bookmarks');
|
||||
define('BOTS_TABLE', $table_prefix . 'bots');
|
||||
define('CONFIG_TABLE', $table_prefix . 'config');
|
||||
define('CONFIRM_TABLE', $table_prefix . 'confirm');
|
||||
define('PROFILE_FIELDS_TABLE', $table_prefix . 'profile_fields');
|
||||
define('PROFILE_LANG_TABLE', $table_prefix . 'profile_lang');
|
||||
define('PROFILE_FIELDS_DATA_TABLE', $table_prefix . 'profile_fields_data');
|
||||
define('PROFILE_FIELDS_LANG_TABLE', $table_prefix . 'profile_fields_lang');
|
||||
define('DISALLOW_TABLE', $table_prefix . 'disallow');
|
||||
define('DRAFTS_TABLE', $table_prefix . 'drafts');
|
||||
define('EXTENSIONS_TABLE', $table_prefix . 'extensions');
|
||||
@ -164,11 +160,17 @@ define('LANG_TABLE', $table_prefix . 'lang');
|
||||
define('LOG_TABLE', $table_prefix . 'log');
|
||||
define('MODERATOR_CACHE_TABLE', $table_prefix . 'moderator_cache');
|
||||
define('MODULES_TABLE', $table_prefix . 'modules');
|
||||
define('POLL_OPTIONS_TABLE', $table_prefix . 'poll_options');
|
||||
define('POLL_VOTES_TABLE', $table_prefix . 'poll_votes');
|
||||
define('POSTS_TABLE', $table_prefix . 'posts');
|
||||
define('PRIVMSGS_TABLE', $table_prefix . 'privmsgs');
|
||||
define('PRIVMSGS_TO_TABLE', $table_prefix . 'privmsgs_to');
|
||||
define('PRIVMSGS_FOLDER_TABLE', $table_prefix . 'privmsgs_folder');
|
||||
define('PRIVMSGS_RULES_TABLE', $table_prefix . 'privmsgs_rules');
|
||||
define('PRIVMSGS_TO_TABLE', $table_prefix . 'privmsgs_to');
|
||||
define('PROFILE_FIELDS_TABLE', $table_prefix . 'profile_fields');
|
||||
define('PROFILE_FIELDS_DATA_TABLE', $table_prefix . 'profile_fields_data');
|
||||
define('PROFILE_FIELDS_LANG_TABLE', $table_prefix . 'profile_fields_lang');
|
||||
define('PROFILE_LANG_TABLE', $table_prefix . 'profile_lang');
|
||||
define('RANKS_TABLE', $table_prefix . 'ranks');
|
||||
define('RATINGS_TABLE', $table_prefix . 'ratings');
|
||||
define('REPORTS_TABLE', $table_prefix . 'reports');
|
||||
@ -187,15 +189,13 @@ define('STYLES_THEME_TABLE', $table_prefix . 'styles_theme');
|
||||
define('STYLES_IMAGESET_TABLE', $table_prefix . 'styles_imageset');
|
||||
define('TOPICS_TABLE', $table_prefix . 'topics');
|
||||
define('TOPICS_POSTED_TABLE', $table_prefix . 'topics_posted');
|
||||
define('TOPICS_WATCH_TABLE', $table_prefix . 'topics_watch');
|
||||
define('TOPICS_TRACK_TABLE', $table_prefix . 'topics_track');
|
||||
define('TOPICS_WATCH_TABLE', $table_prefix . 'topics_watch');
|
||||
define('USER_GROUP_TABLE', $table_prefix . 'user_group');
|
||||
define('USERS_TABLE', $table_prefix . 'users');
|
||||
define('USERS_NOTES_TABLE', $table_prefix . 'users_notes');
|
||||
define('WARNINGS_TABLE', $table_prefix . 'warnings');
|
||||
define('WORDS_TABLE', $table_prefix . 'words');
|
||||
define('POLL_OPTIONS_TABLE', $table_prefix . 'poll_options');
|
||||
define('POLL_VOTES_TABLE', $table_prefix . 'poll_votes');
|
||||
define('ZEBRA_TABLE', $table_prefix . 'zebra');
|
||||
|
||||
// Additional tables
|
||||
|
@ -534,7 +534,7 @@ class custom_profile
|
||||
global $user;
|
||||
|
||||
$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
|
||||
$user_ident = str_replace('pf_', '', $profile_row['field_ident']);
|
||||
$user_ident = '_' . str_replace('pf_', '', $profile_row['field_ident']);
|
||||
|
||||
// checkbox - only testing for isset
|
||||
if ($profile_row['field_type'] == FIELD_BOOL && $profile_row['field_length'] == 2)
|
||||
@ -601,7 +601,7 @@ class custom_profile
|
||||
global $user, $template;
|
||||
|
||||
$profile_row['field_ident'] = (isset($profile_row['var_name'])) ? $profile_row['var_name'] : 'pf_' . $profile_row['field_ident'];
|
||||
$user_ident = str_replace('pf_', '', $profile_row['field_ident']);
|
||||
$user_ident = '_' . str_replace('pf_', '', $profile_row['field_ident']);
|
||||
|
||||
$now = getdate();
|
||||
|
||||
@ -803,7 +803,8 @@ class custom_profile
|
||||
$now = getdate();
|
||||
$row['field_default_value'] = sprintf('%2d-%2d-%4d', $now['mday'], $now['mon'], $now['year']);
|
||||
}
|
||||
$cp_data[$row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
|
||||
|
||||
$cp_data['_' . $row['field_ident']] = (in_array($row['field_type'], array(FIELD_TEXT, FIELD_STRING))) ? $row['lang_default_value'] : $row['field_default_value'];
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
|
@ -402,7 +402,7 @@ function user_delete($mode, $user_id, $post_username = false)
|
||||
break;
|
||||
}
|
||||
|
||||
$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE);
|
||||
$table_ary = array(USERS_TABLE, USER_GROUP_TABLE, TOPICS_WATCH_TABLE, FORUMS_WATCH_TABLE, ACL_USERS_TABLE, TOPICS_TRACK_TABLE, TOPICS_POSTED_TABLE, FORUMS_TRACK_TABLE, PROFILE_FIELDS_DATA_TABLE);
|
||||
|
||||
foreach ($table_ary as $table)
|
||||
{
|
||||
|
@ -172,17 +172,10 @@ class session
|
||||
// Load limit check (if applicable)
|
||||
if ($config['limit_load'])
|
||||
{
|
||||
if (@file_exists('/proc/loadavg') && @is_readable('/proc/loadavg'))
|
||||
if ($load = @file_get_contents('/proc/loadavg'))
|
||||
{
|
||||
if ($load = @file_get_contents('/proc/loadavg'))
|
||||
{
|
||||
$this->load = array_slice(explode(' ', $load), 0, 1);
|
||||
$this->load = floatval($this->load[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_config('limit_load', '0');
|
||||
}
|
||||
$this->load = array_slice(explode(' ', $load), 0, 1);
|
||||
$this->load = floatval($this->load[0]);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -220,18 +213,14 @@ class session
|
||||
|
||||
// Check whether the session is still valid if we have one
|
||||
$method = basename(trim($config['auth_method']));
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
|
||||
if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
||||
$method = 'validate_session_' . $method;
|
||||
if (function_exists($method))
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
|
||||
$method = 'validate_session_' . $method;
|
||||
if (function_exists($method))
|
||||
if (!$method($this->data))
|
||||
{
|
||||
if (!$method($this->data))
|
||||
{
|
||||
$session_expired = true;
|
||||
}
|
||||
$session_expired = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -357,21 +346,17 @@ class session
|
||||
}
|
||||
|
||||
$method = basename(trim($config['auth_method']));
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
|
||||
if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
||||
$method = 'autologin_' . $method;
|
||||
if (function_exists($method))
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
$this->data = $method();
|
||||
|
||||
$method = 'autologin_' . $method;
|
||||
if (function_exists($method))
|
||||
if (sizeof($this->data))
|
||||
{
|
||||
$this->data = $method();
|
||||
|
||||
if (sizeof($this->data))
|
||||
{
|
||||
$this->cookie_data['k'] = '';
|
||||
$this->cookie_data['u'] = $this->data['user_id'];
|
||||
}
|
||||
$this->cookie_data['k'] = '';
|
||||
$this->cookie_data['u'] = $this->data['user_id'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -547,16 +532,12 @@ class session
|
||||
|
||||
// Allow connecting logout with external auth method logout
|
||||
$method = basename(trim($config['auth_method']));
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
|
||||
if (file_exists($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx))
|
||||
$method = 'logout_' . $method;
|
||||
if (function_exists($method))
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/auth/auth_' . $method . '.' . $phpEx);
|
||||
|
||||
$method = 'logout_' . $method;
|
||||
if (function_exists($method))
|
||||
{
|
||||
$method($this->data);
|
||||
}
|
||||
$method($this->data);
|
||||
}
|
||||
|
||||
if ($this->data['user_id'] != ANONYMOUS)
|
||||
|
@ -210,6 +210,7 @@ function view_folder($id, $mode, $folder_id, $folder)
|
||||
'U_FOLDER' => (isset($folder[$row['folder_id']])) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'folder=' . $row['folder_id']) : '',
|
||||
'PM_ICON_IMG' => (!empty($icons[$row['icon_id']])) ? '<img src="' . $config['icons_path'] . '/' . $icons[$row['icon_id']]['img'] . '" width="' . $icons[$row['icon_id']]['width'] . '" height="' . $icons[$row['icon_id']]['height'] . '" alt="" title="" />' : '',
|
||||
'FOLDER_IMG' => $user->img($folder_img, $folder_alt),
|
||||
'FOLDER_IMG_SRC' => $user->img($folder_img, $folder_alt, false, '', 'src'),
|
||||
'PM_IMG' => ($row_indicator) ? $user->img('pm_' . $row_indicator, '') : '',
|
||||
'ATTACH_ICON_IMG' => ($auth->acl_get('u_pm_download') && $row['message_attachment'] && $config['allow_pm_attach']) ? $user->img('icon_attach', $user->lang['TOTAL_ATTACHMENTS']) : '',
|
||||
|
||||
|
@ -443,7 +443,7 @@ class ucp_register
|
||||
'CONFIRM_IMG' => $confirm_image,
|
||||
|
||||
'L_CONFIRM_EXPLAIN' => sprintf($user->lang['CONFIRM_EXPLAIN'], '<a href="mailto:' . htmlentities($config['board_contact']) . '">', '</a>'),
|
||||
'L_ITEMS_REQUIRED' => $l_reg_cond,
|
||||
'L_REG_COND' => $l_reg_cond,
|
||||
'L_USERNAME_EXPLAIN' => sprintf($user->lang[$user_char_ary[str_replace('\\\\', '\\', $config['allow_name_chars'])] . '_EXPLAIN'], $config['min_name_chars'], $config['max_name_chars']),
|
||||
'L_NEW_PASSWORD_EXPLAIN' => sprintf($user->lang['NEW_PASSWORD_EXPLAIN'], $config['min_pass_chars'], $config['max_pass_chars']),
|
||||
|
||||
|
@ -128,6 +128,7 @@ $lang = array_merge($lang, array(
|
||||
'NO_ROLE_AVAILABLE' => 'No role available',
|
||||
'NO_ROLE_NAME_SPECIFIED' => 'Please give the role a name.',
|
||||
'NO_ROLE_SELECTED' => 'Role could not be found.',
|
||||
'NO_USER_GROUP_SELECTED' => 'You haven\'t selected any user or group.',
|
||||
|
||||
'ONLY_FORUM_DEFINED' => 'You only defined forums in your selection. Please also select at least one user or one group.',
|
||||
|
||||
|
@ -213,6 +213,7 @@ $lang = array_merge($lang, array(
|
||||
|
||||
'IF_FOLDER_FULL' => 'If folder is full',
|
||||
'IMPORTANT_NEWS' => 'Important announcements',
|
||||
'ITEMS_REQUIRED' => 'The items marked with * are required profile fields and need to be filled out',
|
||||
|
||||
'LANGUAGE' => 'Language',
|
||||
'LINK_REMOTE_AVATAR' => 'Link off-site',
|
||||
|
@ -26,7 +26,12 @@
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
|
||||
<!-- IF L_ITEMS_REQUIRED -->
|
||||
<!-- IF L_REG_COND -->
|
||||
<tr>
|
||||
<td class="row2" colspan="2"><span class="gensmall">{L_REG_COND}</span></td>
|
||||
</tr>
|
||||
<!-- ENDIF -->
|
||||
<!-- IF .profile_fields -->
|
||||
<tr>
|
||||
<td class="row2" colspan="2"><span class="gensmall">{L_ITEMS_REQUIRED}</span></td>
|
||||
</tr>
|
||||
|
Loading…
x
Reference in New Issue
Block a user