@@ -6,7 +6,7 @@ |
||
6 | 6 | date_default_timezone_set("America/Bogota"); |
7 | 7 | |
8 | 8 | // Memory limit |
9 | -ini_set("memory_limit","256M"); |
|
9 | +ini_set("memory_limit", "256M"); |
|
10 | 10 | |
11 | 11 | // Run application |
12 | 12 | require_once("vendor/autoload.php"); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $http = new Http(); |
87 | 87 | $http->writeStatus($http::HTTP_METHOD_NOT_ALLOWED); |
88 | 88 | |
89 | - die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED .' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
89 | + die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED . ' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | $this->checkSession(); |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | $http = new Http(); |
117 | 117 | $http->writeStatus($http::HTTP_METHOD_NOT_ALLOWED); |
118 | 118 | |
119 | - die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED .' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
119 | + die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED . ' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | # STANDARD VALIDATIONS [check needed arguments] |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $http = new Http(); |
129 | 129 | $http->writeStatus($http::HTTP_BAD_REQUEST); |
130 | 130 | |
131 | - die('Error ' . $http::HTTP_BAD_REQUEST .' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
131 | + die('Error ' . $http::HTTP_BAD_REQUEST . ' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
132 | 132 | } |
133 | 133 | }); |
134 | 134 | |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | foreach ($errors as $errno => $error) |
269 | 269 | { |
270 | 270 | $errorInformation .= |
271 | - "<strong style='color: #a94442'>". |
|
271 | + "<strong style='color: #a94442'>" . |
|
272 | 272 | $method |
273 | 273 | . "</strong>: <span style='color: #e24f4c'>{$error}</span> \n<br />"; |
274 | 274 | } |
@@ -20,7 +20,7 @@ |
||
20 | 20 | $http = new Http(); |
21 | 21 | $http->writeStatus($http::HTTP_METHOD_NOT_ALLOWED); |
22 | 22 | |
23 | - die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED .' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
23 | + die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED . ' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
24 | 24 | } |
25 | 25 | |
26 | 26 | $config = include 'module/Auth/config/user.config.php'; |
@@ -81,7 +81,7 @@ |
||
81 | 81 | { |
82 | 82 | $new = array(); |
83 | 83 | |
84 | - foreach($obj as $key => $val) |
|
84 | + foreach ($obj as $key => $val) |
|
85 | 85 | { |
86 | 86 | $new[$key] = $this->object_to_array($val); |
87 | 87 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $data = array(); |
157 | 157 | |
158 | 158 | # environment settings |
159 | - $this->setTerminal(true); # set terminal |
|
159 | + $this->setTerminal(true); # set terminal |
|
160 | 160 | |
161 | 161 | # TRY-CATCH-BLOCK |
162 | 162 | try { |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | $http = new Http(); |
168 | 168 | $http->writeStatus($http::HTTP_METHOD_NOT_ALLOWED); |
169 | 169 | |
170 | - die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED .' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
170 | + die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED . ' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | $data["connections"] = $this->getUserConnectionEntity()->select([ |
@@ -227,8 +227,8 @@ discard block |
||
227 | 227 | $data = array(); |
228 | 228 | |
229 | 229 | # environment settings |
230 | - $post = $this->getPost(); # catch $_POST |
|
231 | - $this->setTerminal(true); # set terminal |
|
230 | + $post = $this->getPost(); # catch $_POST |
|
231 | + $this->setTerminal(true); # set terminal |
|
232 | 232 | |
233 | 233 | # TRY-CATCH-BLOCK |
234 | 234 | try { |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | $http = new Http(); |
240 | 240 | $http->writeStatus($http::HTTP_METHOD_NOT_ALLOWED); |
241 | 241 | |
242 | - die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED .' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
242 | + die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED . ' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | # STANDARD VALIDATIONS [check needed arguments] |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | $http = new Http(); |
252 | 252 | $http->writeStatus($http::HTTP_BAD_REQUEST); |
253 | 253 | |
254 | - die('Error ' . $http::HTTP_BAD_REQUEST .' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
254 | + die('Error ' . $http::HTTP_BAD_REQUEST . ' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
255 | 255 | } |
256 | 256 | }); |
257 | 257 | |
@@ -359,8 +359,8 @@ discard block |
||
359 | 359 | $data = array(); |
360 | 360 | |
361 | 361 | # environment settings |
362 | - $post = $this->getPost(); # catch $_POST |
|
363 | - $this->setTerminal(true); # set terminal |
|
362 | + $post = $this->getPost(); # catch $_POST |
|
363 | + $this->setTerminal(true); # set terminal |
|
364 | 364 | |
365 | 365 | # TRY-CATCH-BLOCK |
366 | 366 | try { |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | $http = new Http(); |
400 | 400 | $http->writeStatus($http::HTTP_BAD_REQUEST); |
401 | 401 | |
402 | - die('Error ' . $http::HTTP_BAD_REQUEST .' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
402 | + die('Error ' . $http::HTTP_BAD_REQUEST . ' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
403 | 403 | } |
404 | 404 | }); |
405 | 405 | |
@@ -492,7 +492,7 @@ discard block |
||
492 | 492 | $http = new Http(); |
493 | 493 | $http->writeStatus($http::HTTP_METHOD_NOT_ALLOWED); |
494 | 494 | |
495 | - die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED .' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
495 | + die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED . ' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
496 | 496 | } |
497 | 497 | } |
498 | 498 | catch (\Drone\Exception\Exception $e) |
@@ -544,9 +544,9 @@ discard block |
||
544 | 544 | $data = array(); |
545 | 545 | |
546 | 546 | # environment settings |
547 | - $post = $this->getPost(); # catch $_POST |
|
548 | - $get = $_GET; # catch $_GET |
|
549 | - $this->setTerminal(true); # set terminal |
|
547 | + $post = $this->getPost(); # catch $_POST |
|
548 | + $get = $_GET; # catch $_GET |
|
549 | + $this->setTerminal(true); # set terminal |
|
550 | 550 | |
551 | 551 | # TRY-CATCH-BLOCK |
552 | 552 | try { |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | $http = new Http(); |
563 | 563 | $http->writeStatus($http::HTTP_BAD_REQUEST); |
564 | 564 | |
565 | - die('Error ' . $http::HTTP_BAD_REQUEST .' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
565 | + die('Error ' . $http::HTTP_BAD_REQUEST . ' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
566 | 566 | } |
567 | 567 | }); |
568 | 568 | |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | $http = new Http(); |
625 | 625 | $http->writeStatus($http::HTTP_BAD_REQUEST); |
626 | 626 | |
627 | - die('Error ' . $http::HTTP_BAD_REQUEST .' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
627 | + die('Error ' . $http::HTTP_BAD_REQUEST . ' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
628 | 628 | } |
629 | 629 | }); |
630 | 630 | |
@@ -729,7 +729,7 @@ discard block |
||
729 | 729 | $http = new Http(); |
730 | 730 | $http->writeStatus($http::HTTP_METHOD_NOT_ALLOWED); |
731 | 731 | |
732 | - die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED .' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
732 | + die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED . ' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
733 | 733 | } |
734 | 734 | } |
735 | 735 | catch (\Drone\Exception\Exception $e) |
@@ -776,7 +776,7 @@ discard block |
||
776 | 776 | foreach ($errors as $errno => $error) |
777 | 777 | { |
778 | 778 | $errorInformation .= |
779 | - "<strong style='color: #a94442'>". |
|
779 | + "<strong style='color: #a94442'>" . |
|
780 | 780 | $method |
781 | 781 | . "</strong>: <span style='color: #e24f4c'>{$error}</span> \n<br />"; |
782 | 782 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | ], |
25 | 25 | 'environment' => [ |
26 | 26 | 'base_path' => (dirname(dirname($_SERVER['PHP_SELF'])) == "/") ? "" : dirname(dirname($_SERVER['PHP_SELF'])), |
27 | - 'dev_mode' => true, // set this to FALSE for production environments |
|
27 | + 'dev_mode' => true, // set this to FALSE for production environments |
|
28 | 28 | 'locale' => 'en' |
29 | 29 | ], |
30 | 30 | ]; |
31 | 31 | \ No newline at end of file |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | { |
5 | 5 | function ifdef($value, Array $array) |
6 | 6 | { |
7 | - $global = __DIR__ . '/../../../config/global.config.php'; |
|
7 | + $global = __DIR__ . '/../../../config/global.config.php'; |
|
8 | 8 | |
9 | 9 | if (file_exists($global)) |
10 | 10 | { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | if (!$key) |
29 | 29 | return $in; |
30 | 30 | |
31 | - } while($key); |
|
31 | + } while ($key); |
|
32 | 32 | } |
33 | 33 | else |
34 | 34 | return $value; |
@@ -37,11 +37,11 @@ discard block |
||
37 | 37 | |
38 | 38 | return [ |
39 | 39 | 'project' => [ |
40 | - 'name' => ifdef('PROJECT NAME', ["project", "name"]), # The name of your project |
|
40 | + 'name' => ifdef('PROJECT NAME', ["project", "name"]), # The name of your project |
|
41 | 41 | ], |
42 | 42 | "authentication" => [ |
43 | - "method" => ifdef('_COOKIE', ["authentication", "method"]), # the method to store credentials (_COOKIE, _SESSION) |
|
44 | - "key" => ifdef('session_id', ["authentication", "key"]), # the key in the array to store credentials |
|
43 | + "method" => ifdef('_COOKIE', ["authentication", "method"]), # the method to store credentials (_COOKIE, _SESSION) |
|
44 | + "key" => ifdef('session_id', ["authentication", "key"]), # the key in the array to store credentials |
|
45 | 45 | ], |
46 | 46 | "database" => [ |
47 | 47 | /** TABLE PREFIX: |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | { |
5 | 5 | function ifdef($value, Array $array) |
6 | 6 | { |
7 | - $global = __DIR__ . '/../../../config/global.config.php'; |
|
7 | + $global = __DIR__ . '/../../../config/global.config.php'; |
|
8 | 8 | |
9 | 9 | if (file_exists($global)) |
10 | 10 | { |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | if (!$key) |
29 | 29 | return $in; |
30 | 30 | |
31 | - } while($key); |
|
31 | + } while ($key); |
|
32 | 32 | } |
33 | 33 | else |
34 | 34 | return $value; |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | |
38 | 38 | return [ |
39 | 39 | 'project' => [ |
40 | - 'name' => ifdef('PROJECT NAME', ["project", "name"]), # The name of your project |
|
40 | + 'name' => ifdef('PROJECT NAME', ["project", "name"]), # The name of your project |
|
41 | 41 | ], |
42 | 42 | 'mail' => [ |
43 | 43 | /** CHECKING: |
@@ -51,8 +51,8 @@ discard block |
||
51 | 51 | "host" => ifdef('localhost', ["mail", "host"]) |
52 | 52 | ], |
53 | 53 | "authentication" => [ |
54 | - "method" => ifdef('_COOKIE', ["authentication", "method"]), # the method to store credentials (_COOKIE, _SESSION) |
|
55 | - "key" => ifdef('session_id', ["authentication", "key"]), # the key in the array to store credentials |
|
54 | + "method" => ifdef('_COOKIE', ["authentication", "method"]), # the method to store credentials (_COOKIE, _SESSION) |
|
55 | + "key" => ifdef('session_id', ["authentication", "key"]), # the key in the array to store credentials |
|
56 | 56 | /** AUTH TYPE: |
57 | 57 | * db_table: get credentials from a table in a database |
58 | 58 | * db_user: get credentials from database users (database authentication) |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * a database and checks the specified credentials. Theses will checked only if the AUTH TYPE is db_table. |
64 | 64 | */ |
65 | 65 | "gateway" => [ |
66 | - "entity" => "USER", # Table name (without prefix if exists) |
|
66 | + "entity" => "USER", # Table name (without prefix if exists) |
|
67 | 67 | /** CREDENTIALS: |
68 | 68 | * The field names of credentials in the table. |
69 | 69 | */ |
@@ -81,14 +81,14 @@ discard block |
||
81 | 81 | */ |
82 | 82 | "table_info" => [ |
83 | 83 | "columns" => [ |
84 | - "id_field" => "USER_ID", # often the primary key |
|
85 | - "state_field" => "USER_STATE_ID", # required if mail_checking is enabled |
|
84 | + "id_field" => "USER_ID", # often the primary key |
|
85 | + "state_field" => "USER_STATE_ID", # required if mail_checking is enabled |
|
86 | 86 | "email_field" => "EMAIL" # required registration process |
87 | 87 | ], |
88 | 88 | "column_values" => [ |
89 | 89 | "state_field" => [ |
90 | - "pending_email" => 1, # required if mail_checking is enabled |
|
91 | - "user_active" => 2, # required if mail_checking is enabled |
|
90 | + "pending_email" => 1, # required if mail_checking is enabled |
|
91 | + "user_active" => 2, # required if mail_checking is enabled |
|
92 | 92 | ] |
93 | 93 | ] |
94 | 94 | ] |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $table = $this->getEntity()->getTableName(); |
17 | 17 | |
18 | 18 | $config = include 'module/Auth/config/user.config.php'; |
19 | - $id_field = $config["authentication"]["gateway"]["table_info"]["columns"]["id_field"]; |
|
19 | + $id_field = $config["authentication"]["gateway"]["table_info"]["columns"]["id_field"]; |
|
20 | 20 | |
21 | 21 | $sql = "SELECT CASE WHEN MAX($id_field) IS NULL THEN 1 ELSE MAX($id_field) + 1 END AS USER_ID FROM $table"; |
22 | 22 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | public function getUserById($id) |
38 | 38 | { |
39 | 39 | $config = include 'module/Auth/config/user.config.php'; |
40 | - $id_field = $config["authentication"]["gateway"]["table_info"]["columns"]["id_field"]; |
|
40 | + $id_field = $config["authentication"]["gateway"]["table_info"]["columns"]["id_field"]; |
|
41 | 41 | |
42 | 42 | $rowset = $this->select([ |
43 | 43 | $id_field => $id |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | public function getUserByUsernameCredential($username) |
70 | 70 | { |
71 | 71 | $config = include 'module/Auth/config/user.config.php'; |
72 | - $username_credential = $config["authentication"]["gateway"]["credentials"]["username"]; |
|
72 | + $username_credential = $config["authentication"]["gateway"]["credentials"]["username"]; |
|
73 | 73 | |
74 | 74 | $rowset = $this->select([ |
75 | 75 | $username_credential => $username |