Version 5.0.0 beta 1
This commit is contained in:
1 parent
25ddeb65d6
commit
15c7beabc5
6736 files changed
+627902
-497943
No files matched your search
@@ -11,9 +11,16 @@
|
||||
namespace IPS\Login\Handler;
|
||||
|
||||
/* To prevent PHP errors (extending class does not exist) revealing path */
|
||||
if ( !\defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
|
||||
use IPS\Http\Url;
|
||||
use IPS\Login;
|
||||
use IPS\Login\Exception;
|
||||
use IPS\Theme;
|
||||
use function defined;
|
||||
|
||||
if ( !defined( '\IPS\SUITE_UNIQUE_KEY' ) )
|
||||
{
|
||||
header( ( isset( $_SERVER['SERVER_PROTOCOL'] ) ? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
header( ( $_SERVER['SERVER_PROTOCOL'] ?? 'HTTP/1.0' ) . ' 403 Forbidden' );
|
||||
exit;
|
||||
}
|
||||
|
||||
@@ -27,9 +34,9 @@ trait ButtonHandler
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function type()
|
||||
public function type(): int
|
||||
{
|
||||
return \IPS\Login::TYPE_BUTTON;
|
||||
return Login::TYPE_BUTTON;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -37,47 +44,46 @@ trait ButtonHandler
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function button()
|
||||
public function button(): string
|
||||
{
|
||||
return \IPS\Theme::i()->getTemplate( 'login', 'core', 'global' )->loginButton( $this );
|
||||
return Theme::i()->getTemplate( 'login', 'core', 'global' )->loginButton( $this );
|
||||
}
|
||||
|
||||
/**
|
||||
* Authenticate
|
||||
*
|
||||
* @param \IPS\Login $login The login object
|
||||
* @return \IPS\Member
|
||||
* @throws \IPS\Login\Exception
|
||||
* @param Login $login The login object
|
||||
* @throws Exception
|
||||
*/
|
||||
abstract public function authenticateButton( \IPS\Login $login );
|
||||
abstract public function authenticateButton( Login $login );
|
||||
|
||||
/**
|
||||
* Get the button color
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function buttonColor();
|
||||
abstract public function buttonColor(): string;
|
||||
|
||||
/**
|
||||
* Get the button icon
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function buttonIcon();
|
||||
abstract public function buttonIcon(): string;
|
||||
|
||||
/**
|
||||
* Get button text
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
abstract public function buttonText();
|
||||
abstract public function buttonText(): string;
|
||||
|
||||
/**
|
||||
* Get button class
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function buttonClass()
|
||||
public function buttonClass(): string
|
||||
{
|
||||
return '';
|
||||
}
|
||||
@@ -85,9 +91,9 @@ trait ButtonHandler
|
||||
/**
|
||||
* Get logo to display in user cp sidebar
|
||||
*
|
||||
* @return \IPS\Http\Url
|
||||
* @return Url|string|null
|
||||
*/
|
||||
public function logoForUcp()
|
||||
public function logoForUcp(): Url|string|null
|
||||
{
|
||||
return $this->buttonIcon();
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user