Version 1.3.0
This commit is contained in:
1 parent
7ef3d1712a
commit
f87d29ba65
290 files changed
+50206
-17930
No files matched your search
@@ -2,15 +2,17 @@
|
||||
|
||||
/*
|
||||
+--------------------------------------------------------------------------
|
||||
| Invision Board v1.1
|
||||
| Invision Power Board v1.3 Final
|
||||
| ========================================
|
||||
| by Matthew Mecham
|
||||
| (c) 2001,2002 Invision Power Services
|
||||
| http://www.ibforums.com
|
||||
| (c) 2001 - 2003 Invision Power Services
|
||||
| http://www.invisionpower.com
|
||||
| ========================================
|
||||
| Web: http://www.ibforums.com
|
||||
| Email: phpboards@ibforums.com
|
||||
| Licence Info: phpib-licence@ibforums.com
|
||||
| Web: http://www.invisionboard.com
|
||||
| Time: Sun, 04 Jan 2004 00:30:16 GMT
|
||||
| Release: 28e7bfb25f08ac72a789cb1b172fa185
|
||||
| Email: matt@invisionpower.com
|
||||
| Licence Info: http://www.invisionboard.com/?license
|
||||
+---------------------------------------------------------------------------
|
||||
|
|
||||
| > mySQL Admin Stuff
|
||||
@@ -24,7 +26,11 @@
|
||||
*/
|
||||
|
||||
|
||||
// Ensure we've not accessed this script directly:
|
||||
if ( ! defined( 'IN_ACP' ) )
|
||||
{
|
||||
print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
|
||||
exit();
|
||||
}
|
||||
|
||||
@set_time_limit(1200);
|
||||
|
||||
@@ -39,7 +45,20 @@ class ad_mysql {
|
||||
var $str_gzip_header = "\x1f\x8b\x08\x00\x00\x00\x00\x00";
|
||||
|
||||
function ad_mysql() {
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS, $HTTP_GET_VARS;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP, $HTTP_POST_VARS, $HTTP_GET_VARS;
|
||||
|
||||
//---------------------------------------
|
||||
// Kill globals - globals bad, Homer good.
|
||||
//---------------------------------------
|
||||
|
||||
$tmp_in = array_merge( $_GET, $_POST, $_COOKIE );
|
||||
|
||||
foreach ( $tmp_in as $k => $v )
|
||||
{
|
||||
unset($$k);
|
||||
}
|
||||
|
||||
//---------------------------------------
|
||||
|
||||
// Make sure we're a root admin, or else!
|
||||
|
||||
@@ -91,8 +110,8 @@ class ad_mysql {
|
||||
break;
|
||||
|
||||
case 'runsql':
|
||||
$q = $HTTP_POST_VARS['query'] == "" ? $HTTP_GET_VARS['query'] : $HTTP_POST_VARS['query'];
|
||||
$this->view_sql(trim(urldecode(stripslashes($q))));
|
||||
$q = $HTTP_POST_VARS['query'] == "" ? urldecode($HTTP_GET_VARS['query']) : $HTTP_POST_VARS['query'];
|
||||
$this->view_sql(trim(stripslashes($q)));
|
||||
break;
|
||||
|
||||
case 'backup':
|
||||
@@ -125,7 +144,7 @@ class ad_mysql {
|
||||
|
||||
function do_safe_backup($tbl_name="")
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
if ($tbl_name == "")
|
||||
{
|
||||
@@ -229,13 +248,20 @@ class ad_mysql {
|
||||
|
||||
function get_table_sql($tbl, $create_tbl, $skip=0)
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
if ($create_tbl)
|
||||
{
|
||||
// Generate table structure
|
||||
|
||||
$DB->query("SHOW CREATE TABLE ".$INFO['sql_database'].".".$tbl);
|
||||
if ( $IN['addticks'] )
|
||||
{
|
||||
$DB->query("SHOW CREATE TABLE `".$INFO['sql_database'].".".$tbl."`");
|
||||
}
|
||||
else
|
||||
{
|
||||
$DB->query("SHOW CREATE TABLE ".$INFO['sql_database'].".".$tbl);
|
||||
}
|
||||
|
||||
$ctable = $DB->fetch_row();
|
||||
|
||||
@@ -246,10 +272,10 @@ class ad_mysql {
|
||||
|
||||
if ($skip == 1)
|
||||
{
|
||||
if ($tbl == $INFO['sql_database'].'admin_sessions'
|
||||
OR $tbl == $INFO['sql_database'].'sessions'
|
||||
OR $tbl == $INFO['sql_database'].'reg_anti_spam'
|
||||
OR $tbl == $INFO['sql_database'].'search_results'
|
||||
if ($tbl == $INFO['sql_tbl_prefix'].'admin_sessions'
|
||||
OR $tbl == $INFO['sql_tbl_prefix'].'sessions'
|
||||
OR $tbl == $INFO['sql_tbl_prefix'].'reg_anti_spam'
|
||||
OR $tbl == $INFO['sql_tbl_prefix'].'search_results'
|
||||
)
|
||||
{
|
||||
return $ret;
|
||||
@@ -349,7 +375,7 @@ class ad_mysql {
|
||||
|
||||
function sbup_splash()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
$ADMIN->page_detail = "This section allows you to backup your database.";
|
||||
|
||||
@@ -372,7 +398,7 @@ class ad_mysql {
|
||||
until your browser prompts you with a dialogue box. This may take some time depending on
|
||||
the size of the database you are backing up.
|
||||
<br><br>
|
||||
<b><a href='{$ADMIN->base_url}&act=mysql&code=dosafebackup&create_tbl={$IN['create_tbl']}&skip={$IN['skip']}&enable_gzip={$IN['enable_gzip']}'>Click here to start the backup</a></b>"
|
||||
<b><a href='{$ADMIN->base_url}&act=mysql&code=dosafebackup&create_tbl={$IN['create_tbl']}&addticks={$IN['addticks']}&skip={$IN['skip']}&enable_gzip={$IN['enable_gzip']}'>Click here to start the backup</a></b>"
|
||||
) );
|
||||
|
||||
|
||||
@@ -387,7 +413,7 @@ class ad_mysql {
|
||||
|
||||
function show_backup_form()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
$ADMIN->page_detail = "This section allows you to backup your database.
|
||||
<br><br><b>Simple Backup</b>
|
||||
@@ -418,7 +444,7 @@ class ad_mysql {
|
||||
$ADMIN->html .= $SKIN->start_table( "Simple Back Up" );
|
||||
|
||||
$ADMIN->html .= $SKIN->add_td_row( array(
|
||||
"<b>Add 'CREATE TABLE' statements?</b>",
|
||||
"<b>Add 'CREATE TABLE' statements?</b><br>Add backticks around the table name?<br>(if you get a mySQL error, enable this) <input type='checkbox' name='addticks' value=1>",
|
||||
$SKIN->form_yes_no( 'create_tbl', 1),
|
||||
) );
|
||||
|
||||
@@ -450,7 +476,7 @@ class ad_mysql {
|
||||
|
||||
function view_sql($sql)
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
$limit = 50;
|
||||
$start = intval($IN['st']) == "" ? 0 : intval($IN['st']);
|
||||
@@ -505,7 +531,7 @@ class ad_mysql {
|
||||
|
||||
$DB->return_die = 1;
|
||||
|
||||
$DB->query($sql);
|
||||
$DB->query($sql,1);
|
||||
|
||||
// Check for errors..
|
||||
|
||||
@@ -569,7 +595,7 @@ class ad_mysql {
|
||||
|
||||
// Re-run with limit
|
||||
|
||||
$DB->query($sql);
|
||||
$DB->query($sql, 1); /// bypass table swapping
|
||||
}
|
||||
}
|
||||
|
||||
@@ -635,7 +661,7 @@ class ad_mysql {
|
||||
|
||||
function run_tool()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
$ADMIN->page_detail = "This section allows you to administrate your mySQL database.$extra";
|
||||
$ADMIN->page_title = "mySQL ".$this->true_version." Tool Box";
|
||||
@@ -722,7 +748,7 @@ class ad_mysql {
|
||||
|
||||
function list_index()
|
||||
{
|
||||
global $IN, $root_path, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
global $IN, $INFO, $DB, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;
|
||||
|
||||
$form_array = array();
|
||||
|
||||
@@ -788,9 +814,9 @@ class ad_mysql {
|
||||
$SKIN->td_header[] = array( "Export" , "10%" );
|
||||
$SKIN->td_header[] = array( '<input name="allbox" type="checkbox" value="Check All" onClick="CheckAll();">' , "10%" );
|
||||
|
||||
$ADMIN->html .= $SKIN->start_table( "Invision Board Tables" );
|
||||
$ADMIN->html .= $SKIN->start_table( "Invision Power Board Tables" );
|
||||
|
||||
$DB->query("SHOW TABLE STATUS FROM ".$INFO['sql_database']);
|
||||
$DB->query("SHOW TABLE STATUS FROM `".$INFO['sql_database']."`");
|
||||
|
||||
while ( $r = $DB->fetch_row() )
|
||||
{
|
||||
@@ -830,10 +856,11 @@ class ad_mysql {
|
||||
$tot = $this->gen_size( $total , 3, $oBit );
|
||||
|
||||
$ADMIN->html .= $SKIN->add_td_row( array (" ",
|
||||
"<div align='right'>Totals (<b>{$tot[0]} {$tot[1]}</b>)</div>",
|
||||
" ",
|
||||
"<div align='right'><b>{$tbl[0]} {$tbl[1]}</b></div>",
|
||||
"<div align='right'><b>{$idx[0]} {$idx[1]}</b></div>",
|
||||
" ",
|
||||
"<div align='right'>Totals (<b>{$tot[0]} {$tot[1]}</b>)</div>",
|
||||
|
||||
) );
|
||||
|
||||
}
|
||||
@@ -845,7 +872,7 @@ class ad_mysql {
|
||||
$SKIN->td_header[] = array( "Rows" , "30%" );
|
||||
$SKIN->td_header[] = array( '<input name="allbox" type="checkbox" value="Check All" onClick="CheckAll();">' , "10%" );
|
||||
|
||||
$ADMIN->html .= $SKIN->start_table( "Invision Board Tables" );
|
||||
$ADMIN->html .= $SKIN->start_table( "Invision Power Board Tables" );
|
||||
|
||||
$tables = $DB->get_table_names();
|
||||
|
||||
|
||||
Reference in new issue
Block a user