mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-22 22:33:55 -07:00
r516
Выпиливание неподдерживаемых типов баз данных из аттач-мода. Логирование отработки сборщика мусора, логирование отвалившейся базы. git-svn-id: https://torrentpier2.googlecode.com/svn/trunk@516 a8ac35ab-4ca4-ca47-4c2d-a49a94f06293
This commit is contained in:
parent
1bb73649f0
commit
14f691992b
7 changed files with 28 additions and 57 deletions
|
@ -76,8 +76,8 @@ class ajax_common
|
||||||
'manage_user' => array('admin'),
|
'manage_user' => array('admin'),
|
||||||
|
|
||||||
'mod_action' => array('mod'),
|
'mod_action' => array('mod'),
|
||||||
'topic_tpl' => array('mod'),
|
'topic_tpl' => array('mod'),
|
||||||
'group_membership' => array('mod'),
|
'group_membership' => array('mod'),
|
||||||
'post_mod_comment' => array('mod'),
|
'post_mod_comment' => array('mod'),
|
||||||
|
|
||||||
'gen_passkey' => array('user'),
|
'gen_passkey' => array('user'),
|
||||||
|
@ -284,7 +284,7 @@ class ajax_common
|
||||||
$this->send();
|
$this->send();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Verify mod rights
|
* Verify mod rights
|
||||||
*/
|
*/
|
||||||
function verify_mod_rights ($forum_id)
|
function verify_mod_rights ($forum_id)
|
||||||
|
@ -301,7 +301,7 @@ class ajax_common
|
||||||
|
|
||||||
function edit_user_profile ()
|
function edit_user_profile ()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'edit_user_profile.php');
|
require(AJAX_DIR .'edit_user_profile.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function change_user_rank ()
|
function change_user_rank ()
|
||||||
|
@ -327,7 +327,7 @@ class ajax_common
|
||||||
$this->response['html'] = ($rank_id != 0) ? $lang['AWARDED_RANK'] . ' <b> '. $ranks[$rank_id]['rank_title'] .'</b>' : $lang['SHOT_RANK'];
|
$this->response['html'] = ($rank_id != 0) ? $lang['AWARDED_RANK'] . ' <b> '. $ranks[$rank_id]['rank_title'] .'</b>' : $lang['SHOT_RANK'];
|
||||||
}
|
}
|
||||||
|
|
||||||
function change_user_opt ()
|
function change_user_opt ()
|
||||||
{
|
{
|
||||||
global $bf, $lang;
|
global $bf, $lang;
|
||||||
|
|
||||||
|
@ -353,8 +353,8 @@ class ajax_common
|
||||||
|
|
||||||
DB()->query("UPDATE ". BB_USERS ." SET user_opt = {$u_data['user_opt']} WHERE user_id = $user_id LIMIT 1");
|
DB()->query("UPDATE ". BB_USERS ." SET user_opt = {$u_data['user_opt']} WHERE user_id = $user_id LIMIT 1");
|
||||||
|
|
||||||
// Удаляем данные из кеша
|
// Удаляем данные из кеша
|
||||||
cache_rm_user_sessions ($user_id);
|
cache_rm_user_sessions ($user_id);
|
||||||
|
|
||||||
$this->response['resp_html'] = $lang['SAVED'];
|
$this->response['resp_html'] = $lang['SAVED'];
|
||||||
}
|
}
|
||||||
|
@ -382,7 +382,7 @@ class ajax_common
|
||||||
else $this->ajax_die($lang['NOT_AUTHORISED']);
|
else $this->ajax_die($lang['NOT_AUTHORISED']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// User groups membership
|
// User groups membership
|
||||||
function group_membership ()
|
function group_membership ()
|
||||||
{
|
{
|
||||||
global $lang, $user;
|
global $lang, $user;
|
||||||
|
@ -497,19 +497,19 @@ class ajax_common
|
||||||
}
|
}
|
||||||
|
|
||||||
function user_register()
|
function user_register()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'user_register.php');
|
require(AJAX_DIR .'user_register.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function mod_action()
|
function mod_action()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'mod_action.php');
|
require(AJAX_DIR .'mod_action.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function posts()
|
function posts()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'posts.php');
|
require(AJAX_DIR .'posts.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
function manage_user()
|
function manage_user()
|
||||||
{
|
{
|
||||||
|
@ -522,7 +522,7 @@ class ajax_common
|
||||||
}
|
}
|
||||||
|
|
||||||
function index_data()
|
function index_data()
|
||||||
{
|
{
|
||||||
require(AJAX_DIR .'index_data.php');
|
require(AJAX_DIR .'index_data.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -768,27 +768,13 @@ function get_var($var_name, $default, $multibyte = false)
|
||||||
*/
|
*/
|
||||||
function attach_mod_sql_escape($text)
|
function attach_mod_sql_escape($text)
|
||||||
{
|
{
|
||||||
switch (SQL_LAYER)
|
if (function_exists('mysql_real_escape_string'))
|
||||||
{
|
{
|
||||||
case 'postgresql':
|
return DB()->escape_string($text);
|
||||||
return pg_escape_string($text);
|
}
|
||||||
break;
|
else
|
||||||
|
{
|
||||||
case 'mysql':
|
return str_replace("'", "''", str_replace('\\', '\\\\', $text));
|
||||||
case 'mysql4':
|
|
||||||
if (function_exists('mysql_real_escape_string'))
|
|
||||||
{
|
|
||||||
return DB()->escape_string($text);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return str_replace("'", "''", str_replace('\\', '\\\\', $text));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
return str_replace("'", "''", str_replace('\\', '\\\\', $text));
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,7 @@ $domain_name = (!empty($_SERVER['SERVER_NAME'])) ? $_SERVER['SERVER_NAME'] : $do
|
||||||
// Increase number of revision after update
|
// Increase number of revision after update
|
||||||
$bb_cfg['tp_version'] = '2.5 pre-stable';
|
$bb_cfg['tp_version'] = '2.5 pre-stable';
|
||||||
$bb_cfg['tp_release_date'] = '27-07-2013';
|
$bb_cfg['tp_release_date'] = '27-07-2013';
|
||||||
$bb_cfg['tp_release_state'] = 'R515';
|
$bb_cfg['tp_release_state'] = 'R516';
|
||||||
|
|
||||||
// Database
|
// Database
|
||||||
$charset = 'utf8';
|
$charset = 'utf8';
|
||||||
|
|
|
@ -15,6 +15,6 @@ foreach ($gc_cache as $cache_name)
|
||||||
if (method_exists(CACHE($cache_name), 'gc'))
|
if (method_exists(CACHE($cache_name), 'gc'))
|
||||||
{
|
{
|
||||||
$changes = CACHE($cache_name)->gc();
|
$changes = CACHE($cache_name)->gc();
|
||||||
$cron_runtime_log = date('Y-m-d H:i:s') ." -- tr -- $changes rows deleted\n";
|
$cron_runtime_log .= date('Y-m-d H:i:s') ." -- tr -- $changes rows deleted\n";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,14 +29,6 @@ $attach_sql = join(',', $attach_sql);
|
||||||
|
|
||||||
if ($dead_tor_sql && $attach_sql)
|
if ($dead_tor_sql && $attach_sql)
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
// Update topic type
|
|
||||||
DB()->query("
|
|
||||||
UPDATE ". BB_TOPICS ." SET
|
|
||||||
topic_dl_type = ". TOPIC_DL_TYPE_NORMAL ."
|
|
||||||
WHERE topic_id IN($dead_tor_sql)
|
|
||||||
");
|
|
||||||
*/
|
|
||||||
// Delete torstat
|
// Delete torstat
|
||||||
DB()->query("
|
DB()->query("
|
||||||
DELETE FROM ". BB_BT_TORSTAT ."
|
DELETE FROM ". BB_BT_TORSTAT ."
|
||||||
|
|
|
@ -95,6 +95,7 @@ class sql_db
|
||||||
{
|
{
|
||||||
$server = (DBG_USER) ? $this->cfg['dbhost'] : '';
|
$server = (DBG_USER) ? $this->cfg['dbhost'] : '';
|
||||||
header("HTTP/1.0 503 Service Unavailable");
|
header("HTTP/1.0 503 Service Unavailable");
|
||||||
|
bb_log(' ', "db_err/connect_failed_{$this->cfg['dbhost']}");
|
||||||
die("Could not connect to the server $server");
|
die("Could not connect to the server $server");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -232,16 +232,8 @@ class report_privmsg extends report_module
|
||||||
function _subject_details_prepare(&$message, &$subject, $row)
|
function _subject_details_prepare(&$message, &$subject, $row)
|
||||||
{
|
{
|
||||||
global $bb_cfg, $userdata, $datastore;
|
global $bb_cfg, $userdata, $datastore;
|
||||||
require_once(INC_DIR . "bbcode.php");
|
|
||||||
|
|
||||||
//
|
require_once(INC_DIR . "bbcode.php");
|
||||||
// If the board has HTML off but the post has HTML
|
|
||||||
// on then we process it, else leave it alone
|
|
||||||
//
|
|
||||||
/*if ((!$bb_cfg['allow_html'] || !$userdata['user_allowhtml']) && $row['privmsgs_enable_html'])
|
|
||||||
{
|
|
||||||
$message = preg_replace('#(<)([\/]?.*?)(>)#is', '<\\2>', $message);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
$message = bbcode2html($message);
|
$message = bbcode2html($message);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue