1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Issue #2055 - Ability to set a "scope" for HybridAuth provider.

This commit is contained in:
Lóna Lore
2016-11-30 19:24:08 +01:00
parent b8cfac8dd7
commit 57cb4308db
2 changed files with 23 additions and 14 deletions

View File

@@ -158,7 +158,7 @@ class social_ui extends e_admin_ui
"keys" => array ( "id" => "", "secret" => "" ),
"trustForwarded" => false,
// A comma-separated list of permissions you want to request from the user. See the Facebook docs for a full list of available permissions: http://developers.facebook.com/docs/reference/api/permissions.
"scope" => "",
"scope" => "email",
// The display context to show the authentication page. Options are: page, popup, iframe, touch and wap. Read the Facebook docs for more details: http://developers.facebook.com/docs/reference/dialogs#display. Default: page
"display" => ""
@@ -171,13 +171,14 @@ class social_ui extends e_admin_ui
"Github" => array (
"enabled" => true,
"keys" => array ( "id" => "", "secret" => "" )
"keys" => array ( "id" => "", "secret" => "" ),
"scope" => "user:email",
),
"Google" => array (
"enabled" => true,
"keys" => array ( "id" => "", "secret" => "" ),
"scope" => ""
"scope" => "email"
),
/*
"Instagram" => array (
@@ -319,6 +320,7 @@ class social_ui extends e_admin_ui
<col style='width:10%' />
<col class='col-control' />
<col class='col-control' />
<col class='col-control' />
<col style='width:20%' />
</colgroup>
<thead>
@@ -326,6 +328,7 @@ class social_ui extends e_admin_ui
<th>".LAN_SOCIAL_ADMIN_04."</th>
<th>".LAN_SOCIAL_ADMIN_05."</th>
<th>".LAN_SOCIAL_ADMIN_06."</th>
<th>".LAN_SOCIAL_ADMIN_38."</th>
<th class='center'>".LAN_SOCIAL_ADMIN_03."</th>
</tr>
</thead>
@@ -374,7 +377,9 @@ class social_ui extends e_admin_ui
break;
case 'scope':
$textScope .= $frm->hidden('social_login['.$prov.'][scope]','email');
$eopt = array( 'size'=>'block-level');
$keyCount[] = 1;
$textScope .= "<td>".$frm->text('social_login['.$prov.'][scope]', vartrue($pref['social_login'][$prov]['scope']), 100, $eopt)."</td>";
break;
default:
@@ -389,16 +394,20 @@ class social_ui extends e_admin_ui
if(empty($keyCount))
{
$textKeys = "<td>&nbsp;</td><td>&nbsp;</td>";
}
elseif(count($keyCount) == 1)
{
$textKeys .= "<td>&nbsp;</td>";
}
if(empty($keyCount))
{
$textKeys = "<td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td>";
}
elseif(count($keyCount) == 1)
{
$textKeys .= "<td>&nbsp;</td><td>&nbsp;</td>";
}
elseif(count($keyCount) == 2)
{
$textKeys .= "<td>&nbsp;</td>";
}
$text .= $textKeys."<td class='center'>".$textEnabled.$textScope."</td>";
$text .= $textKeys.$textScope."<td class='center'>".$textEnabled."</td>";
$text .= "
</tr>

View File

@@ -45,6 +45,6 @@ define("LAN_SOCIAL_ADMIN_34", "Number of tweets to display.");
define("LAN_SOCIAL_ADMIN_35", "Light");
define("LAN_SOCIAL_ADMIN_36", "Dark");
define("LAN_SOCIAL_ADMIN_37", "Open Graph Meta");
define("LAN_SOCIAL_ADMIN_38", "Scope");