예제 #1
0
 public function check_authentification()
 {
     // begin authenticate part
     if (AUTH_TYPE == 1) {
         if (!$AUTHENTICATE) {
             header("WWW-Authenticate: Basic realm=\"ADMIN " . CONF_SITE_NAME . "\"");
             header("HTTP/1.0 401 Unauthorized");
             $ft = new FastTemplate(ADMIN_TEMPLATE_CONTENT_PATH);
             $ft->define(array("main" => "template_firstpage.html", "content" => "authentication_failed.html"));
             $ft->multiple_assign_define("LANG_");
             $ft->multiple_assign_define("CONF_");
             $ft->parse("BODY", array("content", "main"));
             $ft->showDebugInfo(ERROR_DEBUG);
             $ft->FastPrint();
             exit;
         }
     } else {
         if (AUTH_TYPE == 2) {
             include_once INCLUDE_PATH . 'cls_session.php';
             $sess = new MYSession();
             if (!$sess->get(SESSION_ID)) {
                 $sess->set('session_url_before', $_SERVER['REQUEST_URI']);
                 header("Location: login.php");
                 exit;
             }
         }
     }
     // end authenticate part
 }
예제 #2
0
    $tokenr = sizeof($tokexample);
    $example = "";
    for ($i = 0; $i < $tokenr - 1; $i++) {
        if (!empty($example)) {
            $example .= ";";
        }
        $example .= ucwords($tokexample[$i]);
    }
    $ft->assign("EXAMPLE", $example);
} else {
    $xmlfilename = $all_url_vars['xmlfile'];
    if (!empty($xmlfilename)) {
        $xml = new Xml();
        $xml->setXMLFile(INDEX_PATH . "/schema/" . $xmlfilename);
        $xmlarray = $xml->loadArray();
        $session->set('XMLDATA', $xmlarray);
        $fields = "";
        $example = "";
        foreach ($xmlarray['data'] as $item) {
            if (!empty($fields)) {
                $fields .= ";";
            }
            $fields .= $item['function'];
            if (!empty($example)) {
                $example .= ";";
            }
            $example .= $item['function'];
        }
        //		print_r($xmlarray);exit;
        $ft->assign("DEV_NAME", $xmlarray['developername']);
        $ft->assign("PROJECT_NAME", $xmlarray['projectname']);
예제 #3
0
$sess = new MYSession();
include_once INCLUDE_PATH . "cls_fast_template.php";
include_once INCLUDE_LANGUAGE_PATH . $LANG . ".inc.php";
include_once INCLUDE_LANGUAGE_PATH . $LANG . ".admintool.inc.php";
include_once INCLUDE_PATH . "connection.php";
$stringutil = new String("nope");
$all_url_vars = array();
$all_url_vars = $stringutil->parse_all();
//$util=new Authenticate();
//$util->check_authentification();
if (empty($all_url_vars['action'])) {
    // unset session
    $url = $sess->get('session_url_before');
    session_destroy();
    //$sess = new MYSession();
    $sess->set('session_url_before', $url);
    $ft = new FastTemplate(ADMIN_TEMPLATE_CONTENT_PATH);
    $ft->define(array("main" => "template_firstpage.html", "content" => "login.html"));
    $ft->assign("MESSAGE", $all_url_vars['message']);
    $ft->multiple_assign_define("LANG_");
    $ft->multiple_assign_define("CONF_");
    $ft->parse("BODY", array("content", "main"));
    $ft->showDebugInfo(ERROR_DEBUG);
    $ft->FastPrint();
} else {
    if ($all_url_vars['userid'] == USER && $all_url_vars['password'] == PASSWORD) {
        $sess->set(SESSION_ID, SESSION_ID);
        if ($sess->get('session_url_before')) {
            header("Location: " . $sess->get('session_url_before'));
        } else {
            header("Location: " . CONF_ADMIN_URL);
예제 #4
0
if (empty($fields)) {
    echo "Error on fields";
    exit;
}
$ft = new FastTemplate(TEMPLATE_PATH);
$fthtml = new FastTemplate(TEMPLATE_PATH);
if ($action == "continue_selection") {
    if (empty($items)) {
        echo "Error on items";
        exit;
    }
    $ft->define(array("main" => "template_body.html", "content" => "html2.html"));
    $ft->define_dynamic("dbitem", "content");
    $ft->define_dynamic("dbactivelisting", "content");
    // set to session which will be listed
    $session->set("listing", $all_url_vars['listing']);
    // set to session which will be required from checkbox
    $session->set("required", $all_url_vars['required']);
    // set to session which values will be the require IF is set
    $session->set("requiredset", $all_url_vars['requiredset']);
} elseif ($action == "generate_html") {
    $items = $session->get("items");
    if (empty($items)) {
        echo "Error on items";
        exit;
    }
    $ft->define(array("main" => "template_body.html", "content" => "html3.html"));
    $fthtml->define(array("main" => "t_html_generator.html", "content" => "t_html_generator.html", "main_user" => "t_html_user_generator.html"));
    $fthtml->define_dynamic("dateelements", "main");
    $fthtml->define_dynamic("formelements", "main");
} else {
예제 #5
0
    if (substr($name, $remain) === "_en") {
        $name = substr($name, 0, $remain) . '_' . $replacement_lang;
        return $name;
    } else {
        return $name;
    }
}
$session = new MYSession();
$stringutil = new String();
$all_url_vars = $stringutil->parse_all();
// basic values
if (!isset($all_url_vars['type'])) {
    $all_url_vars['type'] = "php";
}
//print  $all_url_vars['genfromsql'];
$session->set("name", $all_url_vars['name']);
// classname not specified
if (!isset($all_url_vars['classname'])) {
    if ($all_url_vars['type'] == "php" or $all_url_vars['type'] == "php5") {
        $all_url_vars['classname'] = "cls_" . strtolower($all_url_vars['name']) . ".php";
    } else {
        $all_url_vars['classname'] = $all_url_vars['name'] . ".java";
    }
} else {
    $namen = explode(".", $all_url_vars['classname']);
    if ($all_url_vars['type'] == "php" or $all_url_vars['type'] == "php5") {
        $all_url_vars['classname'] = $namen[0] . ".php";
    } else {
        $all_url_vars['classname'] = $namen[0] . ".java";
    }
}