@@ -21,11 +21,11 @@ |
||
21 | 21 | $path = str_replace("\\", DIRECTORY_SEPARATOR, $class); |
22 | 22 | |
23 | 23 | // filepath |
24 | - $abs_path = SOURCE_DIR . DIRECTORY_SEPARATOR . $path . ".php"; |
|
24 | + $abs_path = SOURCE_DIR.DIRECTORY_SEPARATOR.$path.".php"; |
|
25 | 25 | if (!file_exists($abs_path)) { |
26 | - pre('→ ' . $class); |
|
27 | - pre('→ ' . $path); |
|
28 | - pre('→ ' . $abs_path); |
|
26 | + pre('→ '.$class); |
|
27 | + pre('→ '.$path); |
|
28 | + pre('→ '.$abs_path); |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | // require the file |
@@ -38,8 +38,8 @@ |
||
38 | 38 | //Generating the templates translations |
39 | 39 | $translations = $this->tpl->regenerateTemplates(); |
40 | 40 | |
41 | - $locale_path = realpath(BASE_DIR . DIRECTORY_SEPARATOR . 'locale'); |
|
42 | - $locale_path .= DIRECTORY_SEPARATOR . $locale . DIRECTORY_SEPARATOR . 'LC_MESSAGES' . DIRECTORY_SEPARATOR; |
|
41 | + $locale_path = realpath(BASE_DIR.DIRECTORY_SEPARATOR.'locale'); |
|
42 | + $locale_path .= DIRECTORY_SEPARATOR.$locale.DIRECTORY_SEPARATOR.'LC_MESSAGES'.DIRECTORY_SEPARATOR; |
|
43 | 43 | |
44 | 44 | //xgettext localizations |
45 | 45 | $translations = array_merge($translations, GeneratorService::findTranslations(SOURCE_DIR, $locale)); |
@@ -35,7 +35,9 @@ |
||
35 | 35 | public function getTranslations($locale) |
36 | 36 | { |
37 | 37 | //Default locale |
38 | - if (null === $locale) $locale = $this->config->get("default.language", 'es_ES'); |
|
38 | + if (null === $locale) { |
|
39 | + $locale = $this->config->get("default.language", 'es_ES'); |
|
40 | + } |
|
39 | 41 | |
40 | 42 | //Generating the templates translations |
41 | 43 | $translations = $this->tpl->regenerateTemplates(); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | unset($_SERVER["PHP_AUTH_USER"]); |
39 | 39 | unset($_SERVER["PHP_AUTH_PW"]); |
40 | 40 | header_remove("Authorization"); |
41 | - } else { |
|
41 | + }else { |
|
42 | 42 | header('Authorization:'); |
43 | 43 | } |
44 | 44 | } |
@@ -66,9 +66,9 @@ discard block |
||
66 | 66 | Logger::log('Adding debug headers to render response'); |
67 | 67 | $vars["__DEBUG__"]["includes"] = get_included_files(); |
68 | 68 | $vars["__DEBUG__"]["trace"] = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); |
69 | - header('X-PSFS-DEBUG-TS: ' . Dispatcher::getInstance()->getTs() . ' s'); |
|
70 | - header('X-PSFS-DEBUG-MEM: ' . Dispatcher::getInstance()->getMem('MBytes') . ' MBytes'); |
|
71 | - header('X-PSFS-DEBUG-FILES: ' . count(get_included_files()) . ' files opened'); |
|
69 | + header('X-PSFS-DEBUG-TS: '.Dispatcher::getInstance()->getTs().' s'); |
|
70 | + header('X-PSFS-DEBUG-MEM: '.Dispatcher::getInstance()->getMem('MBytes').' MBytes'); |
|
71 | + header('X-PSFS-DEBUG-FILES: '.count(get_included_files()).' files opened'); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | return $vars; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | Logger::log('Configuration saved successful'); |
64 | 64 | Security::getInstance()->setFlash("callback_message", _("Usuario agregado correctamente")); |
65 | 65 | Security::getInstance()->setFlash("callback_route", Router::getInstance()->getRoute("admin", true)); |
66 | - } else { |
|
66 | + }else { |
|
67 | 67 | throw new ConfigException(_('Error al guardar los administradores, prueba a cambiar los permisos')); |
68 | 68 | } |
69 | 69 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | { |
100 | 100 | if ($this->isAdmin()) { |
101 | 101 | return $this->redirect('admin'); |
102 | - } else { |
|
102 | + }else { |
|
103 | 103 | return Admin::staticAdminLogon($route); |
104 | 104 | } |
105 | 105 | } |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | $cookies = array( |
132 | 132 | array( |
133 | 133 | "name" => Security::getInstance()->getHash(), |
134 | - "value" => base64_encode($form->getFieldValue("user") . ":" . $form->getFieldValue("pass")), |
|
134 | + "value" => base64_encode($form->getFieldValue("user").":".$form->getFieldValue("pass")), |
|
135 | 135 | "expire" => time() + 3600, |
136 | 136 | "http" => true, |
137 | 137 | ) |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | 'status_message' => _("Acceso permitido... redirigiendo!!"), |
143 | 143 | 'delay' => 1, |
144 | 144 | ); |
145 | - } else { |
|
145 | + }else { |
|
146 | 146 | $form->setError("user", _("El usuario no tiene acceso a la web")); |
147 | 147 | } |
148 | 148 | } |
@@ -48,10 +48,10 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public static function staticAdminLogon($route = null) |
50 | 50 | { |
51 | - if (file_exists(CONFIG_DIR . DIRECTORY_SEPARATOR . 'admins.json')) { |
|
51 | + if (file_exists(CONFIG_DIR.DIRECTORY_SEPARATOR.'admins.json')) { |
|
52 | 52 | if ('login' !== Config::getInstance()->get('admin_login')) { |
53 | 53 | return AdminServices::getInstance()->setAdminHeaders(); |
54 | - } else { |
|
54 | + }else { |
|
55 | 55 | $form = new LoginForm(); |
56 | 56 | $form->setData(array("route" => $route)); |
57 | 57 | $form->build(); |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | 'form' => $form, |
62 | 62 | )); |
63 | 63 | } |
64 | - } else { |
|
64 | + }else { |
|
65 | 65 | return UserController::showAdminManager(); |
66 | 66 | } |
67 | 67 | } |
@@ -61,11 +61,13 @@ discard block |
||
61 | 61 | */ |
62 | 62 | private function parseAdmins(&$admins) |
63 | 63 | { |
64 | - if (!empty($admins)) foreach ($admins as &$admin) { |
|
64 | + if (!empty($admins)) { |
|
65 | + foreach ($admins as &$admin) { |
|
65 | 66 | if (isset($admin["profile"])) { |
66 | 67 | switch ($admin["profile"]) { |
67 | 68 | case Security::MANAGER_ID_TOKEN: |
68 | 69 | $admin['class'] = 'warning'; |
70 | + } |
|
69 | 71 | break; |
70 | 72 | case Security::ADMIN_ID_TOKEN: |
71 | 73 | $admin['class'] = 'info'; |
@@ -95,7 +97,9 @@ discard block |
||
95 | 97 | $size = $file->getSize() / 8 / 1024; |
96 | 98 | $time = date("c", $file->getMTime()); |
97 | 99 | $dateTime = new \DateTime($time); |
98 | - if (!isset($logs[$dateTime->format("Y")])) $logs[$dateTime->format("Y")] = array(); |
|
100 | + if (!isset($logs[$dateTime->format("Y")])) { |
|
101 | + $logs[$dateTime->format("Y")] = array(); |
|
102 | + } |
|
99 | 103 | $logs[$dateTime->format("Y")][$dateTime->format("m")][$time] = array( |
100 | 104 | "filename" => $file->getFilename(), |
101 | 105 | "size" => round($size, 3) |
@@ -136,7 +140,9 @@ discard block |
||
136 | 140 | $detailLog[] = array_merge(array( |
137 | 141 | "log" => $line, |
138 | 142 | ), $detail); |
139 | - if (count($detailLog) >= 1000) break; |
|
143 | + if (count($detailLog) >= 1000) { |
|
144 | + break; |
|
145 | + } |
|
140 | 146 | } |
141 | 147 | $log = $detailLog; |
142 | 148 | } |
@@ -160,7 +166,9 @@ discard block |
||
160 | 166 | |
161 | 167 | $detail = json_decode($match[0][0], TRUE); |
162 | 168 | } |
163 | - if (empty($detail)) $detail = array(); |
|
169 | + if (empty($detail)) { |
|
170 | + $detail = array(); |
|
171 | + } |
|
164 | 172 | preg_match_all('/\>\ (.*):/i', $line, $match); |
165 | 173 | |
166 | 174 | $type = (isset($match[1][0])) ? $match[1][0] : ''; |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | { |
35 | 35 | $platform = trim(Config::getInstance()->get("platform.name")); |
36 | 36 | header('HTTP/1.1 401 Unauthorized'); |
37 | - header('WWW-Authenticate: Basic Realm="' . $platform . '"'); |
|
37 | + header('WWW-Authenticate: Basic Realm="'.$platform.'"'); |
|
38 | 38 | echo _("Zona restringida"); |
39 | 39 | exit(); |
40 | 40 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $admin['class'] = 'primary'; |
76 | 76 | break; |
77 | 77 | } |
78 | - } else { |
|
78 | + }else { |
|
79 | 79 | $admin["class"] = "primary"; |
80 | 80 | } |
81 | 81 | } |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | $logs = array(); |
93 | 93 | /** @var \SplFileInfo $file */ |
94 | 94 | foreach ($files as $file) { |
95 | - $size = $file->getSize() / 8 / 1024; |
|
95 | + $size = $file->getSize()/8/1024; |
|
96 | 96 | $time = date("c", $file->getMTime()); |
97 | 97 | $dateTime = new \DateTime($time); |
98 | 98 | if (!isset($logs[$dateTime->format("Y")])) $logs[$dateTime->format("Y")] = array(); |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | $time = date("c", $file->getMTime()); |
129 | 129 | $dateTime = new \DateTime($time); |
130 | 130 | $monthOpen = $dateTime->format("m"); |
131 | - $content = file($file->getPath() . DIRECTORY_SEPARATOR . $file->getFilename()); |
|
131 | + $content = file($file->getPath().DIRECTORY_SEPARATOR.$file->getFilename()); |
|
132 | 132 | krsort($content); |
133 | 133 | $detailLog = array(); |
134 | 134 | foreach ($content as &$line) { |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | break; |
182 | 182 | } |
183 | 183 | |
184 | - } catch (\Exception $e) { |
|
184 | + }catch (\Exception $e) { |
|
185 | 185 | $detail = array( |
186 | 186 | "type" => "danger", |
187 | 187 | ); |
@@ -37,7 +37,7 @@ |
||
37 | 37 | )) |
38 | 38 | ->addButton('submit', _("Acceder como {{username}}")) |
39 | 39 | ->addButton("cancel", _("Cancelar"), "button", array( |
40 | - "onclick" => "javacript:location.href = \"" . Router::getInstance()->getRoute('') . "\";", |
|
40 | + "onclick" => "javacript:location.href = \"".Router::getInstance()->getRoute('')."\";", |
|
41 | 41 | "class" => "btn-link", |
42 | 42 | )); |
43 | 43 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | { |
63 | 63 | if (preg_match('/^asc$/i', $direction)) { |
64 | 64 | return Order::ASC; |
65 | - } else { |
|
65 | + }else { |
|
66 | 66 | return Order::DESC; |
67 | 67 | } |
68 | 68 | } |
@@ -26,13 +26,13 @@ |
||
26 | 26 | { |
27 | 27 | $namespace = explode('\\', $this->getModelTableMap()); |
28 | 28 | $module = strtolower($namespace[0]); |
29 | - $secret = Config::getInstance()->get($module . '.api.secret'); |
|
29 | + $secret = Config::getInstance()->get($module.'.api.secret'); |
|
30 | 30 | if (NULL === $secret) { |
31 | 31 | $secret = Config::getInstance()->get("api.secret"); |
32 | 32 | } |
33 | 33 | if (NULL === $secret) { |
34 | 34 | $auth = TRUE; |
35 | - } else { |
|
35 | + }else { |
|
36 | 36 | $token = Request::getInstance()->getHeader('X-API-SEC-TOKEN'); |
37 | 37 | if (array_key_exists('API_TOKEN', $this->query)) { |
38 | 38 | $token = $this->query['API_TOKEN']; |