Example #1
0
 public static function setfld($fld, $type)
 {
     global $t;
     if (array_key_exists($fld, $_POST)) {
         if ($_POST[$fld] == "" && array_key_exists($fld, $t->sf[_PAGETAG_][$t->pgurl])) {
             unset($t->sf[_PAGETAG_][$t->pgurl][$fld]);
         } else {
             $s = skymo::stringOK($_POST[$fld], $type);
             if ($s) {
                 $t->sf[_PAGETAG_][$t->pgurl][$fld] = $_POST[$fld];
             }
         }
     }
 }
Example #2
0
 function __construct($sf, $url, $sec)
 {
     $this->sec = $sec;
     $this->sf = $sf;
     $this->pg = $sf[_PAGETAG_][$url];
     $this->st = $sf["site"];
     if (array_key_exists("json", $this->pg)) {
         $json = skymo::getJson(_JSONDIR_ . $this->pg["json"] . ".json");
         if (is_array($json)) {
             foreach ($json as $item => $val) {
                 $this->{$item} = array_reverse($val);
             }
         }
     }
 }
Example #3
0
 public function checkLogin($un, $pw)
 {
     $res = false;
     $j = skymo::getJson(_PASSWD_);
     if ($j) {
         if (array_key_exists("users", $j)) {
             $this->pwArr = $j["users"];
             if (array_key_exists($un, $this->pwArr)) {
                 $res = $this->pwVerify($pw, $this->pwArr[$un]["pw"]);
                 if (!$res) {
                     $this->errCode = 4;
                 }
             } else {
                 $this->errCode = 3;
             }
         } else {
             $this->errCode = 2;
         }
     } else {
         $this->errCode = 1;
     }
     return $res;
 }
Example #4
0
    ini_set('display_errors', 1);
}
if (is_array($j)) {
    if (array_key_exists(_PAGETAG_, $j)) {
        if (array_key_exists($queryPage, $q)) {
            $url = $q[$queryPage];
        }
        if ($url == "") {
            $url = "/";
        }
        if (array_key_exists($url, $j[_PAGETAG_])) {
            $sec = new userSecurity();
            if ($sec->viewPage($j[_PAGETAG_][$url])) {
                $t = new fTempl($j, $url, $sec);
                $t->q = $q;
                if (array_key_exists("scr", $j[_PAGETAG_][$url])) {
                    include _SCRDIR_ . $j[_PAGETAG_][$url]["scr"] . ".php";
                }
                $t->show();
            } else {
                skymo::http403();
            }
        } else {
            skymo::http404();
        }
    } elseif (_DEBUG_) {
        trigger_error("Page element not found in site file");
    }
} elseif (_DEBUG_) {
    trigger_error("Error in Site file");
}