Skip to content
Snippets Groups Projects
Commit e9a6f686 authored by Stefan Auditor's avatar Stefan Auditor
Browse files

Revert "Issue #3395838 by sanduhrs: Update code style"

This reverts commit eb93fc3c.
parent eb93fc3c
Branches
Tags
No related merge requests found
...@@ -65,7 +65,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface { ...@@ -65,7 +65,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function getSetting($key, $default = NULL) { public function getSetting($key, $default = NULL) {
return $this->settings[$key] ?: $default; return isset($this->settings[$key]) ? $this->settings[$key] : $default;
} }
/** /**
...@@ -119,10 +119,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface { ...@@ -119,10 +119,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
'client_id' => $this->getSetting('client_id'), 'client_id' => $this->getSetting('client_id'),
'response_type' => 'code', 'response_type' => 'code',
'scope' => $scope, 'scope' => $scope,
'redirect_uri' => url($redirect_uri, array( 'redirect_uri' => url($redirect_uri, array('absolute' => TRUE, 'language' => LANGUAGE_NONE)),
'absolute' => TRUE,
'language' => LANGUAGE_NONE,
)),
'state' => openid_connect_create_state_token(), 'state' => openid_connect_create_state_token(),
), ),
); );
...@@ -142,10 +139,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface { ...@@ -142,10 +139,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
'code' => $authorization_code, 'code' => $authorization_code,
'client_id' => $this->getSetting('client_id'), 'client_id' => $this->getSetting('client_id'),
'client_secret' => $this->getSetting('client_secret'), 'client_secret' => $this->getSetting('client_secret'),
'redirect_uri' => url($redirect_uri, array( 'redirect_uri' => url($redirect_uri, array('absolute' => TRUE, 'language' => LANGUAGE_NONE)),
'absolute' => TRUE,
'language' => LANGUAGE_NONE,
)),
'grant_type' => 'authorization_code', 'grant_type' => 'authorization_code',
); );
$request_options = array( $request_options = array(
...@@ -180,7 +174,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface { ...@@ -180,7 +174,7 @@ abstract class OpenIDConnectClientBase implements OpenIDConnectClientInterface {
* {@inheritdoc} * {@inheritdoc}
*/ */
public function decodeIdToken($id_token) { public function decodeIdToken($id_token) {
[$headerb64, $claims64, $signatureb64] = explode('.', $id_token); list($headerb64, $claims64, $signatureb64) = explode('.', $id_token);
$claims64 = str_replace(array('-', '_'), array('+', '/'), $claims64); $claims64 = str_replace(array('-', '_'), array('+', '/'), $claims64);
$claims64 = base64_decode($claims64); $claims64 = base64_decode($claims64);
return drupal_json_decode($claims64); return drupal_json_decode($claims64);
......
...@@ -103,7 +103,7 @@ function openid_connect_connect_form($form, &$form_state, $account) { ...@@ -103,7 +103,7 @@ function openid_connect_connect_form($form, &$form_state, $account) {
* Connect the current user's Drupal account to an external provider. * Connect the current user's Drupal account to an external provider.
*/ */
function openid_connect_connect_form_submit(&$form, &$form_state) { function openid_connect_connect_form_submit(&$form, &$form_state) {
[$op, $client_name] = explode('__', $form_state['triggering_element']['#name'], 2); list($op, $client_name) = explode('__', $form_state['triggering_element']['#name'], 2);
if ($op === 'disconnect') { if ($op === 'disconnect') {
openid_connect_disconnect_account($form_state['account'], $client_name); openid_connect_disconnect_account($form_state['account'], $client_name);
......
...@@ -46,7 +46,7 @@ function openid_connect_redirect_page($client_name) { ...@@ -46,7 +46,7 @@ function openid_connect_redirect_page($client_name) {
// Any other error should be logged. E.g. invalid scope. // Any other error should be logged. E.g. invalid scope.
$variables = array( $variables = array(
'@error' => $_GET['error'], '@error' => $_GET['error'],
'@details' => $_GET['error_description'] ?: t('None'), '@details' => isset($_GET['error_description']) ? $_GET['error_description'] : t('None'),
); );
watchdog('openid_connect_' . $client_name, 'Authorization failed: @error. Details: @details', $variables, WATCHDOG_ERROR); watchdog('openid_connect_' . $client_name, 'Authorization failed: @error. Details: @details', $variables, WATCHDOG_ERROR);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment