diff options
Diffstat (limited to 'phpBB')
-rw-r--r-- | phpBB/adm/admin_jabber.php | 2 | ||||
-rw-r--r-- | phpBB/adm/index.php | 9 | ||||
-rw-r--r-- | phpBB/common.php | 15 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_apache.php | 4 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_db.php | 4 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_ldap.php | 4 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 9 | ||||
-rw-r--r-- | phpBB/includes/functions_user.php | 48 | ||||
-rw-r--r-- | phpBB/includes/session.php | 103 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_activate.php | 124 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_profile.php | 89 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_register.php | 6 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_remind.php | 7 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_schema.sql | 19 | ||||
-rw-r--r-- | phpBB/install/schemas/schema_data.sql | 57 | ||||
-rw-r--r-- | phpBB/language/en/lang_admin.php | 49 | ||||
-rw-r--r-- | phpBB/language/en/lang_main.php | 69 | ||||
-rw-r--r-- | phpBB/memberlist.php | 8 | ||||
-rw-r--r-- | phpBB/styles/subSilver/template/viewonline_body.html | 2 | ||||
-rwxr-xr-x | phpBB/ucp.php | 7 | ||||
-rw-r--r-- | phpBB/viewonline.php | 11 |
21 files changed, 410 insertions, 236 deletions
diff --git a/phpBB/adm/admin_jabber.php b/phpBB/adm/admin_jabber.php index f998578b94..5661a01f35 100644 --- a/phpBB/adm/admin_jabber.php +++ b/phpBB/adm/admin_jabber.php @@ -3,7 +3,7 @@ // // $Id$ // -// FILENAME : viewtopic.php +// FILENAME : admin_jabber.php // STARTED : Sat Feb 13, 2001 // COPYRIGHT : © 2001, 2003 phpBB Group // WWW : http://www.phpbb.com/ diff --git a/phpBB/adm/index.php b/phpBB/adm/index.php index d5f4c05203..8dfa55743a 100644 --- a/phpBB/adm/index.php +++ b/phpBB/adm/index.php @@ -145,7 +145,7 @@ elseif ($pane == 'right') trigger_error($user->lang['NO_ADMIN']); } - $sql = ($activate) ? 'UPDATE ' . USERS_TABLE . " SET user_active = 1 WHERE user_id IN ($mark)" : 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ($mark)"; + $sql = ($activate) ? 'UPDATE ' . USERS_TABLE . ' SET user_type = ' . USER_NORMAL . " WHERE user_id IN ($mark)" : 'DELETE FROM ' . USERS_TABLE . " WHERE user_id IN ($mark)"; $db->sql_query($sql); if (!$delete) @@ -253,7 +253,7 @@ elseif ($pane == 'right') $sql = 'SELECT COUNT(user_id) AS stat FROM ' . USERS_TABLE . ' - WHERE user_active = 1'; + WHERE user_type IN (' . USER_NORMAL . ',' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); @@ -516,9 +516,8 @@ elseif ($pane == 'right') <?php $sql = 'SELECT user_id, username, user_regdate - FROM ' . USERS_TABLE . ' - WHERE user_active = 0 - AND user_id <> ' . ANONYMOUS . ' + FROM ' . USERS_TABLE . ' + WHERE user_type = ' . USER_INACTIVE . ' ORDER BY user_regdate ASC'; $result = $db->sql_query($sql); diff --git a/phpBB/common.php b/phpBB/common.php index 169a6caf9c..731320e38f 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -32,15 +32,6 @@ if (@ini_get('register_globals')) } } -// If magic quotes is off, addslashes -/*if (!get_magic_quotes_gpc()) -{ - $_GET = slash_input_data($_GET); - $_POST = slash_input_data($_POST); - $_REQUEST = slash_input_data($_REQUEST); - $_COOKIE = slash_input_data($_COOKIE); -}*/ - require($phpbb_root_path . 'config.'.$phpEx); if (!defined('PHPBB_INSTALLED')) @@ -86,6 +77,11 @@ define('AVATAR_UPLOAD', 1); define('AVATAR_REMOTE', 2); define('AVATAR_GALLERY', 3); +define('USER_NORMAL', 0); +define('USER_INACTIVE', 1); +define('USER_IGNORE', 2); +define('USER_FOUNDER', 3); + // ACL define('ACL_NO', 0); define('ACL_YES', 1); @@ -156,6 +152,7 @@ define('ATTACHMENTS_TABLE', $table_prefix.'attachments'); define('ATTACHMENTS_DESC_TABLE', $table_prefix.'attach_desc'); define('BANLIST_TABLE', $table_prefix.'banlist'); define('BBCODES_TABLE', $table_prefix.'bbcodes'); +define('BOTS_TABLE', $table_prefix.'bots'); define('CACHE_TABLE', $table_prefix.'cache'); define('CONFIG_TABLE', $table_prefix.'config'); define('CONFIRM_TABLE', $table_prefix.'confirm'); diff --git a/phpBB/includes/auth/auth_apache.php b/phpBB/includes/auth/auth_apache.php index d9b00f5435..3a9fa90cd9 100644 --- a/phpBB/includes/auth/auth_apache.php +++ b/phpBB/includes/auth/auth_apache.php @@ -20,7 +20,7 @@ function login_apache(&$username, &$password) if ($php_auth_user && $php_auth_pw) { - $sql = ' user_id, username, user_password, user_passchg, user_email, user_active + $sql = ' 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); @@ -28,7 +28,7 @@ function login_apache(&$username, &$password) if ($row = $db->sql_fetchrow($result)) { $db->sql_freeresult($result); - return (empty($row['user_active'])) ? 0 : $row; + return ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) ? 0 : $row; } } diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php index 927c3ecfe7..998565ede5 100644 --- a/phpBB/includes/auth/auth_db.php +++ b/phpBB/includes/auth/auth_db.php @@ -14,7 +14,7 @@ function login_db(&$username, &$password) { global $db, $config; - $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_active + $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); @@ -24,7 +24,7 @@ function login_db(&$username, &$password) $db->sql_freeresult($result); if (md5($password) == $row['user_password']) { - return (empty($row['user_active'])) ? 0 : $row; + return ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) ? 0 : $row; } } diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php index 1b89a02d20..13b3d2b0b1 100644 --- a/phpBB/includes/auth/auth_ldap.php +++ b/phpBB/includes/auth/auth_ldap.php @@ -34,7 +34,7 @@ function login_ldap(&$username, &$password) { @ldap_close($ldap); - $sql ='SELECT user_id, username, user_password, user_passchg, user_email, user_active + $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); @@ -42,7 +42,7 @@ function login_ldap(&$username, &$password) if ($row = $db->sql_fetchrow($result)) { $db->sql_freeresult($result); - return (empty($row['user_active'])) ? 0 : $row; + return ($row['user_type'] == USER_INACTIVE || $row['user_type'] == USER_IGNORE) ? 0 : $row; } } } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 09971fc92e..dac19939ba 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1236,16 +1236,15 @@ function page_header($page_title = '') if (!empty($config['load_online']) && !empty($config['load_online_time'])) { $userlist_ary = $userlist_visible = array(); - $logged_visible_online = $logged_hidden_online = $guests_online = 0; - - $prev_user_id = 0; + $logged_visible_online = $logged_hidden_online = $guests_online = $prev_user_id = 0; $prev_user_ip = $reading_sql = ''; + if (!empty($_REQUEST['f'])) { $reading_sql = "AND s.session_page LIKE '%f=" . intval($_REQUEST['f']) . "%'"; } - $sql = 'SELECT u.username, u.user_id, u.user_allow_viewonline, u.user_colour, s.session_ip, s.session_allow_viewonline + $sql = 'SELECT u.username, u.user_id, u.user_type, u.user_allow_viewonline, u.user_colour, s.session_ip, s.session_allow_viewonline FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s WHERE s.session_time >= ' . (time() - (intval($config['load_online_time']) * 60)) . " $reading_sql @@ -1279,7 +1278,7 @@ function page_header($page_title = '') if ($row['user_allow_viewonline'] || $auth->acl_get('u_viewonline')) { - $user_online_link = "<a href=\"memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] . '">' . $user_online_link . '</a>'; + $user_online_link = ($row['user_type'] <> USER_IGNORE) ? "<a href=\"memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] . '">' . $user_online_link . '</a>' : $user_online_link; $online_userlist .= ($online_userlist != '') ? ', ' . $user_online_link : $user_online_link; } } diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php index bab4ccf08a..1c501b0430 100644 --- a/phpBB/includes/functions_user.php +++ b/phpBB/includes/functions_user.php @@ -357,7 +357,7 @@ function avatar_upload($data, &$error) } unset($url_ary); - $tmp_path = (!@ini_get('safe_mode')) ? false : $phpbb_root_path . 'cache/tmp'; + $tmp_path = (!@ini_get('safe_mode')) ? false : $phpbb_root_path . 'cache'; $filename = tempnam($tmp_path, uniqid(rand()) . '-'); if (!($fp = @fopen($filename, 'wb'))) @@ -389,7 +389,7 @@ function avatar_upload($data, &$error) // Replace any chars which may cause us problems with _ $bad_chars = array(' ', '/', ':', '*', '?', '"', '<', '>', '|'); - $data['filename'] = $user->data['user_id'] . '_' . str_replace($bad_chars, '_', $realname) . '.' . $filetype; + $data['filename'] = $data['user_id'] . '_' . str_replace($bad_chars, '_', $realname) . '.' . $filetype; $data['width'] = $width; $data['height'] = $height; @@ -415,6 +415,48 @@ function avatar_upload($data, &$error) return $data; } +function avatar_gallery($category, &$error) +{ + global $config; + + $path = $phpbb_root_path . $config['avatar_gallery_path']; + + // To be replaced with SQL ... before M3 completion + $dp = @opendir($path); + + $data = array(); + $avatar_row_count = $avatar_col_count = 0; + while ($file = readdir($dp)) + { + if ($file{0} != '.' && is_dir("$path/$file")) + { + $dp2 = @opendir("$path/$file"); + + while ($sub_file = readdir($dp2)) + { + if (preg_match('#\.(gif$|png$|jpg|jpeg)$#i', $sub_file)) + { + $data[$file][$avatar_row_count][$avatar_col_count]['file'] = "$file/$sub_file"; + $data[$file][$avatar_row_count][$avatar_col_count]['name'] = ucfirst(str_replace('_', ' ', preg_replace('#^(.*)\..*$#', '\1', $sub_file))); + + $avatar_col_count++; + if ($avatar_col_count == 4) + { + $avatar_row_count++; + $avatar_col_count = 0; + } + } + } + closedir($dp2); + } + } + closedir($dp); + + @ksort($data); + + return $data; +} + // Generates an alphanumeric random string of given length function gen_rand_string($num_chars) { @@ -444,7 +486,7 @@ function add_to_group($action, $group_id, $user_id_ary, $username_ary, $colour, $which_ary = ($user_id_ary) ? 'user_id_ary' : 'username_ary'; - if ($$which_ary && !is_array($$which_ary )) + if ($$which_ary && !is_array($$which_ary)) { $user_id_ary = array($user_id_ary); } diff --git a/phpBB/includes/session.php b/phpBB/includes/session.php index 84f45dca3b..709e1c378c 100644 --- a/phpBB/includes/session.php +++ b/phpBB/includes/session.php @@ -137,23 +137,39 @@ class session $sessiondata = array(); $current_time = time(); + $bot = false; - if ($config['active_sessions']) - { - // Limit sessions in 1 minute period - $sql = 'SELECT COUNT(*) AS sessions - FROM ' . SESSIONS_TABLE . ' - WHERE session_time >= ' . ($current_time - 60); - $result = $db->sql_query($sql); + // Pull bot information from DB and loop through it + $sql = 'SELECT user_id, bot_agent, bot_ip + FROM phpbb_bots + WHERE bot_active = 1'; + $result = $db->sql_query($sql); - $row = $db->sql_fetchrow($result); - $db->sql_freeresult($result); + while ($row = $db->sql_fetchrow($result)) + { + if ($row['bot_agent'] && $row['bot_agent'] == $this->browser) + { + $bot = $row['user_id']; + } + if ($row['bot_ip'] && (!$row['bot_agent'] || $bot)) + { + foreach (explode(',', $row['bot_ip']) as $bot_ip) + { + if (strpos($this->ip, $bot_ip) === 0) + { + $bot = $row['user_id']; + break; + } + } + } - if (intval($row['sessions']) > intval($config['active_sessions'])) + if ($bot) { - trigger_error('BOARD_UNAVAILABLE'); + $user_id = $bot; + break; } } + $db->sql_freeresult($result); // Garbage collection ... remove old sessions updating user information // if necessary. It means (potentially) 11 queries but only infrequently @@ -163,7 +179,7 @@ class session } // Grab user data ... join on session if it exists for session time - $sql = 'SELECT u.*, s.session_time + $sql = 'SELECT u.*, s.session_time, s.session_id FROM (' . USERS_TABLE . ' u LEFT JOIN ' . SESSIONS_TABLE . " s ON s.session_user_id = u.user_id) WHERE u.user_id = $user_id @@ -174,14 +190,37 @@ class session $db->sql_freeresult($result); // Check autologin request, is it valid? - if (empty($this->data) || ($this->data['user_password'] != $autologin && !$set_autologin) || !$this->data['user_active']) + if (empty($this->data) || ($this->data['user_password'] != $autologin && !$set_autologin) || ($this->data['user_type'] == USER_INACTIVE && !$bot)) { $autologin = ''; $this->data['user_id'] = $user_id = ANONYMOUS; } + // If we're a bot then we'll re-use an existing id if available + if ($bot && $this->data['session_id']) + { + $this->session_id = $this->data['session_id']; + } + + if (!$this->data['session_time'] && $config['active_sessions']) + { + // Limit sessions in 1 minute period + $sql = 'SELECT COUNT(*) AS sessions + FROM ' . SESSIONS_TABLE . ' + WHERE session_time >= ' . ($current_time - 60); + $result = $db->sql_query($sql); + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + + if (intval($row['sessions']) > intval($config['active_sessions'])) + { + trigger_error('BOARD_UNAVAILABLE'); + } + } + // Is user banned? Are they excluded? - if (!$this->data['user_founder']) + if (!$this->data['user_type'] != USER_FOUNDER && !$bot) { $banned = false; @@ -259,18 +298,25 @@ class session } $db->sql_return_on_error(false); - $this->data['session_id'] = $this->session_id; + if (!$bot) + { + $this->data['session_id'] = $this->session_id; - $sessiondata['autologinid'] = ($autologin && $user_id != ANONYMOUS) ? $autologin : ''; - $sessiondata['userid'] = $user_id; + $sessiondata['autologinid'] = ($autologin && $user_id != ANONYMOUS) ? $autologin : ''; + $sessiondata['userid'] = $user_id; - $this->set_cookie('data', serialize($sessiondata), $current_time + 31536000); - $this->set_cookie('sid', $this->session_id, 0); - $SID = '?sid=' . $this->session_id; + $this->set_cookie('data', serialize($sessiondata), $current_time + 31536000); + $this->set_cookie('sid', $this->session_id, 0); + $SID = '?sid=' . $this->session_id; - if ($this->data['user_id'] != ANONYMOUS) + if ($this->data['user_id'] != ANONYMOUS) + { + // Trigger EVT_NEW_SESSION + } + } + else { - // Trigger EVT_NEW_SESSION + $SID = '?sid='; } return true; @@ -729,7 +775,7 @@ class auth $db->sql_freeresult($result); // If this user is founder we're going to force fill the admin options ... - if ($userdata['user_founder']) + if ($userdata['user_type'] == USER_FOUNDER) { foreach ($this->acl_options['global'] as $opt => $id) { @@ -833,15 +879,8 @@ class auth $autologin = (!empty($autologin)) ? md5($password) : ''; - if ($login['user_active']) - { - // Trigger EVENT_LOGIN - return $user->create($login['user_id'], $autologin, true, $viewonline); - } - else - { - return false; - } + // Trigger EVENT_LOGIN + return $user->create($login['user_id'], $autologin, true, $viewonline); } } diff --git a/phpBB/includes/ucp/ucp_activate.php b/phpBB/includes/ucp/ucp_activate.php index dbd992fbf2..43d04eda4a 100644 --- a/phpBB/includes/ucp/ucp_activate.php +++ b/phpBB/includes/ucp/ucp_activate.php @@ -3,7 +3,7 @@ // // $Id$ // -// FILENAME : usercp_activate.php +// FILENAME : ucp_activate.php // STARTED : Mon May 19, 2003 // COPYRIGHT : © 2001, 2003 phpBB Group // WWW : http://www.phpbb.com/ @@ -13,74 +13,86 @@ class ucp_activate extends module { - function main($module_id) + function ucp_activate($id, $mode) { global $censors, $config, $db, $user, $auth, $SID, $template, $phpbb_root_path, $phpEx; - $user_id = (isset($_REQUEST['u'])) ? intval($_REQUEST['u']) : false; + $user_id = request_var('u', 0); + $key = request_var('k', ''); - $sql = 'SELECT user_id, username, user_active, user_email, user_newpasswd, user_lang, user_actkey + $sql = 'SELECT user_id, username, user_type, user_email, user_newpasswd, user_lang, user_notify_type, user_actkey FROM ' . USERS_TABLE . " WHERE user_id = $user_id"; $result = $db->sql_query($sql); - if ($row = $db->sql_fetchrow($result)) + if (!($row = $db->sql_fetchrow($result))) { - if ($row['user_active'] && $row['user_actkey'] == '') - { - meta_refresh(3, "index.$phpEx$SID"); - trigger_error($user->lang['Already_activated']); - } - else if ($row['user_actkey'] == $_GET['k']) - { - $sql_update_pass = ($row['user_newpasswd'] != '') ? ", user_password = '" . $db->sql_escape($row['user_newpasswd']) . "', user_newpasswd = ''" : ''; - - $sql = 'UPDATE ' . USERS_TABLE . " - SET user_active = 1, user_actkey = ''" . $sql_update_pass . " - WHERE user_id = " . $row['user_id']; - $result = $db->sql_query($sql); - - if ($config['require_activation'] == USER_ACTIVATION_ADMIN && $sql_update_pass == '') - { - $this->include_file('includes/emailer'); - $emailer = new emailer($config['smtp_delivery']); - - $emailer->use_template('admin_welcome_activated', $row['user_lang']); - $emailer->to($row['user_email']); - - $emailer->assign_vars(array( - 'SITENAME' => $config['sitename'], - 'USERNAME' => $row['username'], - 'PASSWORD' => $password_confirm, - 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])) - ); - $emailer->send(); - $emailer->reset(); - - meta_refresh(3, "index.$phpEx$SID"); - trigger_error($user->lang['Account_active_admin']); - } - else - { - meta_refresh(3, "index.$phpEx$SID"); - $message = (!$sql_update_pass) ? $user->lang['ACCOUNT_ACTIVE'] : $user->lang['PASSWORD_ACTIVATED']; - trigger_error($message); - } - - set_config('newest_user_id', $row['user_id']); - set_config('newest_username', $row['username']); - set_config('num_users', $config['num_users'] + 1, TRUE); - } - else - { - trigger_error($user->lang['Wrong_activation']); - } + trigger_error($user->lang['NO_USER']); + } + $db->sql_freeresult($result); + + if ($row['user_type'] <> USER_INACTIVE && !$row['user_newpasswd']) + { + meta_refresh(3, "index.$phpEx$SID"); + trigger_error($user->lang['ALREADY_ACTIVATED']); + } + + if ($row['user_actkey'] != $key) + { + trigger_error($user->lang['WRONG_ACTIVATION']); + } + + $sql_update_pass = ($row['user_newpasswd']) ? ", user_password = '" . $db->sql_escape($row['user_newpasswd']) . "', user_newpasswd = ''" : ''; + + $sql = 'UPDATE ' . USERS_TABLE . ' + SET user_type = ' . USER_NORMAL . ", user_actkey = ''$sql_update_pass + WHERE user_id = " . $row['user_id']; + $result = $db->sql_query($sql); + + if ($config['require_activation'] == USER_ACTIVATION_ADMIN && $sql_update_pass) + { + include_once($phpbb_root_path . 'includes/functions_messenger.'.$phpEx); + + $messenger = new messenger(); + + $messenger->template('admin_welcome_activated', $row['user_lang']); + $messenger->subject($subject); + + $messenger->replyto($user->data['board_contact']); + $messenger->to($row['user_email'], $row['username']); + + $messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']); + $messenger->headers('X-AntiAbuse: User_id - ' . $user->data['user_id']); + $messenger->headers('X-AntiAbuse: Username - ' . $user->data['username']); + $messenger->headers('X-AntiAbuse: User IP - ' . $user->ip); + + $messenger->assign_vars(array( + 'SITENAME' => $config['sitename'], + 'USERNAME' => $row['username'], + 'PASSWORD' => $password_confirm, + 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig'])) + ); + + $messenger->send($row['user_notify_type']); + $messenger->queue->save(); + + $message = 'ACCOUNT_ACTIVE_ADMIN'; + } else { - trigger_error($user->lang['NO_USER']); + $message = (!$sql_update_pass) ? 'ACCOUNT_ACTIVE' : 'PASSWORD_ACTIVATED'; } - $db->sql_freeresult($result); + + if (!$sql_update_pass) + { + set_config('newest_user_id', $row['user_id']); + set_config('newest_username', $row['username']); + set_config('num_users', $config['num_users'] + 1, TRUE); + } + + meta_refresh(3, "index.$phpEx$SID"); + trigger_error($user->lang[$message]); } } diff --git a/phpBB/includes/ucp/ucp_profile.php b/phpBB/includes/ucp/ucp_profile.php index 367c0dd6d5..f78ae8c5db 100644 --- a/phpBB/includes/ucp/ucp_profile.php +++ b/phpBB/includes/ucp/ucp_profile.php @@ -91,6 +91,9 @@ class ucp_profile extends module update_username($user->data['username'], $username); } + // TODO + // If email changed and email activation enabled, deactivate and notify + meta_refresh(3, "ucp.$phpEx$SID&i=$id&mode=$mode"); $message = $user->lang['PROFILE_UPDATED'] . '<br /><br />' . sprintf($user->lang['RETURN_UCP'], "<a href=\"ucp.$phpEx$SID&i=$id&mode=$mode\">", '</a>'); trigger_error($message); @@ -358,6 +361,9 @@ class ucp_profile extends module case 'avatar': + $display_gallery = (isset($_POST['displaygallery'])) ? true : false; + $avatar_category = request_var('category', ''); + // Can we upload? $can_upload = ($config['allow_avatar_upload'] && file_exists($phpbb_root_path . $config['avatar_path']) && is_writeable($phpbb_root_path . $config['avatar_path']) && $auth->acl_get('u_chgavatar') && (@ini_get('file_uploads') || strtolower(@ini_get('file_uploads')) == 'on')) ? true : false; @@ -386,6 +392,8 @@ class ucp_profile extends module if (!sizeof($error)) { + $data['user_id'] = $user->data['user_id']; + if (!empty($_FILES['uploadfile']['tmp_name']) && $can_upload) { $data = avatar_upload($data, $error); @@ -444,10 +452,10 @@ class ucp_profile extends module switch ($user->data['user_avatar_type']) { case AVATAR_UPLOAD: - $avatar_img = $config['avatar_path'] . '/'; + $avatar_img = $phpbb_root_path . $config['avatar_path'] . '/'; break; case AVATAR_GALLERY: - $avatar_img = $config['avatar_gallery_path'] . '/'; + $avatar_img = $phpbb_root_path . $config['avatar_gallery_path'] . '/'; break; } $avatar_img .= $user->data['user_avatar']; @@ -457,37 +465,76 @@ class ucp_profile extends module $template->assign_vars(array( 'ERROR' => (sizeof($error)) ? implode('<br />', $error) : '', - 'AVATAR' => $avatar_img, 'AVATAR_SIZE' => $config['avatar_filesize'], - 'AVATAR_URL' => (isset($uploadurl)) ? $uploadurl : '', - 'AVATAR_REMOTE' => (isset($remotelink)) ? $remotelink : (($user->data['user_avatar_type'] == AVATAR_REMOTE) ? $user->data['user_avatar'] : ''), - 'WIDTH' => (isset($width)) ? $width : $user->data['user_avatar_width'], - 'HEIGHT' => (isset($height)) ? $height : $user->data['user_avatar_height'], - - 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)), - - 'S_FORM_ENCTYPE' => ($can_upload) ? ' enctype="multipart/form-data"' : '', - 'S_UPLOAD_AVATAR_FILE' => $can_upload, - 'S_UPLOAD_AVATAR_URL' => $can_upload, - 'S_LINK_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false, - 'S_GALLERY_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false, - 'S_AVATAR_CAT_OPTIONS' => $s_categories, - 'S_AVATAR_PAGE_OPTIONS' => $s_pages,) + + 'S_FORM_ENCTYPE' => ($can_upload) ? ' enctype="multipart/form-data"' : '', + + 'L_AVATAR_EXPLAIN' => sprintf($user->lang['AVATAR_EXPLAIN'], $config['avatar_max_width'], $config['avatar_max_height'], round($config['avatar_filesize'] / 1024)),) ); + if ($display_gallery && $auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) + { + $avatar_list = avatar_gallery($category, $error); + + $category = (!$category) ? key($avatar_list) : $category; + + $s_category_options = ''; + foreach (array_keys($avatar_list) as $cat) + { + $s_category_options .= '<option value="' . $cat . '">' . $cat . '</option>'; + } + + $template->assign_vars(array( + 'S_DISPLAY_GALLERY' => true, + 'S_CAT_OPTIONS' => $s_category_options) + ); + + foreach ($avatar_list[$category] as $avatar_row_ary) + { + $template->assign_block_vars('avatar_row', array()); + + foreach ($avatar_row_ary as $avatar_col_ary) + { + $template->assign_block_vars('avatar_row.avatar_column', array( + 'AVATAR_IMAGE' => $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'], + 'AVATAR_NAME' => $avatar_col_ary['name']) + ); + + $template->assign_block_vars('avatar_row.avatar_option_column', array( + 'AVATAR_IMAGE' => $phpbb_root_path . $config['avatar_gallery_path'] . '/' . $avatar_col_ary['file'],) + ); + } + } + } + else + { + $template->assign_vars(array( + 'AVATAR' => $avatar_img, + 'AVATAR_SIZE' => $config['avatar_filesize'], + 'WIDTH' => (isset($width)) ? $width : $user->data['user_avatar_width'], + 'HEIGHT' => (isset($height)) ? $height : $user->data['user_avatar_height'], + + 'S_UPLOAD_AVATAR_FILE' => $can_upload, + 'S_UPLOAD_AVATAR_URL' => $can_upload, + 'S_LINK_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_remote']) ? true : false, + 'S_GALLERY_AVATAR' => ($auth->acl_get('u_chgavatar') && $config['allow_avatar_local']) ? true : false, + 'S_AVATAR_CAT_OPTIONS' => $s_categories, + 'S_AVATAR_PAGE_OPTIONS' => $s_pages,) + ); + } + break; } $template->assign_vars(array( 'L_TITLE' => $user->lang['UCP_' . strtoupper($mode)], - 'S_DISPLAY_' . strtoupper($mode) => true, - 'S_HIDDEN_FIELDS' => $s_hidden_fields, - 'S_UCP_ACTION' => "ucp.$phpEx$SID&i=$id&mode=$mode") + 'S_HIDDEN_FIELDS' => $s_hidden_fields, + 'S_UCP_ACTION' => "ucp.$phpEx$SID&i=$id&mode=$mode") ); - $this->display($user->lang['UCP_PROFILE'], 'ucp_profile.html'); + $this->display($user->lang['UCP_PROFILE'], 'ucp_profile_' . $mode . '.html'); } } diff --git a/phpBB/includes/ucp/ucp_register.php b/phpBB/includes/ucp/ucp_register.php index a6742d8687..c6be2e8b05 100644 --- a/phpBB/includes/ucp/ucp_register.php +++ b/phpBB/includes/ucp/ucp_register.php @@ -152,11 +152,11 @@ class ucp_register extends module $key_len = 54 - (strlen($server_url)); $key_len = ($key_len > 6) ? $key_len : 6; $user_actkey = substr($user_actkey, 0, $key_len); - $user_active = 0; + $user_type = USER_INACTIVE; } else { - $user_active = 1; + $user_type = USER_NORMAL; $user_actkey = ''; } @@ -170,7 +170,7 @@ class ucp_register extends module 'user_timezone' => (float) $tz, 'user_lang' => $lang, 'user_allow_pm' => 1, - 'user_active' => $user_active, + 'user_type' => $user_type, 'user_actkey' => $user_actkey, 'user_ip' => $user->ip, 'user_regdate' => time(), diff --git a/phpBB/includes/ucp/ucp_remind.php b/phpBB/includes/ucp/ucp_remind.php index 98b44640c1..80b863b321 100644 --- a/phpBB/includes/ucp/ucp_remind.php +++ b/phpBB/includes/ucp/ucp_remind.php @@ -24,7 +24,7 @@ class ucp_remind extends module $username = request_var('username', ''); $email = request_var('email', ''); - $sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type, user_active, user_lang + $sql = 'SELECT user_id, username, user_email, user_jabber, user_notify_type, user_type, user_lang FROM ' . USERS_TABLE . " WHERE user_email = '" . $db->sql_escape($email) . "' AND username = '" . $db->sql_escape($username) . "'"; @@ -39,13 +39,14 @@ class ucp_remind extends module } $db->sql_freeresult($result); - if (!$row['user_active']) + if ($row['user_type'] == USER_INACTIVE) { trigger_error($lang['ACCOUNT_INACTIVE']); } $server_url = generate_board_url(); $username = $row['username']; + $user_id = $row['user_id']; $key_len = 54 - strlen($server_url); $key_len = ($str_len > 6) ? $key_len : 6; @@ -74,7 +75,7 @@ class ucp_remind extends module 'PASSWORD' => $user_password, 'EMAIL_SIG' => str_replace('<br />', "\n", "-- \n" . $config['board_email_sig']), - 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&k=$user_actkey") + 'U_ACTIVATE' => "$server_url/ucp.$phpEx?mode=activate&u=$user_id&k=$user_actkey") ); $messenger->send($row['user_notify_type']); diff --git a/phpBB/install/schemas/mysql_schema.sql b/phpBB/install/schemas/mysql_schema.sql index d5d1274ec1..d891f53e63 100644 --- a/phpBB/install/schemas/mysql_schema.sql +++ b/phpBB/install/schemas/mysql_schema.sql @@ -101,6 +101,18 @@ CREATE TABLE phpbb_bbcodes ( PRIMARY KEY (bbcode_id) ); +# Table: 'phpbb_bots' +CREATE TABLE phpbb_bots ( + bot_id tinyint(3) unsigned NOT NULL auto_increment, + bot_active tinyint(1) DEFAULT '1' NOT NULL, + bot_name varchar(255) DEFAULT '' NOT NULL, + user_id mediumint(8) UNSIGNED DEFAULT '0' NOT NULL, + bot_agent varchar(255) DEFAULT '' NOT NULL, + bot_ip varchar(255) DEFAULT '' NOT NULL, + PRIMARY KEY (bot_id), + KEY bot_active (bot_active) +) + # Table: 'phpbb_cache' CREATE TABLE phpbb_cache ( var_name varchar(255) DEFAULT '' NOT NULL, @@ -683,8 +695,7 @@ CREATE TABLE phpbb_user_group ( # Table: 'phpbb_users' CREATE TABLE phpbb_users ( user_id mediumint(8) UNSIGNED NOT NULL auto_increment, - user_active tinyint(1) DEFAULT '1' NOT NULL, - user_founder tinyint(1) DEFAULT '0' NOT NULL, + user_type tinyint(1) DEFAULT '0' NOT NULL, group_id mediumint(8) DEFAULT '3' NOT NULL, user_permissions text DEFAULT '' NOT NULL, user_ip varchar(40) DEFAULT '' NOT NULL, @@ -737,10 +748,10 @@ CREATE TABLE phpbb_users ( user_msnm varchar(255) DEFAULT '' NOT NULL, user_jabber varchar(255) DEFAULT '' NOT NULL, user_website varchar(100) DEFAULT '' NOT NULL, - user_actkey varchar(32) DEFAULT '' NOT NULL, - user_newpasswd varchar(32) DEFAULT '' NOT NULL, user_occ varchar(255) DEFAULT '' NOT NULL, user_interests varchar(255) DEFAULT '' NOT NULL, + user_actkey varchar(32) DEFAULT '' NOT NULL, + user_newpasswd varchar(32) DEFAULT '' NOT NULL, PRIMARY KEY (user_id), KEY user_birthday (user_birthday(6)) ); diff --git a/phpBB/install/schemas/schema_data.sql b/phpBB/install/schemas/schema_data.sql index eb4c7fa43c..db78089c20 100644 --- a/phpBB/install/schemas/schema_data.sql +++ b/phpBB/install/schemas/schema_data.sql @@ -312,20 +312,18 @@ INSERT INTO phpbb_forums (forum_id, forum_name, forum_desc, left_id, right_id, p # MSSQL IDENTITY phpbb_users ON # # -- Users -INSERT INTO phpbb_users (user_id, user_founder, group_id, username, user_regdate, user_password, user_email, user_lang, user_style) VALUES (1, 0, 1, 'Anonymous', 0, '', '', 'en', 1); +INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style) VALUES (1, 2, 1, 'Anonymous', 0, '', '', 'en', 1); # -- username: Admin password: admin (change this or remove it ON #ce everything is working!) -INSERT INTO phpbb_users (user_id, user_founder, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour) VALUES (2, 1, 7, 'Admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000'); +INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_email, user_lang, user_style, user_rank, user_colour) VALUES (2, 3, 7, 'Admin', 0, '21232f297a57a5a743894a0e4a801fc3', 'admin@yourdomain.com', 'en', 1, 1, 'AA0000'); -# MSSQL IDENTITY phpbb_users OFF # - - -# MSSQL IDENTITY phpbb_ranks ON # - -# -- Ranks -INSERT INTO phpbb_ranks (rank_id, rank_title, rank_min, rank_special, rank_image) VALUES (1, 'Site Admin', -1, 1, NULL); +# -- bots +INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_lang, user_style, user_rank, user_colour) VALUES (3, 2, 8, 'Googlebot', 0, '', 'en', 1, 1, '9E8DA7'); +INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_lang, user_style, user_rank, user_colour) VALUES (4, 2, 8, 'Fastcrawler', 0, '', 'en', 1, 1, '9E8DA7'); +INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_lang, user_style, user_rank, user_colour) VALUES (5, 2, 8, 'Alexa', 0, '', 'en', 1, 1, '9E8DA7'); +INSERT INTO phpbb_users (user_id, user_type, group_id, username, user_regdate, user_password, user_lang, user_style, user_rank, user_colour) VALUES (6, 2, 8, 'Inktomi', 0, '', 'en', 1, 1, '9E8DA7'); -# MSSQL IDENTITY phpbb_ranks OFF # +# MSSQL IDENTITY phpbb_users OFF # # MSSQL IDENTITY phpbb_groups ON # @@ -338,7 +336,7 @@ INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (4, 'REGISTER INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (5, 'REGISTERED_COPPA', 3); INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour) VALUES (6, 'SUPER_MODERATORS', 3, '00AA00'); INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour) VALUES (7, 'ADMINISTRATORS', 3, 'AA0000'); -INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (8, 'BANNED', 3); +INSERT INTO phpbb_groups (group_id, group_name, group_type, group_colour) VALUES (8, 'BOTS', 3, '9E8DA7'); # MSSQL IDENTITY phpbb_groups OFF # @@ -347,12 +345,34 @@ INSERT INTO phpbb_groups (group_id, group_name, group_type) VALUES (8, 'BANNED', 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 (4, 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 (8, 3, 0, 0); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (8, 4, 0, 0); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (8, 5, 0, 0); +INSERT INTO phpbb_user_group (group_id, user_id, user_pending, group_leader) VALUES (8, 6, 0, 0); -# -- Modules +# MSSQL IDENTITY phpbb_ranks ON # + +# -- Ranks +INSERT INTO phpbb_ranks (rank_id, rank_title, rank_min, rank_special, rank_image) VALUES (1, 'Site Admin', -1, 1, NULL); + +# MSSQL IDENTITY phpbb_ranks OFF # + + +# MSSQL IDENTITY phpbb_bots ON # + +# -- Bots +INSERT INTO phpbb_bots (bot_id, bot_active, bot_name, user_id, bot_agent, bot_ip) VALUES (1, 1, 'Googebot', 3, 'Googlebot/2.1 (+http://www.googlebot.com/bot.html)', '216.239.46.,64.68.8.'); +INSERT INTO phpbb_bots (bot_id, bot_active, bot_name, user_id, bot_agent, bot_ip) VALUES (2, 1, 'Fastcrawler', 4, 'FAST-WebCrawler', '66.77.73.'); +INSERT INTO phpbb_bots (bot_id, bot_active, bot_name, user_id, bot_agent, bot_ip) VALUES (3, 1, 'Alexa ia_archiver', 5, 'ia_archiver', '66.28.250.,209.237.238.'); +INSERT INTO phpbb_bots (bot_id, bot_active, bot_name, user_id, bot_agent, bot_ip) VALUES (4, 1, 'Inktomi', 6, 'Slurp', '216.35.116.'); + +# MSSQL IDENTITY phpbb_bots OFF # + # MSSQL IDENTITY phpbb_modules OFF # +# -- Modules INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('mcp', 'MAIN', 'main', 1, 1, '', ''); INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'MAIN', 'main', 1, 1, 'front\r\nsubscribed\r\ndrafts', ''); INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_order, module_enabled, module_subs, module_acl) VALUES ('ucp', 'PROFILE', 'profile', 2, 1, 'profile_info\r\nreg_details\r\nsignature\r\navatar', ''); @@ -363,7 +383,6 @@ INSERT INTO phpbb_modules (module_type, module_title, module_filename, module_or # Permissions - # Default user - admin rights INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'u_%'; INSERT INTO phpbb_auth_users (user_id, forum_id, auth_option_id, auth_setting) SELECT 2, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'a_%'; @@ -400,6 +419,10 @@ INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 3, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_list', 'f_read', 'f_post', 'f_reply', 'f_quote', 'f_bbcode', 'f_search', 'f_print'); INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 3, 2, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_list', 'f_read', 'f_post', 'f_reply', 'f_quote', 'f_bbcode', 'f_search', 'f_print'); +# BOTS - read/view only +INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 8, 1, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_list', 'f_read'); +INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 8, 2, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('f_list', 'f_read'); + # -- Moderator cache INSERT INTO phpbb_moderator_cache (user_id, forum_id, username) VALUES (2, 2, 'Admin'); @@ -460,14 +483,6 @@ INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, disp INSERT INTO phpbb_icons (icons_url, icons_width, icons_height, icons_order, display_on_posting) VALUES ('smile/exclaim.gif', 19, 19, 7, 1); -# -- ucp modules -INSERT INTO phpbb_ucp_modules (module_id, module_title, module_filename, module_order) VALUES (1, 'MAIN', 'main', 1); -INSERT INTO phpbb_ucp_modules (module_id, module_title, module_filename, module_order) VALUES (2, 'PROFILE', 'profile', 2); -INSERT INTO phpbb_ucp_modules (module_id, module_title, module_filename, module_order) VALUES (3, 'PREFERENCES', 'prefs', 3); -INSERT INTO phpbb_ucp_modules (module_id, module_title, module_filename, module_order) VALUES (4, 'MESSAGING', 'pm', 4); -INSERT INTO phpbb_ucp_modules (module_id, module_title, module_filename, module_order) VALUES (5, 'LISTS', 'zebra', 5); - - # MSSQL IDENTITY phpbb_search_wordlist ON # # -- wordlist diff --git a/phpBB/language/en/lang_admin.php b/phpBB/language/en/lang_admin.php index 6e3f53a2c2..9171873c92 100644 --- a/phpBB/language/en/lang_admin.php +++ b/phpBB/language/en/lang_admin.php @@ -47,10 +47,6 @@ $lang += array( 'PHP_INFO' => 'PHP Information', 'IM' => 'Jabber Settings', - 'GROUP_CAT' => 'Usergroups', - 'CREATE' => 'Create', - 'GROUP_PREFS' => 'Preferences', - 'LOG_CAT' => 'Logging', 'ADMIN_LOGS' => 'Admin Log', 'MOD_LOGS' => 'Moderator Log', @@ -67,13 +63,18 @@ $lang += array( 'MANAGE_THEME' => 'Themes', 'MANAGE_IMAGESET' => 'Imagesets', - 'USER_CAT' => 'Users', + 'USER_CAT' => 'Users / Groups', 'BAN_EMAILS' => 'Ban Emails', 'BAN_IPS' => 'Ban IPs', 'BAN_USERS' => 'Ban Usernames', 'DISALLOW' => 'Disallow names', 'RANKS' => 'Ranks', 'PRUNE_USERS' => 'Prune users', + 'BOTS' => 'Bots', + 'GROUP_MANAGE' => 'Manage groups', + 'GROUP_PREFS' => 'Group prefs', + 'USER_PERMS' => 'User permissions', + 'GROUP_PERMS' => 'Group permissions', 'ADMINISTRATORS' => 'Administrators', 'USERNAMES_EXPLAIN' => 'Place each username on a seperate line', @@ -221,6 +222,10 @@ $lang += array( 'LOG_EMAIL_ERROR' => '%s', 'LOG_JABBER_ERROR' => '%s', + + 'LOG_BOT_ADDED' => '<b>New bot added</b><br />» %s', + 'LOG_BOT_UPDATED' => '<b>Existing bot updated</b><br />» %s', + 'LOG_BOT_DELETE' => '<b>Deleted bot</b><br />» %s', ); // Index page @@ -1779,4 +1784,38 @@ $lang += array( 'INST_ERR_FTP_LOGIN' => 'Could not login to ftp server, check your username and password', ); +// Bots +$lang += array( + 'BOTS_EXPLAIN' => 'Bots or crawlers are automated agents most commonly used by search engines to update their databases. Since they rarely make proper use of sessions they can distort visitor counts, increase load and sometimes fail to index sites correctly. Here you can define a special type of user to overcome these problems.', + + 'BOT_NAME' => 'Bot name', + 'BOT_LAST_VISIT' => 'Last visit', + 'BOT_NEVER' => 'Never', + 'BOT_ACTIVATE' => 'Activate', + 'BOT_DEACTIVATE' => 'Deactivate', + 'BOT_ADD' => 'Add bot', + + 'BOT_EDIT' => 'Edit bots', + 'BOT_EDIT_EXPLAIN' => 'Here you can add or edit an existing bot entry. You may define an agent string and/or one or more IP addresses (or range of addresses) to match. Be careful when defining matching agent strings or addresses. You may also specify a style and language that the bot will view the board using. This may allow you to reduce bandwidth use by setting a simple style for bots. Remember to set appropriate permissions for the special Bot usergroup.', + 'BOT_NAME' => 'Bot name', + 'BOT_NAME_EXPLAIN' => 'Used only for your own information.', + 'BOT_LANG' => 'Bot language', + 'BOT_LANG_EXPLAIN' => 'The language presented to the bot as it browses', + 'BOT_STYLE' => 'Bot style', + 'BOT_STYLE_EXPLAIN' => 'The style used for the board by the bot', + 'BOT_ACTIVE' => 'Bot active', + 'BOT_AGENT' => 'Agent match', + 'BOT_AGENT_EXPLAIN' => 'A string matching the bots browser agent.', + 'BOT_IP' => 'Bot IP address', + 'BOT_IP_EXPLAIN' => 'Partial matches are allowed, seperate addresses with an apostrophe. A single hostname may be entered instead of an IP.', + + 'BOT_ADDED' => 'New bot successfully added', + 'BOT_UPDATED' => 'Existing bot updated successfully', + 'BOT_DELETED' => 'Bot deleted successfully', + + 'NO_BOT' => 'Found no bot with the specified ID', + 'ERR_BOT_NO_MATCHES' => 'You must supply at least one of an agent or IP for this bot match.', + 'ERR_BOT_NO_IP' => 'The IP addresses you supplied were invalid or the hostname could not be resolved.', +); + ?>
\ No newline at end of file diff --git a/phpBB/language/en/lang_main.php b/phpBB/language/en/lang_main.php index 00a7c87ccb..493e40b968 100644 --- a/phpBB/language/en/lang_main.php +++ b/phpBB/language/en/lang_main.php @@ -245,7 +245,7 @@ $lang = array( 'G_INACTIVE' => 'Unapproved Users', 'G_INACTIVE_COPPA' => 'Unapproved COPPA Users', 'G_GUESTS' => 'Guests', - 'G_BANNED' => 'Banned Users', + 'G_BOTS' => 'Bots', 'NO_NEW_POSTS' => 'No new posts', 'NEW_POSTS' => 'New posts', @@ -684,7 +684,7 @@ $lang += array( 'DOWNLOAD_COUNTS' => '%d Times', // replace %d with count ); -// ucp +// ucp_main $lang += array( 'UCP' => 'User Control Panel', 'UCP_OPTIONS' => 'Options', @@ -733,8 +733,10 @@ $lang += array( 'EMPTY_DRAFT_TITLE' => 'You must enter a draft title', 'EMPTY_DRAFT' => 'You must enter a message to submit your changes', 'BACK_TO_DRAFTS' => 'Back to saved drafts', +); - +// ucp_profile +$lang += array( 'UCP_PROFILE' => 'Profile', 'UCP_REG_DETAILS' => 'Registration details', @@ -763,6 +765,9 @@ $lang += array( 'UCP_JABBER' => 'Jabber Address', 'BIRTHDAY' => 'Birthday', 'BIRTHDAY_EXPLAIN' => 'Setting a year will list your age when it is your birthday.', + 'DAY' => 'Day', + 'MONTH' => 'Month', + 'YEAR' => 'Year', 'UCP_SIGNATURE' => 'Your signature', 'SIGNATURE_NOTICE' => 'Please note that some forums limit the size and content of your signature. Be sure to read any forum or board rules to ensure you comply with them.', @@ -784,7 +789,8 @@ $lang += array( 'LINK_REMOTE_SIZE' => 'Avatar dimensions', 'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.', 'BY' => 'by', // Width by Height - 'AVATAR_GALLERY' => 'Select from gallery', + 'AVATAR_GALLERY' => 'Local gallery', + 'DISPLAY_GALLERY' => 'Display gallery', 'AVATAR_CATEGORY' => 'Category', 'AVATAR_PAGE' => 'Page', @@ -795,8 +801,10 @@ $lang += array( 'AVATAR_NO_SIZE' => 'Could not obtain width or height of linked avatar, please enter them manually.', 'PROFILE_UPDATED' => 'Your profile has been updated.', +); - +// ucp_register +$lang += array( 'REGISTRATION' => 'Registration', 'COPPA_BIRTHDAY' => 'To continue with the registration procedure please tell us when you were born.', 'UCP_COPPA_BEFORE' => 'Before %s', @@ -821,61 +829,24 @@ $lang += array( 'COPPA_COMPLIANCE' => 'COPPA Compliance', 'COPPA_EXPLAIN' => 'Please note that clicking submit will create your account. However it cannot be activated until a parent or guardian approves your registration. You will be emailed a copy of the necessary form with details of where to send it.', - - - 'No_user_id_specified' => 'Sorry but that user does not exist', - 'Wrong_Profile' => 'You cannot modify a profile that is not your own.', - 'Only_one_avatar' => 'Only one type of avatar can be specified', - 'File_no_data' => 'The file at the URL you gave contains no data', - 'No_connection_URL' => 'A connection could not be made to the URL you gave', - 'Incomplete_URL' => 'The URL you entered is incomplete', - 'Wrong_remote_avatar_format' => 'The URL of the remote avatar is not valid', - 'No_send_account_inactive' => 'Sorry, but your password cannot be retrieved because your account is currently inactive. Please contact the forum administrator for more information', - - - 'Profile_updated' => 'Your profile has been updated', - 'Profile_updated_inactive' => 'Your profile has been updated, however you have changed vital details thus your account is now inactive. Check your email to find out how to reactivate your account, or if admin activation is require wait for the administrator to reactivate your account', - - 'Fields_empty' => 'You must fill in the required fields', - 'Avatar_filetype' => 'The avatar filetype must be .jpg, .gif or .png', - 'Avatar_filesize' => 'The avatar image file size must be less than %d kB', - 'Welcome_subject' => 'Welcome to %s Forums', - 'New_account_subject' => 'New user account', - 'Account_activated_subject' => 'Account Activated', - - - - - - 'PASSWORD_MISMATCH' => 'The passwords you entered did not match', + 'PASSWORD_MISMATCH' => 'The passwords you entered did not match', 'CONFIRM_CODE_WRONG' => 'The confirmation code you entered was incorrect.', 'TOO_MANY_REGISTERS' => 'You have exceeded the maximum number of registration attempts for this session. Please try again later.', - - - 'ACCOUNT_ADDED' => 'Thank you for registering, your account has been created. You may now login with your username and password', 'ACCOUNT_INACTIVE' => 'Your account has been created. However, this forum requires account activation, an activation key has been sent to the email address you provided. Please check your email for further information', 'ACCOUNT_INACTIVE_ADMIN'=> 'Your account has been created. However, this forum requires account activation by the administrator. An email has been sent to them and you will be informed when your account has been activated', 'ACCOUNT_COPPA' => 'Your account has been created but has to be approved, please check your email for details.', - - 'Send_password' => 'Send me a new password', - 'Password_updated' => 'A new password has been created, please check your email for details on how to activate it', - 'No_email_match' => 'The email address you supplied does not match the one listed for that username', - 'New_password_activation' => 'New password activation', - 'Password_activated' => 'Your account has been re-activated. To logon please use the password supplied in the email you received', - - - 'COPPA' => 'Your account has been created but has to be approved, please check your email for details.', ); // ucp_activate $lang += array( - 'Account_active' => 'Your account has now been activated. Thank you for registering', - 'Account_active_admin' => 'The account has now been activated', - 'Reactivate' => 'Reactivate your account!', - 'Already_activated' => 'You have already activated your account', - 'Wrong_activation' => 'The activation key you supplied does not match any in the database', + 'ACCOUNT_ACTIVE' => 'Your account has now been activated. Thank you for registering', + 'ACCOUNT_ACTIVE_ADMIN' => 'The account has now been activated', + 'PASSWORD_ACTIVATED' => 'Your new password has been activated', + + 'ALREADY_ACTIVATED' => 'You have already activated your account', + 'WRONG_ACTIVATION' => 'The activation key you supplied does not match any in the database', ); // ucp_remind diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index cd18970e30..25dea6cb37 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -410,7 +410,7 @@ switch ($mode) $sql = 'SELECT username, user_email, user_allow_viewemail, user_lang, user_jabber, user_notify_method FROM ' . USERS_TABLE . " WHERE user_id = $user_id - AND user_active = 1"; + AND user_type IN (" . USER_NORMAL . ', ' . USER_FOUNDER . ')'; $result = $db->sql_query($sql); if (!($row = $db->sql_fetchrow($result))) @@ -676,7 +676,7 @@ switch ($mode) { $sql = 'SELECT COUNT(user_id) AS total_users FROM ' . USERS_TABLE . ' - WHERE user_id <> ' . ANONYMOUS . " + WHERE user_type <> ' . USER_IGNORE . " $where_sql"; $result = $db->sql_query($sql); @@ -728,6 +728,8 @@ switch ($mode) ); } + // TODO + // ????????? $sql = 'SELECT session_user_id, MAX(session_time) AS session_time FROM ' . SESSIONS_TABLE . ' WHERE session_time >= ' . (time() - 300) . ' @@ -745,7 +747,7 @@ switch ($mode) // Do the SQL thang $sql = 'SELECT username, user_id, user_colour, user_allow_viewemail, user_posts, user_regdate, user_rank, user_from, user_website, user_email, user_icq, user_aim, user_yim, user_msnm, user_avatar, user_avatar_type, user_lastvisit FROM ' . USERS_TABLE . ' - WHERE user_id <> ' . ANONYMOUS . " + WHERE user_type IN (' . USER_NORMAL . ', ' . USER_FOUNDER . ") $where_sql ORDER BY $order_by"; $result = $db->sql_query_limit($sql, $config['topics_per_page'], $start); diff --git a/phpBB/styles/subSilver/template/viewonline_body.html b/phpBB/styles/subSilver/template/viewonline_body.html index 96e9aadc60..985c18f1de 100644 --- a/phpBB/styles/subSilver/template/viewonline_body.html +++ b/phpBB/styles/subSilver/template/viewonline_body.html @@ -21,7 +21,7 @@ <!-- ELSE --> <tr class="row2"> <!-- ENDIF --> - <td class="gen" width="35%" height="28"> <a href="{reg_user_row.U_USER_PROFILE}" title="{reg_user_row.USER_IP}">{reg_user_row.USERNAME}</a> </td> + <td class="gen" width="35%" height="28"> <!-- IF reg_user_row.U_USER_PROFILE --><a href="{reg_user_row.U_USER_PROFILE}" title="{reg_user_row.USER_IP}"><!-- ENDIF -->{reg_user_row.USERNAME}<!-- IF reg_user_row.U_USER_PROFILE --></a><!-- ENDIF --> </td> <td class="gen" width="25%" align="center" nowrap="nowrap"> {reg_user_row.LASTUPDATE} </td> <td class="gen" width="40%"> <a href="{reg_user_row.U_FORUM_LOCATION}">{reg_user_row.FORUM_LOCATION}</a> </td> </tr> diff --git a/phpBB/ucp.php b/phpBB/ucp.php index 06e4b4ca5e..ecbf1ddde5 100755 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -238,8 +238,8 @@ $user->setup(); $ucp = new module(); // Basic parameter data -$mode = (!empty($_REQUEST['mode'])) ? htmlspecialchars($_REQUEST['mode']) : false; -$module = (!empty($_REQUEST['i'])) ? htmlspecialchars($_REQUEST['i']) : false; +$mode = request_var('mode', ''); +$module = request_var('i', ''); // Basic "global" modes switch ($mode) @@ -247,6 +247,7 @@ switch ($mode) case 'activate': $ucp->load('ucp', 'activate'); $ucp->module->ucp_activate(); + redirect("index.$phpEx$SID"); break; case 'sendpassword': @@ -292,7 +293,7 @@ switch ($mode) // Only registered users can go beyond this point -if ($user->data['user_id'] == ANONYMOUS) +if ($user->data['user_type'] == USER_INACTIVE || $user->data['user_type'] == USER_IGNORE) { redirect("index.$phpEx"); } diff --git a/phpBB/viewonline.php b/phpBB/viewonline.php index 64c4c9fe8d..028c1b0171 100644 --- a/phpBB/viewonline.php +++ b/phpBB/viewonline.php @@ -22,10 +22,9 @@ $auth->acl($user->data); $user->setup(); // Get and set some variables -$start = (isset($_GET['start'])) ? intval($_GET['start']) : 0; - -$sort_key = (!empty($_REQUEST['sk'])) ? htmlspecialchars($_REQUEST['sk']) : 'b'; -$sort_dir = (!empty($_REQUEST['sd'])) ? htmlspecialchars($_REQUEST['sd']) : 'd'; +$start = request_var('start', 0); +$sort_key = request_var('sk', 'b'); +$sort_dir = request_var('sd', 'd'); $sort_key_text = array('a' => $user->lang['SORT_USERNAME'], 'b' => $user->lang['SORT_LOCATION'], 'c' => $user->lang['SORT_JOINED']); $sort_key_sql = array('a' => 'username', 'b' => 'session_time', 'c' => 'session_page'); @@ -48,7 +47,7 @@ $db->sql_freeresult($result); // Get user list -$sql = 'SELECT u.user_id, u.username, u.user_allow_viewonline, u.user_colour, s.session_time, s.session_page, s.session_ip, s.session_allow_viewonline +$sql = 'SELECT u.user_id, u.username, u.user_type, u.user_allow_viewonline, u.user_colour, s.session_time, s.session_page, s.session_ip, s.session_allow_viewonline FROM ' . USERS_TABLE . ' u, ' . SESSIONS_TABLE . ' s WHERE u.user_id = s.session_user_id AND s.session_time >= ' . (time() - ($config['load_online_time'] * 60)) . ' @@ -187,7 +186,7 @@ while ($row = $db->sql_fetchrow($result)) 'S_ROW_COUNT' => $$which_counter, - 'U_USER_PROFILE' => "memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'], + 'U_USER_PROFILE' => ($row['user_type'] <> USER_IGNORE) ? "memberlist.$phpEx$SID&mode=viewprofile&u=" . $row['user_id'] : '', 'U_FORUM_LOCATION' => $location_url) ); |