Skip to content

Commit

Permalink
Add comments to explain the 'for' loop with '$$value'.
Browse files Browse the repository at this point in the history
  • Loading branch information
terrencegf committed Apr 6, 2020
1 parent d5face5 commit b9f3f70
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 3 additions & 0 deletions src/Service/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -2312,6 +2312,9 @@ public static function handleGotUser()
// We must get and unset session vars BEFORE any HTML output since
// a redirect may go to another site, meaning we need to update
// the session cookie before we leave the cilogon.org domain.
//
// This bit of trickery sets local variables from the PHP session
// that was just populated, using the names in the $user_attrs array.
foreach (DBService::$user_attrs as $value) {
$$value = Util::getSessionVar($value);
}
Expand Down
3 changes: 2 additions & 1 deletion src/Service/Util.php
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,8 @@ public static function saveUserToDataStore(...$args)
// session variables into local vars for ease of use.
static::setUserAttributeSessionVars(...$args);

// Set local variables from the PHP session that was just populated
// This bit of trickery sets local variables from the PHP session
// that was just populated, using the names in the $user_attrs array.
foreach (DBService::$user_attrs as $value) {
$$value = static::getSessionVar($value);
}
Expand Down

0 comments on commit b9f3f70

Please sign in to comment.