Download the PHP package restruct/silverstripe-login-branding without Composer

On this page you can find all versions of the php package restruct/silverstripe-login-branding. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package silverstripe-login-branding

Silverstripe Login-form (de)branding

Maintained by Restruct. If this module saves you time, you can support ongoing maintenance.

Reduces the Silverstripe branding of the login forms module and makes it easily configurable. Optionally, it also makes LeftAndMain.application_name the admin's site name instead of the editable SiteConfig.Title (see SiteConfig Title Override).

Requirements

Installation

The branding applies to the login forms as soon as the module is installed; everything below is optional configuration.

Version compatibility

Branch Module version Silverstripe PHP
main 2.x ^5 \|\| ^6 ^8.1
(tags only) 0.1.2 - 1.1.x ^4 \|\| ^5 \|\| ^6 not declared
(tags only) 0.1.1 ^4 \|\| ^5 not declared
(tags only) 0.1 ^4 not declared

Silverstripe 4 reached end of life in April 2025 and is no longer supported or tested here. Projects still on it can stay on the 1.x or 0.1.x tags, which remain available. On Silverstripe 6, use 2.x: on the earlier tags application_name_overrides_title does nothing there, and LoginIconTemplateAvailable() fatals when called directly before any template has rendered (the login page itself is not affected). Both are fixed in 2.x (see CHANGELOG.md).

main is the only maintained line: it supports every Silverstripe version this module still targets, so there is no separate maintenance branch. A version branch will be created only when a change cannot be made compatible across the supported range.

composer.json is the source of truth for exact constraints; this table is a quick reference.

Login form branding

Reduces the branding of the login forms like this:

Screenshot 2025-10-01 at 09 36 01

The branding above- and credits below the form are configurable via Yaml, options:

Option Default Effect
include_icon true Show the icon (a project LoginIcon.ss, or the built-in shield-lock) above the form
app_brand null Text shown next to the icon; unset shows the icon only
built_by a <code> hint telling you to set it HTML credit line below the form; set to null to hide it
powered_by Powered by <a href="https://silverstripe.org">Silverstripe</a> HTML second credit line; set to null to hide it
use_app_brand_template false Render a project AppBrand.ss instead of icon + app_brand (legacy, see below)

built_by and powered_by are output as HTML, unescaped - put only trusted, developer-written markup in them.

Custom icon/logo/branding

Screenshot 2025-10-01 at 09 43 48

Place a LoginIcon.ss template somewhere in [app]/templates/[Includes/] or themes/[client-theme]/templates/[Includes/], eg:

And configure:

(Legacy:) Replace header using custom AppBrand.ss template

Configure extension to use AppBrand.ss template instead:

Add an AppBrand.ss template file somewhere, eg [app]/templates/[Includes/] or themes/[client-theme]/templates/[Includes/]:

And set the theme as highest prio on SilverStripe\LoginForms\EnablerExtension (before #admin-branding):

Optionally set Restruct\SilverStripe\AdminBranding\SecurityBrandingExtension.include_icon to false to remove the icon.

Shield-lock + bicycle icons kindly provided by Bootstrap Icons.

Expired login page notice

A login page left open longer than the session lives carries a security token (SecurityID) that the session no longer knows. Submitting it fails with "Your session has expired. Please re-submit the form." and the credentials have to be typed again. The module warns before that happens: once the page's token no longer matches the session, a notice appears above the form:

This page has expired. Refresh the page to continue.

The second sentence is a link that reloads the page.

The page asks the server when the tab becomes visible, regains focus, or is restored from the browser's back/forward cache (the pageshow event): the moments a stale page is about to be used. It does not count down to an expiry time, because there usually is none to count to: with the default Session.timeout of 0 the session ends whenever PHP's session garbage collection removes it. Once the notice is shown, checking stops. Network errors are ignored; the next check simply tries again.

It applies to every Security page with a form carrying a SecurityID, such as the login and lost password forms. The MFA steps (silverstripe/mfa) render no such form, so the notice never appears there; MFA handles an expired token itself.

Option Default Effect
expired_notice true Load the notice script on Security pages. false also closes the check endpoint (404)
expired_notice_interval 0 Seconds between extra checks while the page is visible; 0 keeps only the checks on visibility, focus and back/forward navigation. Ignored while LeftAndMain.session_keepalive_ping is false

Each check touches the session. The request carries the session cookie, so PHP resumes the session, which resets its garbage-collection clock - exactly like the CMS keep-alive ping (Security/ping). That is why there is no periodic check by default: polling every few minutes would keep the session alive for as long as the tab stays open and visible, and so defeat the site's idle timeout, also on pages such as Security/changepassword. The checks on visibility and focus only happen when the user comes back to the page, which would touch the session anyway. If you do set an interval, it is dropped while LeftAndMain.session_keepalive_ping is false: a site that switched off the CMS keep-alive should not get a new one from here.

The check is a POST to Security/checktoken with the page's token. It answers only {"valid":true} or {"valid":false} (with Cache-Control: no-store). It never creates or changes a token, and never starts a session for a visitor who has none; for a visitor who has one, it resumes it as described above. The texts are translatable (en and nl are included), under Restruct\SilverStripe\AdminBranding\SecurityBrandingExtension .EXPIRED_NOTICE and .EXPIRED_NOTICE_REFRESH. The notice is styled from the login-forms theme's own colour variables, so it follows its dark mode as well.

The script and stylesheet are exposed from client/ through silverstripe/vendor-plugin; after updating, run composer vendor-expose if your deployment does not already do so.

SiteConfig Title Override

By default, the admin panel shows SiteConfig.Title (editable under Settings) in the left nav and browser tab. If you set LeftAndMain.application_name in config, it gets ignored when SiteConfig is installed.

This module can make application_name the authoritative source, overriding SiteConfig.Title in-memory and optionally removing the now-redundant fields from Settings. The override applies whenever a SiteConfig record is loaded, and is never written back: the stored title stays as it was, also when the record is saved with forceChange()->write(), which marks every field as changed. It applies to every SiteConfig record loaded from the database, not only the one returned by SiteConfig::current_site_config(): any code that reads SiteConfig.Title from a loaded record, including a DataList or get_by_id() of SiteConfig, gets application_name while the override is on.

application_name_clear_fields options

Value Behavior
false Override title but leave Title/Tagline fields in Settings
true (default) Remove Title + Tagline fields from Settings
'tab' Remove fields + remove the empty Main tab (if other tabs remain)

With false, a title typed in Settings is saved, but it is not shown while the override is on: $SiteConfig.Title keeps returning application_name.

hide_cms_page_permissions options

Removes the page-permission fields (who can view / edit / create top-level pages) from Settings, which mean nothing on a site without pages.

Value Behavior
'auto' (default) Remove them only when silverstripe/cms is not installed
true Always remove them
false Always leave them

The Access tab is removed as well when nothing else is left on it.

Running the tests

The module cannot be tested on its own: it needs a host Silverstripe project (with silverstripe/recipe-cms and silverstripe/recipe-testing). Require it there through a Composer path repository with symlink: true - /tests is export-ignore, so a dist or mirrored install contains no tests - add Restruct\LoginBranding\Tests\ pointing at the module's tests/ to the host's autoload-dev, copy phpunit.xml.dist to the host root as phpunit.xml, then:

CI runs the same suite against Silverstripe 5 and 6 on every push; see .github/workflows/ci.yml.


All versions of silverstripe-login-branding with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
silverstripe/framework Version ^5 || ^6
silverstripe/login-forms Version ^5 || ^6
silverstripe/vendor-plugin Version ^2 || ^3
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package restruct/silverstripe-login-branding contains the following files

Loading the files please wait ...