@@ -12,10 +12,10 @@ |
||
12 | 12 | require_once("vendor/autoload.php"); |
13 | 13 | |
14 | 14 | try { |
15 | - $mvc = new Drone\Mvc\Application(include "config/application.config.php"); |
|
16 | - $mvc->run(); |
|
15 | + $mvc = new Drone\Mvc\Application(include "config/application.config.php"); |
|
16 | + $mvc->run(); |
|
17 | 17 | } |
18 | 18 | catch (Drone\Mvc\PageNotFoundException $e) |
19 | 19 | { |
20 | - die('Error 404 (Page Not Found)!!'); |
|
20 | + die('Error 404 (Page Not Found)!!'); |
|
21 | 21 | } |
22 | 22 | \ No newline at end of file |
@@ -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 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $http = new Http(); |
88 | 88 | $http->writeStatus($http::HTTP_METHOD_NOT_ALLOWED); |
89 | 89 | |
90 | - die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED .' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
90 | + die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED . ' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $this->checkSession(); |
@@ -106,8 +106,8 @@ discard block |
||
106 | 106 | $data = []; |
107 | 107 | |
108 | 108 | # environment settings |
109 | - $post = $this->getPost(); # catch $_POST |
|
110 | - $this->setTerminal(true); # set terminal |
|
109 | + $post = $this->getPost(); # catch $_POST |
|
110 | + $this->setTerminal(true); # set terminal |
|
111 | 111 | |
112 | 112 | # TRY-CATCH-BLOCK |
113 | 113 | try { |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | $http = new Http(); |
119 | 119 | $http->writeStatus($http::HTTP_METHOD_NOT_ALLOWED); |
120 | 120 | |
121 | - die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED .' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
121 | + die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED . ' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | # STANDARD VALIDATIONS [check needed arguments] |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | $http = new Http(); |
131 | 131 | $http->writeStatus($http::HTTP_BAD_REQUEST); |
132 | 132 | |
133 | - die('Error ' . $http::HTTP_BAD_REQUEST .' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
133 | + die('Error ' . $http::HTTP_BAD_REQUEST . ' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
134 | 134 | } |
135 | 135 | }); |
136 | 136 | |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | |
242 | 242 | $headers = 'MIME-Version: 1.0' . "\r\n"; |
243 | 243 | $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; |
244 | - $headers .= 'From: '. $from ."\r\n". 'X-Mailer: PHP/' . phpversion(); |
|
244 | + $headers .= 'From: ' . $from . "\r\n" . 'X-Mailer: PHP/' . phpversion(); |
|
245 | 245 | |
246 | 246 | if (!@mail( |
247 | 247 | $post["email"], "Email checking!", |
@@ -321,7 +321,7 @@ discard block |
||
321 | 321 | $http = new Http(); |
322 | 322 | $http->writeStatus($http::HTTP_METHOD_NOT_ALLOWED); |
323 | 323 | |
324 | - die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED .' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
324 | + die('Error ' . $http::HTTP_METHOD_NOT_ALLOWED . ' (' . $http->getStatusText($http::HTTP_METHOD_NOT_ALLOWED) . ')!!'); |
|
325 | 325 | } |
326 | 326 | |
327 | 327 | # STANDARD VALIDATIONS [check needed arguments] |
@@ -333,7 +333,7 @@ discard block |
||
333 | 333 | $http = new Http(); |
334 | 334 | $http->writeStatus($http::HTTP_BAD_REQUEST); |
335 | 335 | |
336 | - die('Error ' . $http::HTTP_BAD_REQUEST .' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
336 | + die('Error ' . $http::HTTP_BAD_REQUEST . ' (' . $http->getStatusText($http::HTTP_BAD_REQUEST) . ')!!'); |
|
337 | 337 | } |
338 | 338 | }); |
339 | 339 | |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | foreach ($errors as $errno => $error) |
412 | 412 | { |
413 | 413 | $errorInformation .= |
414 | - "<strong style='color: #a94442'>". |
|
414 | + "<strong style='color: #a94442'>" . |
|
415 | 415 | $method |
416 | 416 | . "</strong>: <span style='color: #e24f4c'>{$error}</span> \n<br />"; |
417 | 417 | } |
@@ -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'; |
@@ -6,52 +6,52 @@ |
||
6 | 6 | |
7 | 7 | class User extends Entity |
8 | 8 | { |
9 | - /** |
|
10 | - * @var integer |
|
11 | - */ |
|
9 | + /** |
|
10 | + * @var integer |
|
11 | + */ |
|
12 | 12 | public $USER_ID; |
13 | 13 | |
14 | - /** |
|
15 | - * @var string |
|
16 | - */ |
|
14 | + /** |
|
15 | + * @var string |
|
16 | + */ |
|
17 | 17 | public $USERNAME; |
18 | 18 | |
19 | - /** |
|
20 | - * @var integer |
|
21 | - */ |
|
19 | + /** |
|
20 | + * @var integer |
|
21 | + */ |
|
22 | 22 | public $USER_STATE_ID; |
23 | 23 | |
24 | - /** |
|
25 | - * @var integer |
|
26 | - */ |
|
24 | + /** |
|
25 | + * @var integer |
|
26 | + */ |
|
27 | 27 | public $ROLE_ID; |
28 | 28 | |
29 | - /** |
|
30 | - * @var string |
|
31 | - */ |
|
29 | + /** |
|
30 | + * @var string |
|
31 | + */ |
|
32 | 32 | public $USER_PASSWORD; |
33 | 33 | |
34 | - /** |
|
35 | - * @var string |
|
36 | - */ |
|
34 | + /** |
|
35 | + * @var string |
|
36 | + */ |
|
37 | 37 | public $EMAIL; |
38 | 38 | |
39 | - /** |
|
40 | - * @var string |
|
41 | - */ |
|
39 | + /** |
|
40 | + * @var string |
|
41 | + */ |
|
42 | 42 | public $TOKEN; |
43 | 43 | |
44 | - /** |
|
45 | - * @var date |
|
46 | - */ |
|
44 | + /** |
|
45 | + * @var date |
|
46 | + */ |
|
47 | 47 | public $RECORD_DATE; |
48 | 48 | |
49 | 49 | public function __construct($data = []) |
50 | 50 | { |
51 | - parent::__construct($data); |
|
51 | + parent::__construct($data); |
|
52 | 52 | |
53 | - $config = include 'module/Auth/config/user.config.php'; |
|
54 | - $table = $config["authentication"]["gateway"]["entity"]; |
|
53 | + $config = include 'module/Auth/config/user.config.php'; |
|
54 | + $table = $config["authentication"]["gateway"]["entity"]; |
|
55 | 55 | |
56 | 56 | $this->setTableName($table); |
57 | 57 | } |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | |
10 | 10 | class Module extends AbstractionModule |
11 | 11 | { |
12 | - public function init(AbstractionController $c) |
|
13 | - { |
|
14 | - $config = $this->getUserConfig(); |
|
15 | - $_config = $this->toFormConfig($config); |
|
12 | + public function init(AbstractionController $c) |
|
13 | + { |
|
14 | + $config = $this->getUserConfig(); |
|
15 | + $_config = $this->toFormConfig($config); |
|
16 | 16 | |
17 | - # config constraints |
|
17 | + # config constraints |
|
18 | 18 | |
19 | 19 | $components = [ |
20 | 20 | "attributes" => [ |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | } |
81 | 81 | |
82 | 82 | $this->setTranslator($c); |
83 | - } |
|
83 | + } |
|
84 | 84 | |
85 | 85 | private function setTranslator(AbstractionController $c) |
86 | 86 | { |
@@ -102,30 +102,30 @@ discard block |
||
102 | 102 | $c->translator = new \Zend\Mvc\I18n\Translator($i18nTranslator); |
103 | 103 | } |
104 | 104 | |
105 | - public function getUserConfig() |
|
106 | - { |
|
107 | - return include __DIR__ . "/config/user.config.php"; |
|
108 | - } |
|
109 | - |
|
110 | - private function toFormConfig($config) |
|
111 | - { |
|
112 | - $new_config = []; |
|
113 | - $again = false; |
|
114 | - |
|
115 | - foreach ($config as $param => $configure) |
|
116 | - { |
|
117 | - if (is_array($configure)) |
|
118 | - { |
|
119 | - foreach ($configure as $key => $value) |
|
120 | - { |
|
121 | - $again = true; |
|
122 | - $new_config[$param . "_" . $key] = $value; |
|
123 | - } |
|
124 | - } |
|
125 | - else |
|
126 | - $new_config[$param] = $configure; |
|
127 | - } |
|
128 | - |
|
129 | - return (!$again) ? $new_config : $this->toFormConfig($new_config); |
|
130 | - } |
|
105 | + public function getUserConfig() |
|
106 | + { |
|
107 | + return include __DIR__ . "/config/user.config.php"; |
|
108 | + } |
|
109 | + |
|
110 | + private function toFormConfig($config) |
|
111 | + { |
|
112 | + $new_config = []; |
|
113 | + $again = false; |
|
114 | + |
|
115 | + foreach ($config as $param => $configure) |
|
116 | + { |
|
117 | + if (is_array($configure)) |
|
118 | + { |
|
119 | + foreach ($configure as $key => $value) |
|
120 | + { |
|
121 | + $again = true; |
|
122 | + $new_config[$param . "_" . $key] = $value; |
|
123 | + } |
|
124 | + } |
|
125 | + else |
|
126 | + $new_config[$param] = $configure; |
|
127 | + } |
|
128 | + |
|
129 | + return (!$again) ? $new_config : $this->toFormConfig($new_config); |
|
130 | + } |
|
131 | 131 | } |
132 | 132 | \ No newline at end of file |
@@ -3,12 +3,12 @@ |
||
3 | 3 | return [ |
4 | 4 | "Register form" => "Register form", |
5 | 5 | "User registering" => "User registering", |
6 | - "Username" => "Username", |
|
7 | - "username" => "username", |
|
8 | - "Email" => "Email", |
|
9 | - "email" => "email", |
|
10 | - "Password" => "Password", |
|
11 | - "password" => "password", |
|
6 | + "Username" => "Username", |
|
7 | + "username" => "username", |
|
8 | + "Email" => "Email", |
|
9 | + "email" => "email", |
|
10 | + "Password" => "Password", |
|
11 | + "password" => "password", |
|
12 | 12 | "Repeat your password" => "Repeat your password", |
13 | 13 | "Register now" => "Register now", |
14 | 14 | "Log in" => "Log in", |
@@ -1,25 +1,25 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | return [ |
4 | - 'project' => [ |
|
5 | - 'name' => 'SQLWebManager', |
|
6 | - ], |
|
7 | - 'mail' => [ |
|
8 | - 'checking' => [ |
|
9 | - 'enabled' => false, |
|
10 | - 'from' => '[email protected]' |
|
11 | - ], |
|
12 | - ], |
|
13 | - "authentication" => [ |
|
14 | - "method" => "_COOKIE", |
|
15 | - "key" => "session_id", |
|
16 | - "gateway" => [ |
|
17 | - "entity" => "SWM_USERS", |
|
18 | - "credentials" => [ |
|
19 | - "username" => "USERNAME", |
|
20 | - "password" => "USER_PASSWORD" |
|
21 | - ] |
|
22 | - ] |
|
23 | - ], |
|
24 | - "redirect" => "Workarea" |
|
4 | + 'project' => [ |
|
5 | + 'name' => 'SQLWebManager', |
|
6 | + ], |
|
7 | + 'mail' => [ |
|
8 | + 'checking' => [ |
|
9 | + 'enabled' => false, |
|
10 | + 'from' => '[email protected]' |
|
11 | + ], |
|
12 | + ], |
|
13 | + "authentication" => [ |
|
14 | + "method" => "_COOKIE", |
|
15 | + "key" => "session_id", |
|
16 | + "gateway" => [ |
|
17 | + "entity" => "SWM_USERS", |
|
18 | + "credentials" => [ |
|
19 | + "username" => "USERNAME", |
|
20 | + "password" => "USER_PASSWORD" |
|
21 | + ] |
|
22 | + ] |
|
23 | + ], |
|
24 | + "redirect" => "Workarea" |
|
25 | 25 | ]; |
26 | 26 | \ No newline at end of file |
@@ -3,11 +3,11 @@ |
||
3 | 3 | return [ |
4 | 4 | 'router' => [ |
5 | 5 | 'routes' => [ |
6 | - 'Auth' => [ |
|
7 | - 'module' => 'Auth', |
|
8 | - 'controller' => 'LogIn', |
|
9 | - 'view' => 'index' |
|
10 | - ] |
|
6 | + 'Auth' => [ |
|
7 | + 'module' => 'Auth', |
|
8 | + 'controller' => 'LogIn', |
|
9 | + 'view' => 'index' |
|
10 | + ] |
|
11 | 11 | ], |
12 | 12 | ], |
13 | 13 | 'view_manager' => [ |