author | durandn |
Tue, 22 Sep 2015 10:46:31 +0200 | |
changeset 160 | c9cf4845e6a5 |
parent 95 | 8ecee14c6d81 |
permissions | -rw-r--r-- |
0 | 1 |
<?php namespace TestCAS\Http\Controllers; |
2 |
||
3 |
use Cas; |
|
8
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
0
diff
changeset
|
4 |
use phpCAS; |
0 | 5 |
|
6 |
class HomeController extends Controller { |
|
7 |
||
8 |
/* |
|
9 |
|-------------------------------------------------------------------------- |
|
10 |
| Home Controller |
|
11 |
|-------------------------------------------------------------------------- |
|
12 |
| |
|
13 |
| This controller renders your application's "dashboard" for users that |
|
14 |
| are authenticated. Of course, you are free to change or remove the |
|
15 |
| controller as you wish. It is just here to get your app started! |
|
16 |
| |
|
17 |
*/ |
|
18 |
||
19 |
/** |
|
20 |
* Create a new controller instance. |
|
21 |
* |
|
22 |
* @return void |
|
23 |
*/ |
|
24 |
public function __construct() |
|
25 |
{ |
|
26 |
$this->middleware('auth.cas'); |
|
27 |
} |
|
28 |
||
29 |
/** |
|
30 |
* Show the application dashboard to the user. |
|
31 |
* |
|
32 |
* @return Response |
|
33 |
*/ |
|
34 |
public function index() |
|
35 |
{ |
|
8
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
0
diff
changeset
|
36 |
$pt="Error getting PT"; |
82
bf1c38268e25
Updated Readmes + Updated tmp CAS config + Updated Laravel test with iframe + remove X-Frame django middleware from middlewares + removed local ssl certificate from repo
durandn
parents:
9
diff
changeset
|
37 |
$pt=phpCAS::retrievePT(env("LDT_URL")."/remie/workunit/segments_single?project_id=".env("TEST_PROJECT_ID"), $err_code, $err_msg); |
95 | 38 |
$iframe_url=env("LDT_URL")."/remie/workunit/segments_single?project_id=".env("TEST_PROJECT_ID"); |
8
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
0
diff
changeset
|
39 |
|
9
3166a35f5f0d
Added CAS Auth middleware and CAS Login urls to remie platform + removed authserver/homestead/.vagrant from repo
durandn
parents:
8
diff
changeset
|
40 |
$loginUrl=env("LDT_URL")."/accounts/cas/login"; |
8
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
0
diff
changeset
|
41 |
|
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
0
diff
changeset
|
42 |
return view('home')->with( |
82
bf1c38268e25
Updated Readmes + Updated tmp CAS config + Updated Laravel test with iframe + remove X-Frame django middleware from middlewares + removed local ssl certificate from repo
durandn
parents:
9
diff
changeset
|
43 |
array("pt" => $pt, "err_code" => $err_code, "err_msg" => $err_msg, "iframe_url" => $iframe_url, 'loginUrl' => $loginUrl) |
8
5a0cbbe0922a
CAS Authentication (normal and proxy) + local Homestead vm
durandn
parents:
0
diff
changeset
|
44 |
); |
0 | 45 |
} |
46 |
||
47 |
/** |
|
48 |
* logout |
|
49 |
* |
|
50 |
* @return Response |
|
51 |
*/ |
|
52 |
public function logout() |
|
53 |
{ |
|
54 |
cas::logout(['service'=>url('/')]); |
|
55 |
return redirect()->route('index'); |
|
56 |
} |
|
57 |
||
58 |
} |