Example #1
0
 public function action_force_reload()
 {
     $licen = Licen::reinstance();
     $_data = array('key_found' => $licen->hasDataKey('DATA', 'key'));
     if ($licen->hasDataKey('DATA', 'key')) {
         $_data = array('key_found' => true, 'reloaded' => $licen->valRemote($licen->getDataKey('DATA', 'key')));
     } else {
         $_data = array('key_found' => false, 'reloaded' => false);
     }
     $data = array_merge($_data, $this->_generateLicenseStateData());
     return json_encode($data);
 }
Example #2
0
 protected function step_4()
 {
     $license = \Input::post('licenseKey');
     $action = \Input::post('action');
     $postFile = \Input::post('licensePost');
     if (!$this->_isLicenseValid($license) || !in_array($action, array('step4'))) {
         return $this->_goToStep1();
     }
     $decoded = base64_decode($postFile);
     $fileLicen = Licen::parse($decoded);
     $key = $fileLicen->getKey();
     if ($key != $license || !$fileLicen->isLicenseOk()) {
         // Wrong or invalid license was uploaded, ask for new license upload.
         return $this->step_2();
     }
     $finalData = $this->evaluateFinalErrors();
     if (count($finalData) > 0) {
         return $this->step_3();
     }
     // Write license file to disk
     file_put_contents(APPPATH . 'license/license.txt', $decoded);
     Licen::reinstance();
     // Finaly Preform Install
     $data = $this->getStep4PostData();
     return $this->_install($data);
 }