Completed
Branch master (d23ee3)
by Ankit
02:15
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.
ajax/validate_register.php 1 patch
Braces   +6 added lines, -5 removed lines patch added patch discarded remove patch
@@ -15,9 +15,10 @@
 block discarded – undo
15 15
 	$password = $registerField->password;
16 16
 	$obRegister = new Register();
17 17
 	$result = $obRegister->authRegister($name, $email, $username, $password, $mob);
18
-	if(isset($result))
19
-		echo $result;
20
-	else
21
-		echo json_encode([]);
22
-}
18
+	if(isset($result)) {
19
+			echo $result;
20
+	} else {
21
+			echo json_encode([]);
22
+	}
23
+	}
23 24
 ?>
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
@@ -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.
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/Register.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -41,12 +41,10 @@  discard block
 block discarded – undo
41 41
 		if(empty($this->email)) {
42 42
 			$this->key = 1;
43 43
 			$this->error = array_merge($this->error, ["email" => " *Enter the email address"]);
44
-		}
45
-		elseif(filter_var($this->email, FILTER_VALIDATE_EMAIL) == false) {
44
+		} elseif(filter_var($this->email, FILTER_VALIDATE_EMAIL) == false) {
46 45
 			$this->key = 1;
47 46
 			$this->error = array_merge($this->error, ["email" => " *Enter correct Email address"]);
48
-		}
49
-		else
47
+		} else
50 48
 		{
51 49
 			if($this->obValidate->validateEmailInDb($this->email))
52 50
 			{
@@ -58,8 +56,7 @@  discard block
 block discarded – undo
58 56
 		if(empty($this->username)) {
59 57
 			$this->key = 1;
60 58
 			$this->error = array_merge($this->error, ["username" => " *Enter the username"]);
61
-		}
62
-		else
59
+		} else
63 60
 		{
64 61
 			if($this->obValidate->validateUsernameInDb($this->username))
65 62
 			{
@@ -76,8 +73,7 @@  discard block
 block discarded – undo
76 73
 		if(empty($this->mob)) {
77 74
 			$this->key = 1;
78 75
 			$this->error = array_merge($this->error, ["mob" => " *Enter the Mobile Number"]);
79
-		}
80
-		elseif (!preg_match("/^[0-9]{10}$/", $this->mob)) {
76
+		} elseif (!preg_match("/^[0-9]{10}$/", $this->mob)) {
81 77
 			$this->key = 1;
82 78
 			$this->error = array_merge($this->error, ["mob" => " *Enter correct Mobile Number"]);
83 79
 		}
@@ -85,8 +81,7 @@  discard block
 block discarded – undo
85 81
 		if($this->key == 1)
86 82
 		{
87 83
 			return json_encode($this->error);
88
-		}
89
-		else
84
+		} else
90 85
 		{
91 86
 			$this->key = 0;
92 87
 			$pass = md5($this->password);
@@ -94,8 +89,7 @@  discard block
 block discarded – undo
94 89
 			if(!$this->connect->query($query)) {
95 90
 				$this->key = 1;
96 91
 				echo "You are not registered || Error in registration2";
97
-			}
98
-			else
92
+			} else
99 93
 			{
100 94
 				$query = "SELECT id FROM register WHERE email = '$this->email'";
101 95
 				if($result = $this->connect->query($query)) {
@@ -115,8 +109,7 @@  discard block
 block discarded – undo
115 109
 			return json_encode([
116 110
 				"location" => URL."/account.php"
117 111
 			]);
118
-		}
119
-		else
112
+		} else
120 113
 		{
121 114
 			return json_encode($this->error);
122 115
 		}
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
@@ -29,8 +29,7 @@  discard block
 block discarded – undo
29 29
 		{
30 30
 			$this->key = 1;
31 31
 			$this->error = array_merge($this->error, ["login" => " *Enter the login field"]);
32
-		}
33
-		elseif (preg_match("/^[@]{1}$/", $this->login))
32
+		} elseif (preg_match("/^[@]{1}$/", $this->login))
34 33
 		{
35 34
 			if(filter_var($this->email, FILTER_VALIDATE_EMAIL) == false)
36 35
 			{
@@ -41,8 +40,7 @@  discard block
 block discarded – undo
41 40
 		if(empty($this->password)) {
42 41
 			$this->key = 1;
43 42
 			$this->error = array_merge($this->error, ["password" => " *Enter the password"]);
44
-		}
45
-		else
43
+		} else
46 44
 		{
47 45
 			$pass = md5($this->password);
48 46
 		}
@@ -65,23 +63,20 @@  discard block
 block discarded – undo
65 63
 							return json_encode([
66 64
 								"location" => URL."/account.php"
67 65
 							]);
68
-						}
69
-						else
66
+						} else
70 67
 						{
71 68
 							$this->error = array_merge($this->error, ["password" => " *Invalid password"]);
72 69
 							return json_encode($this->error);
73 70
 						}
74 71
 					}
75
-				}
76
-				else
72
+				} else
77 73
 				{
78 74
 					$this->error = array_merge($this->error, ["login" => " *Invalid username or email"]);
79 75
 					return json_encode($this->error);
80 76
 				}
81 77
 			}
82 78
 
83
-		}
84
-		else
79
+		} else
85 80
 		{
86 81
 			return json_encode($this->error);
87 82
 		}
Please login to merge, or discard this patch.