浏览代码

Add the logo soure, width and height

FusionPBX 2 年之前
父节点
当前提交
81dcddcd6e
共有 1 个文件被更改,包括 25 次插入5 次删除
  1. 25 5
      core/authentication/resources/classes/plugins/totp.php

+ 25 - 5
core/authentication/resources/classes/plugins/totp.php

@@ -25,14 +25,34 @@ class plugin_totp {
 	 */
 	function totp() {
 
+		//login logo source
+			if (isset($_SESSION['theme']['logo_login']['text']) && $_SESSION['theme']['logo_login']['text'] != '') {
+				$login_logo_source = $_SESSION['theme']['logo_login']['text'];
+			}
+			else if (isset($_SESSION['theme']['logo']['text']) && $_SESSION['theme']['logo']['text'] != '') {
+				$login_logo_source = $_SESSION['theme']['logo']['text'];
+			}
+			else {
+				$login_logo_source = PROJECT_PATH.'/themes/default/images/logo_login.png';
+			}
+
+		//login logo dimensions
+			if (isset($_SESSION['theme']['login_logo_width']['text']) && $_SESSION['theme']['login_logo_width']['text'] != '') {
+				$login_logo_width = $_SESSION['theme']['login_logo_width']['text'];
+			}
+			else {
+				$login_logo_width = 'auto; max-width: 300px';
+			}
+			if (isset($_SESSION['theme']['login_logo_height']['text']) && $_SESSION['theme']['login_logo_height']['text'] != '') {
+				$login_logo_height = $_SESSION['theme']['login_logo_height']['text'];
+			}
+			else {
+				$login_logo_height = 'auto; max-height: 300px';
+			}
+		
 		//request the username
 			if (!isset($_POST['username']) && !isset($_POST['authentication_code'])) {
 
-				//set a default template
-				$_SESSION['domain']['template']['name'] = 'default';
-				$_SESSION['theme']['menu_brand_image']['text'] = PROJECT_PATH.'/themes/default/images/logo.png';
-				$_SESSION['theme']['menu_brand_type']['text'] = 'image';
-
 				//get the domain
 				$domain_array = explode(":", $_SERVER["HTTP_HOST"]);
 				$domain_name = $domain_array[0];