diff --git a/install/sql/mysql.sql b/install/sql/mysql.sql index a52c3cc35..d43279b51 100644 --- a/install/sql/mysql.sql +++ b/install/sql/mysql.sql @@ -1455,7 +1455,6 @@ CREATE TABLE IF NOT EXISTS `bb_users` ( `user_interests` varchar(255) NOT NULL DEFAULT '', `user_actkey` varchar(32) NOT NULL DEFAULT '', `user_newpasswd` varchar(32) NOT NULL DEFAULT '', - `ignore_srv_load` tinyint(1) NOT NULL DEFAULT '0', `autologin_id` varchar(12) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '', `user_newest_pm_id` mediumint(8) NOT NULL DEFAULT '0', `user_points` float(16,2) NOT NULL DEFAULT '0.00', diff --git a/upload/ajax/edit_user_profile.php b/upload/ajax/edit_user_profile.php index f95230c49..553811321 100644 --- a/upload/ajax/edit_user_profile.php +++ b/upload/ajax/edit_user_profile.php @@ -118,18 +118,13 @@ switch ($field) case 'user_regdate': case 'user_lastvisit': - $tz = TIMENOW + (3600 * $bb_cfg['board_timezone']); - if (($value = strtotime($value, $tz)) < $bb_cfg['board_startdate'] OR $value > TIMENOW) - { - $this->ajax_die($lang['INVALID_DATE'] . $this->request['value']); - } - $value = $value - (3600 * -1); - $this->response['new_value'] = bb_date($value); - break; - - case 'ignore_srv_load': - $value = ($this->request['value']) ? 0 : 1; - $this->response['new_value'] = ($profiledata['user_level'] != USER || $value) ? $lang['NO'] : $lang['YES']; + $tz = TIMENOW + (3600 * $bb_cfg['board_timezone']); + if (($value = strtotime($value, $tz)) < $bb_cfg['board_startdate'] OR $value > TIMENOW) + { + $this->ajax_die($lang['INVALID_DATE'] . $this->request['value']); + } + $value = $value - (3600 * -1); + $this->response['new_value'] = bb_date($value); break; case 'u_up_total': diff --git a/upload/common.php b/upload/common.php index 7819b326b..9cf9b1c89 100644 --- a/upload/common.php +++ b/upload/common.php @@ -2265,24 +2265,5 @@ else if (defined('IN_TRACKER')) { dummy_exit(mt_rand(1200, 2400)); # die('d14:failure reason20:temporarily disablede'); } - - // Limit server load - if ($bb_cfg['max_srv_load'] || $bb_cfg['tr_working_second']) - { - if ((!empty($_GET['uploaded']) || !empty($_GET['downloaded'])) && (!isset($_GET['event']) || $_GET['event'] === 'started')) - { - if ($bb_cfg['tr_working_second'] && (TIMENOW % $bb_cfg['tr_working_second'])) - { - tr_drop_request('wrk_sec'); - } - else if ($bb_cfg['max_srv_load'] && LOADAVG) - { - if (LOADAVG > $bb_cfg['max_srv_load']) - { - tr_drop_request('load'); - } - } - } - } } -} +} \ No newline at end of file diff --git a/upload/config.php b/upload/config.php index 28a507bcb..9bb7ee340 100644 --- a/upload/config.php +++ b/upload/config.php @@ -19,7 +19,6 @@ * Templates * Cookie * Server - - Server load - Backup - GZip * Sessions @@ -56,8 +55,8 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do // Increase number of revision after update $bb_cfg['tp_version'] = '2.5 (unstable)'; -$bb_cfg['tp_release_date'] = '03-08-2013'; -$bb_cfg['tp_release_state'] = 'R536'; +$bb_cfg['tp_release_date'] = '06-08-2013'; +$bb_cfg['tp_release_state'] = 'R537'; // Database $charset = 'utf8'; @@ -109,17 +108,12 @@ $bb_cfg['server_name'] = $domain_name; // The domain name from whic $bb_cfg['server_port'] = (!empty($_SERVER['SERVER_PORT'])) ? $_SERVER['SERVER_PORT'] : 80; // The port your server is running on $bb_cfg['script_path'] = '/'; // The path where FORUM is located relative to the domain name -// Server load -$bb_cfg['max_srv_load'] = 0; // 0 - disable -$bb_cfg['tr_working_second'] = 0; // 0 - disable - // Increase number after changing js or css $bb_cfg['js_ver'] = 1; $bb_cfg['css_ver'] = 1; // Information messages $bb_cfg['board_disabled_msg'] = 'форум временно отключен'; // 'forums temporarily disabled'; // show this msg if board has been disabled via ON/OFF trigger -$bb_cfg['srv_overloaded_msg'] = "Извините, в данный момент сервер перегружен\nПопробуйте повторить запрос через несколько минут"; // Backup $bb_cfg['db_backup_shell_cmd'] = ''; // '/path/to/db_backup.sh 2>&1' @@ -301,7 +295,6 @@ $bb_cfg['user_session_duration'] = 1800; // sec $bb_cfg['admin_session_duration'] = 6*3600; // sec $bb_cfg['user_session_gc_ttl'] = 1800; // number of seconds that a staled session entry may remain in sessions table $bb_cfg['session_cache_gc_ttl'] = 1200; // sec -$bb_cfg['max_reg_users_online'] = 0; // 0 - unlimited $bb_cfg['max_last_visit_days'] = 14; // days $bb_cfg['last_visit_update_intrv'] = 3600; // sec diff --git a/upload/develop/show_source.php b/upload/develop/show_source.php index ed2a44c91..97051f306 100644 --- a/upload/develop/show_source.php +++ b/upload/develop/show_source.php @@ -15,5 +15,4 @@ $prev = @$_GET['prev'] ? $_GET['prev'] : 15; $next = @$_GET['next'] ? $_GET['next'] : 15; require('./dbg_header.php'); -echo showSource($file, $line, $prev, $next); - +echo showSource($file, $line, $prev, $next); \ No newline at end of file diff --git a/upload/includes/cron/jobs/captcha_gen_gc.php b/upload/includes/cron/jobs/captcha_gen_gc.php index c1be8df86..bfe684220 100644 --- a/upload/includes/cron/jobs/captcha_gen_gc.php +++ b/upload/includes/cron/jobs/captcha_gen_gc.php @@ -53,10 +53,9 @@ $del_ids = DB('cap')->fetch_rowset("SELECT cap_id FROM ". BB_CAPTCHA ." WHERE ca foreach ($del_ids as $del_id) { $cap_img_path = CAPTCHA()->get_img_path(abs($del_id)); - if(@fopen($cap_img_path, 'r')) + if (@fopen($cap_img_path, 'r')) { unlink($cap_img_path); - } + } DB('cap')->query("DELETE FROM ". BB_CAPTCHA ." WHERE cap_id = $del_id LIMIT 1"); -} - +} \ No newline at end of file diff --git a/upload/includes/init_bb.php b/upload/includes/init_bb.php index 432fccc3f..82e3154ab 100644 --- a/upload/includes/init_bb.php +++ b/upload/includes/init_bb.php @@ -1,11 +1,6 @@ $bb_cfg['max_srv_load'] && (TIMENOW - $_COOKIE[COOKIE_LOAD]) > $bb_cfg['user_session_duration']) - { - require(TPL_LIMIT_LOAD_EXIT); - } - } -} - function prn_r ($var, $title = '', $print = true) { $r = '
'. (($title) ? "$title\n\n" : '') . htmlspecialchars(print_r($var, true)) .'
'; diff --git a/upload/includes/online_userlist.php b/upload/includes/online_userlist.php index be9ee17d4..56ad2303c 100644 --- a/upload/includes/online_userlist.php +++ b/upload/includes/online_userlist.php @@ -28,7 +28,6 @@ $online = $online_short = array('userlist' => ''); $sql = " SELECT u.username, u.user_id, u.user_opt, u.user_rank, u.user_level, - u.ignore_srv_load, s.session_logged_in, s.session_ip, (s.session_time - s.session_start) AS ses_len, COUNT(s.session_id) AS sessions, COUNT(DISTINCT s.session_ip) AS ips FROM ". BB_SESSIONS ." s, ". BB_USERS ." u WHERE s.session_time > $time_online diff --git a/upload/includes/page_footer.php b/upload/includes/page_footer.php index 4c3b784fb..87c707057 100644 --- a/upload/includes/page_footer.php +++ b/upload/includes/page_footer.php @@ -58,9 +58,8 @@ if ($show_dbg_info) for ($i=0; $i < 3; $i++) { $l[$i] = round($l[$i], 1); - $l[$i] = (IS_ADMIN && $bb_cfg['max_srv_load'] && $l[$i] > ($bb_cfg['max_srv_load'] + 4)) ? "$l[$i]" : $l[$i]; } - $stat .= "  |  ". $lang['LIMIT'] ." $l[0] $l[1] $l[2]"; + $stat .= "  |  ". $lang['LIMIT'] ." $l[0] $l[1] $l[2]"; } $stat .= '  ]'; diff --git a/upload/includes/sessions.php b/upload/includes/sessions.php index c7b699c00..e1916557e 100644 --- a/upload/includes/sessions.php +++ b/upload/includes/sessions.php @@ -235,11 +235,6 @@ class user_common $user_id = (int) $this->data['user_id']; $mod_admin_session = ($this->data['user_level'] == ADMIN || $this->data['user_level'] == MOD); - if (($bb_cfg['max_srv_load'] || $bb_cfg['max_reg_users_online']) && $login && $is_user && !$this->data['ignore_srv_load']) - { - $this->limit_srv_load(); - } - // Initial ban check against user_id or IP address if ($is_user) { @@ -486,7 +481,6 @@ class user_common { $delete_cookies = array( COOKIE_DATA, - COOKIE_LOAD, COOKIE_DBG, 'torhelp', 'explain', @@ -502,7 +496,7 @@ class user_common } } } - else + else { $c_sdata_resv = !empty($_COOKIE[COOKIE_DATA]) ? $_COOKIE[COOKIE_DATA] : null; $c_sdata_curr = ($this->sessiondata) ? serialize($this->sessiondata) : ''; @@ -511,16 +505,6 @@ class user_common { bb_setcookie(COOKIE_DATA, $c_sdata_curr, COOKIE_PERSIST, true); } - if ($bb_cfg['max_srv_load']) - { - $c_isl_resv = isset($_COOKIE[COOKIE_LOAD]) ? intval($_COOKIE[COOKIE_LOAD]) : null; - $c_isl_curr = ($this->data['user_level'] == USER && !$this->data['ignore_srv_load']) ? TIMENOW : 0; - - if ($c_isl_curr !== $c_isl_resv) - { - bb_setcookie(COOKIE_LOAD, $c_isl_curr); - } - } if (isset($bb_cfg['dbg_users'][$this->data['user_id']]) && !isset($_COOKIE[COOKIE_DBG])) { bb_setcookie(COOKIE_DBG, 1, COOKIE_SESSION); @@ -572,36 +556,6 @@ class user_common return $autologin_id; } - /** - * Limit server load - */ - function limit_srv_load () - { - global $bb_cfg; - - if (!empty($_POST['message'])) return; - - $srv_overloaded = false; - - if (LOADAVG) - { - $srv_overloaded = (LOADAVG > $bb_cfg['max_srv_load']); - } - if (!$srv_overloaded && $bb_cfg['max_reg_users_online']) - { - $sql = "SELECT COUNT(DISTINCT session_user_id) AS users_count FROM ". BB_SESSIONS ." WHERE session_time > ". (TIMENOW - 300); - - if ($row = DB()->fetch_row($sql)) - { - $srv_overloaded = ($row['users_count'] > $bb_cfg['max_reg_users_online']); - } - } - if ($srv_overloaded) - { - require(TPL_LIMIT_LOAD_EXIT); - } - } - /** * Initialise user settings */ diff --git a/upload/includes/ucp/usercp_viewprofile.php b/upload/includes/ucp/usercp_viewprofile.php index 8c3d72a87..0bf291307 100644 --- a/upload/includes/ucp/usercp_viewprofile.php +++ b/upload/includes/ucp/usercp_viewprofile.php @@ -214,12 +214,6 @@ else )); } -$template->assign_vars(array( - 'SHOW_ACCESS_PRIVILEGE' => IS_ADMIN, - 'IGNORE_SRV_LOAD' => ($profiledata['user_level'] != USER || $profiledata['ignore_srv_load']) ? $lang['NO'] : $lang['YES'], - 'IGNORE_SRV_LOAD_EDIT' => ($profiledata['user_level'] == USER), -)); - if (IS_ADMIN) { $template->assign_vars(array( diff --git a/upload/language/lang_english/lang_main.php b/upload/language/lang_english/lang_main.php index d5737ed8d..e68dd316f 100644 --- a/upload/language/lang_english/lang_main.php +++ b/upload/language/lang_english/lang_main.php @@ -1396,8 +1396,6 @@ $lang['ONLY_FOR_MOD'] = 'This option only for moderators'; $lang['ONLY_FOR_ADMIN'] = 'This option only for admins'; $lang['ONLY_FOR_SUPER_ADMIN'] = 'This option only for super admins'; -$lang['ACCESS'] = 'Access'; -$lang['ACCESS_SRV_LOAD'] = 'Depend on server load'; $lang['LOGS'] = 'Topic history'; $lang['FORUM_LOGS'] = 'History Forum'; $lang['AUTOCLEAN'] = 'Autoclean:'; diff --git a/upload/language/lang_russian/lang_main.php b/upload/language/lang_russian/lang_main.php index 71bca187b..8a1129acf 100644 --- a/upload/language/lang_russian/lang_main.php +++ b/upload/language/lang_russian/lang_main.php @@ -1398,8 +1398,6 @@ $lang['ONLY_FOR_MOD'] = 'Эта опция доступна только мод $lang['ONLY_FOR_ADMIN'] = 'Эта опция доступна только администраторам'; $lang['ONLY_FOR_SUPER_ADMIN'] = 'Эта опция доступна только суперадминистраторам'; -$lang['ACCESS'] = 'Доступ'; -$lang['ACCESS_SRV_LOAD'] = 'Зависит от загрузки сервера'; $lang['LOGS'] = 'История темы'; $lang['FORUM_LOGS'] = 'История форума'; $lang['AUTOCLEAN'] = 'Автоочистка:'; diff --git a/upload/templates/default/usercp_viewprofile.tpl b/upload/templates/default/usercp_viewprofile.tpl index 6fb6efb01..1b5bea627 100644 --- a/upload/templates/default/usercp_viewprofile.tpl +++ b/upload/templates/default/usercp_viewprofile.tpl @@ -82,10 +82,6 @@ $(document).ready(function(){ {action: "edit_user_profile", id: "user_skype"} {action: "edit_user_profile", id: "user_gender", editableType: "yesno-gender"} {action: "edit_user_profile", id: "user_birthday"} - - -{action: "edit_user_profile", id: "ignore_srv_load", editableType: "yesno-radio"} - {action: "edit_user_profile", id: "u_up_total"} {action: "edit_user_profile", id: "u_down_total"} {action: "edit_user_profile", id: "u_up_release"} @@ -409,12 +405,6 @@ ajax.callback.view_profile = function(data) { {AGE} - - - {L_ACCESS}: - {L_ACCESS_SRV_LOAD}: {IGNORE_SRV_LOAD} - - {L_DRAFTS}: diff --git a/upload/templates/limit_load_exit.php b/upload/templates/limit_load_exit.php deleted file mode 100644 index 687ba48d4..000000000 --- a/upload/templates/limit_load_exit.php +++ /dev/null @@ -1,70 +0,0 @@ -close(); -} -send_no_cache_headers(); - -$redirect_url = !empty($_POST['redirect']) ? $_POST['redirect'] : $_SERVER['REQUEST_URI']; - - - // LOG - global $userdata; - - if ($userdata['username']) - { - $name = html_entity_decode($userdata['username']); - } - else if (!empty($_POST['login_username'])) - { - $name = $_POST['login_username']; - } - else - { - $name = ''; - } - - $file = 'load/load-'. date('m-d'); - $str = array(); - $str[] = date('H:i:s'); - $str[] = sprintf('%-5s', floatval(LOADAVG)); - $str[] = sprintf('%-15s', $_SERVER['REMOTE_ADDR']); - $str[] = sprintf('%-20s', $name); - $str[] = $redirect_url; - $str = join(LOG_SEPR, $str) . LOG_LF; - bb_log($str, $file); - - -?> - - - - - <?php echo $bb_cfg['sitename']?> - - - - -
- - -
-

Извините, в данный момент сервер перегружен.

-

Попробуйте зайти через несколько минут.

-

-
- -
- - - - - \ No newline at end of file