@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | namespace AnkitJain\RegistrationModule; |
4 | -require (dirname(__DIR__) . '/registration-module/vendor/autoload.php'); |
|
4 | +require (dirname(__DIR__).'/registration-module/vendor/autoload.php'); |
|
5 | 5 | use AnkitJain\RegistrationModule\Session; |
6 | 6 | |
7 | -if(Session::get('start') != null) |
|
7 | +if (Session::get('start') != null) |
|
8 | 8 | { |
9 | 9 | Session::forget('start'); |
10 | 10 | header('Location: index.php'); |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | session_start(); |
3 | -if(isset($_SESSION['start'])) |
|
3 | +if (isset($_SESSION['start'])) |
|
4 | 4 | { |
5 | 5 | header("Location: account.php"); |
6 | 6 | } |
@@ -1,18 +1,18 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | namespace AnkitJain\RegistrationModule; |
4 | -require (dirname(__DIR__) . '/vendor/autoload.php'); |
|
4 | +require (dirname(__DIR__).'/vendor/autoload.php'); |
|
5 | 5 | use AnkitJain\RegistrationModule\Login; |
6 | 6 | @session_start(); |
7 | 7 | |
8 | -if(isset($_POST['q'])) |
|
8 | +if (isset($_POST['q'])) |
|
9 | 9 | { |
10 | 10 | $loginField = json_decode($_POST['q']); |
11 | 11 | $login = $loginField->login; |
12 | 12 | $password = $loginField->password; |
13 | 13 | $obLogin = new Login(); |
14 | 14 | $result = $obLogin->authLogin($login, $password); |
15 | - if(isset($result)) |
|
15 | + if (isset($result)) |
|
16 | 16 | echo $result; |
17 | 17 | else |
18 | 18 | echo json_encode([]); |
@@ -1,18 +1,18 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | namespace AnkitJain\RegistrationModule; |
4 | -require (dirname(__DIR__) . '/vendor/autoload.php'); |
|
4 | +require (dirname(__DIR__).'/vendor/autoload.php'); |
|
5 | 5 | use AnkitJain\RegistrationModule\Login; |
6 | 6 | @session_start(); |
7 | 7 | |
8 | -if(isset($_POST['q'])) |
|
8 | +if (isset($_POST['q'])) |
|
9 | 9 | { |
10 | 10 | $loginField = json_decode($_POST['q']); |
11 | 11 | $login = $loginField->login; |
12 | 12 | $password = $loginField->password; |
13 | 13 | $obLogin = new Login(); |
14 | 14 | $result = $obLogin->authLogin($login, $password); |
15 | - if(isset($result)) |
|
15 | + if (isset($result)) |
|
16 | 16 | echo $result; |
17 | 17 | else |
18 | 18 | echo json_encode([]); |
@@ -2,7 +2,7 @@ |
||
2 | 2 | // Define database connection constants |
3 | 3 | define('DB_HOST', '127.0.0.1'); |
4 | 4 | define('DB_USER', 'root'); |
5 | - define('DB_PASSWORD',''); |
|
5 | + define('DB_PASSWORD', ''); |
|
6 | 6 | define('DB_NAME', 'account'); |
7 | 7 | define('URL', 'http://127.0.0.1/openchat'); |
8 | 8 |
@@ -2,7 +2,7 @@ |
||
2 | 2 | // Define database connection constants |
3 | 3 | define('DB_HOST', '127.0.0.1'); |
4 | 4 | define('DB_USER', 'root'); |
5 | - define('DB_PASSWORD',''); |
|
5 | + define('DB_PASSWORD', ''); |
|
6 | 6 | define('DB_NAME', 'account'); |
7 | 7 | define('URL', 'http://127.0.0.1/openchat'); |
8 | 8 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | */ |
13 | 13 | namespace AnkitJain\RegistrationModule; |
14 | 14 | use AnkitJain\RegistrationModule\Session; |
15 | -require_once dirname(__DIR__) . '/config/database.php'; |
|
15 | +require_once dirname(__DIR__).'/config/database.php'; |
|
16 | 16 | |
17 | 17 | /** |
18 | 18 | * For Login the User |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | Session::put('start', $loginID); |
91 | 91 | return json_encode( |
92 | 92 | [ |
93 | - "location" => URL . "/account.php" |
|
93 | + "location" => URL."/account.php" |
|
94 | 94 | ] |
95 | 95 | ); |
96 | 96 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | return json_encode( |
101 | 101 | [ |
102 | - "Error" => "You are not registered, " . $this->connect->error |
|
102 | + "Error" => "You are not registered, ".$this->connect->error |
|
103 | 103 | ] |
104 | 104 | ); |
105 | 105 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | } |
109 | 109 | return json_encode( |
110 | 110 | [ |
111 | - "Error" => "You are not registered, " . $this->connect->error |
|
111 | + "Error" => "You are not registered, ".$this->connect->error |
|
112 | 112 | ] |
113 | 113 | ); |
114 | 114 | } else { |
@@ -11,7 +11,7 @@ |
||
11 | 11 | * @link https://github.com/ankitjain28may/registration-module |
12 | 12 | */ |
13 | 13 | namespace AnkitJain\RegistrationModule; |
14 | -require_once dirname(__DIR__) . '/config/database.php'; |
|
14 | +require_once dirname(__DIR__).'/config/database.php'; |
|
15 | 15 | |
16 | 16 | /** |
17 | 17 | * For validation the Email and Username in DB. |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | namespace AnkitJain\RegistrationModule; |
15 | 15 | use AnkitJain\RegistrationModule\Validate; |
16 | 16 | use AnkitJain\RegistrationModule\Session; |
17 | -require_once dirname(__DIR__) . '/config/database.php'; |
|
17 | +require_once dirname(__DIR__).'/config/database.php'; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * For Register the New User |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | if (!$this->connect->query($query)) { |
99 | 99 | return json_encode( |
100 | 100 | [ |
101 | - "Error" => "You are not registered, " . $this->connect->error |
|
101 | + "Error" => "You are not registered, ".$this->connect->error |
|
102 | 102 | ] |
103 | 103 | ); |
104 | 104 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | if (!$this->connect->query($query)) { |
114 | 114 | return json_encode( |
115 | 115 | [ |
116 | - "Error" => "You are not registered, " . $this->connect->error |
|
116 | + "Error" => "You are not registered, ".$this->connect->error |
|
117 | 117 | ] |
118 | 118 | ); |
119 | 119 | } |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | Session::put('start', $userId); |
122 | 122 | return json_encode( |
123 | 123 | [ |
124 | - "location" => URL . "/account.php" |
|
124 | + "location" => URL."/account.php" |
|
125 | 125 | ] |
126 | 126 | ); |
127 | 127 | } |