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

Set the scope to also be able to retrieve the user's email #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions bootstrap.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
) );
}

// Set the scope to also be able to retrieve the user's email.
// Without this, we can't contact anyone for notifications or moderation events.
$sceneID->SetScope(array("basic", "user:email"));

$currentUser = NULL;
if (get_login_id())
{
Expand Down
12 changes: 11 additions & 1 deletion include_pouet/pouet-user.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,17 @@ function GetSceneIDData( $cached = true )
try
{
$sceneID->GetClientCredentialsToken();
$data = $sceneID->User( $this->id );

// If the current user is the same as the PouetUser, get more info from SceneID
if (get_login_id() == $this->id)
{
$data = $sceneID->Me();
}
else
{
$data = $sceneID->User( $this->id );
}

if ($data && @$data["user"])
{
SQLLib::UpdateRow("users",array(
Expand Down