support multiple logos for resellers
In my company, we have a bunch of resellers that also allows some of their customers access to the panel.
For those, we have been asked to place their own logos in the login page and at the top of the panel. At this time, we have a local patch like this:
--- index.php.bak 2022-09-27 11:23:24.014454894 +0200
+++ index.php 2022-09-27 11:25:56.915375461 +0200
@@ -103,6 +103,10 @@
$base64_logo_txt = $logo['default_logo'];
}
$tmp_base64 = explode(',', $base64_logo_txt, 2);
+if (strpos($_SERVER['HTTP_HOST'], 'example.com')){
+ $im = file_get_contents('themes/default/assets/images/logo_customer_example.png');
+ $base64_logo_txt = 'data:image/png;base64,'.base64_encode($im);
+}
$logo_dimensions = $app->functions->getimagesizefromstring(base64_decode($tmp_base64[1]));
$app->tpl->setVar('base64_logo_width', $logo_dimensions[0].'px');
$app->tpl->setVar('base64_logo_height', $logo_dimensions[1].'px');
--- login/index.php.bak 2022-09-27 11:26:38.029796023 +0200
+++ login/index.php 2022-09-27 11:28:19.584394637 +0200
@@ -485,6 +485,10 @@
$base64_logo_txt = $logo['default_logo'];
}
$tmp_base64 = explode(',', $base64_logo_txt, 2);
+if (strpos($_SERVER['HTTP_HOST'], 'example.com')){
+ $im = file_get_contents('../themes/default/assets/images/logo_customer_example.png');
+ $base64_logo_txt = 'data:image/png;base64,'.base64_encode($im);
+}
$logo_dimensions = $app->functions->getimagesizefromstring(base64_decode($tmp_base64[1]));
$app->tpl->setVar('base64_logo_width', $logo_dimensions[0].'px');
$app->tpl->setVar('base64_logo_height', $logo_dimensions[1].'px');
Which is quite not nice for me
I wonder if it would be possible to upload the reseller logo to their profile, and then somehow associate a domain to them so that it would pick a different logo depending on known domain names used to access the website?
Thank you for considering!