diff --git a/core/html_api.php b/core/html_api.php
index dad50526d9..4c4e8b6188 100644
--- a/core/html_api.php
+++ b/core/html_api.php
@@ -463,11 +463,7 @@ function html_top_banner() {
if( !is_blank( $t_page ) && file_exists( $t_page ) && !is_dir( $t_page ) ) {
include( $t_page );
} else if( $t_show_logo ) {
- if ( is_page_name( 'login_page' ) || is_page_name( 'signup_page' ) || is_page_name( 'signup' ) ) {
- $t_align = 'center';
- } else {
- $t_align = 'left';
- }
+ $t_align = should_center_logo() ? 'center' : 'left';
echo '
';
if( $t_show_url ) {
diff --git a/core/utility_api.php b/core/utility_api.php
index c5a71a3142..dca6c457cc 100644
--- a/core/utility_api.php
+++ b/core/utility_api.php
@@ -198,6 +198,15 @@ function is_page_name( $p_string ) {
return isset( $_SERVER['SCRIPT_NAME'] ) && ( 0 < strpos( $_SERVER['SCRIPT_NAME'], $p_string ) );
}
+/**
+ * A function that determines whether the logo should be centered or left aligned based on the page.
+ * @return bool true: centered, false: otherwise.
+ * @access public
+ */
+function should_center_logo() {
+ return ( is_page_name( 'login_page' ) || is_page_name( 'signup_page' ) || is_page_name( 'signup' ) || is_page_name( 'lost_pwd_page' ) );
+}
+
function is_windows_server() {
if( defined( 'PHP_WINDOWS_VERSION_MAJOR' ) ) {
return (PHP_WINDOWS_VERSION_MAJOR > 0);