New in version 6.0: SDK for external mode
New in version 8.0: SDK for external and local mode
Current SDK Version: 18.0
- The SDK comes preinstalled on every IACBOX with the custom logon page/custom webserver.
- If a central installation (for many systems) is needed, the SDK can be installed on an external webserver.
The SDK provides a small PHP framework which abstracts all the tiny details away and lets you easily make customization and/or create new plugins and extensions.
The SDK written in PHP provides you with a sample login page and plugins for many different authentication methods. Starting with version 2 the SDK is also used for the local custom webserver.
Ahead of any other decisions that have to be made, you have to be aware of two very different operation modes of the Login-API. You have to choose which one serves your needs:
1. External Mode: this is the normal mode of version 1.x. The Login-API SDK is hosted on an external webserver by yourself.
- Allows to point any number of IACBOXes to this login page.
- One single place to make changes.
- Centralized data storage possible.
- You have to host the SDK on an external webserver which has to be maintained and configured by yourself.
- Slower than local mode and consumes uplink bandwidth.
- Without any failover architecture this external server is a single point of failure.
2. Local Mode: Since version 8.0 an IACBOX comes equipped with a custom logon webserver with PHP 5.6 and the preinstalled SDK replacing the traditional loginpage. So this can also be used to just change the look of the login page like it wasn’t possible before.
- The login page ist fast no matter how slow or unreliable your uplink is.
- The traffic to your login page is only local and does not utilize your upstream.
- Make easy and fast changes with the built-in code editor.
- Fewer redirects compared to the external mode, less complex plugins.
- If you are using multiple systems you have to make your changes on every IACBOX seperately.
- If you want to manage a central database with authentication data and having logs of logins the local mode still allows that but it is harder to achive
- Currently no local database available.
Login-API SDK architecture¶
The configuration of the Login-API SDK is handeled in two different places. The main configration can be found in conf/main.config. Everything important regarding the Login-API is handeled there.
|Name of the profile|
|Will be the title of the logon page|
|Shown on the end of the logon page|
|Logo which should be used|
|Backgroundimages shown on the logon page|
|Should the Headermessage be shown|
|Should the language selection be shown|
|Determines which template will be the default tempalte|
|Plugins which should be used for the logon.|
|Available languages for the logon page. Only needed for the external version|
|Will be used if a language could not be found|
|Enable location based configuration|
|Fields to determine different locations|
|Should not be changed except you use another base-URL for the Surf-LAN|
|Url of your Webserver used for plugins with callbacks from externel servers|
|Name of the sender (used in payment plugin only)|
|Email address which will be shown in email (used in payment plugin only)|
|Determines the log level for the Login-API|
|Redirect after the login|
|Has to match the configuration in Module/Interfaces/Login-API on the IACBOX|
|The shared secret can be found in Module/Interfaces/Login-API on the IACBOX|
|The Browser should use autocomplete, autocapitalization, spellcheck and autocorrect features|
|Register one or more custom services (separated by commas)|
|Creates a fake session for testing purposes|
|Refresh call to a certain page|
|Version of the API / protocol|
|Loads the RdbmsConnector to hold and manage a connection to your database.|
- Please note that the configuration use-rdbms can only be used with an external DB
- Create a secure connection to your DB! (e.g.: VPN)
The second part of the configurations are the plugin specific configurations. This files can be found in Iacbox/LoginApi/Plugin/[Plugin]/[plugin].conf. Which configurations have to be done depends on the plugins you have activated in conf/main.conf. For further informations which configurations are possible read the Plugin configuration documentation.
|Ticket/ Voucher Login|
|Password only Login|
|Free login coupled with Free Logon or Take online|
|Social login (Facebook, Google+, Twitter)|
|Payment plugin (PayPal, Sofortüberweisung)|
|Email Login coupled with Email Messaging Module|
|SMS Login coupled with SMS Messaging Module|
|Status information of the client|
|Show advertisement before logon|
|Socialshare||2.0||Others | loc, ext|
|Show sociale like/share buttons|
loc = available in local mode, ext = available in external mode
Template changes can be made on two different places. The structure of the main page can be changend in htdocs/index_view.php. It is also possible to creae your own page and include it in the htdocs/index.php. The main CSS file can be found in htdocs/css/style.css. We recommend to use the overlay file htdocs/css/style_overlay.css for changes to the CSS because the style.css will be updated regularly.
Some plugin specific CSS classes can be found in the corresponding CSS file Iacbox/LoginApi/Plugin/[Pluginname]/css/. If there is a need to change the template structure of a plugin this can be done in the file [pluginname](_local).php. Please note that if you create your own plugin you are not bound to the naming convention for templates we are using in the already existing plugins.
General translations are stored in conf/lang/[language].lang. Plugin specific translations can be found in Iacbox/LoginApi/Plugin/[Pluginname]/lang/. The LoginApi provides translations for all 23 languages of the normal logon page but not alle languages are fully translated.
- Since version 17 it is possible to add translations for the selection of gender and building mapping in the PMS configuration.
- The translation-keys need to be lowercase and seperated per “-” (dash)
- Example: building-mapping = 1:house-a; 2:house-b
As default the SDK logs to your syslog - depending on your Linux distribution this is /var/log/syslog or /var/log/messages. On newer systems
which use systemd you can see your logs with
jounalctl -f. All messages start with LGNAPI which makes it simple to filter (adding
| grep LGNAPI).
If you encounter any errors (especially white pages what means PHP had an fatal error) then you should look into your webserver log - for apache this is very
often /var/log/apache2/error.log or similar.
The SDK logs per default to the syslog of the IACBOX. All messages start with LGNAPI which makes it simple to filter. The System logs can be downloaded in the menu Reporting/System.
If you encounter any errors (especially white pages what means PHP had an fatal error) then you should look into the log of the Login-API webserver. This log can be accessed if you connect via FTP with the user sysop.
If you want to log the messages in a database, which is available in both modes, there is already a custom service called DBLogger part of the SDK.
This is made for external Login-API but theoretically possible in local mode too when writing to an external database (But this is propably a
performance issue). Be sure to have this config lines in your
1 2 3 4 5 6
use-rdbms = true db-type = <database type like pgsql or mysql> db-host = <database host> db-name = <database name> db-user = <database user> db-pwd = <database password>