Browse Source

Add favicon (#6671)

* Add favicon

* Update totp_secret.htm

* Update totp.htm

* Update login.htm

* Update email.htm

* Update totp.php

* Update ldap.php

* Update email.php

* Update database.php
FusionPBX 2 years ago
parent
commit
26f7b44d5c

+ 4 - 0
core/authentication/resources/classes/plugins/database.php

@@ -26,6 +26,9 @@ class plugin_database {
 	 */
 	 */
 	function database() {
 	function database() {
 
 
+		//pre-process some settings
+			$settings['theme']['favicon'] = !empty($settings['theme']['favicon']) ? $settings['theme']['favicon'] : PROJECT_PATH.'/themes/default/favicon.ico';
+
 		//already authorized
 		//already authorized
 			if (isset($_SESSION['authentication']['plugin']['database']) && $_SESSION['authentication']['plugin']['database']["authorized"]) {
 			if (isset($_SESSION['authentication']['plugin']['database']) && $_SESSION['authentication']['plugin']['database']["authorized"]) {
 				return;
 				return;
@@ -96,6 +99,7 @@ class plugin_database {
 					$view->assign("login_logo_width", $login_logo_width);
 					$view->assign("login_logo_width", $login_logo_width);
 					$view->assign("login_logo_height", $login_logo_height);
 					$view->assign("login_logo_height", $login_logo_height);
 					$view->assign("login_logo_source", $login_logo_source);
 					$view->assign("login_logo_source", $login_logo_source);
+					$view->assign("favicon", $settings['theme']['favicon']);
 
 
 				//add the token name and hash to the view
 				//add the token name and hash to the view
 					//$view->assign("token_name", $token['name']);
 					//$view->assign("token_name", $token['name']);

+ 5 - 0
core/authentication/resources/classes/plugins/email.php

@@ -25,6 +25,9 @@ class plugin_email {
 	 */
 	 */
 	function email() {
 	function email() {
 
 
+			//pre-process some settings
+			$settings['theme']['favicon'] = !empty($settings['theme']['favicon']) ? $settings['theme']['favicon'] : PROJECT_PATH.'/themes/default/favicon.ico';
+
 			//set a default template
 			//set a default template
 			$_SESSION['domain']['template']['name'] = 'default';
 			$_SESSION['domain']['template']['name'] = 'default';
 			$_SESSION['theme']['menu_brand_image']['text'] = PROJECT_PATH.'/themes/default/images/logo.png';
 			$_SESSION['theme']['menu_brand_image']['text'] = PROJECT_PATH.'/themes/default/images/logo.png';
@@ -89,6 +92,7 @@ class plugin_email {
 				$view->assign("login_logo_height", $login_logo_height);
 				$view->assign("login_logo_height", $login_logo_height);
 				$view->assign("login_logo_source", $login_logo_source);
 				$view->assign("login_logo_source", $login_logo_source);
 				$view->assign("button_login", $text['button-login']);
 				$view->assign("button_login", $text['button-login']);
+				$view->assign("favicon", $settings['theme']['favicon']);
 
 
 				//show the views
 				//show the views
 				$content = $view->render('username.htm');
 				$content = $view->render('username.htm');
@@ -266,6 +270,7 @@ class plugin_email {
 				$view->assign("login_logo_height", $login_logo_height);
 				$view->assign("login_logo_height", $login_logo_height);
 				$view->assign("login_logo_source", $login_logo_source);
 				$view->assign("login_logo_source", $login_logo_source);
 				$view->assign("button_verify", $text['label-verify']);
 				$view->assign("button_verify", $text['label-verify']);
+				$view->assign("favicon", $settings['theme']['favicon']);
 
 
 				//debug information
 				//debug information
 				//echo "<pre>\n";
 				//echo "<pre>\n";

+ 4 - 0
core/authentication/resources/classes/plugins/ldap.php

@@ -26,6 +26,9 @@ class plugin_ldap {
 		//show the authentication code view
 		//show the authentication code view
 			if ($_REQUEST["username"]) {
 			if ($_REQUEST["username"]) {
 
 
+				//pre-process some settings
+					$settings['theme']['favicon'] = !empty($settings['theme']['favicon']) ? $settings['theme']['favicon'] : PROJECT_PATH.'/themes/default/favicon.ico';
+
 				//login logo source
 				//login logo source
 					if (isset($_SESSION['theme']['logo_login']['text']) && $_SESSION['theme']['logo_login']['text'] != '') {
 					if (isset($_SESSION['theme']['logo_login']['text']) && $_SESSION['theme']['logo_login']['text'] != '') {
 						$login_logo_source = $_SESSION['theme']['logo_login']['text'];
 						$login_logo_source = $_SESSION['theme']['logo_login']['text'];
@@ -84,6 +87,7 @@ class plugin_ldap {
 					$view->assign("login_logo_width", $login_logo_width);
 					$view->assign("login_logo_width", $login_logo_width);
 					$view->assign("login_logo_height", $login_logo_height);
 					$view->assign("login_logo_height", $login_logo_height);
 					$view->assign("login_logo_source", $login_logo_source);
 					$view->assign("login_logo_source", $login_logo_source);
+					$view->assign("favicon", $settings['theme']['favicon']);
 
 
 				//add the token name and hash to the view
 				//add the token name and hash to the view
 					//$view->assign("token_name", $token['name']);
 					//$view->assign("token_name", $token['name']);

+ 6 - 0
core/authentication/resources/classes/plugins/totp.php

@@ -25,6 +25,9 @@ class plugin_totp {
 	 */
 	 */
 	function totp() {
 	function totp() {
 
 
+		//pre-process some settings
+			$settings['theme']['favicon'] = !empty($settings['theme']['favicon']) ? $settings['theme']['favicon'] : PROJECT_PATH.'/themes/default/favicon.ico';
+
 		//get the username
 		//get the username
 			if (isset($_SESSION["username"])) {
 			if (isset($_SESSION["username"])) {
 				$this->username = $_SESSION["username"];
 				$this->username = $_SESSION["username"];
@@ -70,6 +73,7 @@ class plugin_totp {
 				$view->assign("login_logo_height", $login_logo_height);
 				$view->assign("login_logo_height", $login_logo_height);
 				$view->assign("login_logo_source", $login_logo_source);
 				$view->assign("login_logo_source", $login_logo_source);
 				$view->assign("button_login", $text['button-login']);
 				$view->assign("button_login", $text['button-login']);
+				$view->assign("favicon", $settings['theme']['favicon']);
 
 
 				//show the views
 				//show the views
 				$content = $view->render('username.htm');
 				$content = $view->render('username.htm');
@@ -147,6 +151,7 @@ class plugin_totp {
 				$view->assign("login_logo_width", $login_logo_width);
 				$view->assign("login_logo_width", $login_logo_width);
 				$view->assign("login_logo_height", $login_logo_height);
 				$view->assign("login_logo_height", $login_logo_height);
 				$view->assign("login_logo_source", $login_logo_source);
 				$view->assign("login_logo_source", $login_logo_source);
+				$view->assign("favicon", $settings['theme']['favicon']);
 
 
 				//show the views
 				//show the views
 				if ($_SESSION['authentication']['plugin']['database']['authorized'] && empty($this->user_totp_secret)) {
 				if ($_SESSION['authentication']['plugin']['database']['authorized'] && empty($this->user_totp_secret)) {
@@ -204,6 +209,7 @@ class plugin_totp {
 					$view->assign("totp_image", base64_encode($image));
 					$view->assign("totp_image", base64_encode($image));
 					$view->assign("totp_description", $text['description-totp']);
 					$view->assign("totp_description", $text['description-totp']);
 					$view->assign("button_next", $text['button-next']);
 					$view->assign("button_next", $text['button-next']);
+					$view->assign("favicon", $settings['theme']['favicon']);
 
 
 					//render the template
 					//render the template
 					$content = $view->render('totp_secret.htm');
 					$content = $view->render('totp_secret.htm');

+ 1 - 0
core/authentication/resources/views/email.htm

@@ -6,6 +6,7 @@
 		<meta http-equiv='X-UA-Compatible' content='IE=edge' />
 		<meta http-equiv='X-UA-Compatible' content='IE=edge' />
 		<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
 		<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
 		<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
 		<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
+		<link rel='icon' href='{$favicon}'>
 		<title>{$login_title}</title>
 		<title>{$login_title}</title>
 	</head>
 	</head>
 	<body>
 	<body>

+ 1 - 0
core/authentication/resources/views/login.htm

@@ -6,6 +6,7 @@
 		<meta http-equiv='X-UA-Compatible' content='IE=edge' />
 		<meta http-equiv='X-UA-Compatible' content='IE=edge' />
 		<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
 		<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
 		<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
 		<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
+		<link rel='icon' href='{$favicon}'>
 		<title>{$login_title}</title>
 		<title>{$login_title}</title>
 	</head>
 	</head>
 	<body>
 	<body>

+ 1 - 0
core/authentication/resources/views/totp.htm

@@ -6,6 +6,7 @@
 		<meta http-equiv='X-UA-Compatible' content='IE=edge' />
 		<meta http-equiv='X-UA-Compatible' content='IE=edge' />
 		<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
 		<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
 		<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
 		<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
+		<link rel='icon' href='{$favicon}'>
 		<title>{$login_title}</title>
 		<title>{$login_title}</title>
 	</head>
 	</head>
 	<body>
 	<body>

+ 1 - 0
core/authentication/resources/views/totp_secret.htm

@@ -6,6 +6,7 @@
 		<meta http-equiv='X-UA-Compatible' content='IE=edge' />
 		<meta http-equiv='X-UA-Compatible' content='IE=edge' />
 		<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
 		<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
 		<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
 		<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
+		<link rel='icon' href='{$favicon}'>
 		<title>{$login_title}</title>
 		<title>{$login_title}</title>
 	</head>
 	</head>
 	<body>
 	<body>

+ 1 - 0
core/authentication/resources/views/username.htm

@@ -6,6 +6,7 @@
 		<meta http-equiv='X-UA-Compatible' content='IE=edge' />
 		<meta http-equiv='X-UA-Compatible' content='IE=edge' />
 		<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
 		<meta name='viewport' content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no' />
 		<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
 		<link rel='stylesheet' type='text/css' href='{$project_path}/themes/default/css.php' />
+		<link rel='icon' href='{$favicon}'>
 		<title>{$login_title}</title>
 		<title>{$login_title}</title>
 	</head>
 	</head>
 	<body>
 	<body>