Questions about working with login.html

Charles Capps

Verified User
Joined
Jan 21, 2004
Messages
5
We're rolling our own complete custom skin for our customers, which is based on our website design. However, for various reasons, we can't pull any images off of the website itself.

Handling this in a skin is really easy - just pop the image in the images directory and add image names to the .conf files.

However, the login.html file doesn't know any information about the skin the user has chosen (as the user isn't logged in yet, of course), so I can't call any skin-specific information.

So, I'm looking for one of two solutions.

1) It would be nice if there was an existing way that I could magically reference images that exist inside a skin from login.html

or

2) If I could insert images into the web root directory and reference them directly from login.html... without any risk of the added files being removed or altered by an upgrade process. This would mainly involve figuring out where the web root really is. :)

This isn't directly limited to images. Being able to pull in other file types may be needed in the future - probably CSS. (For now, I've copied the style DA inserts into the login.html file manually.)

Thanks for any advice!
 
Hello,

Alright, #2 will most likely be your best solution. I've just added a few tokens for you for the login.html file.. so the full list is now:

REFERER - where the login page is trying to go (normally / )
HOSTNAME - domain.com (whatever is in the browser Address bar)
HTTP - either "http" or "https" depending on the connection type of DA.
FAILEDLOGIN - either "" or the message set by the page.
SERVER_IP - "1.2.3.4" ..this should generally point to /var/www/html so if your installer puts your images in there somewhere, and the login page uses the SERVER_IP, that might work. Alternatively, you could use the HOSTNAME and create an alias in the httpd.conf like "Alias /skin_name /var/www/html/skin_name" so that all references to anything.com/skin_name, no matter what domain, will go to /var/www/html/skin_name.

The extra tokens will be available for 1.20.8

John
 
Nifty stuff.

However.. what can I do with 1.20.7? Unless 1.20.8 is coming out very, very, very soon... (like, within a day or two)
 
The easy solution is to just have a setting at the top of your html file:

|?DOMAIN=domain.com|

and then use http://|DOMAIN|/my_skin/image.gif where you have pictures. This would require that they have a website setup, and that they install their images there. Then they'd just set the value for DOMAIN at the top of the login.html file, and they're good to go.

John
 
OKay, I misspoke - the question is where to actually safely put the files so that they're visible on |DOMAIN| and will never be touched by any automated or manual process, i.e. the upgrade process.
 
Hello,

Well, you'd need to figure out where the documentroot of |DOMAIN| is.. and put the files there. DirectAdmin won't touch anything but it's own skins during an update, and the login.html also will not be touched during an update.

John
 
Well, you've restated my own question to me...

How do I determine the document root for the DA server, running on port 2222, itself? That's where I need to stick the images.
 
Hello,

Well if you're making an installer, then the way to find it would be to look inside /etc/virtual/domainowners, lookup the username from the domain:

domain.com: username

and then the path would be /home/username/domains/domain.com/public_html

John
 
Ooooooh. Blinding flash of the obvious.

I was horribly confused - I thought that there was only one actual instance of the DA daemon running on port 2222 of a single IP address, and all users would have to visit that particular instance... the case seems to be that it listens everywhere on 2222, and figures things out intelligently from there.

In that case, it makes a fix for this problem a little too complex... the images may change frequently, and updating every one of them on every domain will quickly become a pain. We'll probably end up just pulling the images elsewhere, which isn't fantastic, but is easier.

Thank you for your assistance. :)
 
DirectAdmin Support said:
The easy solution is to just have a setting at the top of your html file:

|?DOMAIN=domain.com|

and then use http://|DOMAIN|/my_skin/image.gif where you have pictures. This would require that they have a website setup, and that they install their images there. Then they'd just set the value for DOMAIN at the top of the login.html file, and they're good to go.

John

So if i am reading this right 1.20.8 will have customized login pages per domain? If so that would be really kool for resellers :).
 
Hello,

I'm just saying I've added a few tokens for skin designers to play with. If they use scripting (have to double check that scripting is on for the login.html), then they should be able to to checks on those tokens to change the output.

John
 
Back
Top