-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
v1.4.0: IPS 4.2.x support, 1 new feature
* Work around IPS change of policy on redirection in 4.2.x * Allow disabling of site template on authorization page
- Loading branch information
Showing
9 changed files
with
130 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,6 @@ | ||
[] | ||
[ | ||
{ | ||
"key": "oauth2server_wrap_global_template", | ||
"default": "1" | ||
} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,5 +7,6 @@ | |
"102002": "1.2.2", | ||
"102003": "1.2.3", | ||
"102004": "1.2.4", | ||
"103000": "1.3.0" | ||
"103000": "1.3.0", | ||
"104000": "1.4.0" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
/** | ||
* @package OAuth2 Server | ||
* @author <a href='https://atypical.net'>Joan Touzet</a> | ||
* @copyright (c) 2017 Joan Touzet | ||
*/ | ||
|
||
namespace IPS\oauth2server\modules\admin\oauthserver; | ||
|
||
/* To prevent PHP errors (extending class does not exist) revealing path */ | ||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) | ||
{ | ||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' ); | ||
exit; | ||
} | ||
|
||
/** | ||
* settings | ||
*/ | ||
class _settings extends \IPS\Dispatcher\Controller | ||
{ | ||
/** | ||
* Execute | ||
* | ||
* @return void | ||
*/ | ||
public function execute() | ||
{ | ||
\IPS\Dispatcher::i()->checkAcpPermission( 'settings_manage' ); | ||
parent::execute(); | ||
} | ||
|
||
protected function manage() | ||
{ | ||
\IPS\Output::i()->title = \IPS\Member::loggedIn()->language()->addToStack('settings'); | ||
$form = new \IPS\Helpers\Form; | ||
$form->addHeader( 'oauth2server_settings' ); | ||
$form->add( new \IPS\Helpers\Form\YesNo( 'oauth2server_wrap_global_template', \IPS\Settings::i()->oauth2server_wrap_global_template ) ); | ||
if ( $values = $form->values() ) | ||
{ | ||
$form->saveAsSettings(); | ||
} | ||
\IPS\Output::i()->output = $form; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace IPS\oauth2server\modules\front\redirect; | ||
|
||
/* To prevent PHP errors (extending class does not exist) revealing path */ | ||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) ) | ||
{ | ||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' ); | ||
exit; | ||
} | ||
|
||
/** | ||
* redirect | ||
*/ | ||
class _redirect extends \IPS\Dispatcher\Controller | ||
{ | ||
/** | ||
* Execute | ||
* | ||
* @return void | ||
*/ | ||
public function execute() | ||
{ | ||
parent::execute(); | ||
} | ||
|
||
/** | ||
* Redirect a user to the specified URL. | ||
* | ||
* @param string $ref The URL to which the member will be redirected, base64 encoded. | ||
* @return void | ||
*/ | ||
protected function manage() | ||
{ | ||
$ref = \IPS\Request::i()->ref; | ||
/* Did we just log in? */ | ||
if ( \IPS\Member::loggedIn()->member_id and isset( \IPS\Request::i()->_fromLogin ) ) { | ||
\IPS\Output::i()->redirect( base64_decode($ref) ); | ||
} else { | ||
\IPS\Output::i()->redirect( \IPS\Http\Url::internal('') ); | ||
} | ||
} | ||
} |