Example #1
0
 public static function prepare()
 {
     if (FajrConfig::get('URL.Path')) {
         $_get = array_merge(FajrRouter::pathToParams(FajrUtils::pathInfo()), $_GET);
     } else {
         $_get = $_GET;
     }
     $_post = $_POST;
     // podla pola definujeceho vstupne parametre overim ich platnost
     foreach (self::$allowedParamters as $input => $params) {
         foreach ($params as $name => $type) {
             if (isset(${$input}[$name])) {
                 $checker = self::$conditions[$type]['cond'];
                 if (!Validator::$checker(${$input}[$name], self::$conditions[$type]['options'])) {
                     throw new Exception(str_replace('%%NAME%%', $name, self::$conditions[$type]['message']));
                 }
                 self::$inputParameters[$name] = ${$input}[$name];
                 self::${$input}[$name] = ${$input}[$name];
             }
         }
     }
     // specialne vynimky
     if (isset($_get['logout'])) {
         self::$inputParameters['logout'] = true;
         //self::$_GET['logout'] = true; FIXME: Majak, co tu robilo toto?
         //Pravdepodobne to chceme umazat.
     }
     // budeme pouzivat uz len Input
     unset($_GET);
     unset($_POST);
 }