Back to CMSApplication class

Method isHttpsForced

public bool
isHttpsForced
(mixed $clientId = null)
Checks if HTTPS is forced in the client configuration.
Parameters
  • int $clientId An optional client id (defaults to current application client).
Returns
  • bool True if is forced for the client, false otherwise.
Since
  • 3.7.3

Method isHttpsForced - Source code

/**
 * Checks if HTTPS is forced in the client configuration.
 *
 * @param   integer  $clientId  An optional client id (defaults to current application client).
 *
 * @return  boolean  True if is forced for the client, false otherwise.
 *
 * @since   3.7.3
 */
public function isHttpsForced($clientId = null)
{
    $clientId = (int) ($clientId !== null ? $clientId : $this->getClientId());
    $forceSsl = (int) $this->get('force_ssl');
    if ($clientId === 0 && $forceSsl === 2) {
        return true;
    }
    if ($clientId === 1 && $forceSsl >= 1) {
        return true;
    }
    return false;
}