Esempio n. 1
0
 public function __construct()
 {
     if (!SessionService::getInstance()->get('modelName')) {
         URLService::redirect(\GLOBALVAR\ROOT);
     }
     parent::__construct($this);
 }
Esempio n. 2
0
 public function action_main()
 {
     $path = \GLOBALVAR\USERDEPO_PATH . "/" . SessionService::getInstance()->get('userName') . "/" . SessionService::getInstance()->get('modelName');
     $conf = new GlobalConf();
     $conf->initFromFile($path . ConfFile::$configFile['global']);
     $conf->initGlobal();
     SessionService::getInstance()->set('meshGen', $conf->meshGen);
     SessionService::getInstance()->set('dimension', $conf->dimension);
     $dd = new DDadaptConf();
     $dd->initFromFile($path . ConfFile::$configFile['ddCoarse']);
     $dd->initDDadapt();
     if ($this->requestService->isPost) {
         if (SessionService::getInstance()->get('dimension') == 1 && SessionService::getInstance()->get('meshGen') == 1) {
             URLService::redirect(\GLOBALVAR\ROOT . "/?core=mesh1d");
         } else {
             if (SessionService::getInstance()->get('dimension') == 2 && SessionService::getInstance()->get('meshGen') == 1) {
                 URLService::redirect(\GLOBALVAR\ROOT . "/?core=mesh2d");
             } else {
                 if (SessionService::getInstance()->get('dimension') == 2 && SessionService::getInstance()->get('meshGen') == 2) {
                     URLService::redirect(\GLOBALVAR\ROOT . "/?core=meshGen");
                 } else {
                     URLService::redirect(\GLOBALVAR\ROOT . "/?core=waterConf");
                 }
             }
         }
     }
     return ["conf" => $conf, "ddConf" => $dd];
 }
Esempio n. 3
0
 public function __construct()
 {
     if (!SessionService::getInstance()->get('modelName')) {
         URLService::redirect(\GLOBALVAR\ROOT . "?core=models");
     }
     $this->dir = \GLOBALVAR\USERDEPO_PATH . "/" . SessionService::getInstance()->get('userName') . "/" . SessionService::getInstance()->get('modelName');
     parent::__construct($this);
 }
Esempio n. 4
0
 public function action_main()
 {
     $path = \GLOBALVAR\USERDEPO_PATH . "/" . SessionService::getInstance()->get('userName') . "/" . SessionService::getInstance()->get('modelName');
     $water = new WaterConf();
     $water->initFromFile($path . ConfFile::$configFile['water']);
     $water->initWater();
     if ($this->requestService->isPost) {
         URLService::redirect(\GLOBALVAR\ROOT . "/?core=result");
     }
     return ["conf" => $water, "dim_problem" => SessionService::getInstance()->get('dimension')];
 }
Esempio n. 5
0
 public function action_main()
 {
     $path = \GLOBALVAR\USERDEPO_PATH . "/" . SessionService::getInstance()->get('userName') . "/" . SessionService::getInstance()->get('modelName');
     $mesh2d = new Mesh2D();
     $mesh2d->initFromFile($path . ConfFile::$configFile['mesh2d']);
     $mesh2d->initMesh2D();
     if ($this->requestService->isPost) {
         URLService::redirect(\GLOBALVAR\ROOT . "/?core=waterConf");
     }
     return ["mesh2d" => $mesh2d];
 }
Esempio n. 6
0
 public function action_setModel()
 {
     $domain = SessionService::getInstance()->get('userName');
     if (modelsData::modelExists($domain, $this->request['model'])) {
         $this->delParamSession();
         SessionService::getInstance()->set('modelName', $this->request['model']);
         $this->msg = 'The model selected.';
     } else {
         $this->msg = 'The model does not exist.';
     }
     URLService::redirect(\GLOBALVAR\ROOT . "/?core=globalConf");
     return ['activeModel' => SessionService::getInstance()->get('modelName')];
 }
Esempio n. 7
0
 private static function startUp()
 {
     // platnost session 24min
     session_cache_expire(24);
     session_start();
     // zmena session id pri kazdem zavolani tridy. ochrana session
     session_regenerate_id(false);
     if (empty($_SESSION)) {
         self::load();
     }
     if ($_SESSION['userIsLogged']) {
         // kontrola zda se jedna o stejneho klienta, ktery se prihlasil( SESSION SECURITY )
         if ($_SESSION['fingerPrint'] != md5($_SERVER['HTTP_USER_AGENT'] . self::$SALT . $_SERVER['REMOTE_ADDR'])) {
             URLService::redirect();
             exit;
         }
     }
 }
Esempio n. 8
0
 public function __construct()
 {
     if (isset($_GET['core'])) {
         if (file_exists(\GLOBALVAR\CONTROLLERS_PATH . '/' . $_GET['core'] . 'Control.php')) {
             require_once \GLOBALVAR\CONTROLLERS_PATH . '/' . $_GET['core'] . 'Control.php';
             $class = $_GET['core'] . "Control";
             $this->control = new $class();
             $this->view = $this->control->getViewer();
             //  Detect An Ajax Request
             if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
                 echo json_encode($this->control->getResponse());
                 exit;
             }
         } else {
             URLService::getError('Controller not exist. CLASS: ' . __CLASS__);
         }
     } else {
         URLService::redirect(\GLOBALVAR\ROOT . '/?core=account');
     }
 }
Esempio n. 9
0
 public function __construct()
 {
     parent::__construct($this);
     if (!SessionService::getInstance()->get('modelName')) {
         URLService::redirect(\GLOBALVAR\ROOT . "?core=models");
     }
     //$this->formParametrs($this->type);
     if (!in_array($this->type, $this->corectType)) {
         $this->type = 'mesh';
     }
     $this->setConfPatch();
     $this->data = ParametersData::readConfData($this->dir, $this->file);
     if (!empty($this->data)) {
         $this->setAmount();
         $this->fce = $this->getConfigValue();
     } else {
         $this->msg = "Parameters are not confirmed!";
     }
     $this->conf_mesh = SessionService::getInstance()->get('config_mesh');
     $this->conf_water = SessionService::getInstance()->get('config_water');
     $this->conf_global = SessionService::getInstance()->get('config_global');
 }
Esempio n. 10
0
 public function render_ExceptionPage($e = '')
 {
     $this->exception = $e;
     if (\GLOBALVAR\DEV_ENVIROMENT) {
         require_once \GLOBALVAR\LIB_PATH . '/temp/exception/page.php';
         exit;
     } else {
         URLService::redirect(\GLOBALVAR\ROOT . "/?core=" . $this->core);
     }
 }
Esempio n. 11
0
 public function action_logOut()
 {
     SessionService::getInstance()->destroy();
     URLService::redirect();
 }