Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

See Auth added as a session variable #6982

Closed
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Common/Auth/AuthUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,7 @@ public static function setUserSessionVariables($username, $hash, $userInfo, $aut
$_SESSION['authUserID'] = $userInfo['id']; // user id
$_SESSION['authProvider'] = $authGroup; // user group
$_SESSION['userauthorized'] = $userInfo['authorized']; // user authorized setting
$_SESSION['seeAuth'] = $userInfo['see_auth']; // user see_auth setting (see auth group)
Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay so now we have a session flag where is it implemented? If we need the flag it is retrieved when the user is fetched and used in place. I don't get why we need another var in session if not used unless needed for modules.

I thought see auth wasn't working and this fixed!! Or am I missing something?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not implemented anywhere. That is why I added it. I used it to hide the provider list on the calendar so the provider only sees their own calendar and cannot view other providers calendars. That was the request.

Here is how I used it in the views/day/ajax_template.html

 // EOS FF
 // ==============================
 echo "</div>";
	if ($_SESSION['seeAuth'] != '2') {
 echo "   <select multiple size='5' name='pc_username[]' id='pc_username' class='view2 form-control'>\n";
 echo "    <option value='__PC_ALL__'>"  . xlt("All Users") . "</option>\n";
 foreach ($provinfo as $doc) {
	$username = $doc['username'];
	echo "    <option value='" . attr($username) . "'";
	foreach ($providers as $provider)
		if ($provider['username'] == $username) echo " selected";
	echo ">" . text($doc['lname']) . ", " . text($doc['fname']) . "</option>\n";
 }
 echo "   </select>\n";
	}
[-/php-]

Copy link
Sponsor Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay I guess I'm missing it because I can't find so I'm guessing you haven't implemented yet or my ide search engine is failing me?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sjpadgett, that code snippet was a mode I did for someone else. I did not submit that to the codebase because it may not have mass appeal. This is one of those if you build it they will use it.

// Some users may be able to authorize without being providers:
if ($userInfo['see_auth'] > '2') {
$_SESSION['userauthorized'] = '1';
Expand Down