diff --git a/proxyauth.php b/proxyauth.php index a704097..61ddf54 100644 --- a/proxyauth.php +++ b/proxyauth.php @@ -2,7 +2,7 @@ /** * Name: Proxy Auth * Description: Authenticate a user against reverse proxy headers - * Version: 1.0 + * Version: 1.1 * Author: Mark Wane */ @@ -21,11 +21,13 @@ use Friendica\Model\User; function proxyauth_install(){ Hook::register( 'authenticate', 'addon/proxyauth/proxyauth.php', 'proxyauth_hook' ); + Hook::register( 'login_hook', 'addon/proxyauth/proxyauth.php', 'proxyauth_login' ); Hook::register( 'logging_out', 'addon/proxyauth/proxyauth.php', 'proxyauth_logout' ); } function proxyauth_uninstall(){ Hook::unregister( 'authenticate', 'addon/proxyauth/proxyauth.php', 'proxyauth_hook' ); + Hook::unregister( 'login_hook', 'addon/proxyauth/proxyauth.php', 'proxyauth_login' ); Hook::unregister( 'logging_out', 'addon/proxyauth/proxyauth.php', 'proxyauth_logout' ); } @@ -40,11 +42,25 @@ function proxyauth_hook( $a, &$b ){ return; } +function proxyauth_login( $a, &$o ){ + $o = '
+
+ +
+ +
+ +
+
'; +} + function proxyauth_logout( $a ){ DI::cookie()->clear(); DI::session()->clear(); info( DI::l10n()->t( 'Logging out') ); - DI::baseUrl()->redirect( '/logout_sso' ); + if ( ! stripos( $_SERVER['HTTP_REFERER'], 'auth.cool110.xyz' ) ) { + DI::baseUrl()->redirect( '/logout_sso' ); + } } function proxyauth_auth(){