Completed
Push — master ( b76728...e97d17 )
by Ankit
02:22
created
logout.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,8 +8,7 @@
 block discarded – undo
8 8
 {
9 9
 	Session::forget('start');
10 10
 	header('Location: index.php');
11
-}
12
-else
11
+} else
13 12
 {
14 13
 	echo "Please Login";
15 14
 }
Please login to merge, or discard this patch.
source/Validate.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,9 +18,9 @@  discard block
 block discarded – undo
18 18
 		{
19 19
 			if ($result->num_rows > 0) {
20 20
 				return 1;
21
+			} else {
22
+							return 0;
21 23
 			}
22
-			else
23
-				return 0;
24 24
 		}
25 25
 	}
26 26
 
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 		if ($result = $this->connect->query($query)) {
31 31
 			if ($result->num_rows > 0) {
32 32
 				return 1;
33
+			} else {
34
+							return 0;
33 35
 			}
34
-			else
35
-				return 0;
36 36
 		}
37 37
 	}
38 38
 }
Please login to merge, or discard this patch.
source/Login.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,8 +28,7 @@  discard block
 block discarded – undo
28 28
 		{
29 29
 			$this->key = 1;
30 30
 			$this->error = array_merge($this->error, ["login" => " *Enter the login field"]);
31
-		}
32
-		elseif (preg_match("/^[@]{1}$/", $login))
31
+		} elseif (preg_match("/^[@]{1}$/", $login))
33 32
 		{
34 33
 			if(filter_var($login, FILTER_VALIDATE_EMAIL) == false)
35 34
 			{
@@ -40,8 +39,7 @@  discard block
 block discarded – undo
40 39
 		if(empty($password)) {
41 40
 			$this->key = 1;
42 41
 			$this->error = array_merge($this->error, ["password" => " *Enter the password"]);
43
-		}
44
-		else
42
+		} else
45 43
 		{
46 44
 			$pass = md5($password);
47 45
 		}
@@ -64,23 +62,20 @@  discard block
 block discarded – undo
64 62
 							return json_encode([
65 63
 								"location" => URL."/account.php"
66 64
 							]);
67
-						}
68
-						else
65
+						} else
69 66
 						{
70 67
 							$this->error = array_merge($this->error, ["password" => " *Invalid password"]);
71 68
 							return json_encode($this->error);
72 69
 						}
73 70
 					}
74
-				}
75
-				else
71
+				} else
76 72
 				{
77 73
 					$this->error = array_merge($this->error, ["login" => " *Invalid username or email"]);
78 74
 					return json_encode($this->error);
79 75
 				}
80 76
 			}
81 77
 
82
-		}
83
-		else
78
+		} else
84 79
 		{
85 80
 			return json_encode($this->error);
86 81
 		}
Please login to merge, or discard this patch.
source/Register.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -34,11 +34,9 @@  discard block
 block discarded – undo
34 34
 
35 35
 		if(empty($email)) {
36 36
 			$this->onError(["email" => " *Enter the email address"]);
37
-		}
38
-		elseif(filter_var($email, FILTER_VALIDATE_EMAIL) == false) {
37
+		} elseif(filter_var($email, FILTER_VALIDATE_EMAIL) == false) {
39 38
 			$this->onError(["email" => " *Enter correct Email address"]);
40
-		}
41
-		else
39
+		} else
42 40
 		{
43 41
 			if($this->obValidate->validateEmailInDb($email) === 1)
44 42
 			{
@@ -49,8 +47,7 @@  discard block
 block discarded – undo
49 47
 
50 48
 		if(empty($username)) {
51 49
 			$this->onError(["username" => " *Enter the username"]);
52
-		}
53
-		else
50
+		} else
54 51
 		{
55 52
 			if($this->obValidate->validateUsernameInDb($username) === 1)
56 53
 			{
@@ -65,16 +62,14 @@  discard block
 block discarded – undo
65 62
 
66 63
 		if(empty($mob)) {
67 64
 			$this->onError(["mob" => " *Enter the Mobile Number"]);
68
-		}
69
-		elseif (!preg_match("/^[0-9]{10}$/", $mob)) {
65
+		} elseif (!preg_match("/^[0-9]{10}$/", $mob)) {
70 66
 			$this->onError(["mob" => " *Enter correct Mobile Number"]);
71 67
 		}
72 68
 
73 69
 		if($this->key == 1)
74 70
 		{
75 71
 			return json_encode($this->error);
76
-		}
77
-		else
72
+		} else
78 73
 		{
79 74
 			$this->key = 0;
80 75
 			$pass = md5($password);
@@ -82,8 +77,7 @@  discard block
 block discarded – undo
82 77
 			if(!$this->connect->query($query)) {
83 78
 				$this->key = 1;
84 79
 				echo "You are not registered || Error in registration2";
85
-			}
86
-			else
80
+			} else
87 81
 			{
88 82
 				$query = "SELECT id FROM register WHERE email = '$email'";
89 83
 				if($result = $this->connect->query($query)) {
@@ -103,8 +97,7 @@  discard block
 block discarded – undo
103 97
 			return json_encode([
104 98
 				"location" => URL."/account.php"
105 99
 			]);
106
-		}
107
-		else
100
+		} else
108 101
 		{
109 102
 			return json_encode($this->error);
110 103
 		}
Please login to merge, or discard this patch.
ajax/validate_login.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -11,8 +11,9 @@
 block discarded – undo
11 11
 	$password = $loginField->password;
12 12
 	$obLogin = new Login();
13 13
 	$result = $obLogin->authLogin($login, $password);
14
-	if(isset($result))
15
-		echo $result;
16
-	else
17
-		echo json_encode([]);
18
-}
19 14
\ No newline at end of file
15
+	if(isset($result)) {
16
+			echo $result;
17
+	} else {
18
+			echo json_encode([]);
19
+	}
20
+	}
20 21
\ No newline at end of file
Please login to merge, or discard this patch.
ajax/validate_register.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -12,9 +12,10 @@
 block discarded – undo
12 12
 	$password = $loginField->password;
13 13
 	$obLogin = new Login();
14 14
 	$result = $obLogin->authLogin($login, $password);
15
-	if(isset($result))
16
-		echo $result;
17
-	else
18
-		echo json_encode([]);
19
-}
15
+	if(isset($result)) {
16
+			echo $result;
17
+	} else {
18
+			echo json_encode([]);
19
+	}
20
+	}
20 21
 ?>
Please login to merge, or discard this patch.