Skip to content

Commit

Permalink
create README for upgraded system
Browse files Browse the repository at this point in the history
  • Loading branch information
msaad1999 committed Jan 15, 2020
1 parent 27a9d70 commit ac125da
Show file tree
Hide file tree
Showing 10 changed files with 478 additions and 244 deletions.
407 changes: 221 additions & 186 deletions README.md

Large diffs are not rendered by default.

12 changes: 0 additions & 12 deletions assets/includes/functions.php

This file was deleted.

6 changes: 3 additions & 3 deletions assets/layouts/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

session_start();

require '..\assets\setup\env.php';
require '..\assets\setup\db.inc.php';
require '..\assets\includes\auth_functions.php';
require '../assets/setup/env.php';
require '../assets/setup/db.inc.php';
require '../assets/includes/auth_functions.php';

check_remember_me();

Expand Down
6 changes: 3 additions & 3 deletions assets/layouts/navbar.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@
<span class="caret"></span>
</button>
<div class="dropdown-menu" aria-labelledby="imgdropdown">
<a class="dropdown-item" href="../profile">Profile</a>
<a class="dropdown-item" href="../profile-edit">Edit Profile</a>
<a class="dropdown-item" href="../logout">Logout</a>
<a class="dropdown-item text-muted" href="../profile"><i class="fa fa-user pr-2"></i> Profile</a>
<a class="dropdown-item text-muted" href="../profile-edit"><i class="fa fa-pencil-alt pr-2"></i> Edit Profile</a>
<a class="dropdown-item text-muted" href="../logout"><i class="fa fa-running pr-2"></i> Logout</a>
</div>
</div>

Expand Down
18 changes: 0 additions & 18 deletions assets/setup/env.php.example

This file was deleted.

36 changes: 22 additions & 14 deletions contact/includes/contact.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
require '../../assets/vendor/PHPMailer/src/PHPMailer.php';
require '../../assets/vendor/PHPMailer/src/SMTP.php';

require '../../assets/includes/functions.php';

if (isset($_POST['contact-submit'])) {

if (isset($_SESSION['auth'])){
Expand All @@ -28,29 +26,39 @@

$msg = $_POST['message'];


if (has_header_injection($name) || has_header_injection($email)) {
die();
}

if (!isset($_SESSION['auth']) && (!$name || !$msg)) {

$_SESSION['ERRORS']['mailstatus'] = 'Fields cannot be empty';
header("Location: ../");
exit();
}



// $message = "<strong>Name:</strong> $name<br>"
// . "<strong>Email:</strong> <i>$email</i><br><br>"
// . "<strong>Message:</strong><br><br>$msg";

/*
* -------------------------------------------------------------------------------
* Using email template
* -------------------------------------------------------------------------------
*/

$subject = "$name sent you a message via your contact form";

$message = "<strong>Name:</strong> $name<br>"
. "<strong>Email:</strong> <i>$email</i><br><br>"
. "<strong>Message:</strong><br><br>$msg";
$mail_variables = array();

$mail_variables['APP_NAME'] = APP_NAME;
$mail_variables['username'] = $name;
$mail_variables['email'] = $email;
$mail_variables['message'] = $msg;

if (isset($_POST['subscribe'])) {
$message = file_get_contents("./template_contactemail.php");

$message .= "<br><br><br>"
. "<strong>IMPORTANT:</strong> Please add <i>$email</i> "
. "to your mailing list.<br>";
foreach($mail_variables as $key => $value) {

$message = str_replace('{{ '.$key.' }}', $value, $message);
}

$mail = new PHPMailer(true);
Expand Down
223 changes: 223 additions & 0 deletions contact/includes/template_contactemail.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>New Contact Form Entry</title>
<style type="text/css">
body {
width: 100%;
background-color: #ffffff;
margin: 0;
margin-top: 70px;
padding: 0;
-webkit-font-smoothing: antialiased;
}
p,
h1,
h2,
h3,
h4 {
margin-top: 0;
margin-bottom: 0;
padding-top: 0;
padding-bottom: 0;
}
span.preheader {
display: none;
font-size: 1px;
}
html {
width: 100%;
}
table {
font-size: 14px;
border: 0;
}
/* ----------- responsivity ----------- */
@media only screen and (max-width: 640px) {
/*------ top header ------ */
.main-header {
font-size: 20px !important;
}
.main-section-header {
font-size: 28px !important;
}
.show {
display: block !important;
}
.hide {
display: none !important;
}
.align-center {
text-align: center !important;
}
.no-bg {
background: none !important;
}
/*----- main image -------*/
.main-image img {
width: 440px !important;
height: auto !important;
}
/* ====== divider ====== */
.divider img {
width: 440px !important;
}
/*-------- container --------*/
.container590 {
width: 440px !important;
}
.container580 {
width: 400px !important;
}
.main-button {
width: 220px !important;
}
/*-------- secions ----------*/
.section-img img {
width: 320px !important;
height: auto !important;
}
.team-img img {
width: 100% !important;
height: auto !important;
}
}
@media only screen and (max-width: 479px) {
/*------ top header ------ */
.main-header {
font-size: 18px !important;
}
.main-section-header {
font-size: 26px !important;
}
/* ====== divider ====== */
.divider img {
width: 280px !important;
}
/*-------- container --------*/
.container590 {
width: 280px !important;
}
.container590 {
width: 280px !important;
}
.container580 {
width: 260px !important;
}
/*-------- secions ----------*/
.section-img img {
width: 280px !important;
height: auto !important;
}
}
</style>
</head>
<body class="respond" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table border="0" width="100%" cellpadding="0" cellspacing="0" bgcolor="ffffff" class="bg_color">
<tr>
<td align="center">
<table border="0" align="center" width="590" cellpadding="0" cellspacing="0" class="container590">
<tr>
<td height="20" style="font-size: 20px; line-height: 20px;">&nbsp;</td>
</tr>
<tr>
<td align="center" style="color: #343434; font-size: 24px; font-family: Quicksand, Calibri, sans-serif; font-weight:700;letter-spacing: 3px; line-height: 35px;"
class="main-header">
<div style="line-height: 35px">
<span style="color: #5caad2;">{{ APP_NAME }}:</span> New Contact Form Entry
</div>
</td>
</tr>
<tr>
<td height="10" style="font-size: 10px; line-height: 10px;">&nbsp;</td>
</tr>
<tr>
<td align="center">
<table border="0" width="40" align="center" cellpadding="0" cellspacing="0" bgcolor="eeeeee">
<tr>
<td height="2" style="font-size: 2px; line-height: 2px;">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="70" style="font-size: 20px; line-height: 20px;">&nbsp;</td>
</tr>
<tr>
<td align="center">
<table border="0" width="400" align="center" cellpadding="0" cellspacing="0" class="container590">
<tr>
<td align="left" style="color: #888888; font-size: 16px; font-family: 'Work Sans', Calibri, sans-serif; line-height: 24px;">
<div style="line-height: 24px">
Name: {{ username }} <br>
Email: {{ email }} <br>
Message:
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="25" style="font-size: 25px; line-height: 25px;">&nbsp;</td>
</tr>
<tr>
<td align="center">
<table border="0" width="400" align="center" cellpadding="0" cellspacing="0" class="container590">
<tr>
<td align="left" style="color: #888888; font-size: 16px; font-family: 'Work Sans', Calibri, sans-serif; line-height: 24px;">
<div style="line-height: 24px">
{{ message }}
</div>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="25" style="font-size: 25px; line-height: 25px;">&nbsp;</td>
</tr>
</table>
</td>
</tr>
<tr class="hide">
<td height="25" style="font-size: 25px; line-height: 25px;">&nbsp;</td>
</tr>
<tr>
<td height="40" style="font-size: 40px; line-height: 40px;">&nbsp;</td>
</tr>
</table>
</body>
</html>
8 changes: 3 additions & 5 deletions index.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?php

include 'assets/setup/db.inc.php';
if (isset($_SESSION['auth'])) {

if (isset($_SESSION['userId'])) {

header("Location: ./home");
header("Location: home");
exit();
}
else {

header("Location: ./login");
header("Location: login");
exit();
}
4 changes: 2 additions & 2 deletions profile-edit/includes/template_notificationemail.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Verify Your Email</title>
<title>Password Updated</title>
<style type="text/css">
body {
Expand Down Expand Up @@ -140,7 +140,7 @@ class="main-header">
<div style="line-height: 35px">
PASSWORD UPDATED</span>
<span style="color: #5caad2;">{{ APP_NAME }}:</span> PASSWORD UPDATED
</div>
</td>
Expand Down
2 changes: 1 addition & 1 deletion verify/includes/template_verificationemail.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ class="main-header">
<div style="line-height: 35px">
Please Activate Your Account</span>
<span style="color: #5caad2;">{{ APP_NAME }}:</span> Please Activate Your Account
</div>
</td>
Expand Down

0 comments on commit ac125da

Please sign in to comment.