mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
- extend config checking to include check for writeable path
- removed not utilized user_allow_email column from schema - removed inactive groups (they had no use at all, since inactive users are not able to login) The only benefit those brought are distinguish users - but this is no longer needed too due to the inactive code present. This also allows us to retain group memberships as well as default settings for users being set inactive due to profile changes. - rewrote user_active_flip to support multiple users and a mode, as well as coping with the aforementioned changes - implemented updated jabber class to support SRV server records and for better jabberd2 support. - jabber errors now logged to the error log with a full transaction - fixed user_delete calls to include usernames where possible and also update last post information correctly - implemented additioal checks to user management to cope with common mistakes - On installation, guess the required mysql schema as best as possible. Users now only need to decide if they want to use the mysqli extension or not (mysqli selected by default) and no longer need to know their mysql version. - founders do not need to re-activate their account on profile changes - remove older session if re-authentication was successful (re-authentication always assigns a new session id) - set the cookie directly instead of using php's function - added inactive_remind to see which users got deactivated because of reminders (or re-activation) sent out hopefully not introduced too many bugs - those testing with CVS releases, please concentrate on user registration, activation, profile changes (email/password)... git-svn-id: file:///svn/phpbb/trunk@6436 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
d7f87be493
commit
5284f32178
38 changed files with 875 additions and 593 deletions
|
@ -406,7 +406,9 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||
$cfg_array[$config_name] = (int) $cfg_array[$config_name];
|
||||
break;
|
||||
|
||||
// Relative path (appended $phpbb_root_path)
|
||||
case 'rpath':
|
||||
case 'rwpath':
|
||||
if (!$cfg_array[$config_name])
|
||||
{
|
||||
break;
|
||||
|
@ -426,9 +428,11 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||
$destination = '';
|
||||
}
|
||||
|
||||
$cfg_array[$config_name] = $destination;
|
||||
$cfg_array[$config_name] = trim($destination);
|
||||
|
||||
// Path being relative (still prefixed by phpbb_root_path), but with the ability to escape the root dir...
|
||||
case 'path':
|
||||
case 'wpath':
|
||||
|
||||
if (!$cfg_array[$config_name])
|
||||
{
|
||||
|
@ -437,6 +441,13 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||
|
||||
$cfg_array[$config_name] = trim($cfg_array[$config_name]);
|
||||
|
||||
// Make sure no NUL byte is present...
|
||||
if (strpos($cfg_array[$config_name], '\0') !== false || strpos($cfg_array[$config_name], '%00') !== false)
|
||||
{
|
||||
$cfg_array[$config_name] = '';
|
||||
break;
|
||||
}
|
||||
|
||||
if (!file_exists($phpbb_root_path . $cfg_array[$config_name]))
|
||||
{
|
||||
$error[] = sprintf($user->lang['DIRECTORY_DOES_NOT_EXIST'], $cfg_array[$config_name]);
|
||||
|
@ -447,6 +458,15 @@ function validate_config_vars($config_vars, &$cfg_array, &$error)
|
|||
$error[] = sprintf($user->lang['DIRECTORY_NOT_DIR'], $cfg_array[$config_name]);
|
||||
}
|
||||
|
||||
// Check if the path is writeable
|
||||
if ($config_definition['validate'] == 'wpath' || $config_definition['validate'] == 'rwpath')
|
||||
{
|
||||
if (file_exists($phpbb_root_path . $cfg_array[$config_name]) && !is_writeable($phpbb_root_path . $cfg_array[$config_name]))
|
||||
{
|
||||
$error[] = sprintf($user->lang['DIRECTORY_NOT_WRITEABLE'], $cfg_array[$config_name]);
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1870,7 +1870,6 @@ function get_schema_struct()
|
|||
'user_notify_pm' => array('BOOL', 1),
|
||||
'user_notify_type' => array('TINT:4', 0),
|
||||
'user_allow_pm' => array('BOOL', 1),
|
||||
'user_allow_email' => array('BOOL', 1),
|
||||
'user_allow_viewonline' => array('BOOL', 1),
|
||||
'user_allow_viewemail' => array('BOOL', 1),
|
||||
'user_allow_massemail' => array('BOOL', 1),
|
||||
|
|
|
@ -23,20 +23,21 @@ phpBB Developers : Ashe (Ludovic Arnaud) - [10/2002 - 11/2003, 06/2006 - ]
|
|||
BartVB (Bart van Bragt) - [11/2000 - 03/2006]
|
||||
|
||||
|
||||
Original subSilver by subBlue Design, Tom Beddard, © 2001 phpBB Group
|
||||
Original subSilver by subBlue Design, Tom Beddard, (c) 2001 phpBB Group
|
||||
|
||||
phpBB3 contains code from the following applications:
|
||||
|
||||
LGPL licenced:
|
||||
Smarty © 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/
|
||||
Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff
|
||||
Smarty (c) 2001, 2002 by ispi of Lincoln, Inc, http://smarty.php.net/
|
||||
|
||||
GPL licenced:
|
||||
phpMyAdmin © 2001,2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/
|
||||
Jabber class © 2003 Carlo Zottmann, http://phpjabber.g-blog.net
|
||||
Chora: Copyright 2000-2006, The Horde Project. http://horde.org/chora/
|
||||
Horde Project: Copyright 2000-2006, The Horde Project. http://horde.org/
|
||||
phpMyAdmin (c) 2001,2003 phpMyAdmin Devel team, http://www.phpmyadmin.net/
|
||||
Jabber Class (c) 2004 Nathan Fritz, http://cjphp.netflint.net
|
||||
Chora (c) 2000-2006, The Horde Project. http://horde.org/chora/
|
||||
Horde Project (c) 2000-2006, The Horde Project. http://horde.org/
|
||||
|
||||
PHP License, version 3.0:
|
||||
Pear © 2001-2004 PHP Group, http://pear.php.net
|
||||
Pear (c) 2001-2004 PHP Group, http://pear.php.net
|
||||
|
||||
Text_Diff-0.2.1 http://pear.php.net/package/Text_Diff
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ class acp_attachments
|
|||
'legend1' => 'ACP_ATTACHMENT_SETTINGS',
|
||||
'allow_attachments' => array('lang' => 'ALLOW_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'allow_pm_attach' => array('lang' => 'ALLOW_PM_ATTACHMENTS', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => false),
|
||||
'upload_path' => array('lang' => 'UPLOAD_DIR', 'validate' => 'path', 'type' => 'text:25:100', 'explain' => true),
|
||||
'upload_path' => array('lang' => 'UPLOAD_DIR', 'validate' => 'wpath', 'type' => 'text:25:100', 'explain' => true),
|
||||
'display_order' => array('lang' => 'DISPLAY_ORDER', 'validate' => 'bool', 'type' => 'custom', 'method' => 'display_order', 'explain' => true),
|
||||
'attachment_quota' => array('lang' => 'ATTACH_QUOTA', 'validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
|
||||
'max_filesize' => array('lang' => 'ATTACH_MAX_FILESIZE', 'validate' => 'int', 'type' => 'custom', 'method' => 'max_filesize', 'explain' => true),
|
||||
|
|
|
@ -27,7 +27,7 @@ class acp_board
|
|||
$action = request_var('action', '');
|
||||
$submit = (isset($_POST['submit'])) ? true : false;
|
||||
|
||||
// Validation types are: string, int, bool, rpath, path
|
||||
// Validation types are: string, int, bool, rpath (relative), rwpath (realtive, writeable), path (relative path, but able to escape the root), wpath (writeable)
|
||||
switch ($mode)
|
||||
{
|
||||
case 'settings':
|
||||
|
@ -93,7 +93,7 @@ class acp_board
|
|||
'avatar_filesize' => array('lang' => 'MAX_FILESIZE', 'validate' => 'int', 'type' => 'text:4:10', 'explain' => true, 'append' => ' ' . $user->lang['BYTES']),
|
||||
'avatar_min' => array('lang' => 'MIN_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true),
|
||||
'avatar_max' => array('lang' => 'MAX_AVATAR_SIZE', 'validate' => 'int', 'type' => 'dimension:3:4', 'explain' => true),
|
||||
'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
'avatar_path' => array('lang' => 'AVATAR_STORAGE_PATH', 'validate' => 'rwpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
'avatar_gallery_path' => array('lang' => 'AVATAR_GALLERY_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true)
|
||||
)
|
||||
);
|
||||
|
@ -279,7 +279,7 @@ class acp_board
|
|||
'legend2' => 'PATH_SETTINGS',
|
||||
'smilies_path' => array('lang' => 'SMILIES_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
'icons_path' => array('lang' => 'ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'validate' => 'path', 'type' => 'text:20:255', 'explain' => true),
|
||||
'upload_icons_path' => array('lang' => 'UPLOAD_ICONS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
'ranks_path' => array('lang' => 'RANKS_PATH', 'validate' => 'rpath', 'type' => 'text:20:255', 'explain' => true),
|
||||
|
||||
'legend3' => 'SERVER_URL_SETTINGS',
|
||||
|
|
|
@ -58,16 +58,7 @@ class acp_inactive
|
|||
if ($action == 'activate')
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
|
||||
foreach ($mark as $user_id)
|
||||
{
|
||||
user_active_flip($user_id, USER_INACTIVE);
|
||||
}
|
||||
|
||||
set_config('num_users', $config['num_users'] + sizeof($mark), true);
|
||||
|
||||
// Update latest username
|
||||
update_last_username();
|
||||
user_active_flip('activate', $mark);
|
||||
}
|
||||
else if ($action == 'delete')
|
||||
{
|
||||
|
|
|
@ -44,16 +44,9 @@ class acp_jabber
|
|||
$jab_resource = request_var('jab_resource', $config['jab_resource']);
|
||||
$jab_package_size = request_var('jab_package_size', $config['jab_package_size']);
|
||||
|
||||
$jabber = new jabber();
|
||||
$jabber = new jabber($jab_host, $jab_port, $jab_username, $jab_password, $jab_resource);
|
||||
$error = array();
|
||||
|
||||
// Setup the basis vars for jabber connection
|
||||
$jabber->server = $jab_host;
|
||||
$jabber->port = ($jab_port) ? $jab_port : 5222;
|
||||
$jabber->username = $jab_username;
|
||||
$jabber->password = $jab_password;
|
||||
$jabber->resource = $jab_resource;
|
||||
|
||||
$message = $user->lang['JAB_SETTINGS_CHANGED'];
|
||||
$log = 'JAB_SETTINGS_CHANGED';
|
||||
|
||||
|
|
|
@ -70,7 +70,7 @@ class acp_permissions
|
|||
if ($select_all_groups)
|
||||
{
|
||||
// Add default groups to selection
|
||||
$sql_and = (!$config['coppa_enable']) ? " AND group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
|
||||
$sql_and = (!$config['coppa_enable']) ? " AND group_name <> 'REGISTERED_COPPA'" : '';
|
||||
|
||||
$sql = 'SELECT group_id
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
|
|
|
@ -267,11 +267,7 @@ class acp_prune
|
|||
{
|
||||
if ($action == 'deactivate')
|
||||
{
|
||||
foreach ($user_ids as $user_id)
|
||||
{
|
||||
user_active_flip($user_id, USER_NORMAL, false, false, INACTIVE_MANUAL, true);
|
||||
}
|
||||
|
||||
user_active_flip('deactivate', $user_ids);
|
||||
$l_log = 'LOG_PRUNE_USER_DEAC';
|
||||
}
|
||||
else if ($action == 'delete')
|
||||
|
|
|
@ -174,7 +174,7 @@ class acp_users
|
|||
|
||||
if (confirm_box(true))
|
||||
{
|
||||
user_delete($delete_type, $user_id);
|
||||
user_delete($delete_type, $user_id, $user_row['username']);
|
||||
|
||||
add_log('admin', 'LOG_USER_DELETED', $user_row['username']);
|
||||
trigger_error($user->lang['USER_DELETED'] . adm_back_link($this->u_action));
|
||||
|
@ -205,6 +205,11 @@ class acp_users
|
|||
trigger_error($user->lang['CANNOT_BAN_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
if ($user_row['user_type'] == USER_FOUNDER)
|
||||
{
|
||||
trigger_error($user->lang['CANNOT_BAN_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$ban = array();
|
||||
|
||||
switch ($action)
|
||||
|
@ -256,6 +261,16 @@ class acp_users
|
|||
trigger_error($user->lang['CANNOT_FORCE_REACT_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
if ($user_row['user_type'] == USER_FOUNDER)
|
||||
{
|
||||
trigger_error($user->lang['CANNOT_FORCE_REACT_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
if ($user_row['user_type'] == USER_IGNORE)
|
||||
{
|
||||
trigger_error($user->lang['CANNOT_FORCE_REACT_BOT'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
if ($config['email_enable'])
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
|
@ -267,9 +282,14 @@ class acp_users
|
|||
$key_len = ($key_len > 6) ? $key_len : 6;
|
||||
$user_actkey = substr($user_actkey, 0, $key_len);
|
||||
|
||||
if ($user_row['user_type'] != USER_INACTIVE)
|
||||
if ($user_row['user_type'] == USER_NORMAL)
|
||||
{
|
||||
user_active_flip($user_id, $user_row['user_type'], $user_actkey, $user_row['username'], INACTIVE_MANUAL);
|
||||
user_active_flip('deactivate', $user_id, INACTIVE_REMIND);
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||
SET user_actkey = '" . $db->sql_escape($user_actkey) . "'
|
||||
WHERE user_id = $user_id";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$messenger = new messenger(false);
|
||||
|
@ -311,25 +331,24 @@ class acp_users
|
|||
trigger_error($user->lang['CANNOT_DEACTIVATE_YOURSELF'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
user_active_flip($user_id, $user_row['user_type'], false, $user_row['username'], INACTIVE_MANUAL);
|
||||
if ($user_row['user_type'] == USER_FOUNDER)
|
||||
{
|
||||
trigger_error($user->lang['CANNOT_DEACTIVATE_FOUNDER'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
if ($user_row['user_type'] == USER_IGNORE)
|
||||
{
|
||||
trigger_error($user->lang['CANNOT_DEACTIVATE_BOT'] . adm_back_link($this->u_action . '&u=' . $user_id), E_USER_WARNING);
|
||||
}
|
||||
|
||||
user_active_flip('flip', $user_id);
|
||||
|
||||
$message = ($user_row['user_type'] == USER_INACTIVE) ? 'USER_ADMIN_ACTIVATED' : 'USER_ADMIN_DEACTIVED';
|
||||
$log = ($user_row['user_type'] == USER_INACTIVE) ? 'LOG_USER_ACTIVE' : 'LOG_USER_INACTIVE';
|
||||
|
||||
add_log('admin', $log, $user_row['username']);
|
||||
add_log('user', $user_id, $log . '_USER');
|
||||
|
||||
if ($user_row['user_type'] == USER_INACTIVE)
|
||||
{
|
||||
set_config('num_users', $config['num_users'] + 1, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
set_config('num_users', $config['num_users'] - 1, true);
|
||||
}
|
||||
|
||||
// Update latest username
|
||||
update_last_username();
|
||||
|
||||
trigger_error($user->lang[$message] . adm_back_link($this->u_action . '&u=' . $user_id));
|
||||
|
||||
break;
|
||||
|
@ -783,9 +802,21 @@ class acp_users
|
|||
}
|
||||
else
|
||||
{
|
||||
$quick_tool_ary = array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP', 'active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'), 'delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
|
||||
$quick_tool_ary = array();
|
||||
|
||||
if ($user_row['user_type'] != USER_FOUNDER)
|
||||
{
|
||||
$quick_tool_ary += array('banuser' => 'BAN_USER', 'banemail' => 'BAN_EMAIL', 'banip' => 'BAN_IP');
|
||||
}
|
||||
|
||||
if ($user_row['user_type'] != USER_FOUNDER && $user_row['user_type'] != USER_IGNORE)
|
||||
{
|
||||
$quick_tool_ary += array('active' => (($user_row['user_type'] == USER_INACTIVE) ? 'ACTIVATE' : 'DEACTIVATE'));
|
||||
}
|
||||
|
||||
if ($config['email_enable'])
|
||||
$quick_tool_ary += array('delsig' => 'DEL_SIG', 'delavatar' => 'DEL_AVATAR', 'moveposts' => 'MOVE_POSTS', 'delposts' => 'DEL_POSTS', 'delattach' => 'DEL_ATTACH');
|
||||
|
||||
if ($config['email_enable'] && ($user_row['user_type'] == USER_NORMAL || $user_row['user_type'] == USER_INACTIVE))
|
||||
{
|
||||
$quick_tool_ary['reactivate'] = 'FORCE';
|
||||
}
|
||||
|
@ -807,7 +838,7 @@ class acp_users
|
|||
'S_USER_FOUNDER' => ($user_row['user_type'] == USER_FOUNDER) ? true : false,
|
||||
'S_ACTION_OPTIONS' => $s_action_options,
|
||||
'S_OWN_ACCOUNT' => ($user_id == $user->data['user_id']) ? true : false,
|
||||
'S_USER_INACTIVE' => ($user_row['user_type'] == USER_IGNORE || $user_row['user_type'] == USER_INACTIVE) ? true : false,
|
||||
'S_USER_INACTIVE' => ($user_row['user_type'] == USER_INACTIVE) ? true : false,
|
||||
|
||||
'U_SHOW_IP' => $this->u_action . "&u=$user_id&ip=" . (($ip == 'ip') ? 'hostname' : 'ip'),
|
||||
'U_WHOIS' => $this->u_action . "&action=whois&user_ip={$user_row['user_ip']}",
|
||||
|
@ -1854,11 +1885,11 @@ class acp_users
|
|||
$s_group_options = '';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
if (!$config['coppa_enable'] && in_array($row['group_name'], array('INACTIVE_COPPA', 'REGISTERED_COPPA')))
|
||||
if (!$config['coppa_enable'] && $row['group_name'] == 'REGISTERED_COPPA')
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
$s_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>';
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
|
|
@ -714,7 +714,7 @@ class auth
|
|||
|
||||
$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE username = '" . $db->sql_escape($username) . "'";
|
||||
WHERE LOWER(username) = '" . $db->sql_escape(strtolower($username)) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
@ -738,11 +738,36 @@ class auth
|
|||
// If login succeeded, we will log the user in... else we pass the login array through...
|
||||
if ($login['status'] == LOGIN_SUCCESS)
|
||||
{
|
||||
$old_session_id = $user->session_id;
|
||||
|
||||
if ($admin)
|
||||
{
|
||||
global $SID, $_SID;
|
||||
|
||||
$cookie_expire = time() - 31536000;
|
||||
$user->set_cookie('u', '', $cookie_expire);
|
||||
$user->set_cookie('sid', '', $cookie_expire);
|
||||
unset($cookie_expire);
|
||||
|
||||
$SID = '?sid=';
|
||||
$user->session_id = $_SID = '';
|
||||
}
|
||||
|
||||
$result = $user->session_create($login['user_row']['user_id'], $admin, $autologin, $viewonline);
|
||||
|
||||
// Successful session creation
|
||||
if ($result === true)
|
||||
{
|
||||
// If admin re-authentication we remove the old session entry because a new one has been created...
|
||||
if ($admin)
|
||||
{
|
||||
// the login array is used because the user ids do not differ for re-authentication
|
||||
$sql = 'DELETE FROM ' . SESSIONS_TABLE . "
|
||||
WHERE session_id = '" . $db->sql_escape($old_session_id) . "'
|
||||
AND session_user_id = {$login['user_row']['user_id']}";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
return array(
|
||||
'status' => LOGIN_SUCCESS,
|
||||
'error_msg' => false,
|
||||
|
|
|
@ -27,12 +27,11 @@ define('USER_NORMAL', 0);
|
|||
define('USER_INACTIVE', 1);
|
||||
define('USER_IGNORE', 2);
|
||||
define('USER_FOUNDER', 3);
|
||||
//define('USER_BOT', 2);
|
||||
//define('USER_GUEST', 4);
|
||||
|
||||
define('INACTIVE_REGISTER', 1);
|
||||
define('INACTIVE_PROFILE', 2);
|
||||
define('INACTIVE_MANUAL', 3);
|
||||
define('INACTIVE_REMIND', 4);
|
||||
|
||||
// ACL
|
||||
define('ACL_NEVER', 0);
|
||||
|
|
|
@ -33,6 +33,8 @@ if (!defined('SQL_LAYER'))
|
|||
*/
|
||||
class dbal_mysql extends dbal
|
||||
{
|
||||
var $mysql_version;
|
||||
|
||||
/**
|
||||
* Connect to server
|
||||
* @access public
|
||||
|
@ -51,14 +53,14 @@ class dbal_mysql extends dbal
|
|||
if (@mysql_select_db($this->dbname))
|
||||
{
|
||||
// Determine what version we are using and if it natively supports UNICODE
|
||||
$mysql_version = mysql_get_server_info($this->db_connect_id);
|
||||
$this->mysql_version = mysql_get_server_info($this->db_connect_id);
|
||||
|
||||
if (version_compare($mysql_version, '4.1.3', '>='))
|
||||
if (version_compare($this->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
define('SQL_LAYER', 'mysql4');
|
||||
@mysql_query("SET NAMES 'utf8'", $this->db_connect_id);
|
||||
}
|
||||
else if (version_compare($mysql_version, '4.0.0', '>='))
|
||||
else if (version_compare($this->mysql_version, '4.0.0', '>='))
|
||||
{
|
||||
define('SQL_LAYER', 'mysql4');
|
||||
}
|
||||
|
@ -79,7 +81,7 @@ class dbal_mysql extends dbal
|
|||
*/
|
||||
function sql_server_info()
|
||||
{
|
||||
return 'MySQL ' . @mysql_get_server_info($this->db_connect_id);
|
||||
return 'MySQL ' . $this->mysql_version;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -1913,7 +1913,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
|
|||
'U_PRIVACY' => append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=privacy'),
|
||||
|
||||
'S_DISPLAY_FULL_LOGIN' => ($s_display) ? true : false,
|
||||
'S_LOGIN_ACTION' => (!$admin) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx"), // Needs to stay index.$phpEx because we are within the admin directory
|
||||
'S_LOGIN_ACTION' => (!$admin) ? append_sid("{$phpbb_root_path}ucp.$phpEx", 'mode=login') : append_sid("index.$phpEx", false, true, $user->session_id), // Needs to stay index.$phpEx because we are within the admin directory
|
||||
'S_HIDDEN_FIELDS' => $s_hidden_fields,
|
||||
|
||||
'S_ADMIN_AUTH' => $admin,
|
||||
|
|
|
@ -207,7 +207,7 @@ function group_select_options($group_id, $exclude_ids = false)
|
|||
global $db, $user, $config;
|
||||
|
||||
$exclude_sql = ($exclude_ids !== false && sizeof($exclude_ids)) ? 'WHERE ' . $db->sql_in_set('group_id', array_map('intval', $exclude_ids), true) : '';
|
||||
$sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name NOT IN ('INACTIVE_COPPA', 'REGISTERED_COPPA')" : '';
|
||||
$sql_and = (!$config['coppa_enable']) ? (($exclude_sql) ? ' AND ' : ' WHERE ') . "group_name <> 'REGISTERED_COPPA'" : '';
|
||||
|
||||
$sql = 'SELECT group_id, group_name, group_type
|
||||
FROM ' . GROUPS_TABLE . "
|
||||
|
@ -245,6 +245,7 @@ function get_forum_list($acl_list = 'f_list', $id_only = true, $postable_only =
|
|||
ORDER BY left_id ASC';
|
||||
$result = $db->sql_query($sql, $expire_time);
|
||||
|
||||
$forum_rows = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$forum_rows[] = $row;
|
||||
|
@ -2343,7 +2344,7 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li
|
|||
$sql = 'SELECT user_id, username, user_regdate, user_lastvisit, user_inactive_time, user_inactive_reason
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type = ' . USER_INACTIVE .
|
||||
(($limit_days) ? "AND user_inactive_time >= $limit_days" : '') . "
|
||||
(($limit_days) ? " AND user_inactive_time >= $limit_days" : '') . "
|
||||
ORDER BY $sort_by";
|
||||
$result = $db->sql_query_limit($sql, $limit, $offset);
|
||||
|
||||
|
@ -2363,15 +2364,19 @@ function view_inactive_users(&$users, &$user_count, $limit = 0, $offset = 0, $li
|
|||
case INACTIVE_MANUAL:
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_MANUAL'];
|
||||
break;
|
||||
|
||||
case INACTIVE_REMIND:
|
||||
$row['inactive_reason'] = $user->lang['INACTIVE_REASON_REMIND'];
|
||||
break;
|
||||
}
|
||||
|
||||
$users[] = $row;
|
||||
}
|
||||
|
||||
$sql = 'SELECT count(user_id) AS user_count
|
||||
$sql = 'SELECT COUNT(user_id) AS user_count
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_type = ' . USER_INACTIVE .
|
||||
(($limit_days) ? "AND user_inactive_time >= $limit_days" : '');
|
||||
(($limit_days) ? " AND user_inactive_time >= $limit_days" : '');
|
||||
$result = $db->sql_query($sql);
|
||||
$user_count = (int) $db->sql_fetchfield('user_count');
|
||||
$db->sql_freeresult($result);
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -417,13 +417,7 @@ class messenger
|
|||
if (!$use_queue)
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_jabber.'.$phpEx);
|
||||
$this->jabber = new jabber;
|
||||
|
||||
$this->jabber->server = $config['jab_host'];
|
||||
$this->jabber->port = ($config['jab_port']) ? $config['jab_port'] : 5222;
|
||||
$this->jabber->username = $config['jab_username'];
|
||||
$this->jabber->password = $config['jab_password'];
|
||||
$this->jabber->resource = ($config['jab_resource']) ? $config['jab_resource'] : '';
|
||||
$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_resource']);
|
||||
|
||||
if (!$this->jabber->connect())
|
||||
{
|
||||
|
@ -557,13 +551,7 @@ class queue
|
|||
}
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_jabber.'.$phpEx);
|
||||
$this->jabber = new jabber;
|
||||
|
||||
$this->jabber->server = $config['jab_host'];
|
||||
$this->jabber->port = ($config['jab_port']) ? $config['jab_port'] : 5222;
|
||||
$this->jabber->username = $config['jab_username'];
|
||||
$this->jabber->password = $config['jab_password'];
|
||||
$this->jabber->resource = ($config['jab_resource']) ? $config['jab_resource'] : '';
|
||||
$this->jabber = new jabber($config['jab_host'], $config['jab_port'], $config['jab_username'], $config['jab_password'], $config['jab_resource']);
|
||||
|
||||
if (!$this->jabber->connect())
|
||||
{
|
||||
|
@ -603,14 +591,19 @@ class queue
|
|||
|
||||
$message = 'Method: [ ' . (($config['smtp_delivery']) ? 'SMTP' : 'PHP') . ' ]<br /><br />' . $err_msg . '<br /><br /><u>CALLING PAGE</u><br /><br />' . ((!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']);
|
||||
messenger::error('EMAIL', $message);
|
||||
continue 3;
|
||||
continue 2;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'jabber':
|
||||
foreach ($addresses as $address)
|
||||
{
|
||||
$this->jabber->send_message($address, 'normal', NULL, array('body' => $msg));
|
||||
if ($this->jabber->send_message($address, 'normal', NULL, array('body' => $msg)) === false)
|
||||
{
|
||||
$message = 'Method: [ JABBER ]<br /><br />' . $this->jabber->get_log() . '<br /><br /><u>CALLING PAGE</u><br /><br />' . ((!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']);
|
||||
messenger::error('JABBER', $message);
|
||||
continue 3;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1899,7 +1899,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
|
|||
trigger_error('NO_SUCH_SEARCH_MODULE');
|
||||
}
|
||||
|
||||
require("{$phpbb_root_path}includes/search/$search_type.$phpEx");
|
||||
require_once("{$phpbb_root_path}includes/search/$search_type.$phpEx");
|
||||
|
||||
$error = false;
|
||||
$search = new $search_type($error);
|
||||
|
|
|
@ -141,10 +141,6 @@ function user_add($user_row, $cp_data = false)
|
|||
'user_type' => $user_row['user_type'],
|
||||
);
|
||||
|
||||
/**
|
||||
* @todo user_allow_email is not used anywhere. Think about removing it.
|
||||
*/
|
||||
|
||||
// These are the additional vars able to be specified
|
||||
$additional_vars = array(
|
||||
'user_permissions' => '',
|
||||
|
@ -182,7 +178,6 @@ function user_add($user_row, $cp_data = false)
|
|||
'user_notify_pm' => 1,
|
||||
'user_notify_type' => NOTIFY_EMAIL,
|
||||
'user_allow_pm' => 1,
|
||||
'user_allow_email' => 1,
|
||||
'user_allow_viewonline' => 1,
|
||||
'user_allow_viewemail' => 1,
|
||||
'user_allow_massemail' => 1,
|
||||
|
@ -265,23 +260,34 @@ function user_delete($mode, $user_id, $post_username = false)
|
|||
switch ($mode)
|
||||
{
|
||||
case 'retain':
|
||||
|
||||
if ($post_username === false)
|
||||
{
|
||||
$post_username = $user->lang['GUEST'];
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . FORUMS_TABLE . '
|
||||
SET forum_last_poster_id = ' . ANONYMOUS . (($post_username !== false) ? ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "'" : '') . ", forum_last_poster_colour = ''
|
||||
SET forum_last_poster_id = ' . ANONYMOUS . ", forum_last_poster_name = '" . $db->sql_escape($post_username) . "', forum_last_poster_colour = ''
|
||||
WHERE forum_last_poster_id = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . POSTS_TABLE . '
|
||||
SET poster_id = ' . ANONYMOUS . (($post_username !== false) ? ", post_username = '" . $db->sql_escape($post_username) . "'" : '') . "
|
||||
SET poster_id = ' . ANONYMOUS . ", post_username = '" . $db->sql_escape($post_username) . "'
|
||||
WHERE poster_id = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . POSTS_TABLE . '
|
||||
SET post_edit_user = ' . ANONYMOUS . "
|
||||
WHERE post_edit_user = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
||||
SET topic_poster = ' . ANONYMOUS . "
|
||||
SET topic_poster = ' . ANONYMOUS . ", topic_first_poster_name = '" . $db->sql_escape($post_username) . "', topic_first_poster_colour = ''
|
||||
WHERE topic_poster = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql = 'UPDATE ' . TOPICS_TABLE . '
|
||||
SET topic_last_poster_id = ' . ANONYMOUS . (($post_username !== false) ? ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "'" : '') . "
|
||||
SET topic_last_poster_id = ' . ANONYMOUS . ", topic_last_poster_name = '" . $db->sql_escape($post_username) . "', topic_last_poster_colour = ''
|
||||
WHERE topic_last_poster_id = $user_id";
|
||||
$db->sql_query($sql);
|
||||
break;
|
||||
|
@ -413,99 +419,96 @@ function user_delete($mode, $user_id, $post_username = false)
|
|||
|
||||
set_config('num_users', $config['num_users'] - 1, true);
|
||||
|
||||
// Adjust last post info...
|
||||
|
||||
|
||||
$db->sql_transaction('commit');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Flips user_type from active to inactive and vice versa, handles
|
||||
* group membership updates
|
||||
* Flips user_type from active to inactive and vice versa, handles group membership updates
|
||||
*
|
||||
* @param string $mode can be flip for flipping from active/inactive, activate or deactivate
|
||||
*/
|
||||
function user_active_flip($user_id, $user_type, $user_actkey = false, $username = false, $reason = 0, $no_log = false)
|
||||
function user_active_flip($mode, $user_id_ary, $reason = INACTIVE_MANUAL)
|
||||
{
|
||||
global $db, $user, $auth;
|
||||
global $config, $db, $user;
|
||||
|
||||
$sql = 'SELECT group_id, group_name
|
||||
FROM ' . GROUPS_TABLE . "
|
||||
WHERE group_name IN ('REGISTERED', 'REGISTERED_COPPA', 'INACTIVE', 'INACTIVE_COPPA')";
|
||||
$deactivated = $activated = 0;
|
||||
$sql_statements = array();
|
||||
|
||||
if (!is_array($user_id_ary))
|
||||
{
|
||||
$user_id_ary = array($user_id_ary);
|
||||
}
|
||||
|
||||
if (!sizeof($user_id_ary))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
$sql = 'SELECT user_id, group_id, user_type, user_inactive_reason
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE ' . $db->sql_in_set('user_id', $user_id_ary);
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$group_id_ary = array();
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
{
|
||||
$group_id_ary[$row['group_name']] = $row['group_id'];
|
||||
$sql_ary = array();
|
||||
|
||||
if ($row['user_type'] == USER_IGNORE || $row['user_type'] == USER_FOUNDER ||
|
||||
($mode == 'activate' && $row['user_type'] != USER_INACTIVE) ||
|
||||
($mode == 'deactivate' && $row['user_type'] == USER_INACTIVE))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($row['user_type'] == USER_INACTIVE)
|
||||
{
|
||||
$activated++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$deactivated++;
|
||||
|
||||
// Remove the users session key...
|
||||
$user->reset_login_keys($row['user_id']);
|
||||
}
|
||||
|
||||
$sql_ary += array(
|
||||
'user_type' => ($row['user_type'] == USER_NORMAL) ? USER_INACTIVE : USER_NORMAL,
|
||||
'user_inactive_time' => ($row['user_type'] == USER_NORMAL) ? time() : 0,
|
||||
'user_inactive_reason' => ($row['user_type'] == USER_NORMAL) ? $reason : 0,
|
||||
);
|
||||
|
||||
$sql_statements[$row['user_id']] = $sql_ary;
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$sql = 'SELECT group_id
|
||||
FROM ' . USER_GROUP_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$group_name = ($user_type == USER_NORMAL) ? 'REGISTERED' : 'INACTIVE';
|
||||
while ($row = $db->sql_fetchrow($result))
|
||||
if (sizeof($sql_statements))
|
||||
{
|
||||
if ($name = array_search($row['group_id'], $group_id_ary))
|
||||
foreach ($sql_statements as $user_id => $sql_ary)
|
||||
{
|
||||
$group_name = $name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
$current_group = ($user_type == USER_NORMAL) ? 'REGISTERED' : 'INACTIVE';
|
||||
$switch_group = ($user_type == USER_NORMAL) ? 'INACTIVE' : 'REGISTERED';
|
||||
|
||||
$new_group_id = $group_id_ary[str_replace($current_group, $switch_group, $group_name)];
|
||||
|
||||
$sql = 'UPDATE ' . USER_GROUP_TABLE . "
|
||||
SET group_id = $new_group_id
|
||||
WHERE user_id = $user_id
|
||||
AND group_id = " . $group_id_ary[$group_name];
|
||||
$db->sql_query($sql);
|
||||
|
||||
$sql_ary = array(
|
||||
'user_type' => ($user_type == USER_NORMAL) ? USER_INACTIVE : USER_NORMAL,
|
||||
'user_inactive_time' => ($user_type == USER_NORMAL) ? time() : 0,
|
||||
'user_inactive_reason' => ($user_type == USER_NORMAL) ? $reason : 0,
|
||||
);
|
||||
|
||||
if ($user_actkey !== false)
|
||||
{
|
||||
$sql_ary['user_actkey'] = $user_actkey;
|
||||
}
|
||||
|
||||
$sql = 'UPDATE ' . USERS_TABLE . ' SET ' . $db->sql_build_array('UPDATE', $sql_ary) . "
|
||||
WHERE user_id = $user_id";
|
||||
$db->sql_query($sql);
|
||||
|
||||
// Set the users default group from inactive to registered or registered to inactive
|
||||
// only if the group id changed...
|
||||
group_set_user_default($new_group_id, array($user_id));
|
||||
|
||||
$auth->acl_clear_prefetch($user_id);
|
||||
|
||||
if (!$no_log)
|
||||
{
|
||||
if ($username === false)
|
||||
{
|
||||
$sql = 'SELECT username
|
||||
FROM ' . USERS_TABLE . "
|
||||
WHERE user_id = $user_id";
|
||||
$result = $db->sql_query($sql);
|
||||
$username = (string) $db->sql_fetchfield('username');
|
||||
$db->sql_freeresult($result);
|
||||
$sql = 'UPDATE ' . USERS_TABLE . '
|
||||
SET ' . $db->sql_build_array('UPDATE', $sql_ary) . '
|
||||
WHERE user_id = ' . $user_id;
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
$log = ($user_type == USER_NORMAL) ? 'LOG_USER_INACTIVE' : 'LOG_USER_ACTIVE';
|
||||
add_log('admin', $log, $username);
|
||||
$auth->acl_clear_prefetch(array_keys($sql_statements));
|
||||
}
|
||||
|
||||
return false;
|
||||
if ($deactivated)
|
||||
{
|
||||
set_config('num_users', $config['num_users'] - $deactivated, true);
|
||||
}
|
||||
|
||||
if ($activated)
|
||||
{
|
||||
set_config('num_users', $config['num_users'] + $activated, true);
|
||||
}
|
||||
|
||||
// Update latest username
|
||||
update_last_username();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -127,9 +127,6 @@ class session
|
|||
*
|
||||
* @param bool $update_session_page if true the session page gets updated.
|
||||
* This can be set to circumvent certain scripts to update the users last visited page.
|
||||
*
|
||||
* @todo Introduce further user types, bot, guest
|
||||
* @todo Change user_type (as above) to a bitfield? user_type & USER_FOUNDER for example
|
||||
*/
|
||||
function session_begin($update_session_page = true)
|
||||
{
|
||||
|
@ -148,9 +145,6 @@ class session
|
|||
|
||||
if (isset($_COOKIE[$config['cookie_name'] . '_sid']) || isset($_COOKIE[$config['cookie_name'] . '_u']))
|
||||
{
|
||||
// Switch to request_var ... can this cause issues, can a _GET/_POST param
|
||||
// be used to poison this? Not sure that it makes any difference in terms of
|
||||
// the end result, be it a cookie or param.
|
||||
$this->cookie_data['u'] = request_var($config['cookie_name'] . '_u', 0, false, true);
|
||||
$this->cookie_data['k'] = request_var($config['cookie_name'] . '_k', '', false, true);
|
||||
$this->session_id = request_var($config['cookie_name'] . '_sid', '', false, true);
|
||||
|
@ -265,7 +259,6 @@ class session
|
|||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
// Ultimately to be removed
|
||||
$this->data['is_registered'] = ($this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false;
|
||||
$this->data['is_bot'] = (!$this->data['is_registered'] && $this->data['user_id'] != ANONYMOUS) ? true : false;
|
||||
|
||||
|
@ -275,7 +268,10 @@ class session
|
|||
else
|
||||
{
|
||||
// Added logging temporarly to help debug bugs...
|
||||
add_log('critical', 'LOG_IP_BROWSER_CHECK', $u_ip, $s_ip, $u_browser, $s_browser);
|
||||
if (defined('DEBUG_EXTRA'))
|
||||
{
|
||||
add_log('critical', 'LOG_IP_BROWSER_CHECK', $u_ip, $s_ip, $u_browser, $s_browser);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -374,7 +370,7 @@ class session
|
|||
$sql = 'SELECT u.*
|
||||
FROM ' . USERS_TABLE . ' u, ' . SESSIONS_KEYS_TABLE . ' k
|
||||
WHERE u.user_id = ' . (int) $this->cookie_data['u'] . '
|
||||
AND u.user_type <> ' . USER_INACTIVE . "
|
||||
AND u.user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ")
|
||||
AND k.user_id = u.user_id
|
||||
AND k.key_id = '" . $db->sql_escape(md5($this->cookie_data['k'])) . "'";
|
||||
$result = $db->sql_query($sql);
|
||||
|
@ -389,7 +385,7 @@ class session
|
|||
$sql = 'SELECT *
|
||||
FROM ' . USERS_TABLE . '
|
||||
WHERE user_id = ' . (int) $this->cookie_data['u'] . '
|
||||
AND user_type <> ' . USER_INACTIVE;
|
||||
AND user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ')';
|
||||
$result = $db->sql_query($sql);
|
||||
$this->data = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
@ -439,18 +435,14 @@ class session
|
|||
// session exists in which case session_id will also be set
|
||||
|
||||
// Is user banned? Are they excluded? Won't return on ban, exists within method
|
||||
// @todo Change to !$this->data['user_type'] & USER_FOUNDER && !$this->data['user_type'] & USER_BOT in time
|
||||
if ($this->data['user_type'] != USER_FOUNDER)
|
||||
{
|
||||
$this->check_ban($this->data['user_id'], $this->ip);
|
||||
}
|
||||
|
||||
//
|
||||
// Do away with ultimately?
|
||||
$this->data['is_registered'] = (!$bot && $this->data['user_id'] != ANONYMOUS) ? true : false;
|
||||
|
||||
$this->data['is_registered'] = (!$bot && $this->data['user_id'] != ANONYMOUS && ($this->data['user_type'] == USER_NORMAL || $this->data['user_type'] == USER_FOUNDER)) ? true : false;
|
||||
$this->data['is_bot'] = ($bot) ? true : false;
|
||||
//
|
||||
//
|
||||
|
||||
// If our friend is a bot, we re-assign a previously assigned session
|
||||
if ($this->data['is_bot'] && $bot === $this->data['user_id'] && $this->data['session_id'])
|
||||
|
@ -493,8 +485,8 @@ class session
|
|||
}
|
||||
}
|
||||
|
||||
// @todo Change this ... check for "... && user_type & USER_NORMAL" ?
|
||||
$session_autologin = (($this->cookie_data['k'] || $persist_login) && $this->data['is_registered']) ? true : false;
|
||||
$set_admin = ($set_admin && $this->data['is_registered']) ? true : false;
|
||||
|
||||
// Create or update the session
|
||||
$sql_ary = array(
|
||||
|
@ -734,20 +726,11 @@ class session
|
|||
{
|
||||
global $config;
|
||||
|
||||
if (!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1')
|
||||
{
|
||||
@setcookie($config['cookie_name'] . '_' . $name, $cookiedata, $cookietime, $config['cookie_path']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Firefox does not allow setting cookies with a domain containing no periods.
|
||||
if (strpos($config['cookie_domain'], '.') === false)
|
||||
{
|
||||
$config['cookie_domain'] = '.' . $config['cookie_domain'];
|
||||
}
|
||||
$name_data = rawurlencode($config['cookie_name'] . '_' . $name) . '=' . rawurlencode($cookiedata);
|
||||
$expire = gmdate('D, d-M-Y H:i:s \\G\\M\\T', $cookietime);
|
||||
$domain = (!$config['cookie_domain'] || $config['cookie_domain'] == 'localhost' || $config['cookie_domain'] == '127.0.0.1') ? '' : '; domain=' . $config['cookie_domain'];
|
||||
|
||||
@setcookie($config['cookie_name'] . '_' . $name, $cookiedata, $cookietime, $config['cookie_path'], $config['cookie_domain'], $config['cookie_secure']);
|
||||
}
|
||||
header('Set-Cookie: ' . $name_data . '; expires=' . $expire . '; path=' . $config['cookie_path'] . $domain . ((!$config['cookie_secure']) ? '' : '; secure') . '; HttpOnly', false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1020,15 +1003,20 @@ class user extends session
|
|||
$this->timezone = $config['board_timezone'] * 3600;
|
||||
$this->dst = $config['board_dst'] * 3600;
|
||||
|
||||
/* Browser-specific language setting removed - might re-appear later
|
||||
/**
|
||||
* If a guest user is surfing, we try to guess his/her language first by obtaining the browser language
|
||||
* @todo if re-enabled we need to make sure only those languages installed are checked
|
||||
|
||||
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
|
||||
{
|
||||
$accept_lang_ary = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
|
||||
|
||||
foreach ($accept_lang_ary as $accept_lang)
|
||||
{
|
||||
// Set correct format ... guess full xx_YY form
|
||||
$accept_lang = substr($accept_lang, 0, 2) . '_' . strtoupper(substr($accept_lang, 3, 2));
|
||||
$accept_lang = basename($accept_lang);
|
||||
|
||||
if (file_exists($phpbb_root_path . 'language/' . $accept_lang . "/common.$phpEx"))
|
||||
{
|
||||
$this->lang_name = $config['default_lang'] = $accept_lang;
|
||||
|
@ -1039,6 +1027,8 @@ class user extends session
|
|||
{
|
||||
// No match on xx_YY so try xx
|
||||
$accept_lang = substr($accept_lang, 0, 2);
|
||||
$accept_lang = basename($accept_lang);
|
||||
|
||||
if (file_exists($phpbb_root_path . 'language/' . $accept_lang . "/common.$phpEx"))
|
||||
{
|
||||
$this->lang_name = $config['default_lang'] = $accept_lang;
|
||||
|
@ -1048,7 +1038,7 @@ class user extends session
|
|||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
// We include common language file here to not load it every time a custom language file is included
|
||||
|
|
|
@ -53,7 +53,6 @@ class ucp_activate
|
|||
if ($update_password)
|
||||
{
|
||||
$sql_ary = array(
|
||||
'user_type' => USER_NORMAL,
|
||||
'user_actkey' => '',
|
||||
'user_password' => $user_row['user_newpasswd'],
|
||||
'user_newpasswd' => ''
|
||||
|
@ -69,12 +68,12 @@ class ucp_activate
|
|||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_user.' . $phpEx);
|
||||
|
||||
// Now we need to demote the user from the inactive group and add him to the registered group
|
||||
user_active_flip($user_row['user_id'], $user_row['user_type'], '', $user_row['username'], 0, true);
|
||||
user_active_flip('activate', $user_row['user_id']);
|
||||
|
||||
// Update last username
|
||||
update_last_username();
|
||||
set_config('num_users', $config['num_users'] + 1, true);
|
||||
$sql = 'UPDATE ' . USERS_TABLE . "
|
||||
SET user_actkey = ''
|
||||
WHERE user_id = {$user_row['user_id']}";
|
||||
$db->sql_query($sql);
|
||||
}
|
||||
|
||||
if ($config['require_activation'] == USER_ACTIVATION_ADMIN && !$update_password)
|
||||
|
|
|
@ -120,7 +120,7 @@ class ucp_profile
|
|||
add_log('user', $user->data['user_id'], 'LOG_USER_UPDATE_EMAIL', $username, $user->data['user_email'], $email);
|
||||
}
|
||||
|
||||
if ($config['email_enable'] && $email != $user->data['user_email'] && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN))
|
||||
if ($config['email_enable'] && $email != $user->data['user_email'] && $user->data['user_type'] != USER_FOUNDER && ($config['require_activation'] == USER_ACTIVATION_SELF || $config['require_activation'] == USER_ACTIVATION_ADMIN))
|
||||
{
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx);
|
||||
|
||||
|
@ -185,11 +185,10 @@ class ucp_profile
|
|||
|
||||
$messenger->save_queue();
|
||||
|
||||
user_active_flip('deactivate', $user_id, INACTIVE_PROFILE);
|
||||
|
||||
$sql_ary += array(
|
||||
'user_type' => USER_INACTIVE,
|
||||
'user_actkey' => $user_actkey,
|
||||
'user_inactive_reason' => INACTIVE_PROFILE,
|
||||
'user_inactive_time' => time(),
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -220,9 +220,7 @@ class ucp_register
|
|||
$server_url = generate_board_url();
|
||||
|
||||
// Which group by default?
|
||||
$group_reg = ($coppa) ? 'REGISTERED_COPPA' : 'REGISTERED';
|
||||
$group_inactive = ($coppa) ? 'INACTIVE_COPPA' : 'INACTIVE';
|
||||
$group_name = ($config['require_activation'] == USER_ACTIVATION_NONE || !$config['email_enable']) ? $group_reg : $group_inactive;
|
||||
$group_name = ($coppa) ? 'REGISTERED_COPPA' : 'REGISTERED';
|
||||
|
||||
$sql = 'SELECT group_id
|
||||
FROM ' . GROUPS_TABLE . "
|
||||
|
|
|
@ -46,7 +46,7 @@ class ucp_resend
|
|||
trigger_error('ACCOUNT_ALREADY_ACTIVATED');
|
||||
}
|
||||
|
||||
// Determine coppa status on group (INACTIVE(_COPPA))
|
||||
// Determine coppa status on group (REGISTERED(_COPPA))
|
||||
$sql = 'SELECT group_name, group_type
|
||||
FROM ' . GROUPS_TABLE . '
|
||||
WHERE group_id = ' . $user_row['group_id'];
|
||||
|
@ -59,7 +59,7 @@ class ucp_resend
|
|||
trigger_error('NO_GROUP');
|
||||
}
|
||||
|
||||
$coppa = ($row['group_name'] == 'INACTIVE_COPPA' && $row['group_type'] == GROUP_SPECIAL) ? true : false;
|
||||
$coppa = ($row['group_name'] == 'REGISTERED_COPPA' && $row['group_type'] == GROUP_SPECIAL) ? true : false;
|
||||
|
||||
include_once($phpbb_root_path . 'includes/functions_messenger.' . $phpEx);
|
||||
$messenger = new messenger(false);
|
||||
|
|
|
@ -701,7 +701,6 @@ function prepare_column_data($dbms, $column_data)
|
|||
$sql .= ' COLLATE UNICODE';
|
||||
}
|
||||
|
||||
$sql .= ",\n";
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
|
|
|
@ -886,7 +886,7 @@ class install_install extends module
|
|||
$server_port = ($server_port !== '') ? $server_port : ((!empty($_SERVER['SERVER_PORT'])) ? (int) $_SERVER['SERVER_PORT'] : (int) getenv('SERVER_PORT'));
|
||||
$server_protocol = ($server_protocol !== '') ? $server_protocol : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https://' : 'http://');
|
||||
$cookie_secure = ($cookie_secure !== '') ? $cookie_secure : ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? true : false);
|
||||
|
||||
|
||||
foreach ($this->advanced_config_options as $config_key => $vars)
|
||||
{
|
||||
if (!is_array($vars) && strpos($config_key, 'legend') === false)
|
||||
|
@ -964,6 +964,12 @@ class install_install extends module
|
|||
|
||||
$cookie_domain = ($server_name != '') ? $server_name : (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : getenv('SERVER_NAME');
|
||||
|
||||
// Try to come up with the best solution for cookie domain...
|
||||
if (strpos($cookie_domain, 'www.') === 0)
|
||||
{
|
||||
$cookie_domain = str_replace('www.', '.', $cookie_domain);
|
||||
}
|
||||
|
||||
// If we get here and the extension isn't loaded it should be safe to just go ahead and load it
|
||||
if (!@extension_loaded($this->available_dbms[$dbms]['MODULE']))
|
||||
{
|
||||
|
@ -983,6 +989,19 @@ class install_install extends module
|
|||
// NOTE: trigger_error does not work here.
|
||||
$db->return_on_error = true;
|
||||
|
||||
// If mysql is chosen, we need to adjust the schema filename slightly to reflect the correct version. ;)
|
||||
if ($dbms == 'mysql')
|
||||
{
|
||||
if (SQL_LAYER == 'mysql4' && version_compare($db->mysql_version, '4.1.3', '>='))
|
||||
{
|
||||
$this->available_dbms[$dbms]['SCHEMA'] .= '_41';
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->available_dbms[$dbms]['SCHEMA'] .= '_40';
|
||||
}
|
||||
}
|
||||
|
||||
// Ok we have the db info go ahead and read in the relevant schema
|
||||
// and work on building the table
|
||||
$dbms_schema = 'schemas/' . $this->available_dbms[$dbms]['SCHEMA'] . '_schema.sql';
|
||||
|
@ -1649,33 +1668,31 @@ class install_install extends module
|
|||
switch ($dbms)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
if (stristr($table_prefix, '-') !== false)
|
||||
if (strpos($table_prefix, '-') !== false)
|
||||
{
|
||||
$error[] = $lang['INST_ERR_PREFIX_INVALID'];
|
||||
return false;
|
||||
}
|
||||
|
||||
// no break;
|
||||
|
||||
case 'postgres':
|
||||
$prefix_length = 36;
|
||||
|
||||
break;
|
||||
|
||||
case 'mssql':
|
||||
case 'mssql_odbc':
|
||||
$prefix_length = 90;
|
||||
|
||||
break;
|
||||
|
||||
case 'sqlite':
|
||||
$prefix_length = 200;
|
||||
|
||||
break;
|
||||
|
||||
case 'firebird':
|
||||
case 'oracle':
|
||||
$prefix_length = 6;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1696,10 +1713,9 @@ class install_install extends module
|
|||
switch ($dbms)
|
||||
{
|
||||
case 'mysql':
|
||||
case 'mysql4':
|
||||
case 'mysqli':
|
||||
case 'sqlite':
|
||||
$sql = "SHOW TABLES";
|
||||
$sql = 'SHOW TABLES';
|
||||
$field = "Tables_in_{$dbname}";
|
||||
break;
|
||||
|
||||
|
@ -1755,13 +1771,6 @@ class install_install extends module
|
|||
// Make sure that the user has selected a sensible DBAL for the DBMS actually installed
|
||||
switch ($dbms)
|
||||
{
|
||||
case 'mysql4':
|
||||
if (version_compare(mysql_get_server_info($db->db_connect_id), '4.0.0', '<'))
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_MYSQL4'];
|
||||
}
|
||||
break;
|
||||
|
||||
case 'mysqli':
|
||||
if (version_compare(mysqli_get_server_info($db->db_connect_id), '4.1.3', '<'))
|
||||
{
|
||||
|
@ -1787,9 +1796,11 @@ class install_install extends module
|
|||
WHERE RDB$SYSTEM_FLAG IS NULL
|
||||
AND RDB$FUNCTION_NAME = 'CHAR_LENGTH'";
|
||||
$result = $db->sql_query($sql);
|
||||
$row = $db->sql_fetchrow($result);
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
// if its a UDF, its too old
|
||||
if ($db->sql_fetchrow($result))
|
||||
if ($row)
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
|
||||
}
|
||||
|
@ -1797,14 +1808,13 @@ class install_install extends module
|
|||
{
|
||||
$sql = "SELECT FIRST 0 char_length('')
|
||||
FROM RDB\$DATABASE";
|
||||
$result2 = $db->sql_query($sql);
|
||||
if (!$result2) // This can only fail if char_length is not defined
|
||||
$result = $db->sql_query($sql);
|
||||
if (!$result) // This can only fail if char_length is not defined
|
||||
{
|
||||
$error[] = $lang['INST_ERR_DB_NO_FIREBIRD'];
|
||||
}
|
||||
$db->sql_freeresult($result2);
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
$db->sql_freeresult($result);
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -1819,7 +1829,6 @@ class install_install extends module
|
|||
{
|
||||
$stats[$row['parameter']] = $row['value'];
|
||||
}
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if (version_compare($stats['NLS_RDBMS_VERSION'], '9.2', '<') && $stats['NLS_CHARACTERSET'] !== 'UTF8')
|
||||
|
@ -1831,9 +1840,7 @@ class install_install extends module
|
|||
case 'postgres':
|
||||
$sql = "SHOW server_encoding;";
|
||||
$result = $db->sql_query($sql);
|
||||
|
||||
$row = $db->sql_fetchrow($result);
|
||||
|
||||
$db->sql_freeresult($result);
|
||||
|
||||
if ($row['server_encoding'] !== 'UNICODE' && $row['server_encoding'] !== 'UTF8')
|
||||
|
@ -1949,24 +1956,16 @@ class install_install extends module
|
|||
'DRIVER' => 'firebird'
|
||||
),
|
||||
'mysqli' => array(
|
||||
'LABEL' => 'MySQL 4.1.x/5.x (MySQLi)',
|
||||
'LABEL' => 'MySQL with MySQLi Extension',
|
||||
'SCHEMA' => 'mysql_41',
|
||||
'MODULE' => 'mysqli',
|
||||
'DELIM' => ';',
|
||||
'COMMENTS' => 'remove_remarks',
|
||||
'DRIVER' => 'mysqli'
|
||||
),
|
||||
'mysql4' => array(
|
||||
'LABEL' => 'MySQL 4.x/MySQL 5.x',
|
||||
'SCHEMA' => 'mysql_41',
|
||||
'MODULE' => 'mysql',
|
||||
'DELIM' => ';',
|
||||
'COMMENTS' => 'remove_remarks',
|
||||
'DRIVER' => 'mysql'
|
||||
),
|
||||
'mysql' => array(
|
||||
'LABEL' => 'MySQL',
|
||||
'SCHEMA' => 'mysql_40',
|
||||
'SCHEMA' => 'mysql',
|
||||
'MODULE' => 'mysql',
|
||||
'DELIM' => ';',
|
||||
'COMMENTS' => 'remove_remarks',
|
||||
|
|
|
@ -1403,7 +1403,6 @@ CREATE TABLE phpbb_users (
|
|||
user_notify_pm INTEGER DEFAULT 1 NOT NULL,
|
||||
user_notify_type INTEGER DEFAULT 0 NOT NULL,
|
||||
user_allow_pm INTEGER DEFAULT 1 NOT NULL,
|
||||
user_allow_email INTEGER DEFAULT 1 NOT NULL,
|
||||
user_allow_viewonline INTEGER DEFAULT 1 NOT NULL,
|
||||
user_allow_viewemail INTEGER DEFAULT 1 NOT NULL,
|
||||
user_allow_massemail INTEGER DEFAULT 1 NOT NULL,
|
||||
|
|
|
@ -1645,7 +1645,6 @@ CREATE TABLE [phpbb_users] (
|
|||
[user_notify_pm] [int] DEFAULT (1) NOT NULL ,
|
||||
[user_notify_type] [int] DEFAULT (0) NOT NULL ,
|
||||
[user_allow_pm] [int] DEFAULT (1) NOT NULL ,
|
||||
[user_allow_email] [int] DEFAULT (1) NOT NULL ,
|
||||
[user_allow_viewonline] [int] DEFAULT (1) NOT NULL ,
|
||||
[user_allow_viewemail] [int] DEFAULT (1) NOT NULL ,
|
||||
[user_allow_massemail] [int] DEFAULT (1) NOT NULL ,
|
||||
|
|
|
@ -1005,7 +1005,6 @@ CREATE TABLE phpbb_users (
|
|||
user_notify_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_notify_type tinyint(4) DEFAULT '0' NOT NULL,
|
||||
user_allow_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_allow_email tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
|
|
|
@ -1005,7 +1005,6 @@ CREATE TABLE phpbb_users (
|
|||
user_notify_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_notify_type tinyint(4) DEFAULT '0' NOT NULL,
|
||||
user_allow_pm tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_allow_email tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_allow_viewonline tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_allow_viewemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
user_allow_massemail tinyint(1) UNSIGNED DEFAULT '1' NOT NULL,
|
||||
|
|
|
@ -1814,7 +1814,6 @@ CREATE TABLE phpbb_users (
|
|||
user_notify_pm number(1) DEFAULT '1' NOT NULL,
|
||||
user_notify_type number(4) DEFAULT '0' NOT NULL,
|
||||
user_allow_pm number(1) DEFAULT '1' NOT NULL,
|
||||
user_allow_email number(1) DEFAULT '1' NOT NULL,
|
||||
user_allow_viewonline number(1) DEFAULT '1' NOT NULL,
|
||||
user_allow_viewemail number(1) DEFAULT '1' NOT NULL,
|
||||
user_allow_massemail number(1) DEFAULT '1' NOT NULL,
|
||||
|
|
|
@ -1265,7 +1265,6 @@ CREATE TABLE phpbb_users (
|
|||
user_notify_pm INT2 DEFAULT '1' NOT NULL CHECK (user_notify_pm >= 0),
|
||||
user_notify_type INT2 DEFAULT '0' NOT NULL,
|
||||
user_allow_pm INT2 DEFAULT '1' NOT NULL CHECK (user_allow_pm >= 0),
|
||||
user_allow_email INT2 DEFAULT '1' NOT NULL CHECK (user_allow_email >= 0),
|
||||
user_allow_viewonline INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewonline >= 0),
|
||||
user_allow_viewemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_viewemail >= 0),
|
||||
user_allow_massemail INT2 DEFAULT '1' NOT NULL CHECK (user_allow_massemail >= 0),
|
||||
|
|
|
@ -405,12 +405,10 @@ INSERT INTO phpbb_forums (forum_name, forum_desc, left_id, right_id, parent_id,
|
|||
INSERT INTO phpbb_users (user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (2, 1, 'Anonymous', 0, '', '', 'en', 1, 0, '', 0, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
|
||||
|
||||
# -- username: Admin password: admin (change this or remove it once everything is working!)
|
||||
INSERT INTO phpbb_users (user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (3, 7, 'Admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
|
||||
INSERT INTO phpbb_users (user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour, user_posts, user_permissions, user_ip, user_birthday, user_lastpage, user_last_confirm_key, user_post_sortby_type, user_post_sortby_dir, user_topic_sortby_type, user_topic_sortby_dir, user_avatar, user_sig, user_sig_bbcode_uid, user_from, user_icq, user_aim, user_yim, user_msnm, user_jabber, user_website, user_occ, user_interests, user_actkey, user_newpasswd) VALUES (3, 5, 'Admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000', 1, '', '', '', '', '', 't', 'a', 't', 'd', '', '', '', '', '', '', '', '', '', '', '', '', '', '');
|
||||
|
||||
# -- Groups
|
||||
INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('GUESTS', 3, '', 0, '', '', '');
|
||||
INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('INACTIVE', 3, '', 0, '', '', '');
|
||||
INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('INACTIVE_COPPA', 3, '', 0, '', '', '');
|
||||
INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('REGISTERED', 3, '', 0, '', '', '');
|
||||
INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('REGISTERED_COPPA', 3, '', 0, '', '', '');
|
||||
INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, group_avatar, group_desc, group_desc_uid) VALUES ('GLOBAL_MODERATORS', 3, '00AA00', 1, '', '', '');
|
||||
|
@ -419,9 +417,9 @@ INSERT INTO phpbb_groups (group_name, group_type, group_colour, group_legend, gr
|
|||
|
||||
# -- User -> Group
|
||||
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (1, 1, 0, 0);
|
||||
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (2, 2, 0, 0);
|
||||
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (4, 2, 0, 0);
|
||||
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (6, 2, 0, 0);
|
||||
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (7, 2, 0, 1);
|
||||
INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (5, 2, 0, 1);
|
||||
|
||||
# -- Ranks
|
||||
INSERT INTO phpbb_ranks (rank_title, rank_min, rank_special, rank_image) VALUES ('Site Admin', 0, 1, '');
|
||||
|
@ -506,50 +504,46 @@ INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id,
|
|||
INSERT INTO phpbb_acl_users (user_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 0, 0, 5, 0);
|
||||
|
||||
# ADMINISTRATOR Group - full user features
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 0, 0, 5, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 0, 0, 5, 0);
|
||||
|
||||
# ADMINISTRATOR Group - standard admin
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 0, 0, 1, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 0, 0, 1, 0);
|
||||
|
||||
# REGISTERED and REGISTERED_COPPA having standard user features
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 0, 0, 6, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 0, 0, 6, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 0, 0, 6, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 0, 0, 6, 0);
|
||||
|
||||
# GLOBAL_MODERATORS having full user features
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 0, 0, 5, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 0, 0, 5, 0);
|
||||
|
||||
# GLOBAL_MODERATORS having full global moderator access
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 0, 0, 10, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 0, 0, 10, 0);
|
||||
|
||||
# Giving all groups read only access to the first category
|
||||
# since administrators and moderators are already within the registered users group we do not need to set them here
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (1, 1, 0, 17, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 1, 0, 17, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 1, 0, 17, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 1, 0, 17, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 1, 0, 17, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (8, 1, 0, 17, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 1, 0, 17, 0);
|
||||
|
||||
# Giving access to the first forum
|
||||
|
||||
# guests, inactive and inactive_coppa having read only access
|
||||
# guests having read only access
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (1, 2, 0, 17, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 2, 0, 17, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 2, 0, 17, 0);
|
||||
|
||||
# registered and registered_coppa having standard access
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 2, 0, 15, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 2, 0, 15, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (2, 2, 0, 15, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (3, 2, 0, 15, 0);
|
||||
|
||||
# global moderators having standard access + polls
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 2, 0, 21, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (4, 2, 0, 21, 0);
|
||||
|
||||
# administrators having full forum and full moderator access
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 2, 0, 14, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (7, 2, 0, 10, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 2, 0, 14, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (5, 2, 0, 10, 0);
|
||||
|
||||
# Bots having bot access
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (8, 2, 0, 19, 0);
|
||||
INSERT INTO phpbb_acl_groups (group_id, forum_id, auth_option_id, auth_role_id, auth_setting) VALUES (6, 2, 0, 19, 0);
|
||||
|
||||
|
||||
# -- Demo Topic
|
||||
|
|
|
@ -976,7 +976,6 @@ CREATE TABLE phpbb_users (
|
|||
user_notify_pm INTEGER UNSIGNED NOT NULL DEFAULT '1',
|
||||
user_notify_type tinyint(4) NOT NULL DEFAULT '0',
|
||||
user_allow_pm INTEGER UNSIGNED NOT NULL DEFAULT '1',
|
||||
user_allow_email INTEGER UNSIGNED NOT NULL DEFAULT '1',
|
||||
user_allow_viewonline INTEGER UNSIGNED NOT NULL DEFAULT '1',
|
||||
user_allow_viewemail INTEGER UNSIGNED NOT NULL DEFAULT '1',
|
||||
user_allow_massemail INTEGER UNSIGNED NOT NULL DEFAULT '1',
|
||||
|
|
|
@ -204,8 +204,9 @@ $lang = array_merge($lang, array(
|
|||
|
||||
'DEACTIVATE' => 'Deactivate',
|
||||
'DIMENSIONS' => 'Dimensions',
|
||||
'DIRECTORY_DOES_NOT_EXIST' => 'The entered directory "%s" does not exist.',
|
||||
'DIRECTORY_DOES_NOT_EXIST' => 'The entered path "%s" does not exist.',
|
||||
'DIRECTORY_NOT_DIR' => 'The entered path "%s" is not a directory.',
|
||||
'DIRECTORY_NOT_WRITEABLE' => 'The entered path "%s" is not writeable.',
|
||||
'DISABLE' => 'Disable',
|
||||
'DOWNLOAD' => 'Download',
|
||||
'DOWNLOAD_AS' => 'Download as',
|
||||
|
@ -341,6 +342,7 @@ $lang = array_merge($lang, array(
|
|||
'INACTIVE_REASON_MANUAL' => 'Account deactivated by administrator',
|
||||
'INACTIVE_REASON_PROFILE' => 'Profile details changed',
|
||||
'INACTIVE_REASON_REGISTER' => 'Newly registered account',
|
||||
'INACTIVE_REASON_REMIND' => 'Forced user account reactivation',
|
||||
'INACTIVE_REASON_UNKNOWN' => 'Unknown',
|
||||
'INACTIVE_USERS' => 'Inactive Users',
|
||||
'INACTIVE_USERS_EXPLAIN' => 'This is a list of users who have registered but whos accounts are inactive. You can activate, delete or remind (by sending an email) these users if you wish.',
|
||||
|
|
|
@ -36,8 +36,13 @@ $lang = array_merge($lang, array(
|
|||
|
||||
'BAN_SUCCESSFUL' => 'Ban entered successfully.',
|
||||
|
||||
'CANNOT_BAN_FOUNDER' => 'You are not allowed to ban founder accounts.',
|
||||
'CANNOT_BAN_YOURSELF' => 'You are not allowed to ban yourself.',
|
||||
'CANNOT_DEACTIVATE_BOT' => 'You are not allowed to deactivate bot accounts. Please deactivate the bot instead.',
|
||||
'CANNOT_DEACTIVATE_FOUNDER' => 'You are not allowed to deactivate founder accounts.',
|
||||
'CANNOT_DEACTIVATE_YOURSELF' => 'You are not allowed to deactivate your own account.',
|
||||
'CANNOT_FORCE_REACT_BOT' => 'You are not allowed to force reactivation on bot accounts. Please deactivate the bot instead.',
|
||||
'CANNOT_FORCE_REACT_FOUNDER' => 'You are not allowed to force reactivation on founder accounts.',
|
||||
'CANNOT_FORCE_REACT_YOURSELF' => 'You are not allowed to force reactivation of your own account.',
|
||||
'CANNOT_REMOVE_ANONYMOUS' => 'You are not able to remove the guest user account.',
|
||||
'CANNOT_REMOVE_YOURSELF' => 'You are not allowed to remove your own user account.',
|
||||
|
|
|
@ -214,8 +214,6 @@ $lang = array_merge($lang, array(
|
|||
'G_ADMINISTRATORS' => 'Administrators',
|
||||
'G_BOTS' => 'Bots',
|
||||
'G_GUESTS' => 'Guests',
|
||||
'G_INACTIVE' => 'Unapproved Users',
|
||||
'G_INACTIVE_COPPA' => 'Unapproved COPPA Users',
|
||||
'G_REGISTERED' => 'Registered Users',
|
||||
'G_REGISTERED_COPPA' => 'Registered COPPA Users',
|
||||
'G_GLOBAL_MODERATORS' => 'Global Moderators',
|
||||
|
|
|
@ -92,15 +92,14 @@ $lang = array_merge($lang, array(
|
|||
'DEV_NO_TEST_FILE' => 'No value has been specified for the test_file variable in the convertor. If you are a user of this convertor, you should not be seeing this error, please report this message to the convertor author. If you are a convertor author, you must specify the name of a file which exists in the source forum to allow the path to it to be verified.',
|
||||
'DIRECTORIES_AND_FILES' => 'Directory and file setup',
|
||||
'DISABLE_KEYS' => 'Disabling keys',
|
||||
'DLL_FIREBIRD' => 'Firebird 1.5+',
|
||||
'DLL_FIREBIRD' => 'Firebird',
|
||||
'DLL_FTP' => 'Remote FTP support [ Installation ]',
|
||||
'DLL_GD' => 'GD graphics support [ Visual Confirmation ]',
|
||||
'DLL_MBSTRING' => 'Multi-byte character support',
|
||||
'DLL_MSSQL' => 'MSSQL Server 2000+',
|
||||
'DLL_MSSQL_ODBC' => 'MSSQL Server 2000+ via ODBC',
|
||||
'DLL_MYSQL' => 'MySQL 3.23.x/4.x',
|
||||
'DLL_MYSQL4' => 'MySQL 4.x/5.x',
|
||||
'DLL_MYSQLI' => 'MySQL 4.1.x/5.x with MySQLi Extension',
|
||||
'DLL_MYSQL' => 'MySQL',
|
||||
'DLL_MYSQLI' => 'MySQL with MySQLi Extension',
|
||||
'DLL_ORACLE' => 'Oracle',
|
||||
'DLL_POSTGRES' => 'PostgreSQL 7.x/8.x',
|
||||
'DLL_SQLITE' => 'SQLite',
|
||||
|
|
Loading…
Add table
Reference in a new issue