@@ -9,68 +9,68 @@ |
||
9 | 9 | |
10 | 10 | # Cadmium |
11 | 11 | |
12 | -define('CADMIUM_NAME', 'Cadmium CMS'); |
|
13 | -define('CADMIUM_HOME', 'http://cadmium-cms.com'); |
|
12 | +define('CADMIUM_NAME', 'Cadmium CMS'); |
|
13 | +define('CADMIUM_HOME', 'http://cadmium-cms.com'); |
|
14 | 14 | |
15 | -define('CADMIUM_VERSION', '0.4.4'); |
|
16 | -define('CADMIUM_COPY', '2017'); |
|
15 | +define('CADMIUM_VERSION', '0.4.4'); |
|
16 | +define('CADMIUM_COPY', '2017'); |
|
17 | 17 | |
18 | 18 | # Third-party |
19 | 19 | |
20 | -define('JQUERY_VERSION', '3.1.1'); |
|
21 | -define('SEMANTIC_UI_VERSION', '2.2.7'); |
|
22 | -define('CKEDITOR_VERSION', '4.6.2'); |
|
20 | +define('JQUERY_VERSION', '3.1.1'); |
|
21 | +define('SEMANTIC_UI_VERSION', '2.2.7'); |
|
22 | +define('CKEDITOR_VERSION', '4.6.2'); |
|
23 | 23 | |
24 | 24 | # Sections |
25 | 25 | |
26 | -define('SECTION_SITE', 'site'); |
|
27 | -define('SECTION_ADMIN', 'admin'); |
|
26 | +define('SECTION_SITE', 'site'); |
|
27 | +define('SECTION_ADMIN', 'admin'); |
|
28 | 28 | |
29 | 29 | # Filemanager types |
30 | 30 | |
31 | -define('FILEMANAGER_TYPE_DIR', 'dir'); |
|
32 | -define('FILEMANAGER_TYPE_FILE', 'file'); |
|
31 | +define('FILEMANAGER_TYPE_DIR', 'dir'); |
|
32 | +define('FILEMANAGER_TYPE_FILE', 'file'); |
|
33 | 33 | |
34 | 34 | # Access |
35 | 35 | |
36 | -define('ACCESS_PUBLIC', 0); |
|
37 | -define('ACCESS_REGISTERED', 1); |
|
38 | -define('ACCESS_ADMINISTRATOR', 2); |
|
36 | +define('ACCESS_PUBLIC', 0); |
|
37 | +define('ACCESS_REGISTERED', 1); |
|
38 | +define('ACCESS_ADMINISTRATOR', 2); |
|
39 | 39 | |
40 | 40 | # Frequency |
41 | 41 | |
42 | -define('FREQUENCY_ALWAYS', 'always'); |
|
43 | -define('FREQUENCY_HOURLY', 'hourly'); |
|
44 | -define('FREQUENCY_DAILY', 'daily'); |
|
45 | -define('FREQUENCY_WEEKLY', 'weekly'); |
|
46 | -define('FREQUENCY_MONTHLY', 'monthly'); |
|
47 | -define('FREQUENCY_YEARLY', 'yearly'); |
|
48 | -define('FREQUENCY_NEVER', 'never'); |
|
42 | +define('FREQUENCY_ALWAYS', 'always'); |
|
43 | +define('FREQUENCY_HOURLY', 'hourly'); |
|
44 | +define('FREQUENCY_DAILY', 'daily'); |
|
45 | +define('FREQUENCY_WEEKLY', 'weekly'); |
|
46 | +define('FREQUENCY_MONTHLY', 'monthly'); |
|
47 | +define('FREQUENCY_YEARLY', 'yearly'); |
|
48 | +define('FREQUENCY_NEVER', 'never'); |
|
49 | 49 | |
50 | 50 | # Rank |
51 | 51 | |
52 | -define('RANK_GUEST', 0); |
|
53 | -define('RANK_USER', 1); |
|
54 | -define('RANK_ADMINISTRATOR', 2); |
|
52 | +define('RANK_GUEST', 0); |
|
53 | +define('RANK_USER', 1); |
|
54 | +define('RANK_ADMINISTRATOR', 2); |
|
55 | 55 | |
56 | 56 | # Sex |
57 | 57 | |
58 | -define('SEX_NOT_SELECTED', 0); |
|
59 | -define('SEX_MALE', 1); |
|
60 | -define('SEX_FEMALE', 2); |
|
58 | +define('SEX_NOT_SELECTED', 0); |
|
59 | +define('SEX_MALE', 1); |
|
60 | +define('SEX_FEMALE', 2); |
|
61 | 61 | |
62 | 62 | # Status |
63 | 63 | |
64 | -define('STATUS_ONLINE', 0); |
|
65 | -define('STATUS_MAINTENANCE', 1); |
|
66 | -define('STATUS_UPDATE', 2); |
|
64 | +define('STATUS_ONLINE', 0); |
|
65 | +define('STATUS_MAINTENANCE', 1); |
|
66 | +define('STATUS_UPDATE', 2); |
|
67 | 67 | |
68 | 68 | # Target |
69 | 69 | |
70 | -define('TARGET_SELF', 0); |
|
71 | -define('TARGET_BLANK', 1); |
|
70 | +define('TARGET_SELF', 0); |
|
71 | +define('TARGET_BLANK', 1); |
|
72 | 72 | |
73 | 73 | # Visibility |
74 | 74 | |
75 | -define('VISIBILITY_DRAFT', 0); |
|
76 | -define('VISIBILITY_PUBLISHED', 1); |
|
75 | +define('VISIBILITY_DRAFT', 0); |
|
76 | +define('VISIBILITY_PUBLISHED', 1); |
@@ -21,13 +21,13 @@ |
||
21 | 21 | |
22 | 22 | # Check installation |
23 | 23 | |
24 | - if (null !== ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH . '/index.php'); |
|
24 | + if (null !== ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH.'/index.php'); |
|
25 | 25 | |
26 | 26 | # Get handler class |
27 | 27 | |
28 | 28 | $checked = (Install::checkRequirements() && Validate::boolean(Request::get('checked'))); |
29 | 29 | |
30 | - $class = ('Modules\Install\Handler\\' . (!$checked ? 'Check' : 'Database')); |
|
30 | + $class = ('Modules\Install\Handler\\'.(!$checked ? 'Check' : 'Database')); |
|
31 | 31 | |
32 | 32 | # ------------------------ |
33 | 33 |
@@ -21,7 +21,9 @@ |
||
21 | 21 | |
22 | 22 | # Check installation |
23 | 23 | |
24 | - if (null !== ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH . '/index.php'); |
|
24 | + if (null !== ($data = Schema::get('System')->load())) { |
|
25 | + Request::redirect(INSTALL_PATH . '/index.php'); |
|
26 | + } |
|
25 | 27 | |
26 | 28 | # Get handler class |
27 | 29 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | # Check installation |
23 | 23 | |
24 | - if (null === ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH . '/install.php'); |
|
24 | + if (null === ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH.'/install.php'); |
|
25 | 25 | |
26 | 26 | # Connect to database |
27 | 27 |
@@ -21,7 +21,9 @@ |
||
21 | 21 | |
22 | 22 | # Check installation |
23 | 23 | |
24 | - if (null === ($data = Schema::get('System')->load())) Request::redirect(INSTALL_PATH . '/install.php'); |
|
24 | + if (null === ($data = Schema::get('System')->load())) { |
|
25 | + Request::redirect(INSTALL_PATH . '/install.php'); |
|
26 | + } |
|
25 | 27 | |
26 | 28 | # Connect to database |
27 | 29 |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) Request::redirect(INSTALL_PATH.'/admin/register'); |
|
25 | 25 | |
26 | 26 | return (new Auth\Action\Recover)->handle(); |
27 | 27 | } |
@@ -21,7 +21,9 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) { |
|
25 | + Request::redirect(INSTALL_PATH . '/admin/register'); |
|
26 | + } |
|
25 | 27 | |
26 | 28 | return (new Auth\Action\Recover)->handle(); |
27 | 29 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) Request::redirect(INSTALL_PATH.'/admin/register'); |
|
25 | 25 | |
26 | 26 | return (new Auth\Action\Reset)->handle(); |
27 | 27 | } |
@@ -21,7 +21,9 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) { |
|
25 | + Request::redirect(INSTALL_PATH . '/admin/register'); |
|
26 | + } |
|
25 | 27 | |
26 | 28 | return (new Auth\Action\Reset)->handle(); |
27 | 29 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) Request::redirect(INSTALL_PATH.'/admin/register'); |
|
25 | 25 | |
26 | 26 | return (new Auth\Action\Login)->handle(); |
27 | 27 | } |
@@ -21,7 +21,9 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/register'); |
|
24 | + if (Auth::isInitial()) { |
|
25 | + Request::redirect(INSTALL_PATH . '/admin/register'); |
|
26 | + } |
|
25 | 27 | |
26 | 28 | return (new Auth\Action\Login)->handle(); |
27 | 29 | } |
@@ -21,7 +21,7 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (!Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/login'); |
|
24 | + if (!Auth::isInitial()) Request::redirect(INSTALL_PATH.'/admin/login'); |
|
25 | 25 | |
26 | 26 | return (new Auth\Action\Register)->handle(); |
27 | 27 | } |
@@ -21,7 +21,9 @@ |
||
21 | 21 | |
22 | 22 | public function handle() : Template\Block { |
23 | 23 | |
24 | - if (!Auth::isInitial()) Request::redirect(INSTALL_PATH . '/admin/login'); |
|
24 | + if (!Auth::isInitial()) { |
|
25 | + Request::redirect(INSTALL_PATH . '/admin/login'); |
|
26 | + } |
|
25 | 27 | |
26 | 28 | return (new Auth\Action\Register)->handle(); |
27 | 29 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | if (false === ($result = Auth\Utils\Connector\Secret::authorize($code, $admin))) { |
39 | 39 | |
40 | - Request::redirect(INSTALL_PATH . ($admin ? '/admin' : '/profile') . '/reset'); |
|
40 | + Request::redirect(INSTALL_PATH.($admin ? '/admin' : '/profile').'/reset'); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | # Set recovery data |
@@ -29,19 +29,29 @@ |
||
29 | 29 | |
30 | 30 | # Check code |
31 | 31 | |
32 | - if (false === ($code = Validate::authCode($code))) return false; |
|
32 | + if (false === ($code = Validate::authCode($code))) { |
|
33 | + return false; |
|
34 | + } |
|
33 | 35 | |
34 | 36 | # Get auth |
35 | 37 | |
36 | - if (!($auth = Entitizer::get(static::$type))->init($code, 'code')) return false; |
|
38 | + if (!($auth = Entitizer::get(static::$type))->init($code, 'code')) { |
|
39 | + return false; |
|
40 | + } |
|
37 | 41 | |
38 | - if (($auth->ip !== REQUEST_CLIENT_IP) || ($auth->time < (REQUEST_TIME - static::$lifetime))) return false; |
|
42 | + if (($auth->ip !== REQUEST_CLIENT_IP) || ($auth->time < (REQUEST_TIME - static::$lifetime))) { |
|
43 | + return false; |
|
44 | + } |
|
39 | 45 | |
40 | 46 | # Get user |
41 | 47 | |
42 | - if (0 === ($user = Entitizer::get(TABLE_USERS, $auth->id))->id) return false; |
|
48 | + if (0 === ($user = Entitizer::get(TABLE_USERS, $auth->id))->id) { |
|
49 | + return false; |
|
50 | + } |
|
43 | 51 | |
44 | - if ($user->rank < ($admin ? RANK_ADMINISTRATOR : RANK_USER)) return false; |
|
52 | + if ($user->rank < ($admin ? RANK_ADMINISTRATOR : RANK_USER)) { |
|
53 | + return false; |
|
54 | + } |
|
45 | 55 | |
46 | 56 | # ------------------------ |
47 | 57 |