Example #1
0
            /*if($user_id==1)
            {
            header("Location:adminsettings_panel.php");
            }*/
            return $user_id;
        } else {
            $http_path = $common->http_path;
            header("Location:{$http_path}/index.php");
            exit;
        }
    }
}
$obj = new Session();
//include_once("../lang/eng.php");
if ($fSubmit == "submit") {
    $user_id = $obj->verify_Login($db_object, $common, $fLogin, $fPassword);
} else {
    $hash = $_COOKIE["Pmsuser"];
    $user_id = $common->check_session_super($hash, $db_object);
    //echo "user_id=$user_id<br>";
    if ($user_id == 0) {
        $http_path = $common->http_path;
        header("Location:{$http_path}/index.php");
        exit;
    }
    //--------- generated cookie is read for verification of dashboard change
    $user_table = $common->prefix_table("user_table");
    $viewasadmin = $_COOKIE["viewasadmin"];
    $selqry = "select admin_id from {$user_table} where user_id='{$viewasadmin}'";
    $temp_user_id = $db_object->get_a_line($selqry);
    if ($viewasadmin != "" && $temp_user_id["admin_id"] == $user_id || $viewasadmin != "" && $user_id == 1) {