Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
🚀 RELEASE: Merge branch 'release-v1.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
taija committed Mar 25, 2020
2 parents 2411818 + 0e7ad23 commit b2a3c1b
Show file tree
Hide file tree
Showing 8 changed files with 718 additions and 1,128 deletions.
10 changes: 5 additions & 5 deletions app/Http/Controllers/BlocksController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
class BlocksController extends Controller
{
//
public function blockList()
public function blockList(Request $request)
{
/**
* Load from Data API
Expand All @@ -24,14 +24,14 @@ public function blockList()
);

$user = $dataAPI->getUser(
session('username'),
$request->get('username'),
$token
);

$data = array(
'userData' => $user,
'username' => session('username'),
'logout' => session('logout_url'),
'username' => $request->get('username'),
'logout' => $request->get('logoutUrl'),
);

if (null !== $user && null !== $user['blocks'])
Expand All @@ -44,7 +44,7 @@ public function blockList()
}
else
{
Log::info( 'User '. (null !== session('username') ? session('username') : '[NOT SET]') .' logged in, had no student record');
Log::info( 'User '. (null !== $request->get('username') ? $request->get('username') : '[NOT SET]') .' logged in, had no student record');
return view('error/notStudent', $data);
}

Expand Down
11 changes: 6 additions & 5 deletions app/Http/Middleware/SimpleSAMLphp.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,16 @@ public function handle($request, Closure $next)
* Store Username and Auth Object in Session
*/
$attributes = $auth->getAttributes();
session(['username' => $attributes[config('simplesamlphp.username')][0]]);
session(['logout_url' => $auth->getLogoutURL('https://www.bellevuecollege.edu')]);
$request->attributes->add(['username' => $attributes[config('simplesamlphp.username')][0]]);
$request->attributes->add(['logoutUrl' => $auth->getLogoutURL('https://www.bellevuecollege.edu')]);

}
else // Disable auth on test and local environments
{
session(['username' => 't.test']); // Modify this username if needed
session(['logout_url' => 'https://www.bellevuecollege.edu']);
$request->attributes->add(['username' => 't.test']); // Modify this username if needed
$request->attributes->add(['logoutUrl' => 'https://www.bellevuecollege.edu']);
}

return $next($request);
}
}
}
20 changes: 12 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,29 @@
"description": "Simple Laravel Project to check for Registration Blocks",
"license": "GPLv3",
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"guzzlehttp/guzzle": "^6.3",
"laravel/framework": "5.7.*",
"laravel/tinker": "^1.0",
"symfony/psr-http-message-bridge": "^1.2"
"php": "^7.3",
"fideloper/proxy": "^4.2",
"guzzlehttp/guzzle": "^6.5",
"laravel/framework": "6.0.*",
"laravel/helpers": "^1.1",
"laravel/tinker": "^2.1",
"symfony/http-foundation": "~4.3.8"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.0"
"phpunit/phpunit": "^8.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
"sort-packages": true,
"platform": {
"php": "7.3.14"
}
},
"extra": {
"laravel": {
Expand Down
Loading

0 comments on commit b2a3c1b

Please sign in to comment.