Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
b97d9d3
Update composer.lock
jitendra-shrarma Oct 22, 2018
cb4d287
Bump phpmailer/phpmailer from 6.0.6 to 6.1.6
jitendra-shrarma Oct 29, 2018
87a86ef
start updating readme.md
jitendra-shrarma Nov 9, 2018
9aaccba
Revert "Delete ~$atbook - SRS.docx"
jitendra-shrarma Nov 5, 2018
11370ed
Update message_card.php
jitendra-shrarma Nov 11, 2018
ea89377
Update message_card.php
jitendra-shrarma Nov 12, 2018
1516d86
Update registration.php
jitendra-shrarma Nov 14, 2018
700fd31
Update Register.php
jitendra-shrarma Nov 15, 2018
9085818
Update Register.php
jitendra-shrarma Nov 17, 2018
83cc3d4
change tab on registration failure
jitendra-shrarma Nov 18, 2018
cd03e90
do not show notices
jitendra-shrarma Nov 20, 2018
220adbe
update notice problem
jitendra-shrarma Nov 21, 2018
e40d52d
update session time out error
jitendra-shrarma Nov 23, 2018
714aa75
Update Register.php
jitendra-shrarma Nov 24, 2018
f53ff63
documentation
jitendra-shrarma Nov 26, 2018
5f236cc
Update db.sql
jitendra-shrarma Nov 27, 2018
f5bd3a7
forgot password with captcha
jitendra-shrarma Nov 28, 2018
0570298
forgot password remains
jitendra-shrarma Nov 30, 2018
db05cdb
forgot password done
jitendra-shrarma Dec 1, 2018
6650756
account_verification done
jitendra-shrarma Dec 3, 2018
98dd159
Create chatbook - SRS.docx
jitendra-shrarma Dec 4, 2018
4e6175d
Update db.sql
jitendra-shrarma Dec 6, 2018
d8cc84e
Update load_profile_posts.php
jitendra-shrarma Dec 7, 2018
d8346d5
Update load_posts.php
jitendra-shrarma Dec 9, 2018
fc42f92
made it
jitendra-shrarma Dec 10, 2018
01af3e1
set user offline if he closes the tabs or change the tab
jitendra-shrarma Dec 12, 2018
4e0e324
Update User.php
jitendra-shrarma Dec 13, 2018
3e9db8e
online functionality is completed
jitendra-shrarma Dec 15, 2018
882d5e4
phpmailer.php
jitendra-shrarma Dec 16, 2018
817592d
profile remove user from user list is restricted back to user if he i…
jitendra-shrarma Dec 18, 2018
e310837
registration is easy
jitendra-shrarma Dec 21, 2018
92feb39
session_isalive.php check
jitendra-shrarma Dec 19, 2018
b602382
description updated
Mar 2, 2019
69ff4ee
Update README.md
Mar 2, 2019
0ed1b31
Update README.md
Mar 2, 2019
b5282ea
Update README.md
Mar 2, 2019
260d472
Update README.md
Mar 2, 2019
c1dc2d2
Update README.md
Mar 2, 2019
e75d64d
Update README.md
Mar 2, 2019
c35b4e3
Update README.md
Mar 2, 2019
84c8580
Update README.md
Mar 2, 2019
5bfcf3d
Update README.md
Mar 2, 2019
17d6210
Update README.md
Mar 2, 2019
e4c2a42
Update README.md
Mar 2, 2019
a3c0830
Delete ~$atbook - SRS.docx
jitendra-shrarma Nov 12, 2018
f638c0d
Merge pull request #1 from God-Hand/dependabot/composer/phpmailer/php…
jitendra-shrarma Oct 15, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1 +1,54 @@
# ChatBook
## Product Info
ChatBook is a free online social networking website which allows users to connect with their friends and family. It gives a global platform for users around the world to connect with each other. Users can also share posts and engage in Message conversations. This is an independent product and will be the first release of the product.

## Functionalities
User can register to the ChatBook and login whenever he wishes to do so. User can build his profile, add or edit information, see his own profile and upload profile picture to his profile, can also change password .With this site users can connect with their friends and family through a common platform. A user can search for his friends and will be shown appropriate results if matching profiles are found. Any user can post to his profile which will be visible to his connections and separately view profile posts by him/for him.

![alt text](https://github.com/God-Hand/ChatBook/blob/master/documents/Images/ChatBook.png)

## Operating Environment
- Minimum: 2 CPU Cores (Recommended: 4 Cores or more)
- Recommended memory: 2 GB for Windows platforms, 1 GB for Linux
- Recommended disk space: 1024 MB
- Required Applications: WAMP (Windows, Apache, MySQL, PHP)

## Assumptions and Dependencies
- There will be availability of Internet via 3G, 4G or Wi-Fi.
- The user of the site will be acquainted with Basic English language.
- The user should have a valid email address in order to register into ChatBook.
- Central server of the system must be able to handle all the incoming requests simultaneously.
- The user has basic knowledge of computers and internet.

## Data Flow Diagrams
- Level-0

![alt text](https://github.com/God-Hand/ChatBook/blob/master/documents/Images/level-0%20dfd.png)

- Level-1

![alt text](https://github.com/God-Hand/ChatBook/blob/master/documents/Images/level-1%20dfd.png)

## Sequence Diagram
![alt text](https://github.com/God-Hand/ChatBook/blob/master/documents/Images/New%20Open%20Me%20First%20-%20Getting%20Started.png)

## User Interfaces
- Register Page

![alt text](https://github.com/God-Hand/ChatBook/blob/master/documents/Images/Register.PNG)

- Login Page

![alt text](https://github.com/God-Hand/ChatBook/blob/master/documents/Images/Login.PNG)

- Home Page

![alt text](https://github.com/God-Hand/ChatBook/blob/master/documents/Images/desktop.PNG)

- Profile Page

![alt text](https://github.com/God-Hand/ChatBook/blob/master/documents/Images/profile%20page.PNG)

- Messaging Page

![alt text](https://github.com/God-Hand/ChatBook/blob/master/documents/Images/message%20box%20at%2090%25.PNG)
10 changes: 10 additions & 0 deletions account_verification.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php
require 'config/config.php';
require 'includes/classes/Register.php';
require 'includes/classes/User.php';

$register = new Register($conn);
if($register->verifyAccount($_REQUEST['email'], $_REQUEST['token'])){
header("location: index.php");
}
?>
Binary file removed assets/images/cover_pics/_15419363491542113717.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed assets/images/post_pics/_15419363491542113531.png
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"require": {
"phpmailer/phpmailer": "^6.0"
}
}
87 changes: 87 additions & 0 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions config/config.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?php
ob_start();
session_start();
error_reporting(E_ALL & ~E_NOTICE);
$timezone = date_default_timezone_set("Asia/Kolkata");

const DB_HOSTNAME = "localhost";
Expand Down
Binary file added documents/Images/90% message box.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/ChatBook.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/Login.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/Register.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/after becoming friend.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/change password.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/comment_likes.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/comments.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/delete account.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/desktop.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/forgot password.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/friend Request.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/friend_Requests.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/level-0 dfd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/level-1 dfd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/message box at 90%.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/messages.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/notification.PNG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documents/Images/notifications.PNG
Binary file added documents/Images/personal.PNG
Binary file added documents/Images/post_likes.PNG
Binary file added documents/Images/posts.PNG
Binary file added documents/Images/profile page.PNG
Binary file added documents/Images/upload.PNG
Binary file added documents/Images/user table.PNG
Binary file added documents/chatbook - SRS.docx
Binary file not shown.
69 changes: 64 additions & 5 deletions db.sql → documents/db.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1:3306
-- Generation Time: Nov 11, 2018 at 10:57 AM
-- Generation Time: Dec 08, 2018 at 07:08 AM
-- Server version: 5.7.19
-- PHP Version: 7.1.9

Expand Down Expand Up @@ -38,7 +38,14 @@ CREATE TABLE IF NOT EXISTS `comments` (
`post_id` int(11) UNSIGNED NOT NULL,
PRIMARY KEY (`comment_id`),
KEY `comment_id` (`comment_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `comments`
--

INSERT INTO `comments` (`comment_id`, `commented_by`, `body`, `commented_time`, `deleted`, `post_id`) VALUES
(1, 'jitrendra_sharma1543819574', 'hi', '2018-12-05 12:37:13', 0, 4);

-- --------------------------------------------------------

Expand Down Expand Up @@ -69,7 +76,24 @@ CREATE TABLE IF NOT EXISTS `friend_requests` (
`accepted` tinyint(1) DEFAULT NULL,
`deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`request_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `friend_requests`
--

INSERT INTO `friend_requests` (`request_id`, `user_from`, `user_to`, `request_time`, `accepted`, `deleted`) VALUES
(1, 'deepak_singh1543819622', 'jitrendra_sharma1543819574', '2018-12-03 12:19:01', NULL, 1),
(2, 'deepak_singh1543819622', 'jitrendra_sharma1543819574', '2018-12-03 13:57:29', NULL, 1),
(3, 'deepak_singh1543819622', 'jitrendra_sharma1543819574', '2018-12-03 13:57:31', 1, 1),
(4, 'jitrendra_sharma1543819574', 'deepak_singh1543819622', '2018-12-05 12:39:27', NULL, 1),
(5, 'jitrendra_sharma1543819574', 'deepak_singh1543819622', '2018-12-06 07:06:39', NULL, 1),
(6, 'jitrendra_sharma1543819574', 'deepak_singh1543819622', '2018-12-06 07:06:41', NULL, 1),
(7, 'jitrendra_sharma1543819574', 'deepak_singh1543819622', '2018-12-06 07:06:42', NULL, 1),
(8, 'jitrendra_sharma1543819574', 'deepak_singh1543819622', '2018-12-06 07:06:42', NULL, 1),
(9, 'jitrendra_sharma1543819574', 'deepak_singh1543819622', '2018-12-06 07:06:42', NULL, 1),
(10, 'jitrendra_sharma1543819574', 'deepak_singh1543819622', '2018-12-06 07:06:43', NULL, 1),
(11, 'jitrendra_sharma1543819574', 'deepak_singh1543819622', '2018-12-06 07:06:45', 1, 1);

-- --------------------------------------------------------

Expand All @@ -86,7 +110,15 @@ CREATE TABLE IF NOT EXISTS `messages` (
`time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`message_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `messages`
--

INSERT INTO `messages` (`message_id`, `user_from`, `user_to`, `message_body`, `time`, `deleted`) VALUES
(1, 'jitrendra_sharma1543819574', 'deepak_singh1543819622', 'done', '2018-12-05 12:39:58', 0),
(2, 'deepak_singh1543819622', 'jitrendra_sharma1543819574', 'hi', '2018-12-06 07:07:40', 1);

-- --------------------------------------------------------

Expand Down Expand Up @@ -125,7 +157,17 @@ CREATE TABLE IF NOT EXISTS `posts` (
`deleted` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`post_id`),
KEY `post_id` (`post_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=latin1;

--
-- Dumping data for table `posts`
--

INSERT INTO `posts` (`post_id`, `user_from`, `user_to`, `body`, `image`, `posted_time`, `deleted`) VALUES
(1, 'deepak_singh1543819622', '', '', 'assets/images/post_pics/deepak_singh15438196221543819653.png', '2018-12-03 12:17:40', 1),
(2, 'deepak_singh1543819622', '', 'See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg See jvdvdbf f f d fd rgfdg', 'assets/images/post_pics/deepak_singh15438196221543826815.png', '2018-12-03 14:17:14', 1),
(3, 'deepak_singh1543819622', '', '', 'assets/images/post_pics/deepak_singh15438196221543832180.png', '2018-12-03 15:46:21', 1),
(4, 'jitrendra_sharma1543819574', '', 'see this', 'assets/images/post_pics/jitrendra_sharma15438195741543993596.png', '2018-12-05 12:36:42', 0);

-- --------------------------------------------------------

Expand All @@ -141,6 +183,13 @@ CREATE TABLE IF NOT EXISTS `post_likes` (
PRIMARY KEY (`username`,`post_id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `post_likes`
--

INSERT INTO `post_likes` (`username`, `liked`, `post_id`) VALUES
('jitrendra_sharma1543819574', 0, 4);

-- --------------------------------------------------------

--
Expand All @@ -154,6 +203,8 @@ CREATE TABLE IF NOT EXISTS `users` (
`username` varchar(60) NOT NULL,
`email` varchar(100) NOT NULL,
`password` varchar(100) NOT NULL,
`verification_token` varchar(8) DEFAULT NULL,
`forgot_token` varchar(8) DEFAULT NULL,
`signup_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`profile_pic` varchar(255) NOT NULL,
`cover_pic` varchar(255) NOT NULL,
Expand All @@ -168,9 +219,17 @@ CREATE TABLE IF NOT EXISTS `users` (
`school` varchar(255) DEFAULT NULL,
`college` varchar(255) DEFAULT NULL,
`bio` tinytext,
`is_online` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`username`),
UNIQUE KEY `username` (`username`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`first_name`, `last_name`, `username`, `email`, `password`, `verification_token`, `forgot_token`, `signup_date`, `profile_pic`, `cover_pic`, `deactivate_account`, `friend_array`, `phone_no`, `gender`, `birthday`, `city`, `state`, `country`, `school`, `college`, `bio`, `is_online`) VALUES
('Jitendra', 'Sharma', 'jitendra_sharma1544202659', 'jks9536097795@gmail.com', '25f9e794323b453885f5181f1b624d0b', NULL, '6NZ8Fjht', '2018-12-07 17:10:58', 'assets/images/profile_pics/defaults/profile_pic.png', 'assets/images/cover_pics/defaults/cover_pic.jpg', 0, ',', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0);
COMMIT;

/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
Expand Down
Binary file added documents/~$atbook - SRS.docx
Binary file not shown.
86 changes: 86 additions & 0 deletions forgot_password.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php
require 'config/config.php';
require 'includes/classes/Register.php';
require 'includes/classes/User.php';

$register = new Register($conn);
if(isset($_REQUEST['email']) and isset($_REQUEST['token']) and $register->validateToken($_REQUEST['email'],$_REQUEST['token'])){
$_SESSION['email'] = $_REQUEST['email'];
}else if(isset($_POST['new_password']) and isset($_POST['change_password'])){
if($register->changePassword($_SESSION['email'], $_POST['new_password'])){
header("location: index.php");
}
}else{
header("location: index.php");
}
?>

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>ChatBook - Change Password</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/css/bootstrap.min.css" rel="stylesheet">
<link href="assets/css/registration.css" rel="stylesheet">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.0/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootbox.js/4.4.0/bootbox.min.js"></script>
</head>
<body>
<div class="container" style="max-width: 300px;">
<div class="row">
<form action="forgot_password.php" method="post">
<div class="col-md-12">
<h4>Change Password</h4>
<hr>
<div class="form-group row">
<label for="newPassword" class="col-4 col-form-label">New Password</label>
<div class="col-8">
<input id="newPassword" name="new_password" minlength="8" maxlength="15" placeholder="New Password" class="form-control here border" onkeyup="checkPassword(this)" type="password" required>
</div>
</div>
<div class="form-group row">
<label for="confirmPassword" class="col-4 col-form-label">Confirm Password</label>
<div class="col-8">
<input id="confirmPassword" name="confirm_password" minlength="8" maxlength="15" placeholder="Confirm Password" class="form-control here border" onkeyup="matchPasswords(this)" type="password" required>
</div>
</div>
<div class="form-group row">
<div class="offset-4 col-8">
<input id="saveChangedPasswordBtn" type="submit" name="change_password" class="btn btn-primary" value="Change Password">
</div>
</div>
</div>
</form>
</div>
</div>
</body>
</html>

<script>
// change password actions
function checkPassword(obj){
var element = document.getElementById(obj.id);
if( obj.value.length < 8 || obj.value.length > 15){
element.classList.add('border-danger');
} else {
element.classList.remove('border-danger');
element.classList.add('border-success');
}
}
function matchPasswords(obj){
var element = document.getElementById(obj.id);
if( obj.value != document.getElementById('newPassword').value){
element.classList.add('border-danger');
} else {
element.classList.remove('border-danger');
element.classList.add('border-success');
}
}
$('#saveChangedPasswordBtn').click(function(){
if ($('#confirmPassword').val() != $('#newPassword').val()) {
bootbox.alert("Password Mismatch!");
}
});
</script>
2 changes: 1 addition & 1 deletion friend_request.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
right:10px;
}
</style>
<body>
<body onbeforeunload="countPage();">
<?php include("header.php"); ?>
<div role="main" class="container">
<div class="row">
Expand Down
Loading