Ejemplo n.º 1
0
function print_index()
{
    global $gbl, $sgbl, $ghtml, $login;
    ob_start();
    print_time('index');
    $cgi_clientname = $ghtml->frm_clientname;
    Htmllib::checkForScript($cgi_clientname);
    $cgi_class = $ghtml->frm_class;
    if (!$cgi_class) {
        $cgi_class = getClassFromName($cgi_clientname);
    }
    $cgi_password = $ghtml->frm_password;
    $cgi_forgotpwd = $ghtml->frm_forgotpwd;
    $cgi_email = $ghtml->frm_email;
    $cgi_key = $ghtml->frm_login_key;
    if (!$cgi_password || !$cgi_clientname) {
        $ghtml->print_redirect("/login/?frm_emessage=login_error");
    }
    $cgi_classname = 'client';
    if ($cgi_class) {
        $cgi_classname = $cgi_class;
    }
    if ($cgi_clientname == "" || $cgi_password == "" && $cgi_key == "") {
        $cgi_forgotpwd = $ghtml->frm_forgotpwd;
        return;
    }
    $ip = $_SERVER['REMOTE_ADDR'];
    if (!check_login_success($cgi_classname, $cgi_clientname, $cgi_password, $cgi_key)) {
        return;
    }
    log_log("login_success", "Successful Login to {$cgi_clientname} from " . $_SERVER['REMOTE_ADDR']);
    /*
    	try {
    		$att = $gbl->g->getFromList("loginattempt", $ip);
    		$att->delete();
    } catch (Exception $e) {
    }
    */
    if (check_disable_admin($cgi_clientname)) {
        $ghtml->print_redirect("/login/?frm_emessage=login_error");
        exit;
    }
    if (get_login($cgi_classname, $cgi_clientname)) {
        do_login($cgi_classname, $cgi_clientname);
        $login->was();
        check_blocked_ip();
        $ghtml->print_redirect("/");
    } else {
        $ghtml->cgiset("frm_emessage", "login_error");
    }
    $cgi_forgotpwd = $ghtml->frm_forgotpwd;
}
Ejemplo n.º 2
0
            <div class="clr"></div>
        </div>
    </div>
    <div id="break"></div>

<?php 
} elseif ($cgi_forgotpwd == 2) {
    $progname = $sgbl->__var_program_name;
    $cprogname = ucfirst($progname);
    $cgi_clientname = $ghtml->frm_clientname;
    $cgi_email = $ghtml->frm_email;
    htmllib::checkForScript($cgi_clientname);
    $classname = $ghtml->frm_class;
    if (!$classname) {
        $classname = getClassFromName($cgi_clientname);
    }
    if (!empty($cgi_clientname) && !empty($cgi_email)) {
        $tablename = $classname;
        $database = new Sqlite(null, $tablename);
        $data = $database->rawQuery("select contactemail from {$tablename} where nname = '{$cgi_clientname}';");
        if (empty($data)) {
            $ghtml->print_redirect("/login/?frm_emessage=nouser_email");
            //throw lxException('Contact email is not set on Kloxo, it could not be send to a empty address.');
        } elseif (!isset($data[0]['contactemail'])) {
            $ghtml->print_redirect("/login/?frm_emessage=nouser_email");
            //throw lxException('Contact email is not set on Kloxo, it could not be send to a empty address.');
        } else {
            $contact_email = $data[0]['contactemail'];
            if (empty($contact_email)) {
                //throw lxException('Contact email is not set on Kloxo, it could not be send to a empty address.');