Esempio n. 1
0
 /**
  * Stuff to setup specific to Ajax upgrading - executes after upgrade has been established
  *
  */
 protected function init($script)
 {
     define('SUPPRESS_KEEPALIVE_ECHO', true);
     parent::init();
     $this->process_options();
     if ($this->setuptype == 'install') {
         $this->startup_errors[] = $this->phrase['install']['cli_install_not_supported'];
     }
     if ($this->startup_errors or $this->startup_file_errors) {
         $this->echo_phrase("\r\n");
         if ($this->startup_file_errors) {
             foreach ($this->startup_file_errors as $error) {
                 $errorstring = $this->convert_phrase("{$error}\r\n");
             }
             $response = $this->prompt(sprintf($this->phrase['core']['suspect_files_detected_cli'], $errorstring), array('y', 'n', 'Y', 'N'));
             if (strtolower($response) == 'n') {
                 die;
             }
         } else {
             foreach ($this->startup_errors as $error) {
                 $this->echo_phrase($this->convert_phrase("{$error}\r\n"));
             }
             die;
         }
     }
     // Where does this upgrade need to begin?
     if ($script) {
         $this->scriptinfo['version'] = $script;
     } else {
         $this->scriptinfo = $this->get_upgrade_start();
     }
     $this->process_script($this->scriptinfo['version'], $script);
 }
Esempio n. 2
0
 /**
  * Stuff to setup specific to Ajax upgrading - executes after upgrade has been established
  *
  */
 protected function init()
 {
     parent::init();
     $this->registry->input->clean_array_gpc('p', array('ajax' => TYPE_BOOL, 'jsfail' => TYPE_BOOL));
     if ($this->registry->GPC['jsfail']) {
         $this->startup_errors[] = $this->phrase['core']['javascript_disabled'];
     }
     $this->htmloptions['finalversion'] = end($this->versions);
     $this->htmloptions['setuptype'] = sprintf($this->phrase['core']['vb_' . $this->setuptype . '_system'], $this->htmloptions['finalversion']);
     $this->htmloptions['setuptypetitle'] = sprintf($this->phrase['core']['vb_' . $this->setuptype . '_system_title'], $this->htmloptions['finalversion']);
     $this->htmloptions['enter_system'] = $this->phrase['authenticate']['enter_' . $this->setuptype . '_system'];
     if ($this->registry->GPC['ajax']) {
         $this->registry->input->clean_array_gpc('p', array('step' => TYPE_UINT, 'startat' => TYPE_UINT, 'version' => TYPE_NOHTML, 'response' => TYPE_NOHTML, 'checktable' => TYPE_BOOL, 'status' => TYPE_BOOL, 'firstrun' => TYPE_BOOL, 'only' => TYPE_BOOL, 'htmlsubmit' => TYPE_BOOL, 'htmldata' => TYPE_ARRAY, 'options' => TYPE_ARRAY));
         $this->registry->GPC['response'] = convert_urlencoded_unicode($this->registry->GPC['response']);
         $this->registry->GPC['htmldata'] = convert_urlencoded_unicode($this->registry->GPC['htmldata']);
         if ($this->registry->GPC['status']) {
             $this->fetch_query_status();
         }
         $this->scriptinfo = array('version' => $this->fetch_short_version($this->registry->GPC['version']), 'startat' => $this->registry->GPC['startat'], 'step' => $this->registry->GPC['step'], 'only' => $this->registry->GPC['only']);
         $script = $this->load_script($this->scriptinfo['version']);
         $this->process_step($this->registry->GPC['version'], $this->registry->GPC['step'], $this->registry->GPC['startat'], $this->registry->GPC['checktable'], $this->registry->GPC_exists['response'] ? $this->registry->GPC['response'] : null, $this->registry->GPC['firstrun'], $this->registry->GPC['only'], $this->registry->GPC['htmlsubmit'], $this->registry->GPC['htmldata'], $this->registry->GPC['options']);
     } else {
         $this->registry->input->clean_array_gpc('r', array('version' => TYPE_NOHTML, 'startat' => TYPE_UINT, 'step' => TYPE_UINT, 'only' => TYPE_BOOL));
         $proceed = true;
         if ($proceed) {
             if ($this->registry->GPC['version'] and $this->versions[$this->registry->GPC['version']]) {
                 $this->scriptinfo = array('version' => $this->registry->GPC['version'], 'startat' => $this->registry->GPC['startat'], 'step' => $this->registry->GPC['step']);
             }
             $this->begin_upgrade($this->scriptinfo['version'], $this->registry->GPC['only']);
         }
         $this->print_html();
         // Begin processing
         if ($this->htmloptions['processlog']) {
         }
     }
 }