Ejemplo n.º 1
0
function get_outa_here()
{
    superendsession();
    header('Location: /');
    exit;
}
Ejemplo n.º 2
0
$Email = my_fix($_POST['inputEmail2']);
$Blowfish = encrypt_password(random_str(16));
$Connection = get_connection();
try {
    $Connection->beginTransaction();
    $q0 = gq_insert('framy_Personal', 'NameFirst,NameLast,Email', ':a,:b,:c');
    $s0 = $Connection->prepare($q0);
    $s0->bindValue(':a', $NameFirst, PDO::PARAM_STR);
    $s0->bindValue(':b', $NameLast, PDO::PARAM_STR);
    $s0->bindValue(':c', $Email, PDO::PARAM_STR);
    $s0->execute();
    $s0->closeCursor();
    $PersonalId = $Connection->lastInsertId('framy_Personal_PersonalId_seq');
    $q1 = gq_insert('framy_Blowfish', 'PersonalId,Blowfish', ':a,:b');
    $s1 = $Connection->prepare($q1);
    $s1->bindValue(':a', $PersonalId, PDO::PARAM_INT);
    $s1->bindValue(':b', $Blowfish, PDO::PARAM_STR);
    $s1->execute();
    $s1->closeCursor();
    $Connection->commit();
} catch (Exception $e) {
    $Connection->rollBack();
    superendsession();
    exception_error($e);
    die;
}
$_SESSION['PersonalId'] = $PersonalId;
$_SESSION['NameFirst'] = $NameFirst;
$_SESSION['NameLast'] = $NameLast;
$_SESSION['Email'] = $Email;
$_SESSION['submitCreateAccountHello'] = TRUE;
Ejemplo n.º 3
0
function print_container()
{
    echo "<div class=\"container\">";
    $NoRemainingContent = FALSE;
    switch ($_SERVER['REQUEST_METHOD']) {
        case 'POST':
            if (isset($_POST['submitCreateAccount'])) {
                site_include(DIR_NOSESSION . 'submit-createaccount.php');
            }
            if (isset($_POST['submitResetPassword'])) {
                site_include(DIR_NOSESSION . 'submit-resetpassword.php');
            }
            if (isset($_POST['submitLogIn'])) {
                site_include(DIR_NOSESSION . 'submit-login.php');
            }
            if (isset($_POST['submitChangePassword'])) {
                site_include(DIR_NOSESSION . 'submit-changepassword.php');
            }
            header("Location: {$_SERVER['REQUEST_URI']}");
            exit;
            break;
        case 'GET':
            if (isset($_SESSION['Copyright'])) {
                unset($_SESSION['Copyright']);
                site_include(DIR_READY . 'copyright.php');
                Config::write('site.includenone', TRUE);
            }
            if (isset($_SESSION['submitCreateAccountHello'])) {
                unset($_SESSION['submitCreateAccountHello']);
                site_include(DIR_NOSESSION . 'submit-createaccount-hello.php');
            }
            if (isset($_SESSION['submitResetPasswordHello'])) {
                unset($_SESSION['submitResetPasswordHello']);
                site_include(DIR_NOSESSION . 'submit-resetpassword-hello.php');
            }
            if (isset($_SESSION['submitChangePasswordMessage'])) {
                unset($_SESSION['submitChangePasswordMessage']);
                site_include(DIR_NOSESSION . 'submit-changepassword-hello.php');
            }
            break;
    }
    if (isset($_SESSION['ForceChangePassword'])) {
        site_include(DIR_NOSESSION . 'form-changepassword.php');
        // Retain $_SESSION['ForceChangePassword'] for use in 'submit-changepassword.php'
        unset($_SESSION['LoggedIn']);
    } else {
        if (isset($_SESSION['LoggedIn'])) {
            if ($_SESSION['LoggedIn']) {
                site_include(DIR_SESSION . 'session.php');
            } else {
                site_include(DIR_NOSESSION . 'submit-login-error.php');
                superendsession();
                site_include(DIR_NOSESSION . 'nosession.php');
            }
        } else {
            superendsession();
            site_include(DIR_NOSESSION . 'nosession.php');
        }
    }
    echo "</div>";
}