Author Topic: Renaming Login Page  (Read 7341 times)

Offline Grim

  • Newbie
  • *
  • Posts: 1
Renaming Login Page
« on: November 05, 2007, 08:16:17 PM »
I'm trying to find where the login page (skins/default/templates/login.html) is linked at. I need to know how, when you go to say mail.domain.com it goes to the login.html page and same as when you logout it goes to the login.html page.  I just want to change the extension from html to php but have looked and couldn't find where to change that was.

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Re: Renaming Login Page
« Reply #1 on: December 06, 2007, 09:13:31 AM »
what controls it is that the main index.php is what calls the proper template and include files.

Why would you want to change the extension?
 
  

Offline SaintMail

  • Newbie
  • *
  • Posts: 2
Re: Renaming Login Page
« Reply #2 on: January 15, 2008, 05:42:28 PM »
I'm trying to do the same thing.

I want to add some php scripting to my login page and I can't figure out where I can tell roundcube to load "skins/default/templates/login.php" instead of "skins/default/templates/login.html".

--Rick
http://webmail.saintmail.net/



Quote from: Grim
I'm trying to find where the login page (skins/default/templates/login.html) is linked at. I need to know how, when you go to say mail.domain.com it goes to the login.html page and same as when you logout it goes to the login.html page.  I just want to change the extension from html to php but have looked and couldn't find where to change that was.

Offline bpat1434

  • Administrator
  • Hero Member
  • *****
  • Posts: 673
Re: Renaming Login Page
« Reply #3 on: January 15, 2008, 10:23:45 PM »
Look in the includes/rcmail_template.inc file and if not there rcmail_template.html.... I believe that there is a method in each class called "parse" or "write". I'm not sure which one retrieves the template off the top of my head; however, it's pretty apparent when you open the files.

From there, you need to flag when the parameter "login" is passed to the method. The one problem is that if you put PHP into your login.html page, then you have to call eval() on it, which means that while you have valid PHP in there, the HTML won't be accessible to you. So you'd have to change the form of the login.html file to be all html contained in a variable, then use that variable in the class. It's a whole lot more work than it's worth. You'd be better off just defining a new element as part of the roundcube xml parser and putting in your items there, doing the real PHP work where it's supposed to be done.

That's not to mention the fact that if you were to put PHP into the template file(s), then you'd negate the reason for using an MVC in the first place. So if you're going to include custom coding (like side-bars and stuff), you're better off adding a new tag type so that you can reference it via "" or something like that. Then let the PHP code in the template parser take care of it. Make sense?