Пример #1
0
 static function LoadPage($PageName, $Wrapper = true)
 {
     if (KERNEL::IsValidPage($PageName) == false) {
         KERNEL::OnError("Attempt to load invalid page '" . $PageName . "'");
     }
     if (!is_null(KERNEL::$Pages[$PageName][2])) {
         $Result = call_user_func(KERNEL::$Pages[$PageName][2]);
         if ($Result !== true) {
             KERNEL::OnError("Access Denied - " . $Result);
             die("");
             // Force cancel just incase
         }
     }
     if ($Wrapper) {
         global $GMDConfig;
         $OpenID = new LightOpenID($GMDConfig["Domain"]);
         if ($OpenID->validate()) {
             $ID = $OpenID->identity;
             $URL_Parts = explode("/", $ID);
             // Get their SteamID
             $CommunityID = $URL_Parts[sizeof($URL_Parts) - 1];
             $SteamID = CommunityToSteam($CommunityID);
             // Try and authenticate them
             $User = User::GetByField("User", "SteamID", $SteamID);
             if ($User->IsReal()) {
                 $User->AuthToUser();
             } else {
                 User::RegisterUser($SteamID, $_SERVER['REMOTE_ADDR'])->AuthToUser();
             }
             KERNEL::HardNavigate("home");
         } elseif ($_GET["page"] == "login") {
             if (User::$ActiveUser != false) {
                 if (isset($_GET["logout"])) {
                     User::Logout();
                 }
                 KERNEL::HardNavigate("home");
             } else {
                 $OpenID->identity = 'http://steamcommunity.com/openid';
                 header('Location: ' . $OpenID->authUrl());
             }
         }
         LightOpenID::revalidate();
     }
     global $OutputData;
     $OutputData = "";
     if ($Wrapper) {
         require "includes/util/header.php";
     }
     require "pages/" . $PageName . "/_process.php";
     require "pages/" . $PageName . "/_display.php";
     echo $OutputData;
     if ($Wrapper) {
         require "includes/util/footer.php";
     }
 }
Пример #2
0
<?php

require_once "./src/conection.php";
if ($_SERVER["REQUEST_METHOD"] === "POST") {
    $user = User::RegisterUser($_POST['name'], $_POST['email'], $_POST['password1'], $_POST['password2'], $_POST['description']);
    if ($user !== FALSE) {
        $_SESSION['userId'] = $user->getId();
        header("Location: showUser.php?userId=" . $userId);
    } else {
        echo "Zle dane rejestracji";
    }
}
?>

<fieldset>
    <legend>Rejestracja:</legend>
    <form action="register.php" method="post">
        <p>
            <label>
                Email:
                <input type="email" name="email">
            </label>
        </p>
        <p>
            <label>
                Name:
                <input type="text" name="name">
            </label>
        </p>
        <p>
            <label>
Пример #3
0
    if (isset($_REQUEST['login'])) {
        //login
        $fp->log("login!");
        $u = User::CheckUser($_REQUEST['email'], $_REQUEST['password']);
        $fp->log($u);
        if ($u) {
            MyAuth::setLoginAuthenticate($u['uid']);
            header("Location: {$appAfterLoginUrl}");
            die;
        } else {
            echo '<span class="error_message">Login not valid!</span>';
        }
    } else {
        //signup
        $fp->log("Signup!");
        if (!User::RegisterUser($_REQUEST['first_name'], $_REQUEST['last_name'], $_REQUEST['email'], $_REQUEST['password'], $_REQUEST['gender'])) {
            echo '<span class="error_message">Probaly the email has been already used! Plase try wih a different one</span>';
        } else {
            $u = User::getByEmail($_REQUEST['email']);
            MyAuth::setLoginAuthenticate($u['uid']);
            header("Location: {$appAfterLoginUrl}");
            die;
        }
    }
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:fb="http://www.facebook.com/2008/fbml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta http-equiv="Content-Style-Type" content="text/css">
Пример #4
0
<?php

spl_autoload_register('MyLoader');
function MyLoader($sClass)
{
    if (strstr($sClass, 'Sql')) {
        require_once '../classes/databases/' . $sClass . '.php';
    } else {
        require_once '../classes/' . $sClass . '.php';
    }
}
$oDatabase_connection = new Database();
$oDatabase = $oDatabase_connection->Connect();
$oUser = new User($oDatabase);
switch ($_POST['action']) {
    case 'register':
        $aResult = $oUser->RegisterUser($_POST);
        break;
    case 'active':
        $aResult = $oUser->ActivateAccount($_POST['hash']);
        break;
    case 'login':
        $aResult = $oUser->LoginUser($_POST);
        break;
    default:
        $aResult = array('success' => 'false', 'message' => 'Sie haben was verbotenes probiert');
        break;
}
echo json_encode($aResult);
Пример #5
0
    /* MAKE SURE THEY ARENT TRYING ANYTHING TRICKY */
    if ($payment_currency != $Currency) {
        die("");
        // Bad currency..
    } elseif ($receiver_email != $Email) {
        die("");
        // Bad receiver email..
    } elseif ($payment_status != "Completed") {
        die("");
        // Transaction not complete
    }
    /* Fetch the User Account */
    $User = User::GetByField("User", "SteamID", $custom);
    if ($User == false || $User->IsReal() == false) {
        // They don't have an account.. wtf, lets make one to be safe
        $User = User::RegisterUser($custom, "0.0.0.0");
    }
    /* MAKE SURE THEY DIDNT ALREADY GET THEIR SHIT */
    $Donation = Donation::GetByField("Donation", "TransactionID", $txn_id);
    if ($Donation->IsReal() == true) {
        die("");
        // They already got their shit
    }
    /* GIVE THEM THEIR SHIT */
    $time = time();
    $uid = $User->Data["ID"];
    $User->ChangeValue("Credit", $User->Data["Credit"] + $payment_amount);
    Database::Query("INSERT INTO `gmd_donations` VALUES ( NULL, 1, '{$txn_id}', '{$custom}', '{$payer_email}', '{$first_name}', '{$last_name}', {$time}, {$payment_amount}, '{$payment_currency}' );");
} else {
    fwrite($FileObj, "bad ipn");
    die("");
Пример #6
0
    $password = $_POST['password'];
    $user = new User();
    $message = "";
    $message = $user->Login($username, $password);
    if ($message == "User found") {
        $_SESSION['username'] = $username;
        $base = get_basename();
        header('Location: ' . $base);
    }
}
if (isset($_POST['register-form-btn']) && !empty($_POST['register-form-btn'])) {
    $reg_array = array();
    array_push($reg_array, $_POST['username'], $_POST['password'], $_POST['firstName'], $_POST['lastName'], $_POST['phonenumber'], $_POST['email'], $_POST['academicID'], $_POST['academicPass']);
    $user = new User();
    $username = $_POST['username'];
    $message = $user->RegisterUser($reg_array);
    if ($message == "registered") {
        $_SESSION['username'] = $username;
        $base = get_basename();
        header('Location: ' . $base);
    } else {
        $message_error = "Η εγγραφη σας δεν ολοκληρώθηκε σωστά";
        echo "<script>error_messages('{$message_error}');</script>";
    }
}
?>

		    	<div class="row">
					<div class="col-md-6 col-md-offset-3">
						<div class="panel panel-login">
							<div class="panel-heading">
Пример #7
0
$u = MyAuth::checkAuthentication(false); //### This must change later to true and take vcare to pass the cookie
if (!$u)
{
    error('Not logged in');
}
*/
//In order to debug XML add "?T3ST=1" in the URL
if (isset($_REQUEST[$debug_parameter])) {
    $XML_debug = true;
}
if (isset($_REQUEST['action'])) {
    if ($_REQUEST['action'] == "register") {
        $fp->log("register");
        $email = $_REQUEST['email'];
        $pwd = $_REQUEST['pwd'];
        if (!User::RegisterUser($_REQUEST['first_name'], $_REQUEST['last_name'], $email, $pwd, $_REQUEST['gender'])) {
            echo '{"status":"ERROR","results":{"user":"******", "mess":"Problem on the DB"}}';
        } else {
            $u = User::getByEmail($_REQUEST['email']);
            $uid = $u['uid'];
            MyAuth::setLoginAuthenticate($uid);
            unset($r['pwd']);
            echo '{"status":"OK","results":' . json_encode($u) . '}';
        }
    } else {
        if ($_REQUEST['action'] == "login") {
            $email = $_REQUEST['email'];
            $pwd = $_REQUEST['pwd'];
            $u = User::CheckUser($email, $pwd);
            $fp->log("User::CheckUser({$email}, {$pwd})");
            if ($u) {