Completed
Push — master ( 69cdb4...c2609a )
by Nazar
03:54
created
components/modules/OAuth2/admin/clients.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) 2014-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) 2014-2016, Nazar Mokrynskyi
7
+	 * @license   MIT License, see license.txt
8
+	 */
9 9
 namespace cs;
10 10
 include __DIR__.'/clients/save.php';
11 11
 Index::instance()->form_attributes['is'] = 'cs-form';
Please login to merge, or discard this patch.
components/modules/OAuth2/events/uninstalled.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) 2013-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) 2013-2016, Nazar Mokrynskyi
7
+	 * @license		MIT License, see license.txt
8
+	 */
9 9
 namespace	cs;
10 10
 Event::instance()->on(
11 11
 	'admin/System/components/modules/install/after',
Please login to merge, or discard this patch.
components/modules/OAuth2/events.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.
components/modules/OAuth2/authorize.php 2 patches
Indentation   +16 added lines, -16 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,
@@ -46,8 +46,8 @@  discard block
 block discarded – undo
46 46
 $L      = new Prefix('oauth2_');
47 47
 $Page   = Page::instance();
48 48
 /**
49
- * Errors processing
50
- */
49
+	 * Errors processing
50
+	 */
51 51
 if (!isset($_GET['client_id'])) {
52 52
 	error_redirect('invalid_request', 'client_id parameter required');
53 53
 	return;
@@ -115,8 +115,8 @@  discard block
 block discarded – undo
115 115
 	}
116 116
 }
117 117
 /**
118
- * guest_token should return JSON data while all other works with redirects
119
- */
118
+	 * guest_token should return JSON data while all other works with redirects
119
+	 */
120 120
 if ($_GET['response_type'] != 'guest_token') {
121 121
 	if (!isset($_GET['redirect_uri'])) {
122 122
 		$e = new ExitException(
@@ -189,8 +189,8 @@  discard block
 block discarded – undo
189 189
 	}
190 190
 }
191 191
 /**
192
- * Authorization processing
193
- */
192
+	 * Authorization processing
193
+	 */
194 194
 if (isset($_POST['mode'])) {
195 195
 	switch ($_POST['mode']) {
196 196
 		case 'allow':
Please login to merge, or discard this patch.
Switch Indentation   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -230,84 +230,84 @@
 block discarded – undo
230 230
 	return;
231 231
 }
232 232
 switch ($_GET['response_type']) {
233
-	case 'code':
234
-		$Response->redirect(
235
-			http_build_url(
236
-				urldecode($redirect_uri),
237
-				[
238
-					'code'  => $code,
239
-					'state' => isset($_GET['state']) ? $_GET['state'] : false
240
-				]
241
-			),
242
-			302
243
-		);
244
-		$Page->Content = '';
245
-		return;
246
-	case 'token':
247
-		$token_data = $OAuth2->get_code($code, $client['id'], $client['secret'], $redirect_uri);
248
-		if ($token_data) {
249
-			unset($token_data['refresh_token']);
233
+		case 'code':
250 234
 			$Response->redirect(
251
-				uri_for_token(
252
-					http_build_url(
253
-						urldecode($redirect_uri),
254
-						array_merge(
255
-							$token_data,
256
-							[
257
-								'state' => isset($_GET['state']) ? $_GET['state'] : false
258
-							]
259
-						)
260
-					)
235
+				http_build_url(
236
+					urldecode($redirect_uri),
237
+					[
238
+						'code'  => $code,
239
+						'state' => isset($_GET['state']) ? $_GET['state'] : false
240
+					]
261 241
 				),
262 242
 				302
263 243
 			);
264 244
 			$Page->Content = '';
265 245
 			return;
266
-		} else {
267
-			error_redirect('server_error', "Server can't get token data, try later");
268
-			return;
269
-		}
270
-	case 'guest_token':
271
-		$Response
272
-			->header('cache-control', 'no-store')
273
-			->header('pragma', 'no-cache');
274
-		if ($User->user()) {
275
-			$e = new ExitException(
276
-				[
277
-					'access_denied',
278
-					'Only guests, not users allowed to access this response_type'
279
-				],
280
-				403
281
-			);
282
-			$e->setJson();
283
-			throw $e;
284
-		}
285
-		$code = $OAuth2->add_code($client['id'], 'token', urldecode($_GET['redirect_uri']));
286
-		if (!$code) {
287
-			$e = new ExitException(
288
-				[
289
-					'server_error',
290
-					"Server can't generate code, try later"
291
-				],
292
-				500
293
-			);
294
-			$e->setJson();
295
-			throw $e;
296
-		}
297
-		$token_data = $OAuth2->get_code($code, $client['id'], $client['secret'], urldecode($_GET['redirect_uri']));
298
-		if ($token_data) {
299
-			unset($token_data['refresh_token']);
300
-			$Page->json($token_data);
301
-			return;
302
-		} else {
303
-			$e = new ExitException(
304
-				[
305
-					'server_error',
306
-					"Server can't get token data, try later"
307
-				],
308
-				500
309
-			);
310
-			$e->setJson();
311
-			throw $e;
312
-		}
246
+		case 'token':
247
+			$token_data = $OAuth2->get_code($code, $client['id'], $client['secret'], $redirect_uri);
248
+			if ($token_data) {
249
+				unset($token_data['refresh_token']);
250
+				$Response->redirect(
251
+					uri_for_token(
252
+						http_build_url(
253
+							urldecode($redirect_uri),
254
+							array_merge(
255
+								$token_data,
256
+								[
257
+									'state' => isset($_GET['state']) ? $_GET['state'] : false
258
+								]
259
+							)
260
+						)
261
+					),
262
+					302
263
+				);
264
+				$Page->Content = '';
265
+				return;
266
+			} else {
267
+				error_redirect('server_error', "Server can't get token data, try later");
268
+				return;
269
+			}
270
+		case 'guest_token':
271
+			$Response
272
+				->header('cache-control', 'no-store')
273
+				->header('pragma', 'no-cache');
274
+			if ($User->user()) {
275
+				$e = new ExitException(
276
+					[
277
+						'access_denied',
278
+						'Only guests, not users allowed to access this response_type'
279
+					],
280
+					403
281
+				);
282
+				$e->setJson();
283
+				throw $e;
284
+			}
285
+			$code = $OAuth2->add_code($client['id'], 'token', urldecode($_GET['redirect_uri']));
286
+			if (!$code) {
287
+				$e = new ExitException(
288
+					[
289
+						'server_error',
290
+						"Server can't generate code, try later"
291
+					],
292
+					500
293
+				);
294
+				$e->setJson();
295
+				throw $e;
296
+			}
297
+			$token_data = $OAuth2->get_code($code, $client['id'], $client['secret'], urldecode($_GET['redirect_uri']));
298
+			if ($token_data) {
299
+				unset($token_data['refresh_token']);
300
+				$Page->json($token_data);
301
+				return;
302
+			} else {
303
+				$e = new ExitException(
304
+					[
305
+						'server_error',
306
+						"Server can't get token data, try later"
307
+					],
308
+					500
309
+				);
310
+				$e->setJson();
311
+				throw $e;
312
+			}
313 313
 }
Please login to merge, or discard this patch.
components/modules/HybridAuth/events.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   HybridAuth
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   HybridAuth
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
 Event::instance()->on(
11 11
 	'System/User/construct/after',
Please login to merge, or discard this patch.
components/modules/Disqus/events.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        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;
10 10
 Event::instance()->on(
11 11
 	'System/Index/construct',
Please login to merge, or discard this patch.
components/modules/Plupload/events/installed.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Plupload
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
7
- * @license   GNU GPL v2, see license.txt
8
- */
3
+	 * @package   Plupload
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
7
+	 * @license   GNU GPL v2, see license.txt
8
+	 */
9 9
 namespace cs\modules\Plupload;
10 10
 use
11 11
 	cs\Config,
@@ -13,13 +13,13 @@  discard block
 block discarded – undo
13 13
 	cs\Event,
14 14
 	cs\Storage;
15 15
 /**
16
- * Supports next events:
17
- *  System/upload_files/del_tag
18
- *  [
19
- *   'url' => url, //Optional
20
- *   'tag' => tag  //Optional ("%" symbol may be used at the end of string to delete all files, that starts from specified string)
21
- *  ]
22
- */
16
+	 * Supports next events:
17
+	 *  System/upload_files/del_tag
18
+	 *  [
19
+	 *   'url' => url, //Optional
20
+	 *   'tag' => tag  //Optional ("%" symbol may be used at the end of string to delete all files, that starts from specified string)
21
+	 *  ]
22
+	 */
23 23
 Event::instance()
24 24
 	->on(
25 25
 		'admin/System/components/modules/uninstall/before',
Please login to merge, or discard this patch.
components/modules/Plupload/events/enabled.php 1 patch
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,19 +1,19 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * @package   Plupload
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
7
- * @license   GNU GPL v2, see license.txt
8
- */
3
+	 * @package   Plupload
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
7
+	 * @license   GNU GPL v2, see license.txt
8
+	 */
9 9
 /**
10
- * Supports next events:
11
- *  System/upload_files/add_tag
12
- *  [
13
- *   'url' => url, //Required
14
- *   'tag' => tag  //Required
15
- *  ]
16
- */
10
+	 * Supports next events:
11
+	 *  System/upload_files/add_tag
12
+	 *  [
13
+	 *   'url' => url, //Required
14
+	 *   'tag' => tag  //Required
15
+	 *  ]
16
+	 */
17 17
 namespace cs\modules\Plupload;
18 18
 use
19 19
 	cs\Config,
Please login to merge, or discard this patch.
components/modules/Plupload/events.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   Plupload
4
- * @category  modules
5
- * @author    Nazar Mokrynskyi <[email protected]>
6
- * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
7
- * @license   GNU GPL v2, see license.txt
8
- */
3
+	 * @package   Plupload
4
+	 * @category  modules
5
+	 * @author    Nazar Mokrynskyi <[email protected]>
6
+	 * @copyright Copyright (c) 2013-2016, Nazar Mokrynskyi
7
+	 * @license   GNU GPL v2, see license.txt
8
+	 */
9 9
 namespace cs;
10 10
 Event::instance()
11 11
 	->on(
Please login to merge, or discard this patch.