Completed
Push — master ( 7710e6...19a091 )
by Nazar
04:14
created
core/classes/Event.php 1 patch
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,18 +1,18 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 namespace cs;
9 9
 /**
10
- * Event class
11
- *
12
- * Provides events subscribing and dispatching
13
- *
14
- * @method static $this instance($check = false)
15
- */
10
+	 * Event class
11
+	 *
12
+	 * Provides events subscribing and dispatching
13
+	 *
14
+	 * @method static $this instance($check = false)
15
+	 */
16 16
 class Event {
17 17
 	use
18 18
 		Singleton;
Please login to merge, or discard this patch.
core/classes/User.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 namespace cs\User;
9 9
 use
10 10
 	cs\Config,
Please login to merge, or discard this patch.
components/modules/Comments/api/index.delete.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Comments
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Comments
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Comments;
10 10
 use
11 11
 	cs\Config,
@@ -54,8 +54,8 @@  discard block
 block discarded – undo
54 54
 	throw new ExitException($L->comment_editing_server_error, 500);
55 55
 }
56 56
 /**
57
- * @var Comments $Comments
58
- */
57
+	 * @var Comments $Comments
58
+	 */
59 59
 $result = $Comments->set($Route->route[0], $_POST['text']);
60 60
 if ($result) {
61 61
 	$Page->json($result['text']);
Please login to merge, or discard this patch.
components/modules/Uploader/api/index.php 1 patch
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Uploader
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Uploader
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs;
10 10
 use
11 11
 	Karwana\Mime\Mime;
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 	throw new ExitException('File Not Specified', 400);
21 21
 }
22 22
 /**
23
- * Getting Uploader module configuration
24
- */
23
+	 * Getting Uploader module configuration
24
+	 */
25 25
 $module_data   = Config::instance()->module('Uploader');
26 26
 $max_file_size = (int)$module_data->max_file_size;
27 27
 switch (substr(strtolower($module_data->max_file_size), -2)) {
@@ -45,25 +45,25 @@  discard block
 block discarded – undo
45 45
 	throw new ExitException(500);
46 46
 }
47 47
 /**
48
- * Only registered users allowed
49
- */
48
+	 * Only registered users allowed
49
+	 */
50 50
 if (!$User->user()) {
51 51
 	throw new ExitException(403);
52 52
 }
53 53
 /**
54
- * Getting instances of storage and database
55
- */
54
+	 * Getting instances of storage and database
55
+	 */
56 56
 $storage = Storage::instance()->storage($module_data->storage('files'));
57 57
 /**
58
- * @var DB\_Abstract $cdb
59
- */
58
+	 * @var DB\_Abstract $cdb
59
+	 */
60 60
 $cdb = DB::instance()->db_prime($module_data->db('files'));
61 61
 if (!$storage || !$cdb) {
62 62
 	throw new ExitException(500);
63 63
 }
64 64
 /**
65
- * Moving file into storage
66
- */
65
+	 * Moving file into storage
66
+	 */
67 67
 if (!$module_data->directory_created) {
68 68
 	$storage->mkdir('Uploader');
69 69
 	$module_data->directory_created = 1;
@@ -83,8 +83,8 @@  discard block
 block discarded – undo
83 83
 	throw new ExitException(500);
84 84
 }
85 85
 /**
86
- * Registering file in database
87
- */
86
+	 * Registering file in database
87
+	 */
88 88
 if (!$cdb->q(
89 89
 	"INSERT INTO `[prefix]uploader_files`
90 90
 		(`user`, `uploaded`, `source`, `url`)
Please login to merge, or discard this patch.
components/modules/Blogs/Tags.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Blogs
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   Blogs
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2015-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs\modules\Blogs;
10 10
 use
11 11
 	cs\Cache\Prefix,
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
 	cs\plugins\Tags\Tags as Tags_trait,
14 14
 	cs\Singleton;
15 15
 /**
16
- * Tags trait
17
- *
18
- * Provides methods for working with tags for faster development
19
- *
20
- * @method static $this instance($check = false)
21
- */
16
+	 * Tags trait
17
+	 *
18
+	 * Provides methods for working with tags for faster development
19
+	 *
20
+	 * @method static $this instance($check = false)
21
+	 */
22 22
 class Tags {
23 23
 	use
24 24
 		Tags_trait,
Please login to merge, or discard this patch.
components/modules/OAuth2/blank.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   OAuth2
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   OAuth2
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs;
10 10
 
11 11
 Event::instance()
Please login to merge, or discard this patch.
core/traits/Session/Management.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 namespace cs\User;
9 9
 use
10 10
 	cs\Config,
Please login to merge, or discard this patch.
core/traits/Session/Data.php 1 patch
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   CleverStyle CMS
4
- * @author    Nazar Mokrynskyi <[email protected]>
5
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
- * @license   MIT License, see license.txt
7
- */
3
+	 * @package   CleverStyle CMS
4
+	 * @author    Nazar Mokrynskyi <[email protected]>
5
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
6
+	 * @license   MIT License, see license.txt
7
+	 */
8 8
 namespace cs\User;
9 9
 use
10 10
 	cs\Config,
Please login to merge, or discard this patch.
components/modules/OAuth2/authorize.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   OAuth2
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
- * @license   MIT License, see license.txt
8
- */
3
+	 * @package   OAuth2
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2011-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 /**
10
- * Provides next events:<br>
11
- *  OAuth2/custom_sign_in_page
12
- *  OAuth2/custom_allow_access_page
13
- */
10
+	 * Provides next events:<br>
11
+	 *  OAuth2/custom_sign_in_page
12
+	 *  OAuth2/custom_allow_access_page
13
+	 */
14 14
 namespace cs\modules\OAuth2;
15 15
 use
16 16
 	h,
@@ -43,8 +43,8 @@  discard block
 block discarded – undo
43 43
 $L      = new Prefix('oauth2_');
44 44
 $Page   = Page::instance();
45 45
 /**
46
- * Errors processing
47
- */
46
+	 * Errors processing
47
+	 */
48 48
 if (!isset($_GET['client_id'])) {
49 49
 	error_redirect('invalid_request', 'client_id parameter required');
50 50
 	return;
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
 }
132 132
 $Response = Response::instance();
133 133
 /**
134
- * Authorization processing
135
- */
134
+	 * Authorization processing
135
+	 */
136 136
 if (isset($_POST['mode'])) {
137 137
 	if ($_POST['mode'] == 'allow') {
138 138
 		$OAuth2->add_access($client['id']);
Please login to merge, or discard this patch.
Switch Indentation   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -172,43 +172,43 @@
 block discarded – undo
172 172
 	return;
173 173
 }
174 174
 switch ($_GET['response_type']) {
175
-	case 'code':
176
-		$Response->redirect(
177
-			http_build_url(
178
-				urldecode($redirect_uri),
179
-				[
180
-					'code'  => $code,
181
-					'state' => isset($_GET['state']) ? $_GET['state'] : false
182
-				]
183
-			),
184
-			302
185
-		);
186
-		$Page->Content = '';
187
-		return;
188
-	case 'token':
189
-		$token_data = $OAuth2->get_code($code, $client['id'], $client['secret'], $redirect_uri);
190
-		if ($token_data) {
191
-			unset($token_data['refresh_token']);
175
+		case 'code':
192 176
 			$Response->redirect(
193
-				uri_for_token(
194
-					http_build_url(
195
-						urldecode($redirect_uri),
196
-						array_merge(
197
-							$token_data,
198
-							[
199
-								'state' => isset($_GET['state']) ? $_GET['state'] : false
200
-							]
201
-						)
202
-					)
177
+				http_build_url(
178
+					urldecode($redirect_uri),
179
+					[
180
+						'code'  => $code,
181
+						'state' => isset($_GET['state']) ? $_GET['state'] : false
182
+					]
203 183
 				),
204 184
 				302
205 185
 			);
206 186
 			$Page->Content = '';
207 187
 			return;
208
-		} else {
209
-			error_redirect('server_error', "Server can't get token data, try later");
210
-			return;
211
-		}
212
-	default:
213
-		error_redirect('unsupported_response_type', 'Specified response_type is not supported, only "token" or "code" types available');
188
+		case 'token':
189
+			$token_data = $OAuth2->get_code($code, $client['id'], $client['secret'], $redirect_uri);
190
+			if ($token_data) {
191
+				unset($token_data['refresh_token']);
192
+				$Response->redirect(
193
+					uri_for_token(
194
+						http_build_url(
195
+							urldecode($redirect_uri),
196
+							array_merge(
197
+								$token_data,
198
+								[
199
+									'state' => isset($_GET['state']) ? $_GET['state'] : false
200
+								]
201
+							)
202
+						)
203
+					),
204
+					302
205
+				);
206
+				$Page->Content = '';
207
+				return;
208
+			} else {
209
+				error_redirect('server_error', "Server can't get token data, try later");
210
+				return;
211
+			}
212
+		default:
213
+			error_redirect('unsupported_response_type', 'Specified response_type is not supported, only "token" or "code" types available');
214 214
 }
Please login to merge, or discard this patch.