@@ -94,7 +94,7 @@ |
||
94 | 94 | |
95 | 95 | /** |
96 | 96 | * @param $totalLength |
97 | - * @return bool|string |
|
97 | + * @return false|string |
|
98 | 98 | */ |
99 | 99 | protected function getAvailableTicket($totalLength) |
100 | 100 | { |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('cas_service_hosts', function (Blueprint $table) { |
|
15 | + Schema::create('cas_service_hosts', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('host')->unique(); |
18 | 18 | $table->integer('service_id')->unsigned(); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('cas_tickets', function (Blueprint $table) { |
|
15 | + Schema::create('cas_tickets', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('ticket', 32)->unique(); |
18 | 18 | $table->string('service_url', 1024); |
@@ -12,7 +12,7 @@ |
||
12 | 12 | */ |
13 | 13 | public function up() |
14 | 14 | { |
15 | - Schema::create('cas_services', function (Blueprint $table) { |
|
15 | + Schema::create('cas_services', function(Blueprint $table) { |
|
16 | 16 | $table->increments('id'); |
17 | 17 | $table->string('name')->unique(); |
18 | 18 | $table->boolean('enabled')->default(true); |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $this->ticketRepository->invalidTicket($record); |
116 | 116 | $this->unlockTicket($ticket); |
117 | 117 | |
118 | - $attr = $returnAttr ? $record->user->getCASAttributes() : []; |
|
118 | + $attr = $returnAttr ? $record->user->getCASAttributes() : [ ]; |
|
119 | 119 | |
120 | 120 | return $this->successResponse($record->user->getName(), $attr, $format); |
121 | 121 | } |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | ]; |
139 | 139 | |
140 | 140 | if (!empty($attrs)) { |
141 | - $data['serviceResponse']['authenticationSuccess']['attributes'] = $attrs; |
|
141 | + $data[ 'serviceResponse' ][ 'authenticationSuccess' ][ 'attributes' ] = $attrs; |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | return new Response($data); |
@@ -52,11 +52,11 @@ discard block |
||
52 | 52 | public function showLogin(Request $request) |
53 | 53 | { |
54 | 54 | $service = $request->get('service', ''); |
55 | - $errors = []; |
|
55 | + $errors = [ ]; |
|
56 | 56 | if (!empty($service)) { |
57 | 57 | //service not found in white list |
58 | 58 | if (!$this->serviceRepository->isUrlValid($service)) { |
59 | - $errors[] = (new CasException(CasException::INVALID_SERVICE))->getCasMsg(); |
|
59 | + $errors[ ] = (new CasException(CasException::INVALID_SERVICE))->getCasMsg(); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | //must not be transparent |
72 | 72 | if ($request->get('warn') === 'true' && !empty($service)) { |
73 | 73 | $query = $request->query->all(); |
74 | - unset($query['warn']); |
|
74 | + unset($query[ 'warn' ]); |
|
75 | 75 | $url = cas_route('login_page', $query); |
76 | 76 | |
77 | 77 | return $this->loginInteraction->showLoginWarnPage($request, $url, $service); |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | try { |
99 | 99 | $ticket = $this->ticketRepository->applyTicket($user, $serviceUrl); |
100 | 100 | } catch (CasException $e) { |
101 | - return $this->loginInteraction->redirectToHome([$e->getCasMsg()]); |
|
101 | + return $this->loginInteraction->redirectToHome([ $e->getCasMsg() ]); |
|
102 | 102 | } |
103 | 103 | $finalUrl = $serviceUrl.($query ? '&' : '?').'ticket='.$ticket->ticket; |
104 | 104 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | { |
113 | 113 | return $this->loginInteraction->logout( |
114 | 114 | $request, |
115 | - function (Request $request) { |
|
115 | + function(Request $request) { |
|
116 | 116 | event(new CasUserLogoutEvent($request, $this->loginInteraction->getCurrentUser($request))); |
117 | 117 | } |
118 | 118 | ); |
@@ -6,19 +6,19 @@ |
||
6 | 6 | ]; |
7 | 7 | |
8 | 8 | if (config('cas.middleware.common')) { |
9 | - $options['middleware'] = config('cas.middleware.common'); |
|
9 | + $options[ 'middleware' ] = config('cas.middleware.common'); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | Route::group( |
13 | 13 | $options, |
14 | - function () { |
|
14 | + function() { |
|
15 | 15 | $auth = config('cas.middleware.auth'); |
16 | 16 | $p = config('cas.router.name_prefix'); |
17 | - Route::get('login', ['as' => $p.'login_page', 'uses' => 'SecurityController@showLogin']); |
|
18 | - Route::post('login', ['as' => $p.'login_action', 'uses' => 'SecurityController@login']); |
|
19 | - Route::get('logout', ['as' => $p.'logout', 'uses' => 'SecurityController@logout'])->middleware($auth); |
|
20 | - Route::any('validate', ['as' => $p.'v1validate', 'uses' => 'ValidateController@v1ValidateAction']); |
|
21 | - Route::any('serviceValidate', ['as' => $p.'v2validate', 'uses' => 'ValidateController@v2ValidateAction']); |
|
22 | - Route::any('p3/serviceValidate', ['as' => $p.'v3validate', 'uses' => 'ValidateController@v3ValidateAction']); |
|
17 | + Route::get('login', [ 'as' => $p.'login_page', 'uses' => 'SecurityController@showLogin' ]); |
|
18 | + Route::post('login', [ 'as' => $p.'login_action', 'uses' => 'SecurityController@login' ]); |
|
19 | + Route::get('logout', [ 'as' => $p.'logout', 'uses' => 'SecurityController@logout' ])->middleware($auth); |
|
20 | + Route::any('validate', [ 'as' => $p.'v1validate', 'uses' => 'ValidateController@v1ValidateAction' ]); |
|
21 | + Route::any('serviceValidate', [ 'as' => $p.'v2validate', 'uses' => 'ValidateController@v2ValidateAction' ]); |
|
22 | + Route::any('p3/serviceValidate', [ 'as' => $p.'v3validate', 'uses' => 'ValidateController@v3ValidateAction' ]); |
|
23 | 23 | } |
24 | 24 | ); |
@@ -14,7 +14,7 @@ |
||
14 | 14 | { |
15 | 15 | protected $table = 'cas_service_hosts'; |
16 | 16 | public $timestamps = false; |
17 | - protected $fillable = ['host']; |
|
17 | + protected $fillable = [ 'host' ]; |
|
18 | 18 | |
19 | 19 | public function service() |
20 | 20 | { |
@@ -15,7 +15,7 @@ |
||
15 | 15 | { |
16 | 16 | protected $table = 'cas_tickets'; |
17 | 17 | public $timestamps = false; |
18 | - protected $fillable = ['ticket', 'service_url', 'expire_at', 'created_at']; |
|
18 | + protected $fillable = [ 'ticket', 'service_url', 'expire_at', 'created_at' ]; |
|
19 | 19 | |
20 | 20 | public function isExpired() |
21 | 21 | { |