예제 #1
0
                 banned();
             }
         }
     }
     if ($security_settings["ip_check_server"]) {
         $hostnames = @file_get_contents($security_settings["ip_check_server"] . getIP());
         $hostnames = json_decode($hostnames);
         if ($hostnames && property_exists($hostnames, "status") && $hostnames->status == 200) {
             if (property_exists($hostnames, 'suggestion') && $hostnames->suggestion == "deny") {
                 banned();
             }
             if (property_exists($hostnames, 'hostnames')) {
                 foreach ($security_settings["hostname_ban_list"] as $ban) {
                     foreach ($hostnames->hostnames as $hostname) {
                         if (stripos($hostname, $ban) !== false) {
                             banned();
                         }
                     }
                 }
             }
         }
     }
     $fake_address_input_used = false;
     if (!empty($_POST["address"])) {
         $fake_address_input_used = true;
     }
 }
 if (!$disable_admin_panel && array_key_exists('p', $_GET) && $_GET['p'] == 'admin') {
     $invalid_key = false;
     if (array_key_exists('password', $_POST)) {
         if ($pass[0] == crypt($_POST['password'], $pass[0])) {
예제 #2
0
function loggedIn()
{
    @session_start();
    if (isset($_SESSION["user_id"])) {
        $majboor = ORM::for_table('majboor')->where(array('userName' => $_SESSION["user_name"], 'sessionId' => session_id()))->find_one();
        if (!$majboor) {
            return 2;
            //multiple browser login hai
        } else {
            if (banned($_SESSION["user_id"]) == true) {
                logout();
                return 0;
                //banned
            } else {
                return 1;
                //login hai
            }
        }
    } else {
        return 0;
        //login nahi
    }
}