Re: [Postfixadmin-devel] Problem in handling of $CONF['theme_logo']
Brought to you by:
christian_boltz,
gingerdog
From: Christian B. <pos...@cb...> - 2016-12-22 00:43:34
|
Hello, Am Dienstag, 20. Dezember 2016 schrieb Ullrich von Bassewitz: > This is in postfixadmin version 3.0. > > I didn't want to mess with internal postfixadmin directories and > stored my custom company logo in another path: /images/mylogo.png. So > config.inc.php contains > > $CONF['theme_logo'] = '/images/mylogo.png'; > > This works well with the admin login page, but not with the user login > page. The generated HTML code for the user login page contains: > > <a href='main.php'><img id="login_header_logo" > src="..//images/mylogo.png" alt="Logo" /></a> > > postfixadmin prepends "../" to the configured path and makes it > impossible to use any path that is not relative to the postfixadmin > directory. This comes from smarty.inc.php: > > if (!isset($rel_path)) $rel_path = ''; # users/* sets this to '../' > $CONF['theme_css'] = $rel_path . htmlentities($CONF['theme_css']); > > and all of the files in the "users" subdirectory, where rel_path is > set to "../". > > I didn't know how fix it without breaking something. Maybe one of the > developers can have a look at it or at least open a ticket so it may > get fixed somewhere along the way. Thanks! Hmm, this is an interesting issue. If we drop the $rel_path prefix, we'll break it for all people using an image relative to the PostfixAdmin directory. Since this is the default, this means "nearly everybody". OTOH, I know that the current code makes it impossible to use absolute paths. A way that works for both usecases isn't too easy, but it could be possible. I can thing of two options: - move users/*.php to users-*.php to avoid the additional directory level and the need for $relpath. - merging the admin and user login would work, but that's a different beast. Note that both options are more a long-term fix - I'd guess some things will break after moving files around ;-) For now, may I propose that you use a relative path like $CONF['theme_logo'] = "myimages/mylogo.png" and create an Alias in your apache config so that Apache maps the real file to that location? Regards, Christian Boltz -- By basic sanity check I meant error/warning messages which can be understood by mere simple human beings from planet earth [Cristian Rodríguez in opensuse-packaging] |