mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 12:48:26 +02:00
db-verify routines moved to class and integrated into main admin->database page.
This commit is contained in:
@@ -8,9 +8,9 @@
|
|||||||
*
|
*
|
||||||
* Administration - Database Utilities
|
* Administration - Database Utilities
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_admin/db.php,v $
|
* $URL$
|
||||||
* $Revision$
|
* $Revision$
|
||||||
* $Date$
|
* $Id$
|
||||||
* $Author$
|
* $Author$
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@@ -31,30 +31,29 @@ if(isset($_POST['back']))
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
|
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$e_sub_cat = 'database';
|
$e_sub_cat = 'database';
|
||||||
|
|
||||||
require_once (e_HANDLER."form_handler.php");
|
$frm = e107::getForm();
|
||||||
$frm = new e_form();
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
require_once (e_HANDLER."message_handler.php");
|
|
||||||
$emessage = &eMessage::getInstance();
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Execute trigger
|
* Execute trigger
|
||||||
*/
|
*/
|
||||||
if(isset($_POST['trigger_db_execute']))
|
if(isset($_POST['db_execute']))
|
||||||
{
|
{
|
||||||
|
$type = key($_POST['db_execute']);
|
||||||
|
|
||||||
if(!varset($_POST['db_execute']))
|
if(!varset($_POST['db_execute']))
|
||||||
{
|
{
|
||||||
$emessage->add(DBLAN_53, E_MESSAGE_WARNING);
|
$mes->add(DBLAN_53, E_MESSAGE_WARNING);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$_POST[$_POST['db_execute']] = true;
|
$_POST[$type] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,25 +63,20 @@ if(isset($_POST['db_update']) || varset($_GET['mode'])=='db_update')
|
|||||||
exit();
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['verify_sql']) || varset($_GET['mode'])=='verify_sql')
|
|
||||||
{
|
|
||||||
header("location: ".e_ADMIN."db_verify.php");
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(isset($_POST['exportXmlFile']))
|
if(isset($_POST['exportXmlFile']))
|
||||||
{
|
{
|
||||||
if(exportXmlFile($_POST['xml_prefs'],$_POST['xml_tables'],$_POST['package_images']))
|
if(exportXmlFile($_POST['xml_prefs'],$_POST['xml_tables'],$_POST['package_images']))
|
||||||
{
|
{
|
||||||
$emessage = eMessage::getInstance();
|
$mes = eMessage::getInstance();
|
||||||
$emessage->add(LAN_SUCCESS, E_MESSAGE_SUCCESS);
|
$mes->add(LAN_SUCCESS, E_MESSAGE_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
require_once ("auth.php");
|
require_once ("auth.php");
|
||||||
require_once (e_HANDLER."form_handler.php");
|
|
||||||
$frm = new e_form();
|
|
||||||
$st = new system_tools;
|
$st = new system_tools;
|
||||||
|
|
||||||
|
|
||||||
@@ -136,7 +130,6 @@ class system_tools
|
|||||||
//TODO Merge db_verify.php into db.php
|
//TODO Merge db_verify.php into db.php
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(isset($_POST['delplug']))
|
if(isset($_POST['delplug']))
|
||||||
{
|
{
|
||||||
$this->delete_plugin_entry($_POST['pref_type']);
|
$this->delete_plugin_entry($_POST['pref_type']);
|
||||||
@@ -151,10 +144,18 @@ class system_tools
|
|||||||
{
|
{
|
||||||
$this->del_pref_val($_POST['pref_type']);
|
$this->del_pref_val($_POST['pref_type']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(isset($_POST['verify_sql']) || varset($_GET['mode'])=='verify_sql')
|
||||||
|
{
|
||||||
|
require_once(e_HANDLER."db_verify_class.php");
|
||||||
|
$dbv = new db_verify;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if(isset($_POST['verify_sql_record']) || varset($_GET['mode'])=='verify_sql_record' || isset($_POST['check_verify_sql_record']) || isset($_POST['delete_verify_sql_record']))
|
if(isset($_POST['verify_sql_record']) || varset($_GET['mode'])=='verify_sql_record' || isset($_POST['check_verify_sql_record']) || isset($_POST['delete_verify_sql_record']))
|
||||||
{
|
{
|
||||||
// $this->verify_sql_record(); - currently performed in db_verify.php
|
|
||||||
|
//$this->verify_sql_record(); // - currently performed in db_verify_class.php
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isset($_POST['importForm']) || $_GET['mode']=='importForm')
|
if(isset($_POST['importForm']) || $_GET['mode']=='importForm')
|
||||||
@@ -197,9 +198,10 @@ class system_tools
|
|||||||
if(vartrue($_POST['perform_utf8_convert']))
|
if(vartrue($_POST['perform_utf8_convert']))
|
||||||
{
|
{
|
||||||
$this->perform_utf8_convert();
|
$this->perform_utf8_convert();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!vartrue($_GET['mode']))
|
if(!vartrue($_GET['mode']) && !isset($_POST['db_execute']))
|
||||||
{
|
{
|
||||||
$this->render_options();
|
$this->render_options();
|
||||||
}
|
}
|
||||||
@@ -427,7 +429,7 @@ class system_tools
|
|||||||
*/
|
*/
|
||||||
private function render_options()
|
private function render_options()
|
||||||
{
|
{
|
||||||
$frm = e107::getSingleton('e_form');
|
$frm = e107::getForm();
|
||||||
|
|
||||||
$text = "
|
$text = "
|
||||||
<form method='post' action='".e_SELF."' id='core-db-main-form'>
|
<form method='post' action='".e_SELF."' id='core-db-main-form'>
|
||||||
@@ -445,7 +447,11 @@ class system_tools
|
|||||||
$text .= "<tr>
|
$text .= "<tr>
|
||||||
<td>".$val['diz']."</td>
|
<td>".$val['diz']."</td>
|
||||||
<td>
|
<td>
|
||||||
".$frm->radio('db_execute', $key).$frm->label($val['label'], 'db_execute', $key)."
|
<a href='".e_SELF."?mode=".$key."' title=\"".$val['label']."\">".ADMIN_EXECUTE_ICON."</a>
|
||||||
|
".
|
||||||
|
// $frm->submit_image('db_execute['.$key.']', '1', 'execute', $val['label']).
|
||||||
|
// $frm->radio('db_execute', $key).$frm->label($val['label'], 'db_execute', $key).
|
||||||
|
"
|
||||||
</td>
|
</td>
|
||||||
</tr>\n";
|
</tr>\n";
|
||||||
|
|
||||||
@@ -454,16 +460,17 @@ class system_tools
|
|||||||
$text .= "
|
$text .= "
|
||||||
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>";
|
||||||
<div class='buttons-bar center'>
|
// $text .= "<div class='buttons-bar center'>
|
||||||
".$frm->admin_button('trigger_db_execute', DBLAN_51, 'execute')."
|
// ".$frm->admin_button('trigger_db_execute', DBLAN_51, 'execute')."
|
||||||
</div>
|
// </div>";
|
||||||
|
$text .= "
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
";
|
";
|
||||||
|
|
||||||
$emessage = eMessage::getInstance();
|
$mes = e107::getMessage();
|
||||||
e107::getRender()->tablerender(DBLAN_10, $emessage->render().$text);
|
e107::getRender()->tablerender(DBLAN_10, $mes->render().$text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -6,48 +6,18 @@
|
|||||||
* Released under the terms and conditions of the
|
* Released under the terms and conditions of the
|
||||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||||
*
|
*
|
||||||
* Administration - DB Verify
|
* Administration - DB Verify Class
|
||||||
*
|
*
|
||||||
* $Source: /cvs_backup/e107_0.8/e107_admin/db_verify.php,v $
|
* $URL: /cvs_backup/e107_0.8/e107_admin/db_verify.php,v $
|
||||||
* $Revision$
|
* $Revision: 12255 $
|
||||||
* $Date$
|
* $Id: 2011-06-07 17:16:42 -0700 (Tue, 07 Jun 2011) $
|
||||||
* $Author$
|
* $Author: e107coders $
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
require_once("../class2.php");
|
|
||||||
|
|
||||||
if(varset($_POST['db_tools_back']))
|
if (!defined('e107_INIT')) { exit; }
|
||||||
{
|
|
||||||
header("Location:".e_ADMIN_ABS."db.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_'.e_PAGE);
|
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_db_verify.php');
|
||||||
|
|
||||||
$e_sub_cat = 'database';
|
|
||||||
|
|
||||||
require_once("auth.php");
|
|
||||||
|
|
||||||
|
|
||||||
if (!$sql_data)
|
|
||||||
{
|
|
||||||
// exit(DBLAN_1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!getperms("0"))
|
|
||||||
{
|
|
||||||
header("Location:".SITEURL."index.php");
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$dbv = new db_verify;
|
|
||||||
// print_a($dbv->tables);
|
|
||||||
|
|
||||||
require_once(e_ADMIN."footer.php");
|
|
||||||
exit;
|
|
||||||
|
|
||||||
class db_verify
|
class db_verify
|
||||||
{
|
{
|
||||||
@@ -83,7 +53,7 @@ class db_verify
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$emessage->add($filename.DBLAN_22, E_MESSAGE_WARNING);
|
$emessage->add($filename.DBVLAN_22, E_MESSAGE_WARNING);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -104,8 +74,8 @@ class db_verify
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$mes->add("Tables appear to be okay!",E_MESSAGE_SUCCESS);
|
$mes->add("Tables appear to be okay!",E_MESSAGE_SUCCESS); //TODO LAN
|
||||||
$text .= "<div class='buttons-bar center'>".$frm->admin_button('back', DBLAN_17, 'back')."</div>";
|
//$text .= "<div class='buttons-bar center'>".$frm->admin_button('back', DBVLAN_17, 'back')."</div>";
|
||||||
$ns->tablerender("Okay",$mes->render().$text);
|
$ns->tablerender("Okay",$mes->render().$text);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -155,11 +125,15 @@ class db_verify
|
|||||||
$fileIndexData = $this->getIndex($this->tables[$selection]['data'][$key]);
|
$fileIndexData = $this->getIndex($this->tables[$selection]['data'][$key]);
|
||||||
$sqlIndexData = $this->getIndex($sqlDataArr['data'][0]);
|
$sqlIndexData = $this->getIndex($sqlDataArr['data'][0]);
|
||||||
|
|
||||||
// $debugA = print_r($fileFieldData,TRUE); // Extracted Field Arrays
|
$debugA = print_r($fileFieldData,TRUE); // Extracted Field Arrays
|
||||||
// $debugB = print_r($sqlFieldData,TRUE); // Extracted Field Arrays
|
$debugA .= "<h2>Index</h2>";
|
||||||
|
$debugA .= print_r($fileIndexData,TRUE);
|
||||||
|
$debugB = print_r($sqlFieldData,TRUE); // Extracted Field Arrays
|
||||||
|
$debugB .= "<h2>Index</h2>";
|
||||||
|
$debugB .= print_r($sqlIndexData,TRUE);
|
||||||
|
|
||||||
$debugA = $this->tables[$selection]['data'][$key]; // Extracted Raw Field Text
|
// $debugA = $this->tables[$selection]['data'][$key]; // Extracted Raw Field Text
|
||||||
$debugB = $sqlDataArr['data'][0]; // Extracted Raw Field Text
|
// $debugB = $sqlDataArr['data'][0]; // Extracted Raw Field Text
|
||||||
|
|
||||||
if($debugA)
|
if($debugA)
|
||||||
{
|
{
|
||||||
@@ -266,9 +240,9 @@ class db_verify
|
|||||||
$mes = e107::getMessage();
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
$text = "
|
$text = "
|
||||||
<form method='post' action='".e_SELF."'>
|
<form method='post' action='".e_SELF."?".e_QUERY."'>
|
||||||
<fieldset id='core-db-verify-{$selection}'>
|
<fieldset id='core-db-verify-{$selection}'>
|
||||||
<legend id='core-db-verify-{$selection}-legend'>".DBLAN_16." - $what ".DBLAN_18."</legend>
|
<legend id='core-db-verify-{$selection}-legend'>".DBVLAN_16." - $what ".DBVLAN_18."</legend>
|
||||||
|
|
||||||
<table cellpadding='0' cellspacing='0' class='adminlist'>
|
<table cellpadding='0' cellspacing='0' class='adminlist'>
|
||||||
<colgroup span='4'>
|
<colgroup span='4'>
|
||||||
@@ -280,22 +254,22 @@ class db_verify
|
|||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>".DBLAN_4.": {$k}</th>
|
<th>".DBVLAN_4.": {$k}</th>
|
||||||
<th>".DBLAN_5."</th>
|
<th>".DBVLAN_5."</th>
|
||||||
<th class='center'>".DBLAN_6."</th>
|
<th class='center'>".DBVLAN_6."</th>
|
||||||
<th>".DBLAN_7."</th>
|
<th>".DBVLAN_7."</th>
|
||||||
<th class='center last'>".DBLAN_19."</th>
|
<th class='center last'>".DBVLAN_19."</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
";
|
";
|
||||||
|
|
||||||
$info = array(
|
$info = array(
|
||||||
'missing_table' => DBLAN_13,
|
'missing_table' => DBVLAN_13,
|
||||||
'mismatch' => DBLAN_8,
|
'mismatch' => DBVLAN_8,
|
||||||
'missing_field' => DBLAN_11,
|
'missing_field' => DBVLAN_11,
|
||||||
'ok' => ADMIN_TRUE_ICON,
|
'ok' => ADMIN_TRUE_ICON,
|
||||||
'missing_index' => DBLAN_25,
|
'missing_index' => DBVLAN_25,
|
||||||
);
|
);
|
||||||
|
|
||||||
$modes = array(
|
$modes = array(
|
||||||
@@ -383,9 +357,9 @@ class db_verify
|
|||||||
";
|
";
|
||||||
$text .= "
|
$text .= "
|
||||||
<div class='buttons-bar right'>
|
<div class='buttons-bar right'>
|
||||||
".$frm->admin_button('runfix', DBLAN_21, 'execute', '', array('id'=>false))."
|
".$frm->admin_button('runfix', DBVLAN_21, 'execute', '', array('id'=>false))."
|
||||||
".$frm->admin_button('check_all', 'jstarget:fix_active', 'action', LAN_CHECKALL, array('id'=>false))."
|
".$frm->admin_button('check_all', 'jstarget:fix', 'action', LAN_CHECKALL, array('id'=>false))."
|
||||||
".$frm->admin_button('uncheck_all', 'jstarget:fix_active', 'action', LAN_UNCHECKALL, array('id'=>false))."
|
".$frm->admin_button('uncheck_all', 'jstarget:fix', 'action', LAN_UNCHECKALL, array('id'=>false))."
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
@@ -393,7 +367,7 @@ class db_verify
|
|||||||
";
|
";
|
||||||
|
|
||||||
|
|
||||||
$ns->tablerender(DBLAN_23.' - '.DBLAN_16, $mes->render().$text);
|
$ns->tablerender(DBVLAN_23.' - '.DBVLAN_16, $mes->render().$text);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -431,11 +405,11 @@ class db_verify
|
|||||||
$text = "";
|
$text = "";
|
||||||
if($invalid)
|
if($invalid)
|
||||||
{
|
{
|
||||||
$text .= "<strong>".DBLAN_9."</strong>
|
$text .= "<strong>".DBVLAN_9."</strong>
|
||||||
<div class='indent'>".$invalid."</div>";
|
<div class='indent'>".$invalid."</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
$text .= "<strong>".DBLAN_10."</strong>
|
$text .= "<strong>".DBVLAN_10."</strong>
|
||||||
<div class='indent'>".$valid."</div>";
|
<div class='indent'>".$valid."</div>";
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
@@ -653,7 +627,8 @@ class db_verify
|
|||||||
|
|
||||||
function getIndex($data)
|
function getIndex($data)
|
||||||
{
|
{
|
||||||
$regex = "/(?:(PRIMARY|UNIQUE|FULLTEXT))?[\s]*?KEY (?: ?`?([\w]*)`?)[\s]* ?(?:\([\s]?`?([\w,]*[\s]?)`?\))?,?/i";
|
// $regex = "/(?:(PRIMARY|UNIQUE|FULLTEXT))?[\s]*?KEY (?: ?`?([\w]*)`?)[\s]* ?(?:\([\s]?`?([\w,]*[\s]?)`?\))?,?/i";
|
||||||
|
$regex = "/(?:(PRIMARY|UNIQUE|FULLTEXT))?[\s]*?KEY (?: ?`?([\w]*)`?)[\s]* ?(?:\([\s]?([\w,`]*[\s]?)`?\))?,?/i";
|
||||||
preg_match_all($regex,$data,$m);
|
preg_match_all($regex,$data,$m);
|
||||||
|
|
||||||
$ret = array();
|
$ret = array();
|
||||||
@@ -662,10 +637,11 @@ class db_verify
|
|||||||
|
|
||||||
foreach($m[3] as $k=>$val)
|
foreach($m[3] as $k=>$val)
|
||||||
{
|
{
|
||||||
|
$val = str_replace("`","",$val);
|
||||||
$ret[$val] = array(
|
$ret[$val] = array(
|
||||||
'type' => strtoupper($m[1][$k]),
|
'type' => strtoupper($m[1][$k]),
|
||||||
'keyname' => (vartrue($m[2][$k])) ? $m[2][$k] : $m[3][$k],
|
'keyname' => (vartrue($m[2][$k])) ? str_replace("`","",$m[2][$k]) : str_replace("`","",$m[3][$k]),
|
||||||
'field' => $m[3][$k]
|
'field' => str_replace("`","",$m[3][$k])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -738,14 +714,14 @@ class db_verify
|
|||||||
$text = "
|
$text = "
|
||||||
<form method='post' action='".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."' id='core-db-verify-sql-tables-form'>
|
<form method='post' action='".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."' id='core-db-verify-sql-tables-form'>
|
||||||
<fieldset id='core-db-verify-sql-tables'>
|
<fieldset id='core-db-verify-sql-tables'>
|
||||||
<legend>".DBLAN_14."</legend>
|
<legend>".DBVLAN_14."</legend>
|
||||||
<table cellpadding='0' cellspacing='0' class='adminlist'>
|
<table cellpadding='0' cellspacing='0' class='adminlist'>
|
||||||
<colgroup span='1'>
|
<colgroup span='1'>
|
||||||
<col style='width: 100%'></col>
|
<col style='width: 100%'></col>
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th class='last'>".$frm->checkbox_toggle('check-all-verify', 'table_').LAN_CHECKALL.' | '.LAN_UNCHECKALL."</th>
|
<th class='last'>".$frm->checkbox_toggle('check-all-verify', 'verify_table').LAN_CHECKALL.' | '.LAN_UNCHECKALL."</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -764,14 +740,14 @@ class db_verify
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class='buttons-bar center'>
|
<div class='buttons-bar center'>
|
||||||
".$frm->admin_button('db_verify', DBLAN_15)."
|
".$frm->admin_button('db_verify', DBVLAN_15)."
|
||||||
".$frm->admin_button('db_tools_back', DBLAN_17, 'back')."
|
".$frm->admin_button('db_tools_back', DBVLAN_17, 'back')."
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
";
|
";
|
||||||
|
|
||||||
$ns->tablerender(DBLAN_23.' - '.DBLAN_16, $mes->render().$text);
|
$ns->tablerender(DBVLAN_23.' - '.DBVLAN_16, $mes->render().$text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -798,7 +774,7 @@ function check_tables($what)
|
|||||||
$text = "
|
$text = "
|
||||||
<form method='post' action='".e_SELF."'>
|
<form method='post' action='".e_SELF."'>
|
||||||
<fieldset id='core-db-verify-{$what}'>
|
<fieldset id='core-db-verify-{$what}'>
|
||||||
<legend id='core-db-verify-{$what}-legend'>".DBLAN_16." - $what ".DBLAN_18."</legend>
|
<legend id='core-db-verify-{$what}-legend'>".DBVLAN_16." - $what ".DBVLAN_18."</legend>
|
||||||
";
|
";
|
||||||
foreach(array_keys($table_list) as $k)
|
foreach(array_keys($table_list) as $k)
|
||||||
{ // $k is the DB table name (less prefix)
|
{ // $k is the DB table name (less prefix)
|
||||||
@@ -814,11 +790,11 @@ function check_tables($what)
|
|||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>".DBLAN_4.": {$k}</th>
|
<th>".DBVLAN_4.": {$k}</th>
|
||||||
<th>".DBLAN_5."</th>
|
<th>".DBVLAN_5."</th>
|
||||||
<th class='center'>".DBLAN_6."</th>
|
<th class='center'>".DBVLAN_6."</th>
|
||||||
<th>".DBLAN_7."</th>
|
<th>".DBVLAN_7."</th>
|
||||||
<th class='center last'>".DBLAN_19."</th>
|
<th class='center last'>".DBVLAN_19."</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -954,11 +930,11 @@ function check_tables($what)
|
|||||||
if ($fld_err)
|
if ($fld_err)
|
||||||
{
|
{
|
||||||
$body_txt .= "
|
$body_txt .= "
|
||||||
<td class='center middle error'>".DBLAN_8."</td>
|
<td class='center middle error'>".DBVLAN_8."</td>
|
||||||
<td>
|
<td>
|
||||||
<strong>".DBLAN_9."</strong>
|
<strong>".DBVLAN_9."</strong>
|
||||||
<div class='indent'>{$xfparams}</div>
|
<div class='indent'>{$xfparams}</div>
|
||||||
<strong>".DBLAN_10."</strong>
|
<strong>".DBVLAN_10."</strong>
|
||||||
<div class='indent'>{$fparams}</div>
|
<div class='indent'>{$fparams}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class='center middle autocheck e-pointer'>".fix_form($k, $fname, $fparams, "alter")."</td>
|
<td class='center middle autocheck e-pointer'>".fix_form($k, $fname, $fparams, "alter")."</td>
|
||||||
@@ -970,11 +946,11 @@ function check_tables($what)
|
|||||||
elseif ($fieldnum != $xfieldnum)
|
elseif ($fieldnum != $xfieldnum)
|
||||||
{ // Field numbers different - missing field?
|
{ // Field numbers different - missing field?
|
||||||
$body_txt .= "
|
$body_txt .= "
|
||||||
<td class='center middle error'>".DBLAN_5." ".DBLAN_8."</td>
|
<td class='center middle error'>".DBVLAN_5." ".DBVLAN_8."</td>
|
||||||
<td>
|
<td>
|
||||||
<strong>".DBLAN_9.": </strong>#{$xfieldnum}
|
<strong>".DBVLAN_9.": </strong>#{$xfieldnum}
|
||||||
<br />
|
<br />
|
||||||
<strong>".DBLAN_10.": </strong>#{$fieldnum}
|
<strong>".DBVLAN_10.": </strong>#{$fieldnum}
|
||||||
</td>
|
</td>
|
||||||
<td class='center middle'> </td>
|
<td class='center middle'> </td>
|
||||||
|
|
||||||
@@ -999,9 +975,9 @@ function check_tables($what)
|
|||||||
{
|
{
|
||||||
$prev_fname = $fname; //FIXME - wrong $prev_fname!
|
$prev_fname = $fname; //FIXME - wrong $prev_fname!
|
||||||
$body_txt .= "
|
$body_txt .= "
|
||||||
<td class='center middle error'>".DBLAN_11."</td>
|
<td class='center middle error'>".DBVLAN_11."</td>
|
||||||
<td>
|
<td>
|
||||||
<strong>".DBLAN_10."</strong>
|
<strong>".DBVLAN_10."</strong>
|
||||||
<div class='indent'>{$fparams}</div>
|
<div class='indent'>{$fparams}</div>
|
||||||
</td>
|
</td>
|
||||||
<td class='center middle autocheck e-pointer'>".fix_form($k, $fname, $fparams, "insert", $prev_fname)."</td>
|
<td class='center middle autocheck e-pointer'>".fix_form($k, $fname, $fparams, "insert", $prev_fname)."</td>
|
||||||
@@ -1030,7 +1006,7 @@ function check_tables($what)
|
|||||||
<tr>
|
<tr>
|
||||||
<td>$k</td>
|
<td>$k</td>
|
||||||
<td>$tf</td>
|
<td>$tf</td>
|
||||||
<td class='center middle'>".DBLAN_12."</td>
|
<td class='center middle'>".DBVLAN_12."</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td class='center middle autocheck e-pointer'>".fix_form($k, $tf, $fparams, "drop")."</td>
|
<td class='center middle autocheck e-pointer'>".fix_form($k, $tf, $fparams, "drop")."</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -1046,7 +1022,7 @@ function check_tables($what)
|
|||||||
<tr>
|
<tr>
|
||||||
<td>{$k}</td>
|
<td>{$k}</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td class='center middle error'>".DBLAN_13."</td>
|
<td class='center middle error'>".DBVLAN_13."</td>
|
||||||
<td> </td>
|
<td> </td>
|
||||||
<td class='center middle autocheck e-pointer'>".fix_form($k, $tf, $tablines[$k], "create") . "</td>
|
<td class='center middle autocheck e-pointer'>".fix_form($k, $tf, $tablines[$k], "create") . "</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -1100,7 +1076,7 @@ function check_tables($what)
|
|||||||
{
|
{
|
||||||
$text .= "
|
$text .= "
|
||||||
<div class='buttons-bar right'>
|
<div class='buttons-bar right'>
|
||||||
".$frm->admin_button('do_fix', DBLAN_21, 'execute', '', array('id'=>false))."
|
".$frm->admin_button('do_fix', DBVLAN_21, 'execute', '', array('id'=>false))."
|
||||||
".$frm->admin_button('check_all', 'jstarget:fix_active', 'action', LAN_CHECKALL, array('id'=>false))."
|
".$frm->admin_button('check_all', 'jstarget:fix_active', 'action', LAN_CHECKALL, array('id'=>false))."
|
||||||
".$frm->admin_button('uncheck_all', 'jstarget:fix_active', 'action', LAN_UNCHECKALL, array('id'=>false))."
|
".$frm->admin_button('uncheck_all', 'jstarget:fix_active', 'action', LAN_UNCHECKALL, array('id'=>false))."
|
||||||
</div>
|
</div>
|
||||||
@@ -1120,7 +1096,7 @@ function check_tables($what)
|
|||||||
$text .= "
|
$text .= "
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<div class='buttons-bar center'>
|
<div class='buttons-bar center'>
|
||||||
".$frm->admin_button('back', DBLAN_17, 'back')."
|
".$frm->admin_button('back', DBVLAN_17, 'back')."
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
@@ -1135,7 +1111,7 @@ global $table_list;
|
|||||||
|
|
||||||
if(isset($_POST['do_fix']))
|
if(isset($_POST['do_fix']))
|
||||||
{
|
{
|
||||||
//$emessage->add(DBLAN_20);
|
//$emessage->add(DBVLAN_20);
|
||||||
foreach( $_POST['fix_active'] as $key=>$val)
|
foreach( $_POST['fix_active'] as $key=>$val)
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -1213,7 +1189,7 @@ if(isset($_POST['do_fix']))
|
|||||||
$text = "
|
$text = "
|
||||||
<form method='post' action='".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."' id='core-db-verify-sql-tables-form'>
|
<form method='post' action='".e_SELF.(e_QUERY ? '?'.e_QUERY : '')."' id='core-db-verify-sql-tables-form'>
|
||||||
<fieldset id='core-db-verify-sql-tables'>
|
<fieldset id='core-db-verify-sql-tables'>
|
||||||
<legend>".DBLAN_14."</legend>
|
<legend>".DBVLAN_14."</legend>
|
||||||
<table cellpadding='0' cellspacing='0' class='adminlist'>
|
<table cellpadding='0' cellspacing='0' class='adminlist'>
|
||||||
<colgroup span='1'>
|
<colgroup span='1'>
|
||||||
<col style='width: 100%'></col>
|
<col style='width: 100%'></col>
|
||||||
@@ -1240,14 +1216,14 @@ $text .= "
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class='buttons-bar center'>
|
<div class='buttons-bar center'>
|
||||||
".$frm->admin_button('db_verify', DBLAN_15)."
|
".$frm->admin_button('db_verify', DBVLAN_15)."
|
||||||
".$frm->admin_button('db_tools_back', DBLAN_17, 'back')."
|
".$frm->admin_button('db_tools_back', DBVLAN_17, 'back')."
|
||||||
</div>
|
</div>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
</form>
|
</form>
|
||||||
";
|
";
|
||||||
|
|
||||||
$e107->ns->tablerender(DBLAN_23.' - '.DBLAN_16, $emessage->render().$text);
|
$e107->ns->tablerender(DBVLAN_23.' - '.DBVLAN_16, $emessage->render().$text);
|
||||||
require_once(e_ADMIN."footer.php");
|
require_once(e_ADMIN."footer.php");
|
||||||
exit;
|
exit;
|
||||||
|
|
||||||
@@ -1343,29 +1319,6 @@ function table_list()
|
|||||||
return $tabs;
|
return $tabs;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
/**
|
|
||||||
* Handle page DOM within the page header
|
|
||||||
*
|
|
||||||
* @return string JS source
|
|
||||||
*/
|
|
||||||
function headerjs()
|
|
||||||
{
|
|
||||||
require_once (e_HANDLER.'js_helper.php');
|
|
||||||
$ret = "
|
|
||||||
<script type='text/javascript'>
|
|
||||||
if(typeof e107Admin == 'undefined') var e107Admin = {}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* OnLoad Init Control
|
|
||||||
*/
|
|
||||||
e107Admin.initRules = {
|
|
||||||
'Helper': true,
|
|
||||||
'AdminMenu': false
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
<script type='text/javascript' src='".e_FILE_ABS."jslib/core/admin.js'></script>
|
|
||||||
";
|
|
||||||
|
|
||||||
return $ret;
|
|
||||||
}
|
|
||||||
?>
|
?>
|
@@ -318,6 +318,7 @@ define("LAN_VISIBILITY", "Visibility");
|
|||||||
define("LAN_ICON", "Icon");
|
define("LAN_ICON", "Icon");
|
||||||
define("LAN_LOADING", "Loading...");
|
define("LAN_LOADING", "Loading...");
|
||||||
define("LAN_FILE", "File");
|
define("LAN_FILE", "File");
|
||||||
|
define("LAN_EXECUTE","Execute");
|
||||||
|
|
||||||
|
|
||||||
define("LAN_SECURITYL_0", "Looking for troubles (none)");
|
define("LAN_SECURITYL_0", "Looking for troubles (none)");
|
||||||
|
@@ -9,29 +9,32 @@
|
|||||||
| $Author$
|
| $Author$
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
define("DBLAN_1", "Unable to read the sql datafile<br /><br />Please ensure the file <b>core_sql.php</b> exists in the <b>/admin/sql</b> directory.");
|
define("DBVLAN_1", "Unable to read the sql datafile<br /><br />Please ensure the file <b>core_sql.php</b> exists in the <b>/admin/sql</b> directory.");
|
||||||
// define("DBLAN_2", "Verifying all");
|
// define("DBLAN_2", "Verifying all");
|
||||||
|
|
||||||
define("DBLAN_4", "Table");
|
define("DBVLAN_4", "Table");
|
||||||
define("DBLAN_5", "Field");
|
define("DBVLAN_5", "Field");
|
||||||
define("DBLAN_6", "Status");
|
define("DBVLAN_6", "Status");
|
||||||
define("DBLAN_7", "Notes");
|
define("DBVLAN_7", "Notes");
|
||||||
define("DBLAN_8", "Mismatch");
|
define("DBVLAN_8", "Mismatch");
|
||||||
define("DBLAN_9", "Currently");
|
define("DBVLAN_9", "Currently");
|
||||||
define("DBLAN_10", "should be");
|
define("DBVLAN_10", "should be");
|
||||||
define("DBLAN_11", "Field missing!");
|
define("DBVLAN_11", "Field missing!");
|
||||||
define("DBLAN_12", "Extra Field!");
|
define("DBVLAN_12", "Extra Field!");
|
||||||
define("DBLAN_13", "Table missing!");
|
define("DBVLAN_13", "Table missing!");
|
||||||
define("DBLAN_14", "Choose table(s) to validate");
|
define("DBVLAN_14", "Choose table(s) to validate");
|
||||||
define("DBLAN_15", "Start Verify");
|
define("DBVLAN_15", "Start Verify");
|
||||||
define("DBLAN_16", "SQL Verification");
|
define("DBVLAN_16", "SQL Verification");
|
||||||
define("DBLAN_17", "Back");
|
define("DBVLAN_17", "Back");
|
||||||
define("DBLAN_18", "tables");
|
define("DBVLAN_18", "tables");
|
||||||
define("DBLAN_19", "Attempt to Fix");
|
define("DBVLAN_19", "Attempt to Fix");
|
||||||
define("DBLAN_20", "Attempting to fix tables");
|
define("DBVLAN_20", "Attempting to fix tables");
|
||||||
define("DBLAN_21", "Fix Selected Items");
|
define("DBVLAN_21", "Fix Selected Items");
|
||||||
define("DBLAN_22", " is not readable");
|
define("DBVLAN_22", " is not readable");
|
||||||
define("DBLAN_23", "Database Utilities");
|
define("DBVLAN_23", "Database Utilities");
|
||||||
define("DBLAN_24", "Please select action.");
|
define("DBVLAN_24", "Please select action.");
|
||||||
define("DBLAN_25", "Index missing!");
|
define("DBVLAN_25", "Index missing!");
|
||||||
|
|
||||||
|
// IMPORTANT NOTE: DBLAN has been replaced by DBBLAN in this file since 0.7 due to conflicts with db.php
|
||||||
|
|
||||||
?>
|
?>
|
Reference in New Issue
Block a user