How to Create Custom-Branded Login Pages

For cPanel *For cPanel & WHM 11.36 WHM 11.38*

Introduction

This document explains how to create custom login pages. Custom login pages will be applied to every account on the server. Resellers cannot create their own custom login pages at this time.

  • PICK Important: Much of the information in this document may change in the future. However, the variables used by the templates will remain the same throughout future versions of cPanel & WHM.
  • note Note: Throughout this document, $themename is meant to represent the name of theme you are customizing.

Duplicating the existing theme

You can find all of the materials required to rebrand login pages in /usr/local/cpanel/base/unprotected/. This directory contains the main login template and CSS files, in addition to 2 important subdirectories:

  • /usr/local/cpanel/base/unprotected/$themename/templates/ — This directory contains several additional customizable templates. These templates include error pages, the reset password feature, and a few lesser-used templates that you need to customize in order to fully brand login pages.
  • /usr/local/cpanel/base/unprotected/$themename/images/ — This directory contains all of the images that appear on login pages.

First, create a duplicate of the existing cpanel theme:

  1. Access WHM's Universal Theme Manager (Main >> Themes >> Universal Theme Manager).
  2. Click the Manage Themes link under Login.
  3. Click the Clone icon next to the cpanel theme.
  4. Enter a name for the duplicate theme in the available text field and click Submit.

At this point, you will have a copy of the cpanel theme located in /usr/local/cpanel/base/unprotected/$themename. In this case, $themename is the name you entered in step 4.

Once you have duplicated a theme, you are free to edit the images and templates listed below.

Once you have finished editing the theme, navigate to Tweak Settings and select your new theme from the Default login theme option.

To change the locale on your custom login page, use the edit a locale feature.

To add new strings to your custom login page, we strongly encourage you to use the maketext function.

Locating the images

Please take note of the following points about the subheader logos for cPanel, WHM, and webmail:

  • Images are located in /usr/local/$themename/base/unprotected/cpanel/images. There are 3 subheader images and 9 other images to customize.
  • The container area for all of the subheader images is 345 x 75 pixels.
  • The subheader logos themselves are 318 x 55 pixels. You should design your custom logo using the same dimensions to allow for padding within the login subheader.
  • The subheader logos are located in the login-sub-header div in style_v2.css.

Subheader Images

Full path Image Description
/usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo.png

The cPanel subheader.
/usr/local/cpanel/base/unprotected/$themename/images/whm.png

The WHM subheader.
/usr/local/cpanel/base/unprotected/$themename/images/webmail.png

The webmail subheader.

Other images

Full path Image Description
/usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo-tiny.png

The cPanel logo at the bottom of the login pages.
/usr/local/cpanel/base/unprotected/$themename/images/icon-password.png

The icon that appears in the password field.
/usr/local/cpanel/base/unprotected/$themename/images/icon-username.png

The icon that appears in the username field.
/usr/local/cpanel/base/unprotected/$themename/images/login-error-close.png

The icon that allows users to close any pop-up messages received by the system.
/usr/local/cpanel/base/unprotected/$themename/images/login-whisp.png Click for image The background image on the login pages.
/usr/local/cpanel/base/unprotected/$themename/images/notice-error.png

The image that appears on the page whenever an error is encountered.
/usr/local/cpanel/base/unprotected/$themename/images/notice-info.png

The image that appears whenever the system needs to display additional information.
/usr/local/cpanel/base/unprotected/$themename/images/notice-success.png

The image that appears whenever the user successfully logs in or resets his or her password.
/usr/local/cpanel/base/unprotected/$themename/images/warning.png

The image that appears whenever a warning is raised.

Customizable templates reference

token_denied.tmpl

The Error Template.png
Click to enlarge example.

Location /usr/local/cpanel/base/unprotected/$themename/templates/error.tmpl
Description The screen that is encountered whenever the user receives a 404, token denied, referrer denied, or access denied response.
Images /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo-tiny.png

Template variables

Variable Type Description
form_ref hash Form variables to pass with with the request.
dest_uri string The URL, without the token, to load after the user re-authenticates.
theme string The theme to load.
error_msg string The error message to display.
parameterized_form hash The form variables passed in, as a URL query string
user string The username to re-authenticate.

login.tmpl

The cPanel Login Template
Click to enlarge example.

Location /usr/local/cpanel/base/unprotected/$themename/templates/login.tmpl
Description The default login page.
Images
  • /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo.png
  • /usr/local/cpanel/base/unprotected/$themename/images/login-whisp.png
  • /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo-tiny.png
  • /usr/local/cpanel/base/unprotected/$themename/images/icon-username.png
  • /usr/local/cpanel/base/unprotected/$themename/images/icon-password.png

Template variables

Variable Type Description
msg_code string The key that corresponds to the message in login_messages to display on the loading page, after the user authenticates.
dest_uri string The URL to load, without the token, after the user successfully authenticates.

passthrough.tmpl

Confirmation Code Interface.png
Click to enlarge example.

Location /usr/local/cpanel/base/unprotected/$themename/templates/passthrough.tmpl
Description This template is used as a confirmation page and redirect after a token was denied.
Images Not Applicable

Template variables

Template Type Description
redirect_uri string The URL to which the user should be redirected.
form_ref hash The form values to send to redirect_uri.
cp_security_token string The new security token to use in the URL.

resetpass.tmpl

Confirmation Code Interface.png
Click to enlarge example.

Location /usr/local/cpanel/base/unprotected/$themename/resetpass.tmpl
Description The main template for the password reset pages.
Images
  • /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo.png
  • /usr/local/cpanel/base/unprotected/$themename/images/login-whisp.png
  • /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo-tiny.png
  • /usr/local/cpanel/base/unprotected/$themename/images/icon-username.png

resetpass_confirmation.tmpl

Confirmation Code Interface.png
Click to enlarge example.

Location /usr/local/cpanel/base/unprotected/$themename/templates/resetpass_confirmation.tmpl
Description This template is used whenever a user attempts to reset the password. The user must enter the confirmation code received in his or her email address in order to reset the password.
Images
  • /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo.png
  • /usr/local/cpanel/base/unprotected/$themename/images/login-whisp.png
  • /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo-tiny.png
  • /usr/local/cpanel/base/unprotected/$themename/images/notice-info.png

resetpass_no_user.tmpl

The No User Template
Click to enlarge example.

Location /usr/local/cpanel/base/unprotected/$themename/templates/resetpass_no_user.tmpl
Description This template is used whenever a user clicks the Reset Password link without entering his or her username.
Images
  • /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo.png
  • /usr/local/cpanel/base/unprotected/$themename/images/login-whisp.png
  • /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo-tiny.png
  • /usr/local/cpanel/base/unprotected/$themename/images/icon-username.png

resetpass_success.tmpl

The Password Reset Success Template
Click to enlarge example.

Location /usr/local/cpanel/base/unprotected/$themename/templates/resetpass_success.tmpl
Description This template is used whenever a user successfully resets his or her password.
Images
  • /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo.png
  • /usr/local/cpanel/base/unprotected/$themename/images/login-whisp.png
  • /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo-tiny.png
  • /usr/local/cpanel/base/unprotected/$themename/images/notice-success.png

reset-email-html.tmpl

The Reset Password Email Template in HTML
Click to enlarge example.

Location /usr/local/cpanel/base/unprotected/$themename/resetpass-email-html.tmpl
Description This template defines the email messages that users receive whenever they attempt to reset their password, if the user's email client can display HTML.
Images /usr/local/cpanel/base/unprotected/$themename/images/cpanel-logo-tiny.png

Template variables

Variable Type Description
remote_addr string The user’s IP address.
confirmation_code string The confirmation code to use with the resetpass utility.
secure_reset_link string The SSL version of the URL that the user will access to reset his or her password.
insecure_reset_link string The URL the user will access to reset his or her password, without SSL.

reset-email.tmpl

The Reset Password Email Template without HTML
Click to enlarge example.

Location /usr/local/cpanel/base/unprotected/$themename/resetpass-email.tmpl
Description This template defines the email message that users will receive whenever they attempt to reset their password.
Images Not Applicable

Template variables

Variable Type Description
remote_addr string The user’s IP address.
confirmation_code string The confirmation code to use with the resetpass utility.
secure_reset_link string The SSL version of the URL that the user will access to reset his or her password.
insecure_reset_link string The URL the user will access to reset his or her password, without SSL.

Topic revision: r27 - 13 Feb 2013 - 14:34:30 - Main.ColinShannon
AllDocumentation/WHMDocs.CustomBrandedLoginPages moved from Sandbox.CustomBrandedLoginPages on 14 Feb 2012 - 16:44 by Main.JustinSchaefer - put it back