File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 44 use Pdsinterop \PhpSolid \Server ;
55 use Pdsinterop \PhpSolid \ClientRegistration ;
66 use Pdsinterop \PhpSolid \User ;
7+ use Pdsinterop \PhpSolid \Session ;
78
89 class Solid {
910 public static function respondToJwks () {
@@ -19,6 +20,8 @@ public static function respondToWellKnownOpenIdConfiguration() {
1920 }
2021
2122 public static function respondToAuthorize () {
23+ $ user = User::getUser (Session::getLoggedInUser ());
24+
2225 $ clientId = $ _GET ['client_id ' ];
2326 $ getVars = $ _GET ;
2427
@@ -146,6 +149,7 @@ public static function respondToRegister() {
146149 }
147150
148151 public static function respondToSharing () {
152+ $ user = User::getUser (Session::getLoggedInUser ());
149153 $ clientId = $ _POST ['client_id ' ];
150154 $ userId = $ user ['userId ' ];
151155 if ($ _POST ['consent ' ] === 'true ' ) {
Original file line number Diff line number Diff line change 44 class Session {
55 private $ cookieLifetime = 24 *60 *60 ;
66 public static function start ($ username ) {
7- session_start ([
8- 'cookie_lifetime ' => 24 *60 *60 // 1 day
9- ]);
7+ if (session_status () === PHP_SESSION_NONE ) {
8+ session_start ([
9+ 'cookie_lifetime ' => 24 *60 *60 // 1 day
10+ ]);
11+ }
1012 $ _SESSION ['username ' ] = $ username ;
1113 }
1214
1315 public static function getLoggedInUser () {
14- session_start ();
16+ if (session_status () === PHP_SESSION_NONE ) {
17+ session_start ();
18+ }
1519 if (!isset ($ _SESSION ['username ' ])) {
1620 return false ;
1721 }
You can’t perform that action at this time.
0 commit comments