@@ -61,11 +61,11 @@ discard block |
||
61 | 61 | |
62 | 62 | # Set link |
63 | 63 | |
64 | - $link = (INSTALL_PATH . static::$link . '/'); |
|
64 | + $link = (INSTALL_PATH.static::$link.'/'); |
|
65 | 65 | |
66 | - if (static::$nesting) $contents->link = ($link . ($this->create ? 'create' : 'edit') . '?id=' . $this->parent->id); |
|
66 | + if (static::$nesting) $contents->link = ($link.($this->create ? 'create' : 'edit').'?id='.$this->parent->id); |
|
67 | 67 | |
68 | - else $contents->link = ($link . ($this->create ? 'create' : ('edit?id=' . $this->entity->id))); |
|
68 | + else $contents->link = ($link.($this->create ? 'create' : ('edit?id='.$this->entity->id))); |
|
69 | 69 | |
70 | 70 | # Process parent block |
71 | 71 | |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | |
125 | 125 | # Redirect if entity not found |
126 | 126 | |
127 | - if (!$this->create && (0 === $this->entity->id)) return Request::redirect(INSTALL_PATH . static::$link); |
|
127 | + if (!$this->create && (0 === $this->entity->id)) return Request::redirect(INSTALL_PATH.static::$link); |
|
128 | 128 | |
129 | 129 | # Create form |
130 | 130 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | if ($this->form->handle(new static::$controller($this->entity))) { |
138 | 138 | |
139 | - Request::redirect(INSTALL_PATH . static::$link . '/edit?id=' . $this->entity->id . '&submitted'); |
|
139 | + Request::redirect(INSTALL_PATH.static::$link.'/edit?id='.$this->entity->id.'&submitted'); |
|
140 | 140 | } |
141 | 141 | |
142 | 142 | # Display success message |
@@ -45,7 +45,9 @@ discard block |
||
45 | 45 | |
46 | 46 | private function processSelector(Template\Block $selector) { |
47 | 47 | |
48 | - if ($this->create) return $selector->disable(); |
|
48 | + if ($this->create) { |
|
49 | + return $selector->disable(); |
|
50 | + } |
|
49 | 51 | |
50 | 52 | $selector->parent_id = $this->entity->parent_id; |
51 | 53 | |
@@ -68,25 +70,33 @@ discard block |
||
68 | 70 | |
69 | 71 | # Set path / title |
70 | 72 | |
71 | - if (static::$nesting) $contents->path = $this->path; |
|
72 | - |
|
73 | - else $contents->title = ($this->create ? Language::get(static::$naming_new) : $this->entity->get(static::$naming)); |
|
73 | + if (static::$nesting) { |
|
74 | + $contents->path = $this->path; |
|
75 | + } else { |
|
76 | + $contents->title = ($this->create ? Language::get(static::$naming_new) : $this->entity->get(static::$naming)); |
|
77 | + } |
|
74 | 78 | |
75 | 79 | # Process parent block |
76 | 80 | |
77 | - if (static::$nesting) $this->processParent($contents->getBlock('parent')); |
|
81 | + if (static::$nesting) { |
|
82 | + $this->processParent($contents->getBlock('parent')); |
|
83 | + } |
|
78 | 84 | |
79 | 85 | # Set link |
80 | 86 | |
81 | 87 | $link = (INSTALL_PATH . static::$link . '/'); |
82 | 88 | |
83 | - if (static::$nesting) $contents->link = ($link . ($this->create ? 'create' : 'edit') . '?id=' . $this->parent->id); |
|
84 | - |
|
85 | - else $contents->link = ($link . ($this->create ? 'create' : ('edit?id=' . $this->entity->id))); |
|
89 | + if (static::$nesting) { |
|
90 | + $contents->link = ($link . ($this->create ? 'create' : 'edit') . '?id=' . $this->parent->id); |
|
91 | + } else { |
|
92 | + $contents->link = ($link . ($this->create ? 'create' : ('edit?id=' . $this->entity->id))); |
|
93 | + } |
|
86 | 94 | |
87 | 95 | # Process selector block |
88 | 96 | |
89 | - if (static::$nesting) $this->processSelector($contents->getBlock('selector')); |
|
97 | + if (static::$nesting) { |
|
98 | + $this->processSelector($contents->getBlock('selector')); |
|
99 | + } |
|
90 | 100 | |
91 | 101 | # Implement form |
92 | 102 | |
@@ -119,11 +129,15 @@ discard block |
||
119 | 129 | |
120 | 130 | $parent_id = Number::forceInt(Request::post('parent_id')); |
121 | 131 | |
122 | - if (!$this->entity->move($parent_id)) return $ajax->setError(Language::get(static::$message_error_move)); |
|
132 | + if (!$this->entity->move($parent_id)) { |
|
133 | + return $ajax->setError(Language::get(static::$message_error_move)); |
|
134 | + } |
|
123 | 135 | |
124 | 136 | } else if (Request::post('action') === 'remove') { |
125 | 137 | |
126 | - if (!$this->entity->remove()) return $ajax->setError(Language::get(static::$message_error_remove)); |
|
138 | + if (!$this->entity->remove()) { |
|
139 | + return $ajax->setError(Language::get(static::$message_error_remove)); |
|
140 | + } |
|
127 | 141 | } |
128 | 142 | |
129 | 143 | # ------------------------ |
@@ -135,7 +149,9 @@ discard block |
||
135 | 149 | |
136 | 150 | protected function handle() { |
137 | 151 | |
138 | - if (!$this->create && Request::isAjax()) return $this->handleAjax(); |
|
152 | + if (!$this->create && Request::isAjax()) { |
|
153 | + return $this->handleAjax(); |
|
154 | + } |
|
139 | 155 | |
140 | 156 | # Create entity |
141 | 157 | |
@@ -143,7 +159,9 @@ discard block |
||
143 | 159 | |
144 | 160 | $this->entity = Entitizer::get(static::$table, (!$this->create ? $id : 0)); |
145 | 161 | |
146 | - if (!$this->create && (0 === $this->entity->id)) return Request::redirect(INSTALL_PATH . static::$link); |
|
162 | + if (!$this->create && (0 === $this->entity->id)) { |
|
163 | + return Request::redirect(INSTALL_PATH . static::$link); |
|
164 | + } |
|
147 | 165 | |
148 | 166 | # Create parent entity |
149 | 167 | |
@@ -151,7 +169,9 @@ discard block |
||
151 | 169 | |
152 | 170 | # Get path |
153 | 171 | |
154 | - if (false !== ($path = $this->parent->path())) $this->path = $path; |
|
172 | + if (false !== ($path = $this->parent->path())) { |
|
173 | + $this->path = $path; |
|
174 | + } |
|
155 | 175 | |
156 | 176 | # Create form |
157 | 177 | |
@@ -161,7 +181,9 @@ discard block |
||
161 | 181 | |
162 | 182 | if ($this->form->handle(new static::$controller($this->entity), true)) { |
163 | 183 | |
164 | - if ($this->create && (0 !== $this->parent->id)) $this->entity->move($this->parent->id); |
|
184 | + if ($this->create && (0 !== $this->parent->id)) { |
|
185 | + $this->entity->move($this->parent->id); |
|
186 | + } |
|
165 | 187 | |
166 | 188 | Request::redirect(INSTALL_PATH . static::$link . '/edit?id=' . $this->entity->id . '&submitted'); |
167 | 189 | } |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | if ($this->form->handle(new Settings\Controller\General())) { |
37 | 37 | |
38 | - Request::redirect(INSTALL_PATH . '/admin/system/settings?submitted'); |
|
38 | + Request::redirect(INSTALL_PATH.'/admin/system/settings?submitted'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | # Display success message |
@@ -40,7 +40,9 @@ |
||
40 | 40 | |
41 | 41 | # Display success message |
42 | 42 | |
43 | - if (false !== Request::get('submitted')) Popup::set('positive', Language::get('SETTINGS_SUCCESS')); |
|
43 | + if (false !== Request::get('submitted')) { |
|
44 | + Popup::set('positive', Language::get('SETTINGS_SUCCESS')); |
|
45 | + } |
|
44 | 46 | |
45 | 47 | # ------------------------ |
46 | 48 |
@@ -45,7 +45,7 @@ |
||
45 | 45 | |
46 | 46 | if ($this->form_personal->handle($controller_personal) || $this->form_password->handle($controller_password)) { |
47 | 47 | |
48 | - Request::redirect(INSTALL_PATH . '/profile/edit?submitted'); |
|
48 | + Request::redirect(INSTALL_PATH.'/profile/edit?submitted'); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | # Display success message |
@@ -50,7 +50,9 @@ |
||
50 | 50 | |
51 | 51 | # Display success message |
52 | 52 | |
53 | - if (false !== Request::get('submitted')) Messages::set('success', Language::get('USER_SUCCESS_EDIT')); |
|
53 | + if (false !== Request::get('submitted')) { |
|
54 | + Messages::set('success', Language::get('USER_SUCCESS_EDIT')); |
|
55 | + } |
|
54 | 56 | |
55 | 57 | # ------------------------ |
56 | 58 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | |
36 | 36 | if ($this->form->handle(new Install\Controller\Database())) { |
37 | 37 | |
38 | - Request::redirect(INSTALL_PATH . '/admin/register'); |
|
38 | + Request::redirect(INSTALL_PATH.'/admin/register'); |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | # ------------------------ |
@@ -18,7 +18,7 @@ |
||
18 | 18 | |
19 | 19 | $class = ($value ? 'positive' : 'negative'); $icon = ($value ? 'check circle' : 'warning circle'); |
20 | 20 | |
21 | - $text = Language::get('INSTALL_REQUIREMENT_' . strtoupper($name) . '_' . ($value ? 'SUCCESS' : 'FAIL')); |
|
21 | + $text = Language::get('INSTALL_REQUIREMENT_'.strtoupper($name).'_'.($value ? 'SUCCESS' : 'FAIL')); |
|
22 | 22 | |
23 | 23 | $requirements[] = ['class' => $class, 'icon' => $icon, 'text' => $text]; |
24 | 24 | } |
@@ -24,14 +24,14 @@ |
||
24 | 24 | |
25 | 25 | if (0 === $key) $names = $this->getString(array_keys($row), '$name', ', '); |
26 | 26 | |
27 | - $values[] = ('(' . $this->getString(array_values($row), '$value', ', ') . ')'); |
|
27 | + $values[] = ('('.$this->getString(array_values($row), '$value', ', ').')'); |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | # Build query |
31 | 31 | |
32 | - $this->query = ('INSERT ' . ($ignore ? 'IGNORE ' : '') . |
|
32 | + $this->query = ('INSERT '.($ignore ? 'IGNORE ' : ''). |
|
33 | 33 | |
34 | - 'INTO ' . $table . ' (' . $names . ') VALUES ' . implode(', ', $values)); |
|
34 | + 'INTO '.$table.' ('.$names.') VALUES '.implode(', ', $values)); |
|
35 | 35 | } |
36 | 36 | } |
37 | 37 | } |
@@ -29,9 +29,11 @@ |
||
29 | 29 | |
30 | 30 | $names = ''; $values = []; |
31 | 31 | |
32 | - foreach ($set as $key => $row) if (is_array($row)) { |
|
32 | + foreach ($set as $key => $row) { |
|
33 | + if (is_array($row)) { |
|
33 | 34 | |
34 | 35 | if (0 === $key) $names = $this->getString(array_keys($row), '$name', ', '); |
36 | + } |
|
35 | 37 | |
36 | 38 | $values[] = ('(' . $this->getString(array_values($row), '$value', ', ') . ')'); |
37 | 39 | } |
@@ -2,15 +2,15 @@ |
||
2 | 2 | |
3 | 3 | # Database tables |
4 | 4 | |
5 | -define('TABLE_PAGES', 'pages'); |
|
6 | -define('TABLE_PAGES_RELATIONS', 'pages_relations'); |
|
5 | +define('TABLE_PAGES', 'pages'); |
|
6 | +define('TABLE_PAGES_RELATIONS', 'pages_relations'); |
|
7 | 7 | |
8 | -define('TABLE_MENU', 'menu'); |
|
9 | -define('TABLE_MENU_RELATIONS', 'menu_relations'); |
|
8 | +define('TABLE_MENU', 'menu'); |
|
9 | +define('TABLE_MENU_RELATIONS', 'menu_relations'); |
|
10 | 10 | |
11 | -define('TABLE_VARIABLES', 'variables'); |
|
12 | -define('TABLE_WIDGETS', 'widgets'); |
|
11 | +define('TABLE_VARIABLES', 'variables'); |
|
12 | +define('TABLE_WIDGETS', 'widgets'); |
|
13 | 13 | |
14 | -define('TABLE_USERS', 'users'); |
|
15 | -define('TABLE_USERS_SECRETS', 'users_secrets'); |
|
16 | -define('TABLE_USERS_SESSIONS', 'users_sessions'); |
|
14 | +define('TABLE_USERS', 'users'); |
|
15 | +define('TABLE_USERS_SECRETS', 'users_secrets'); |
|
16 | +define('TABLE_USERS_SESSIONS', 'users_sessions'); |
@@ -2,126 +2,126 @@ |
||
2 | 2 | |
3 | 3 | # Admin ip |
4 | 4 | |
5 | -define('CONFIG_ADMIN_IP', ''); |
|
5 | +define('CONFIG_ADMIN_IP', ''); |
|
6 | 6 | |
7 | 7 | # Session |
8 | 8 | |
9 | -define('CONFIG_SESSION_NAME', '_sessid'); |
|
10 | -define('CONFIG_SESSION_LIFETIME', 2592000); # 30 days |
|
9 | +define('CONFIG_SESSION_NAME', '_sessid'); |
|
10 | +define('CONFIG_SESSION_LIFETIME', 2592000); # 30 days |
|
11 | 11 | |
12 | 12 | # Language |
13 | 13 | |
14 | -define('CONFIG_LANGUAGE_COOKIE_EXPIRES', 30758400); # 356 days |
|
14 | +define('CONFIG_LANGUAGE_COOKIE_EXPIRES', 30758400); # 356 days |
|
15 | 15 | |
16 | 16 | # Template |
17 | 17 | |
18 | -define('CONFIG_TEMPLATE_COOKIE_EXPIRES', 30758400); # 356 days |
|
18 | +define('CONFIG_TEMPLATE_COOKIE_EXPIRES', 30758400); # 356 days |
|
19 | 19 | |
20 | 20 | # Entitizer |
21 | 21 | |
22 | -define('CONFIG_ENTITIZER_MAX_DEPTH', 6); |
|
22 | +define('CONFIG_ENTITIZER_MAX_DEPTH', 6); |
|
23 | 23 | |
24 | 24 | # Page |
25 | 25 | |
26 | -define('CONFIG_PAGE_TITLE_MAX_LENGTH', 255); |
|
27 | -define('CONFIG_PAGE_NAME_MAX_LENGTH', 40); |
|
28 | -define('CONFIG_PAGE_DESCRIPTION_MAX_LENGTH', 512); |
|
29 | -define('CONFIG_PAGE_KEYWORDS_MAX_LENGTH', 512); |
|
26 | +define('CONFIG_PAGE_TITLE_MAX_LENGTH', 255); |
|
27 | +define('CONFIG_PAGE_NAME_MAX_LENGTH', 40); |
|
28 | +define('CONFIG_PAGE_DESCRIPTION_MAX_LENGTH', 512); |
|
29 | +define('CONFIG_PAGE_KEYWORDS_MAX_LENGTH', 512); |
|
30 | 30 | |
31 | 31 | # Menuitem |
32 | 32 | |
33 | -define('CONFIG_MENUITEM_TEXT_MAX_LENGTH', 255); |
|
34 | -define('CONFIG_MENUITEM_SLUG_MAX_LENGTH', 255); |
|
35 | -define('CONFIG_MENUITEM_POSITION_MAX_LENGTH', 2); |
|
33 | +define('CONFIG_MENUITEM_TEXT_MAX_LENGTH', 255); |
|
34 | +define('CONFIG_MENUITEM_SLUG_MAX_LENGTH', 255); |
|
35 | +define('CONFIG_MENUITEM_POSITION_MAX_LENGTH', 2); |
|
36 | 36 | |
37 | 37 | # Variables |
38 | 38 | |
39 | -define('CONFIG_VARIABLE_TITLE_MAX_LENGTH', 64); |
|
40 | -define('CONFIG_VARIABLE_NAME_MAX_LENGTH', 32); |
|
41 | -define('CONFIG_VARIABLE_VALUE_MAX_LENGTH', 255); |
|
39 | +define('CONFIG_VARIABLE_TITLE_MAX_LENGTH', 64); |
|
40 | +define('CONFIG_VARIABLE_NAME_MAX_LENGTH', 32); |
|
41 | +define('CONFIG_VARIABLE_VALUE_MAX_LENGTH', 255); |
|
42 | 42 | |
43 | 43 | # Widgets |
44 | 44 | |
45 | -define('CONFIG_WIDGET_TITLE_MAX_LENGTH', 64); |
|
46 | -define('CONFIG_WIDGET_NAME_MAX_LENGTH', 32); |
|
45 | +define('CONFIG_WIDGET_TITLE_MAX_LENGTH', 64); |
|
46 | +define('CONFIG_WIDGET_NAME_MAX_LENGTH', 32); |
|
47 | 47 | |
48 | 48 | # Filemanager |
49 | 49 | |
50 | -define('CONFIG_FILEMANAGER_NAME_MAX_LENGTH', 128); |
|
50 | +define('CONFIG_FILEMANAGER_NAME_MAX_LENGTH', 128); |
|
51 | 51 | |
52 | 52 | # User |
53 | 53 | |
54 | -define('CONFIG_USER_SESSION_LIFETIME', 604800); # 7 days |
|
55 | -define('CONFIG_USER_SECRET_LIFETIME', 86400); # 1 day |
|
54 | +define('CONFIG_USER_SESSION_LIFETIME', 604800); # 7 days |
|
55 | +define('CONFIG_USER_SECRET_LIFETIME', 86400); # 1 day |
|
56 | 56 | |
57 | -define('CONFIG_USER_NAME_MIN_LENGTH', 4); |
|
58 | -define('CONFIG_USER_NAME_MAX_LENGTH', 16); |
|
57 | +define('CONFIG_USER_NAME_MIN_LENGTH', 4); |
|
58 | +define('CONFIG_USER_NAME_MAX_LENGTH', 16); |
|
59 | 59 | |
60 | -define('CONFIG_USER_PASSWORD_MIN_LENGTH', 4); |
|
61 | -define('CONFIG_USER_PASSWORD_MAX_LENGTH', 32); |
|
60 | +define('CONFIG_USER_PASSWORD_MIN_LENGTH', 4); |
|
61 | +define('CONFIG_USER_PASSWORD_MAX_LENGTH', 32); |
|
62 | 62 | |
63 | -define('CONFIG_USER_EMAIL_MAX_LENGTH', 128); |
|
63 | +define('CONFIG_USER_EMAIL_MAX_LENGTH', 128); |
|
64 | 64 | |
65 | -define('CONFIG_USER_FIRST_NAME_MAX_LENGTH', 32); |
|
66 | -define('CONFIG_USER_LAST_NAME_MAX_LENGTH', 32); |
|
65 | +define('CONFIG_USER_FIRST_NAME_MAX_LENGTH', 32); |
|
66 | +define('CONFIG_USER_LAST_NAME_MAX_LENGTH', 32); |
|
67 | 67 | |
68 | -define('CONFIG_USER_CITY_MAX_LENGTH', 32); |
|
68 | +define('CONFIG_USER_CITY_MAX_LENGTH', 32); |
|
69 | 69 | |
70 | -define('CONFIG_USER_CAPTCHA_MAX_LENGTH', 16); |
|
70 | +define('CONFIG_USER_CAPTCHA_MAX_LENGTH', 16); |
|
71 | 71 | |
72 | 72 | # Captcha |
73 | 73 | |
74 | -define('CONFIG_CAPTCHA_LENGTH', 5); |
|
74 | +define('CONFIG_CAPTCHA_LENGTH', 5); |
|
75 | 75 | |
76 | -define('CONFIG_CAPTCHA_WIDTH', 150); |
|
77 | -define('CONFIG_CAPTCHA_HEIGHT', 40); |
|
76 | +define('CONFIG_CAPTCHA_WIDTH', 150); |
|
77 | +define('CONFIG_CAPTCHA_HEIGHT', 40); |
|
78 | 78 | |
79 | -define('CONFIG_CAPTCHA_FONT', 'Fonts/airstrip.ttf'); |
|
80 | -define('CONFIG_CAPTCHA_FONT_SIZE', 20); |
|
79 | +define('CONFIG_CAPTCHA_FONT', 'Fonts/airstrip.ttf'); |
|
80 | +define('CONFIG_CAPTCHA_FONT_SIZE', 20); |
|
81 | 81 | |
82 | -define('CONFIG_CAPTCHA_TEXT_INDENT', 15); |
|
83 | -define('CONFIG_CAPTCHA_TEXT_STEP', 25); |
|
82 | +define('CONFIG_CAPTCHA_TEXT_INDENT', 15); |
|
83 | +define('CONFIG_CAPTCHA_TEXT_STEP', 25); |
|
84 | 84 | |
85 | 85 | # Admin |
86 | 86 | |
87 | -define('CONFIG_ADMIN_LANGUAGE_DEFAULT', 'en-US'); |
|
88 | -define('CONFIG_ADMIN_TEMPLATE_DEFAULT', 'Default'); |
|
87 | +define('CONFIG_ADMIN_LANGUAGE_DEFAULT', 'en-US'); |
|
88 | +define('CONFIG_ADMIN_TEMPLATE_DEFAULT', 'Default'); |
|
89 | 89 | |
90 | -define('CONFIG_ADMIN_PAGES_DISPLAY', 50); |
|
91 | -define('CONFIG_ADMIN_MENUITEMS_DISPLAY', 50); |
|
92 | -define('CONFIG_ADMIN_VARIABLES_DISPLAY', 50); |
|
93 | -define('CONFIG_ADMIN_WIDGETS_DISPLAY', 50); |
|
94 | -define('CONFIG_ADMIN_USERS_DISPLAY', 50); |
|
90 | +define('CONFIG_ADMIN_PAGES_DISPLAY', 50); |
|
91 | +define('CONFIG_ADMIN_MENUITEMS_DISPLAY', 50); |
|
92 | +define('CONFIG_ADMIN_VARIABLES_DISPLAY', 50); |
|
93 | +define('CONFIG_ADMIN_WIDGETS_DISPLAY', 50); |
|
94 | +define('CONFIG_ADMIN_USERS_DISPLAY', 50); |
|
95 | 95 | |
96 | -define('CONFIG_ADMIN_FILEMANAGER_ITEMS_DISPLAY', 50); |
|
96 | +define('CONFIG_ADMIN_FILEMANAGER_ITEMS_DISPLAY', 50); |
|
97 | 97 | |
98 | 98 | # Site |
99 | 99 | |
100 | -define('CONFIG_SITE_LANGUAGE_DEFAULT', 'en-US'); |
|
101 | -define('CONFIG_SITE_TEMPLATE_DEFAULT', 'Default'); |
|
100 | +define('CONFIG_SITE_LANGUAGE_DEFAULT', 'en-US'); |
|
101 | +define('CONFIG_SITE_TEMPLATE_DEFAULT', 'Default'); |
|
102 | 102 | |
103 | -define('CONFIG_SITE_TITLE_DEFAULT', 'Demo Site'); |
|
104 | -define('CONFIG_SITE_SLOGAN_DEFAULT', 'A place for site slogan'); |
|
103 | +define('CONFIG_SITE_TITLE_DEFAULT', 'Demo Site'); |
|
104 | +define('CONFIG_SITE_SLOGAN_DEFAULT', 'A place for site slogan'); |
|
105 | 105 | |
106 | -define('CONFIG_SITE_TITLE_MAX_LENGTH', 128); |
|
107 | -define('CONFIG_SITE_SLOGAN_MAX_LENGTH', 255); |
|
108 | -define('CONFIG_SITE_DESCRIPTION_MAX_LENGTH', 512); |
|
109 | -define('CONFIG_SITE_KEYWORDS_MAX_LENGTH', 512); |
|
106 | +define('CONFIG_SITE_TITLE_MAX_LENGTH', 128); |
|
107 | +define('CONFIG_SITE_SLOGAN_MAX_LENGTH', 255); |
|
108 | +define('CONFIG_SITE_DESCRIPTION_MAX_LENGTH', 512); |
|
109 | +define('CONFIG_SITE_KEYWORDS_MAX_LENGTH', 512); |
|
110 | 110 | |
111 | 111 | # System |
112 | 112 | |
113 | -define('CONFIG_SYSTEM_URL_MAX_LENGTH', 128); |
|
114 | -define('CONFIG_SYSTEM_EMAIL_MAX_LENGTH', 128); |
|
113 | +define('CONFIG_SYSTEM_URL_MAX_LENGTH', 128); |
|
114 | +define('CONFIG_SYSTEM_EMAIL_MAX_LENGTH', 128); |
|
115 | 115 | |
116 | -define('CONFIG_SYSTEM_TIMEZONE_DEFAULT', 'UTC'); |
|
116 | +define('CONFIG_SYSTEM_TIMEZONE_DEFAULT', 'UTC'); |
|
117 | 117 | |
118 | 118 | # Database |
119 | 119 | |
120 | -define('CONFIG_DATABASE_SERVER_MAX_LENGTH', 128); |
|
121 | -define('CONFIG_DATABASE_USER_MAX_LENGTH', 64); |
|
122 | -define('CONFIG_DATABASE_PASSWORD_MAX_LENGTH', 64); |
|
123 | -define('CONFIG_DATABASE_NAME_MAX_LENGTH', 64); |
|
120 | +define('CONFIG_DATABASE_SERVER_MAX_LENGTH', 128); |
|
121 | +define('CONFIG_DATABASE_USER_MAX_LENGTH', 64); |
|
122 | +define('CONFIG_DATABASE_PASSWORD_MAX_LENGTH', 64); |
|
123 | +define('CONFIG_DATABASE_NAME_MAX_LENGTH', 64); |
|
124 | 124 | |
125 | 125 | # Other |
126 | 126 | |
127 | -define('CONFIG_UPLOADS_MAX_SIZE', 104857600); # 100 MB |
|
127 | +define('CONFIG_UPLOADS_MAX_SIZE', 104857600); # 100 MB |
@@ -10,7 +10,9 @@ discard block |
||
10 | 10 | |
11 | 11 | public function __invoke(array $post) { |
12 | 12 | |
13 | - if (!Auth::check()) return false; |
|
13 | + if (!Auth::check()) { |
|
14 | + return false; |
|
15 | + } |
|
14 | 16 | |
15 | 17 | # Declare variables |
16 | 18 | |
@@ -22,13 +24,15 @@ discard block |
||
22 | 24 | |
23 | 25 | # Validate values |
24 | 26 | |
25 | - if (false === ($password_new = Validate::userPassword($password_new))) |
|
26 | - |
|
27 | + if (false === ($password_new = Validate::userPassword($password_new))) { |
|
28 | + |
|
27 | 29 | return ['password_new', 'USER_ERROR_PASSWORD_NEW_INVALID']; |
30 | + } |
|
28 | 31 | |
29 | - if (0 !== strcmp($password_new, $password_retype)) |
|
30 | - |
|
32 | + if (0 !== strcmp($password_new, $password_retype)) { |
|
33 | + |
|
31 | 34 | return ['password_retype', 'USER_ERROR_PASSWORD_MISMATCH']; |
35 | + } |
|
32 | 36 | |
33 | 37 | # Encode password |
34 | 38 | |
@@ -38,7 +42,9 @@ discard block |
||
38 | 42 | |
39 | 43 | $data = ['auth_key' => $auth_key, 'password' => $password]; |
40 | 44 | |
41 | - if (!Auth::user()->edit($data)) return 'USER_ERROR_AUTH_RECOVER'; |
|
45 | + if (!Auth::user()->edit($data)) { |
|
46 | + return 'USER_ERROR_AUTH_RECOVER'; |
|
47 | + } |
|
42 | 48 | |
43 | 49 | # Remove secret |
44 | 50 |