diff options
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_attachments.php | 10 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_apache.php | 12 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_db.php | 12 | ||||
-rw-r--r-- | phpBB/includes/auth/auth_ldap.php | 12 | ||||
-rw-r--r-- | phpBB/includes/functions.php | 2 | ||||
-rw-r--r-- | phpBB/includes/functions_messenger.php | 5 | ||||
-rw-r--r-- | phpBB/includes/functions_posting.php | 9 |
7 files changed, 50 insertions, 12 deletions
diff --git a/phpBB/includes/acp/acp_attachments.php b/phpBB/includes/acp/acp_attachments.php index 120c6a789f..d2beba55c5 100644 --- a/phpBB/includes/acp/acp_attachments.php +++ b/phpBB/includes/acp/acp_attachments.php @@ -947,6 +947,7 @@ class acp_attachments AND is_orphan = 1'; $result = $db->sql_query($sql); + $files_added = $space_taken = 0; while ($row = $db->sql_fetchrow($result)) { $post_row = $post_info[$upload_list[$row['attach_id']]]; @@ -986,9 +987,18 @@ class acp_attachments WHERE topic_id = ' . $post_row['topic_id']; $db->sql_query($sql); + $space_taken += $row['filesize']; + $files_added++; + add_log('admin', 'LOG_ATTACH_FILEUPLOAD', $post_row['post_id'], $row['real_filename']); } $db->sql_freeresult($result); + + if ($files_added) + { + set_config('upload_dir_size', $config['upload_dir_size'] + $space_taken, true); + set_config('num_files', $config['num_files'] + $files_added, true); + } } } diff --git a/phpBB/includes/auth/auth_apache.php b/phpBB/includes/auth/auth_apache.php index 50a49ee21e..acdd4e3386 100644 --- a/phpBB/includes/auth/auth_apache.php +++ b/phpBB/includes/auth/auth_apache.php @@ -48,8 +48,18 @@ function login_apache(&$username, &$password) if (!$password) { return array( - 'status' => LOGIN_BREAK, + 'status' => LOGIN_ERROR_PASSWORD, 'error_msg' => 'NO_PASSWORD_SUPPLIED', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + if (!$username) + { + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), ); } diff --git a/phpBB/includes/auth/auth_db.php b/phpBB/includes/auth/auth_db.php index aa09710730..00dd438210 100644 --- a/phpBB/includes/auth/auth_db.php +++ b/phpBB/includes/auth/auth_db.php @@ -32,8 +32,18 @@ function login_db(&$username, &$password) if (!$password) { return array( - 'status' => LOGIN_BREAK, + 'status' => LOGIN_ERROR_PASSWORD, 'error_msg' => 'NO_PASSWORD_SUPPLIED', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + if (!$username) + { + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), ); } diff --git a/phpBB/includes/auth/auth_ldap.php b/phpBB/includes/auth/auth_ldap.php index 9507dc645a..3163153997 100644 --- a/phpBB/includes/auth/auth_ldap.php +++ b/phpBB/includes/auth/auth_ldap.php @@ -104,8 +104,18 @@ function login_ldap(&$username, &$password) if (!$password) { return array( - 'status' => LOGIN_BREAK, + 'status' => LOGIN_ERROR_PASSWORD, 'error_msg' => 'NO_PASSWORD_SUPPLIED', + 'user_row' => array('user_id' => ANONYMOUS), + ); + } + + if (!$username) + { + return array( + 'status' => LOGIN_ERROR_USERNAME, + 'error_msg' => 'LOGIN_ERROR_USERNAME', + 'user_row' => array('user_id' => ANONYMOUS), ); } diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 7a6e4c656d..5005033166 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -2658,7 +2658,7 @@ function get_preg_expression($mode) switch ($mode) { case 'email': - return '[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.(?:[a-z0-9\-]+\.)*[a-z]+'; + return '(?:[a-z0-9\'\.\-_\+\|]|&)+@[a-z0-9\-]+\.(?:[a-z0-9\-]+\.)*[a-z]+'; break; case 'bbcode_htm': diff --git a/phpBB/includes/functions_messenger.php b/phpBB/includes/functions_messenger.php index 8aba4ed255..ef896f2c89 100644 --- a/phpBB/includes/functions_messenger.php +++ b/phpBB/includes/functions_messenger.php @@ -1056,8 +1056,7 @@ class smtp_class global $user; $err_msg = ''; - $local_host = php_uname('n'); - $local_host = (empty($local_host)) ? 'localhost' : $local_host; + $local_host = (function_exists('php_uname')) ? php_uname('n') : $user->host; // If we are authenticating through pop-before-smtp, we // have to login ones before we get authenticated @@ -1332,7 +1331,7 @@ class smtp_class // Realm if (empty($tokens['realm'])) { - $tokens['realm'] = php_uname('n'); + $tokens['realm'] = (function_exists('php_uname')) ? php_uname('n') : $user->host; } // Maxbuf diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index 7eba43c955..a2482c64c4 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -1121,16 +1121,15 @@ function user_notification($mode, $subject, $topic_title, $forum_name, $forum_id // Get banned User ID's $sql = 'SELECT ban_userid - FROM ' . BANLIST_TABLE; + FROM ' . BANLIST_TABLE . ' + WHERE ban_userid <> 0 + AND ban_exclude <> 1'; $result = $db->sql_query($sql); $sql_ignore_users = ANONYMOUS . ', ' . $user->data['user_id']; while ($row = $db->sql_fetchrow($result)) { - if (isset($row['ban_userid'])) - { - $sql_ignore_users .= ', ' . $row['ban_userid']; - } + $sql_ignore_users .= ', ' . (int) $row['ban_userid']; } $db->sql_freeresult($result); |