Esempio n. 1
0
File: db.php Progetto: notzen/e107
 function __construct()
 {
     global $mySQLdefaultdb;
     $this->_options = array("db_update" => array('diz' => DBLAN_15, 'label' => DBLAN_16), "verify_sql" => array('diz' => DBLAN_4, 'label' => DBLAN_5), 'optimize_sql' => array('diz' => DBLAN_6, 'label' => DBLAN_7), 'plugin_scan' => array('diz' => DBLAN_28, 'label' => DBLAN_29), 'pref_editor' => array('diz' => DBLAN_19, 'label' => DBLAN_20), 'verify_sql_record' => array('diz' => DBLAN_35, 'label' => DBLAN_36), 'importForm' => array('diz' => DBLAN_59, 'label' => DBLAN_59), 'exportForm' => array('diz' => DBLAN_58, 'label' => DBLAN_58), 'sc_override_scan' => array('diz' => DBLAN_55, 'label' => DBLAN_56), 'convert_to_utf8' => array('diz' => 'Convert Database to UTF-8', 'label' => 'Convert DB to UTF-8'), 'correct_perms' => array('diz' => 'Correct File and Directory perms', 'label' => 'Correct Perms'));
     if (isset($_POST['delplug'])) {
         $this->delete_plugin_entry($_POST['pref_type']);
     }
     if (isset($_POST['upload'])) {
         $this->importXmlFile();
     }
     if (isset($_POST['delpref']) || isset($_POST['delpref_checked']) && isset($_POST['delpref2'])) {
         $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();
         $dbv->backUrl = e_SELF . "?mode=verify_sql";
         $dbv->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'])) {
         //$this->verify_sql_record(); // - currently performed in db_verify_class.php
     }
     if (isset($_POST['importForm']) || $_GET['mode'] == 'importForm') {
         $this->importForm();
     }
     if (isset($_POST['convert_to_utf8']) || $_GET['mode'] == 'convert_to_utf8') {
         $this->convertUTF8Form();
     }
     if (isset($_POST['exportForm']) || $_GET['mode'] == 'exportForm') {
         $this->exportXmlForm();
     }
     if (isset($_POST['optimize_sql']) || $_GET['mode'] == 'optimize_sql') {
         $this->optimizesql($mySQLdefaultdb);
     }
     if (isset($_POST['pref_editor']) || $_GET['mode'] == 'pref_editor' || isset($_POST['delpref']) || isset($_POST['delpref_checked'])) {
         $type = isset($_GET['type']) ? $_GET['type'] : "core";
         $this->pref_editor($type);
     }
     if (isset($_POST['sc_override_scan']) || $_GET['mode'] == 'sc_override_scan') {
         $this->scan_override();
     }
     if (isset($_POST['plugin_scan']) || e_QUERY == "plugin" || isset($_POST['delplug']) || $_GET['mode'] == 'plugin_scan') {
         $this->plugin_viewscan();
     }
     if (vartrue($_POST['perform_utf8_convert'])) {
         $this->perform_utf8_convert();
         return;
     }
     if (varset($_GET['mode']) == 'correct_perms') {
         $this->correct_perms();
         return;
     }
     if (!vartrue($_GET['mode']) && !isset($_POST['db_execute'])) {
         $this->render_options();
     }
 }
Esempio n. 2
0
 function __construct()
 {
     global $mySQLdefaultdb;
     $this->_utf8_exclude = array(MPREFIX . "core");
     $this->_options = array("db_update" => array('diz' => DBLAN_15, 'label' => DBLAN_16), "verify_sql" => array('diz' => DBLAN_4, 'label' => DBLAN_5), 'optimize_sql' => array('diz' => DBLAN_6, 'label' => DBLAN_7), 'plugin_scan' => array('diz' => DBLAN_28, 'label' => DBLAN_29), 'pref_editor' => array('diz' => DBLAN_19, 'label' => DBLAN_20), 'importForm' => array('diz' => DBLAN_59, 'label' => DBLAN_59), 'exportForm' => array('diz' => DBLAN_58, 'label' => DBLAN_58), 'sc_override_scan' => array('diz' => DBLAN_55, 'label' => DBLAN_56), 'convert_to_utf8' => array('diz' => DBLAN_64, 'label' => DBLAN_65), 'correct_perms' => array('diz' => DBLAN_66, 'label' => DBLAN_67), 'backup' => array('diz' => DBLAN_68, 'label' => DBLAN_69));
     if (deftrue('e_DEVELOPER')) {
         $this->_options['multisite'] = array('diz' => "<span class='label label-warning'>Developer Mode Only</span>", 'label' => 'Multi-Site');
         $this->_options['github'] = array('diz' => "<span class='label label-warning'>Developer Mode Only</span> Overwrite local files with the latest from github.", 'label' => 'Sync with Github');
     }
     $this->_options = multiarray_sort($this->_options, 'label');
     if (isset($_POST['delplug'])) {
         $this->delete_plugin_entry($_POST['pref_type']);
     }
     if (isset($_POST['upload'])) {
         $this->importXmlFile();
     }
     if (isset($_POST['delpref']) || isset($_POST['delpref_checked']) && isset($_POST['delpref2'])) {
         $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();
         $dbv->backUrl = e_SELF . "?mode=verify_sql";
         $dbv->verify();
         return;
     }
     // ----------------- Processes ------------------
     //	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_class.php
     //	}
     if (isset($_POST['importForm']) || $_GET['mode'] == 'importForm') {
         $this->importForm();
     }
     if (isset($_POST['db_update']) || varset($_GET['mode']) == 'db_update') {
         //	header("location: ".e_ADMIN."e107_update.php");
         require_once e_ADMIN . "update_routines.php";
         new e107Update($dbupdate);
         return;
     }
     if (isset($_POST['convert_to_utf8']) || $_GET['mode'] == 'convert_to_utf8') {
         $this->convertUTF8Form();
     }
     if (isset($_POST['exportForm']) || $_GET['mode'] == 'exportForm') {
         $this->exportXmlForm();
     }
     if (isset($_POST['optimize_sql']) || $_GET['mode'] == 'optimize_sql') {
         $this->optimizesql($mySQLdefaultdb);
     }
     if (isset($_POST['pref_editor']) || $_GET['mode'] == 'pref_editor' || isset($_POST['delpref']) || isset($_POST['delpref_checked'])) {
         $type = isset($_GET['type']) ? $_GET['type'] : "core";
         $this->pref_editor($type);
     }
     if (isset($_POST['sc_override_scan']) || $_GET['mode'] == 'sc_override_scan') {
         $this->scan_override();
     }
     if (isset($_POST['plugin_scan']) || e_QUERY == "plugin" || isset($_POST['delplug']) || $_GET['mode'] == 'plugin_scan') {
         $this->plugin_viewscan('refresh');
     }
     if (!empty($_POST['create_multisite'])) {
         $this->multiSiteProcess();
     }
     if (!empty($_POST['perform_utf8_convert'])) {
         $this->perform_utf8_convert();
         return;
     }
     if (!empty($_POST['githubSyncProcess'])) {
         $this->githubSyncProcess();
         return;
     }
     // --------------------- Modes --------------------------------.
     if (varset($_GET['mode']) == 'correct_perms') {
         $this->correct_perms();
         return;
     }
     if (varset($_GET['mode']) == 'multisite') {
         $this->multiSite();
         return;
     }
     if (varset($_GET['mode']) == 'github') {
         $this->githubSync();
     }
     if (varset($_GET['mode']) == 'backup') {
         $this->backup();
         return;
     }
     if (!vartrue($_GET['mode']) && !isset($_POST['db_execute'])) {
         $this->render_options();
     }
 }