<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Login Page Extensions on</title><link>/iacbox/24.0/docs/loginpage/extensions/</link><description>Recent content in Login Page Extensions on</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><lastBuildDate>Tue, 08 Feb 2022 15:00:00 +0200</lastBuildDate><atom:link href="/iacbox/24.0/docs/loginpage/extensions/index.xml" rel="self" type="application/rss+xml"/><item><title>Overview</title><link>/iacbox/24.0/docs/loginpage/extensions/overview/</link><pubDate>Tue, 08 Feb 2022 15:00:00 +0200</pubDate><guid>/iacbox/24.0/docs/loginpage/extensions/overview/</guid><description>What is an extension for? #
With Login Page Extensions custom code can be added to Login Pages.
There are different extension points with different purposes.
TIP As the login page code is a thin layer of PHP on top of IACBOX core componentes, all extensions need to be written in PHP 8.2. Extension points #
An extension can be one of those 4 types.
Purpose Parent class name Description Custom Element ElementExtension Add a custom element with custom properties to be used on any login page.</description></item><item><title>Conventions</title><link>/iacbox/24.0/docs/loginpage/extensions/conventions/</link><pubDate>Tue, 08 Feb 2022 15:00:00 +0200</pubDate><guid>/iacbox/24.0/docs/loginpage/extensions/conventions/</guid><description>File/dir hierarchy #
Every extension needs to be in one directory named in CamelCase style because this directory is part of the PHP namespace.
$ tree Example Example ├── ExampleExtension.php # Required: The extension class with the name &amp;quot;&amp;lt;Dir&amp;gt;Extension.php&amp;quot; └── ExampleApiConnector.php # Optional: Any other class file needed by the extension Naming conventions #
PHP namespace #
For correct auto loading it&amp;rsquo;s mandatory to use this PHP namespace.
&amp;lt;?php namespace Iacbox\Loginpage\Extension\&amp;lt;YourExtensionDir&amp;gt;; // example: extension dir is &amp;quot;example&amp;quot;, extension class is &amp;quot;ExampleExtension&amp;quot; // any other class file in the same dir has to have this namespace too to be unique.</description></item><item><title>Base extension</title><link>/iacbox/24.0/docs/loginpage/extensions/base-extension/</link><pubDate>Tue, 08 Feb 2022 15:00:00 +0200</pubDate><guid>/iacbox/24.0/docs/loginpage/extensions/base-extension/</guid><description>Purpose #
Start with a BaseExtension if this extension is
no element no login method no request handler In most cases this is the case when implementing event hooks like reacting on logins.
Extension class #
To create a new base extension extend the Iacbox\Loginpage\Extension\Extension class.
Class reference /** * Returns the priority of extension which defaults to LoginpageCallback::PRIO_DEFAULT = 50. * Override this method to return a higher or lower priority for this extension.</description></item><item><title>Event handlers</title><link>/iacbox/24.0/docs/loginpage/extensions/event-handlers/</link><pubDate>Tue, 08 Feb 2022 15:00:00 +0200</pubDate><guid>/iacbox/24.0/docs/loginpage/extensions/event-handlers/</guid><description>Purpose #
Event handlers are generic extension points which can be added to a base extension to react on certain event.
Events #
Listener purpose Interface name Description Render partial HTML PrepareForRenderListener Render HTML or Javascript which is added to the login page Do something before a login form gets processed FormPostEntryListener Do something after a login form was processed FormPostLeaveListener Good extension point for reacting on (successful) logins. PrepareForRenderListener #
Chances are good you want to use a Custom Element.</description></item><item><title>Element</title><link>/iacbox/24.0/docs/loginpage/extensions/element/</link><pubDate>Tue, 08 Feb 2022 15:00:00 +0200</pubDate><guid>/iacbox/24.0/docs/loginpage/extensions/element/</guid><description>Purpose #
An Element is an extension that renders HTML and/or Javascript into the login page. Every Element shows up in the Login Page Editor and can be added once or multiple times via drag-and-drop. TIP If a new login method is to be added, please use the special extension type described here. ElementExtension class #
To create a new custom element extend the Iacbox\Loginpage\Extension\ElementExtension class.
Class reference /** * Returns the priority of extension which defaults to LoginpageCallback::PRIO_DEFAULT = 50.</description></item><item><title>Element request handler</title><link>/iacbox/24.0/docs/loginpage/extensions/element-request-handler/</link><pubDate>Tue, 08 Feb 2022 15:00:00 +0200</pubDate><guid>/iacbox/24.0/docs/loginpage/extensions/element-request-handler/</guid><description>Purpose #
An ElementRequestHandler is needed if a custom Element needs to process requests originating from that Element like form POSTs or GET requests.
In contrast to a RequestHandler this interface is only for Elements and is needed if the handler reacts on events from an element. For a request to be send to the ElementRequestHandler, the POST param elemID with the ID of the element from the getId() function is needed.</description></item><item><title>Login method</title><link>/iacbox/24.0/docs/loginpage/extensions/login-method/</link><pubDate>Tue, 08 Feb 2022 15:00:00 +0200</pubDate><guid>/iacbox/24.0/docs/loginpage/extensions/login-method/</guid><description>Purpose #
Authenticating guests/staff against a service that we haven&amp;rsquo;t covered yet.
LoginMethodExtension class #
To create a custom login method extend the Iacbox\Loginpage\Extension\LoginMethodExtension class.
Class reference /** * Returns unique internal name used to identify LoginMethod (a-z0-9) * Override this method to set unique internal name of the login method * @return string internal name of login method */ public function getName():string {} /** * Returns name which is used in login page editor * Override this method to set display name of login method * @return string Name displayed in editor */ public function getDisplayName():string {} /** * Returns the priority of extension which defaults to LoginpageCallback::PRIO_DEFAULT = 50.</description></item><item><title>Request handler</title><link>/iacbox/24.0/docs/loginpage/extensions/request-handler/</link><pubDate>Tue, 08 Feb 2022 15:00:00 +0200</pubDate><guid>/iacbox/24.0/docs/loginpage/extensions/request-handler/</guid><description>Purpose #
A request handler intercepts some requests, but not all. Depending on specific request parameters that can be defined. Every request passes many built-in handlers - for example a NotFoundHandler that shows a 404 Not Found page.
RequestHandlerExtension class #
To create a new custom request handler extend the Iacbox\Loginpage\Extension\RequestHandlerExtension class.
Class reference /** * Returns the priority of extension which defaults to LoginpageCallback::PRIO_DEFAULT = 50. * Override this method to return a higher or lower priority for this extension.</description></item><item><title>Configure Extension</title><link>/iacbox/24.0/docs/loginpage/extensions/configure-extension/</link><pubDate>Tue, 08 Feb 2022 15:00:00 +0200</pubDate><guid>/iacbox/24.0/docs/loginpage/extensions/configure-extension/</guid><description>Purpose #
An extension might needs configuration values that can&amp;rsquo;t be hard-coded into the extension itself because
these values are different per location (IDs, &amp;hellip;) these values are credentials and should not be stored in the code these values are subject to change (like API endpoint URLs) By implementing the ConfigurableLpExtension interface an extension gets a config section in the page tab at the bottom as soon as the extension is activated for this login page.</description></item><item><title>Loginpage classes</title><link>/iacbox/24.0/docs/loginpage/extensions/loginpage-classes/</link><pubDate>Tue, 08 Feb 2022 15:00:00 +0200</pubDate><guid>/iacbox/24.0/docs/loginpage/extensions/loginpage-classes/</guid><description>Request #
Iacbox\Loginpage\Request
Request encapsulates all request environment super globals like POST and GET params, path and the current Session
Class reference /** * Returns unique ID of the request * @return string ID of the request */ public function getID():string {} /** * Returns request method of the request * @return string Request method of the request */ public function getMethod():string {} /** * Returns path of the request * @return string Path of the request */ public function getPath():string {} /** * Returns query string of the the request * @return string Query string of the request */ public function getQueryString():string {} /** * Returns hash of GET params of the request * @return array GET params of the request */ public function getGetParams():array {} /** * Returns specific GET param of the request * @param string $paramName Name of GET param to read * @return string Specified GET param or null if not found */ public function getGetParam(string $paramName):?</description></item></channel></rss>