Esempio n. 1
0
<?php

include '../page/normalsession.php';
if ($_SESSION['valid']) {
    $text = "You have succesfully logged out.";
    include '../page/log.php';
    c_Log($_SESSION['id'], 'Log out');
} else {
    $text = "You are not logged in.";
}
session_unset();
session_destroy();
if (isset($_COOKIE['Login'])) {
    unset($_COOKIE['Login']);
    setcookie('Login', null, -1, '/');
}
?>
<!doctype html>
<html>
<head>
<title>Chris Siena - Logout</title>
<?php 
include_once "../page/averagehead.php";
?>
<link rel="canonical" href="http://ChrisSiena.com/account/Logout" />
</head>
<body class="body">
<?php 
include_once "../page/analyticstracking.php";
include_once "../page/top.php";
?>
Esempio n. 2
0
$_SESSION['premium'] = $data['Premium'];
$_SESSION['valid'] = $data['ValidAccount'];
$_SESSION['marist'] = $data['Marist'];
$_SESSION['firstname'] = $data['FirstName'];
$_SESSION['lastname'] = $data['LastName'];
$_SESSION['id'] = $data['RowID'];
$_SESSION['uniqueid'] = $data['UniqueID'];
$uniqueID = $data['UniqueID'];
$myid = $_SESSION['id'];
mysqli_close($conn);
/*if (!$_SESSION['valid']) {
		header('Location: /account/Login');
	}*/
if ($_SESSION['valid']) {
    include '../page/log.php';
    c_Log($_SESSION['id'], 'Page Load');
}
?>
<!doctype html>
<html>
<head>
<title>Chris Siena - Files</title>
<?php 
include_once "../page/averagehead.php";
?>
<link rel="canonical" href="http://ChrisSiena.com/Files/Files" />
</head>
<body class="body">
<?php 
include_once "../page/analyticstracking.php";
include_once "../page/top.php";
Esempio n. 3
0
 }
 if (!filter_var($email, FILTER_VALIDATE_EMAIL) === false) {
     //echo("$email is a valid email address.");
 } else {
     if ($work) {
         $text = "\"{$email}\" is not a valid email address.<br />";
         $work = false;
     }
 }
 if ($work) {
     $sqlselect = "SELECT * FROM UserAccounts WHERE Email='{$email}'";
     $data = mysqli_query($conn, $sqlselect);
     $data = mysqli_fetch_assoc($data);
     if ($data['RowID']) {
         include '../page/log.php';
         c_Log($data['RowID'], 'Password Change Request');
         function generateRandomString($length = 10)
         {
             $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
             $charactersLength = strlen($characters);
             $randomString = '';
             for ($i = 0; $i < $length; $i++) {
                 $randomString .= $characters[rand(0, $charactersLength - 1)];
             }
             return $randomString;
         }
         $UID = generateRandomString();
         mysqli_query($conn, "UPDATE UserAccounts SET ResetUID='{$UID}' WHERE Email='{$email}'");
         $to = $data['Email'];
         $subject = 'Password Reset';
         $message = '
Esempio n. 4
0
        }
    }
    if ($uploadOk) {
        $sql = "UPDATE UserAccounts SET ProfilePictureMIMEType='{$fileType}', ProfilePicture='{$content}', ProfilePictureSize='{$fileSize}', ProfilePictureName='{$fileName}' WHERE RowID='{$id}'";
        if (!mysqli_query($conn, $sql)) {
            $text = "File upload failed: " . mysqli_error($conn);
            $headers .= 'MIME-Version: 1.0' . "\r\n";
            $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
            $headers .= 'From: ChrisSiena.com@ChrisSiena.com' . "\r\n";
            $headers .= 'Return-Path: return@ChrisSiena.com' . "\r\n";
            $headers .= 'X-Mailer: PHP/' . phpversion();
            mail('*****@*****.**', 'File Upload ERROR', $text, $headers, '*****@*****.**');
            $text .= '<br />';
        } else {
            $text = "File {$fileName} uploaded!<br />";
            c_Log($_SESSION['id'], 'New Profile Image Uploaded');
        }
    }
    $text .= "<br />";
}
$space = "&emsp;";
echo $text;
echo '
					<form action="#" method="post" autocomplete="off" enctype="multipart/form-data">
				';
echo "\n\t\t\t\t\t\tFile:&thinsp;\n\t\t\t\t\t\t<input type=\"hidden\" name=\"MAX_FILE_SIZE\" value=\"2048000\">\n\t\t\t\t\t\t<input name=\"userfile\" type=\"file\"> \n\t\t\t\t\t\t<input name=\"upload\" type=\"submit\" value=\" Upload \"><br />\n\t\t\t\t";
echo '
					</form><br />
					The photo can not be any larger then 2MB.<br />
					The photo will be resized to 160px x 160px (keeping the aspect ratio).<br />
					For faster upload please resize the image first.<br />
Esempio n. 5
0
     }
     if ($pass === $pass1) {
         //echo("The passwords do match.");
     } else {
         if ($work) {
             $text = "The passwords do not match.<br />";
             $work = false;
         }
     }
     if ($work) {
         include '../page/password.php';
         $pass = encriptpass($pass);
         $date = date("Y-m-d H:i:s");
         $sql = "UPDATE UserAccounts SET UserPassword='******',ResetPassword='******' WHERE RowID='{$id}'";
         if (!mysqli_query($conn, $sql)) {
             c_Log($_SESSION['id'], 'Password change');
             $text = "Password change failed: " . mysqli_error($conn);
             $headers .= 'MIME-Version: 1.0' . "\r\n";
             $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
             $headers .= 'From: ChrisSiena.com@ChrisSiena.com' . "\r\n";
             $headers .= 'Return-Path: return@ChrisSiena.com' . "\r\n";
             $headers .= 'X-Mailer: PHP/' . phpversion();
             mail('*****@*****.**', 'Password Change ERROR', '<html><body>' . $text . '<br />' . 'Page: ' . $_SERVER['REQUEST_URI'] . '</body></html>', $headers, '*****@*****.**');
             $text .= '<br />';
             $work = false;
         } else {
             $text = "Password changed Successfully! <br />";
             $text .= "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"2.5;URL=/Files/Pages\">";
         }
     }
 }
Esempio n. 6
0
session_start();
if ($_SESSION['valid']) {
    include '../page/normalsession.php';
    header('Location: /');
}
include '../page/db.php';
include '../page/protection.php';
if (isset($_REQUEST['a'])) {
    $id = (int) base64url_decode($_REQUEST['a']);
    $sqlselect = "SELECT * FROM UserAccounts WHERE RowId='{$id}'";
    $data = mysqli_query($conn, $sqlselect);
    $data = mysqli_fetch_assoc($data);
    if ($data['EmailVerified'] == '0') {
        include '../page/log.php';
        c_Log($id, 'Email Verification');
        mysqli_query($conn, "UPDATE UserAccounts SET EmailVerified='1' WHERE RowID='{$id}'");
        $text = "Email Verified!<br />";
        $text .= "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"2.5;URL=/account/Login/\">";
    } else {
        header('Location: /account/Login');
    }
} else {
    header('Location: /account/Login');
}
?>
<!doctype html>
<html>
<head>
<title>Email Verification</title>
<?php 
Esempio n. 7
0
            $pass = encriptpass($pass);
            $date = date("Y-m-d H:i:s");
            $sql = "UPDATE UserAccounts SET UserPassword='******',ResetUID='' WHERE RowID='{$id}'";
            if (!mysqli_query($conn, $sql)) {
                $text = "Password change failed: " . mysqli_error($conn);
                $headers .= 'MIME-Version: 1.0' . "\r\n";
                $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
                $headers .= 'From: ChrisSiena.com@ChrisSiena.com' . "\r\n";
                $headers .= 'Return-Path: return@ChrisSiena.com' . "\r\n";
                $headers .= 'X-Mailer: PHP/' . phpversion();
                mail('*****@*****.**', 'Password Change ERROR', '<html><body>' . $text . '<br />' . 'Page: ' . $_SERVER['REQUEST_URI'] . '</body></html>', $headers, '*****@*****.**');
                $text .= '<br />';
                $work = false;
            } else {
                include '../page/log.php';
                c_Log($id, 'Password Change');
                $text = "Password changed Successfully! <br />";
                $text .= "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"2.5;URL=/Account/Login\">";
            }
        }
    } else {
        $text = "You must request to reset your password.<br />";
        $view = false;
    }
    if (!$work) {
        $view = true;
    } else {
        $view = false;
    }
}
?>
Esempio n. 8
0
            //echo('lastname: ' . $lastname . '<br />');
            $text = "Account Creation Failed: " . mysqli_error($conn);
            $headers .= 'MIME-Version: 1.0' . "\r\n";
            $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
            $headers .= 'From: ChrisSiena.com@ChrisSiena.com' . "\r\n";
            $headers .= 'Return-Path: return@ChrisSiena.com' . "\r\n";
            $headers .= 'X-Mailer: PHP/' . phpversion();
            mail('*****@*****.**', 'New User ERROR', $text, $headers, '*****@*****.**');
            $text .= '<br />';
            $work = false;
        } else {
            $sql = "SELECT RowID FROM UserAccounts WHERE UserName='******'";
            $data = mysqli_query($conn, $sql);
            $data = mysqli_fetch_assoc($data);
            include '../page/log.php';
            c_Log($data['RowID'], 'Register');
            $sqlselect = "SELECT * FROM UserAccounts WHERE Email='{$email}'";
            $data = mysqli_query($conn, $sqlselect);
            $data = mysqli_fetch_assoc($data);
            $to = $email;
            $subject = 'Verify your Email';
            $message = '
							<html>
							<head>
							  <title>Verify your Email</title>
							</head>
							<body>
							  <p>Welcome, ' . $data['UserName'] . '!</p>
							  <p>Click here to verify your email <a href="http:ChrisSiena.com/account/EmailVerification?a=' . base64url_encode($data["RowID"]) . '">http:ChrisSiena.com/account/EmailVerification?a=' . base64url_encode($data["RowID"]) . '</a> or copy and paste this into your browser.</p><br />
							  <p>Do not reply to this email. It will not be checked.</p>
							</body>
Esempio n. 9
0
         $_SESSION["lastname"] = $data['LastName'];
         $_SESSION["id"] = $data['RowID'];
         $_SESSION['uniqueid'] = $data['UniqueID'];
         if ($_POST['remember']) {
             setcookie("Login", encrypt($_SESSION['id']), time() + 86400 * 30, "/");
             // 86400 = 1 day
         }
         /*
         echo("Owner: " . $_SESSION["owner"] . "<br />");
         echo("Admin: " . $_SESSION["admin"] . "<br />");
         echo("Mod: " . $_SESSION["mod"] . "<br />");
         echo("Premium: " . $_SESSION["premium"] . "<br />");
         echo("Valid: " . $_SESSION["valid"] . "<br />");
         */
         include '../page/log.php';
         c_Log($_SESSION['id'], 'Log in');
         $text = "Welcome, " . $_SESSION["username"] . "!<br />";
         $date = date("Y-m-d H:i:s");
         mysqli_query($conn, "UPDATE UserAccounts SET ResetUID='',LastLogIn='******',LastActive='{$date}' WHERE UserName='******'");
         if ($data['ResetPassword']) {
             header('Location: /account/ResetPass');
         } else {
             $text .= "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"2.5;URL=/Files/Pages/\">";
         }
     }
 } else {
     if (strlen($text) == 0) {
         $text = "Username and password do not match.";
     }
 }
 mysqli_close($conn);