On Tue, Sep 02, 2003 at 01:43:31PM -0500, James A Baker wrote:
> >         cd sqwebmail/html/en-us &&
> >         for i in *.html; do \
> >                 mv $i $i.prev; \
> >                 sed \
> >                         -e 
> > '/\[#SQWEBMAILCSS#\]/p;s%%/images/webmail.css%' \
> >                         -e 's/,width=28 height=20 /,/' \
> >                         $i.prev >$i; \
> >                 rm $i.prev; \
> >         done
> 
> But realize that only the old templates (prior to 3.6.0) should be 
> using unquoted attributes for width and height. The search string for 
> the newer templates would include quotes in the second substitution 
> (-e) line of that script.

Thank you - I hadn't spotted that!

> > (3) allow your users to write their own login page, which posts the
> > username/password to sqwebmail. They can prettify this as much as they 
> > like.
> 
> But this is a bit awkward as you would need to enable separate template 
> directories just to handle this, wouldn't you? I mean, sqwebmail 
> actually handles returning the page content itself, rather than letting 
> Apache (or whatever server) find the appropriate file... because even 
> on the login page, it has to do code replacements of various strings. 
> Am I missing something?

Users can create myhost.com/login.html containing whatever they like, which
posts to the sqwebmail CGI.

Actually I implemented a slightly more complex solution, which I'm not
entirely happy with, but what I did is replace the login.html / expired.html
/ invalid.html sqwebmail templates with redirects: for example,
en-us/login.html is

<html>
<head>
<meta http-equiv="refresh" content="0; url=/login.html">
</head>
<body>
<p>If your browser does not refresh automatically, please
<a href="/login.html">click here</a> to continue</p>
</body>
</html>

This means that even if someone directly runs
http://myhost.com/cgi-bin/sqwebmail then when it tries to display a login
page it gets redirected to the user's hand-crafted login page. (I then use
mod_rewrite with a -f test, which says that if the user's directory does not
contain a login.html, then it falls back to a default one. The same applies
to the /images/ directory, incidentally)

So the nice thing is this gives me a way to allow users to override
login.html / invalid.html / expired.html without being able to touch any
other templates. The bad thing is that the refresh message flashes onto the
screen a couple of times as webmail loads. But I couldn't think of a better
solution without modifying the sqwebmail code, either to allow selective
template replacement, or to implement HTTP headers (Status: 302 moved etc)

> And finally, it should be noted that there are (I believe) 3 different 
> pages that produce the same "login page layout" as the primary login 
> page.

Yep, I glossed over that before :-)

> One's the primary one, the other 2 are error pages of some sort, IIRC. 
> -- Anyway, you should look around for all pages with the same layout if 
> you want to give them control over the "login page" appearance. ... I 
> believe that the form field names, logindomain replacement string, and 
> logo/signin images are probably each unique to those pages.

The pages are identical apart from the addition of a relevant error message
on invalid.html and expired.html. It might make maintenance easier if that
message were a substitution string in login.html: e.g.

  [#IF_INVALID You entered an invalid username or password#]
  [#IF_EXPIRED Your login has expired#]

Regards,

Brian.

Reply via email to