@@ -20,7 +20,7 @@ |
||
20 | 20 | * @GET |
21 | 21 | * @route /admin/config/params |
22 | 22 | * @visible false |
23 | - * @return mixed |
|
23 | + * @return string|null |
|
24 | 24 | */ |
25 | 25 | public function getConfigParams() { |
26 | 26 | $response = array_merge(Config::$required, Config::$optional); |
@@ -25,10 +25,10 @@ discard block |
||
25 | 25 | public function getConfigParams() { |
26 | 26 | $response = array_merge(Config::$required, Config::$optional); |
27 | 27 | $domains = Router::getInstance()->getDomains(); |
28 | - foreach($domains as $domain => $routes) { |
|
28 | + foreach ($domains as $domain => $routes) { |
|
29 | 29 | $pDomain = str_replace('@', '', $domain); |
30 | 30 | $pDomain = str_replace('/', '', $pDomain); |
31 | - $response[] = strtolower($pDomain) . '.api.secret'; |
|
31 | + $response[] = strtolower($pDomain).'.api.secret'; |
|
32 | 32 | } |
33 | 33 | return $this->json($response); |
34 | 34 | } |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | */ |
43 | 43 | public function config() |
44 | 44 | { |
45 | - Logger::log("Config loaded executed by " . $this->getRequest()->getRequestUri()); |
|
45 | + Logger::log("Config loaded executed by ".$this->getRequest()->getRequestUri()); |
|
46 | 46 | /* @var $form \PSFS\base\config\ConfigForm */ |
47 | 47 | $form = new ConfigForm(); |
48 | 48 | $form->build(); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | } |
80 | 80 | Security::getInstance()->setFlash("callback_message", _("Configuración actualizada correctamente")); |
81 | 81 | Security::getInstance()->setFlash("callback_route", $this->getRoute("admin-config", true)); |
82 | - } else { |
|
82 | + }else { |
|
83 | 83 | throw new \HttpException(_('Error al guardar la configuración, prueba a cambiar los permisos'), 403); |
84 | 84 | } |
85 | 85 | } |
@@ -28,7 +28,7 @@ |
||
28 | 28 | * @GET |
29 | 29 | * @route /admin/routes/show |
30 | 30 | * @visible false |
31 | - * @return mixed |
|
31 | + * @return string|null |
|
32 | 32 | */ |
33 | 33 | public function getRouting() |
34 | 34 | { |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $router->simpatize(); |
52 | 52 | Security::getInstance()->setFlash("callback_message", _("Rutas generadas correctamente")); |
53 | 53 | Security::getInstance()->setFlash("callback_route", $this->getRoute("admin-routes", true)); |
54 | - } catch(\Exception $e) { |
|
54 | + }catch (\Exception $e) { |
|
55 | 55 | Logger::log($e->getMessage(), LOG_ERR); |
56 | 56 | Security::getInstance()->setFlash("callback_message", _("Algo no ha salido bien, revisa los logs")); |
57 | 57 | Security::getInstance()->setFlash("callback_route", $this->getRoute("admin-routes", true)); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | * @package PSFS\controller |
13 | 13 | * @domain ROOT |
14 | 14 | */ |
15 | -class Admin extends AuthAdminController{ |
|
15 | +class Admin extends AuthAdminController { |
|
16 | 16 | |
17 | 17 | const DOMAIN = 'ROOT'; |
18 | 18 |
@@ -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)); |
@@ -33,7 +33,9 @@ |
||
33 | 33 | public function getTranslations($locale) |
34 | 34 | { |
35 | 35 | //Default locale |
36 | - if (null === $locale) $locale = $this->config->get("default_language"); |
|
36 | + if (null === $locale) { |
|
37 | + $locale = $this->config->get("default_language"); |
|
38 | + } |
|
37 | 39 | |
38 | 40 | //Generating the templates translations |
39 | 41 | $translations = $this->tpl->regenerateTemplates(); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | Logger::log('Configuration saved successful'); |
54 | 54 | Security::getInstance()->setFlash("callback_message", _("Usuario agregado correctamente")); |
55 | 55 | Security::getInstance()->setFlash("callback_route", $this->getRoute("admin"), true); |
56 | - } else { |
|
56 | + }else { |
|
57 | 57 | throw new ConfigException(_('Error al guardar los administradores, prueba a cambiar los permisos')); |
58 | 58 | } |
59 | 59 | } |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | $cookies = array( |
105 | 105 | array( |
106 | 106 | "name" => Security::getInstance()->getHash(), |
107 | - "value" => base64_encode($form->getFieldValue("user") . ":" . $form->getFieldValue("pass")), |
|
107 | + "value" => base64_encode($form->getFieldValue("user").":".$form->getFieldValue("pass")), |
|
108 | 108 | "expire" => time() + 3600, |
109 | 109 | "http" => true, |
110 | 110 | ) |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | 'status_message' => _("Acceso permitido... redirigiendo!!"), |
116 | 116 | 'delay' => 1, |
117 | 117 | ); |
118 | - } else { |
|
118 | + }else { |
|
119 | 119 | $form->setError("user", _("El usuario no tiene acceso a la web")); |
120 | 120 | } |
121 | 121 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function generateModule() |
32 | 32 | { |
33 | - Logger::log("Arranque generador de módulos al solicitar " . $this->getRequest()->getRequestUri()); |
|
33 | + Logger::log("Arranque generador de módulos al solicitar ".$this->getRequest()->getRequestUri()); |
|
34 | 34 | /* @var $form \PSFS\base\config\ConfigForm */ |
35 | 35 | $form = new ModuleForm(); |
36 | 36 | $form->build(); |
@@ -60,8 +60,8 @@ discard block |
||
60 | 60 | $this->gen->createStructureModule($module, $force, $type); |
61 | 61 | Security::getInstance()->setFlash("callback_message", str_replace("%s", $module, _("Módulo %s generado correctamente"))); |
62 | 62 | Security::getInstance()->setFlash("callback_route", $this->getRoute("admin-module", true)); |
63 | - } catch (\Exception $e) { |
|
64 | - Logger::getInstance()->infoLog($e->getMessage() . " [" . $e->getFile() . ":" . $e->getLine() . "]"); |
|
63 | + }catch (\Exception $e) { |
|
64 | + Logger::getInstance()->infoLog($e->getMessage()." [".$e->getFile().":".$e->getLine()."]"); |
|
65 | 65 | throw new ConfigException('Error al generar el módulo, prueba a cambiar los permisos', 403); |
66 | 66 | } |
67 | 67 | } |