Kelmas

Well-Known Member
Nov 6, 2006
121
0
166
Lithuania
If you set up Horde by yourself on some account, you may avoid language selection.

I don't think you'll understand the language, but this is an example of a Horde login screen can look like: webmail.vu.lt. Right after submitting details it takes to Inbox.

And in cPanel's Horde you get to Horde portal and have to click 'Mail'. So I think there are about five steps to access Inbox.

I personally have set up custom SquirrelMail version on my server with simple one-click login screen.
 

streigh

Active Member
Dec 5, 2006
32
0
156
Hello...
anyone have anything done for a direct Horde INBOX login ?

anything? anyone?

Regards.
Ok I keep seeing requests for this - here is a single page login to horde for cpanel from www root. This setup is for x theme and horde. This has everything EXCEPT the fix for @domain.com - I am working on that.

1: use the login script listed above in msg #2 of this thread. or use any login script that passes through to :2095/login

2: create a webmail login header file as follows:

#locate /usr/local/cpanel/base/webmail/x/header.html
<SCRIPT LANGUAGE="JavaScript">
window.location="/horde/index.php";
// -->
</script>


This causes webmaillogin.cgi to redirect to horde
of course, this eliminates the options normally available on the webmaillogin screen - but I think we can put those somewhere else. I will follow up.

3: Fix the horde login to allow pass-through
edit /usr/local/cpanel/base/horde/templates/login/login.inc

under function setfocus() add 1 line after 'else' :

function setFocus()
{
if (document.horde_login.horde_user.value == "") {
document.horde_login.horde_user.focus();
} else {
document.horde_login.horde_pass.focus();
document.horde_login.submit();
}

return true;

this causes hordes login screen to autosubmit if theres already a user name
This eliminates the language selection screen
 
Last edited:

wzd

Well-Known Member
Dec 16, 2005
120
1
168
South Africa
cPanel Access Level
Root Administrator
haha this is a nonsensical comment but this thread is really old. I hope someone puts it to sleep soon as i wouldn't mind using it...

Raise hands for the oldest thread to keep going?
 

streigh

Active Member
Dec 5, 2006
32
0
156
haha this is a nonsensical comment but this thread is really old. I hope someone puts it to sleep soon as i wouldn't mind using it...

Raise hands for the oldest thread to keep going?
One of those cases where they won't fix it so we have to do it ourselves :)

By the way - that login script is flawed above - I have a fixed version and will post it as soon as I comment it up. I added automatic @domainname and switch to lower case - both of which have been requested in other threads.

Do you think I should just start a new thread and post it there?
 

streigh

Active Member
Dec 5, 2006
32
0
156
Email login HTML script

here ya go - this works great for login screen - combine with the 2 header mods and you have 1-click login to horde!

<html>
<head>
<title>
Cpanel Login
</title>

<script type="text/javascript">


/* Domain name
this section uses javascript to automatically detect the domain name
or you can manually enter it eg domain="example.com"
*/

domain=document.domain


/* Make changes here for HTTPS */
loginurl="http://" + domain + ":2095/login"



function set_target() {
var user
user=document.login_form.user.value


/* This adds @domain.com if you want it */
if (user.indexOf("@") == '-1')
{
user=user + "@" + domain
}


/* This converts user input to lower case - make sure all usernames are created that way */
document.login_form.user.value=user.toLowerCase()


document.login_form.method = "post"
document.login_form.action = loginurl
}

</script>
</head>

<body>

<form name="login_form" onsubmit="set_target()" method="get" >

<table align="center">
<tr>
<td>
<span ">Username:</span>
</td>
<td>

<input name="user" type="text" value="" />

</td>
</tr>
<tr>
<td>
<span >Password:</span>
</td>
<td>

<input name="pass" type="password" value="" />

<tr>

<td colspan="2" align="center">

<input type="submit" value="Login" onmouseout="blur(this);" />

</td>
</tr>
</table>
</form>

</body>
</html>
 

wzd

Well-Known Member
Dec 16, 2005
120
1
168
South Africa
cPanel Access Level
Root Administrator
looks like you might have it. Going to test it now and get back to you :)
 

streigh

Active Member
Dec 5, 2006
32
0
156
looks like you might have it. Going to test it now and get back to you :)

Actually, dont delete the original header.html -poke in something like this: (new lines in red)
<html>
<head>
<title>cPanel Mail Management</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="$themebase/style.css">
<script language="JavaScript">

/* punch past webmaillogin and mail cpanel webmail utilities */

ref=document.referrer
dom=document.domain
logpage='http://' + dom + '/'
fwdpage='http://' + dom + ':2095/webmailforward.cgi'
agepage='http://' + dom + ':2095/webmailaging.cgi'
paspage='http://' + dom + ':2095/webmailpasswd.cgi'
vacpage='http://' + dom + ':2095/webmailautorespond.cgi'
boxpage='http://' + dom + ':2095/webmailboxtrapper.cgi'


if (ref == logpage)
window.location = 'http://' + dom + ':2095/horde/index.php'

if (ref == fwdpage)
window.location = 'http://' + dom + ':2095/horde/index.php'

if (ref == agepage)
window.location = 'http://' + dom + ':2095/horde/index.php'

if (ref == paspage)
window.location = 'http://' + dom + ':2095/horde/index.php'

if (ref == vacpage)
window.location = 'http://' + dom + ':2095/horde/index.php'

if (ref == boxpage)
window.location = 'http://' + dom + ':2095/horde/index.php'


<!--
function MM_swapImgRestore() { //v3.0​

Those other checks are so you can plug support back into horde for the forwards, aging and such - I've got those all working now from the "my account" menu in horde.

I think the header.html might be called from some other places, so putting the referring page check in makes sure we're ok - all those if's are ugly - but it was quick and foolproof :)

Now, how did I get "my account" working?
First, enable the items in registry.php (vacation, forwards,passwd and make a new ones for boxtrapper and aging if you want them)


from here I'll just do vacation you can guess the others...
Now, make directories for ./horde/vacation and ./horde/vacation/config
in config, place a file called conf.xml
<?xml version="1.0"?>
<!-- $Horde: vacation/config/conf.xml,v 0.01 2007/01/18 18:05:58 jan Exp $ -->
<configuration>
</configuration>​

in /vacation, make an index.php file containing:
<script type="text/javascript">
window.top.location="http://" + document.domain + ":2095/webmailautorespond.cgi"
</script>​

now, if you want to keep it pretty, you can add themes/graphics vacation.png from the vacation distribution.

I had to break out of the frame because returning caused an extra sidebar - better to reload.

Passwd is a little buggy - it will give you the cpanel webmail login screen after changing because you fail the punch-through.

By the way - I included boxtrapper, and it should work, but I haven't installed it and am not sure it it will work.

OOps, almost forgot - of course, you have to edit ./horde/config/conf.php and make an admin, then add the new items using setup (they will have no options, just create the config files)

Also, there's something screwed up with the horde/js directory - none of the tabs in hordes setup screens work for me, I replaced the entire directory from a horde distribution and all is fine now.

make sure you setup horde to logout to http://yourdomain.com/

I think we need a check in the login script to strip out "www." if its there, but I am tired :)

Now - I want to get user administration working from inside horde:cool:
 
Last edited:

streigh

Active Member
Dec 5, 2006
32
0
156
the login script

Ok, can someone tell me why the login script above shows user and password fields in firefox, but the username field does NOT show in IE:confused: :confused:
Nevermind - for anyone using this, replace <span ">Username:</span>
(remove the quote that doesnt belong

what I want to know is why did it work fine in firefox?
 
Last edited:

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
I just wanted to pass along that I am (and have been) working on doing some of this "from the other side" :)

1. I've a patch that removes the language dropdown, without hacking the template. It's a rewrite of the login.php script. Once one clicks the Horde Icon, a user is dropped right into the Inbox. There are still a few problems with languages and the interface.

2. I created a cPanel Horde module that integrates the webmail functions (boxtrapper, aging, etc). These are available as a new menu on the Horde sidebar. Right now they only open a new browser window with the function page.

3. Modified the configuration to display a users current Quota and Usage while in the Email section of Horde.

There are still other features and Items to implement. So far none of this is touching WHM/cPanel code, only Horde. The final will be to see about the ability to specify a webmail app as default.
 

streigh

Active Member
Dec 5, 2006
32
0
156
I just wanted to pass along that I am (and have been) working on doing some of this "from the other side" :)

1. I've a patch that removes the language dropdown, without hacking the template. It's a rewrite of the login.php script. Once one clicks the Horde Icon, a user is dropped right into the Inbox. There are still a few problems with languages and the interface.

2. I created a cPanel Horde module that integrates the webmail functions (boxtrapper, aging, etc). These are available as a new menu on the Horde sidebar. Right now they only open a new browser window with the function page.

3. Modified the configuration to display a users current Quota and Usage while in the Email section of Horde.

There are still other features and Items to implement. So far none of this is touching WHM/cPanel code, only Horde. The final will be to see about the ability to specify a webmail app as default.
Kewl - an ETA would be nice...

As far as I can tell, the cpanel built-in version of horde is already hacked to remove the username and password fields, plus someone did something to that /js directory.

the only change that touches any cpanel code here is the header.html mod. and most of the changes there are to make sure we only interact with the right referrers.

Now - if I am reading 2 correctly, you are launching the webmail functions as a pop-up? Funny - I went nuts trying to get the thing to look good while swapping out and back in from those pages - a pop up does do the trick too.

3: USEAGE! I forgot USEAGE! - ......... wanna race? ;)

What would be nice is:
A useage status bar - not the ugly numerical stats that most people run in horde.

This is spam/not spam support from inside mail - pretty easy if you fix the broken admin pages.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Kewl - an ETA would be nice...

As far as I can tell, the cpanel built-in version of horde is already hacked to remove the username and password fields, plus someone did something to that /js directory.
We do nothing to the /js directory. The only code we touch is the login.php script.

the only change that touches any cpanel code here is the header.html mod. and most of the changes there are to make sure we only interact with the right referrers.
The code I saw above has the non-ssl port hard coded. I may be looking at the wrong code though. What I'm doing will work with either SSL or non-SSL, without referrers since those are very unreliable.

Now - if I am reading 2 correctly, you are launching the webmail functions as a pop-up? Funny - I went nuts trying to get the thing to look good while swapping out and back in from those pages - a pop up does do the trick too.
You can call it a popup, it uses the target attribute on the url. Since we're not dealing with xHTML, it's usable. Since this portion of my code was a 'quick and dirty' hack today, the popup was the easiest. On my TODO list is investigating integrating the forms directly into the Horde interface. With the cPanel module I wrote, it may be easy enough to do this.

3: USEAGE! I forgot USEAGE! - ......... wanna race? ;)

What would be nice is:
A useage status bar - not the ugly numerical stats that most people run in horde.
Yeah, I'm using the numerical one for now, because it's already done :D However, it has some weirdness in Safari. I'll add the pretty graphical one to my todo list.

This is spam/not spam support from inside mail - pretty easy if you fix the broken admin pages.
I would really like to integrate the spam and filtering with what we have in cPanel, but that may be more trouble than it's worth at the moment. Of course, I haven't even looked at what is involved so take the prior comment with a large chunk of salt.

Some of my code is in our bugzilla, the rest is in a tarball. I'll see about making it all available for playing and feed back.
 

streigh

Active Member
Dec 5, 2006
32
0
156
QUOTE=cpanelkenneth;292332]We do nothing to the /js directory. The only code we touch is the login.php script.
Well - take a look at what I mean - enable an admin in horde and go into the setup menus - the tabs don't work. Now, replace the JS folder with a horde distribution and they start working fine - I did have it figured out to a single file, but 'lost my notes' and it's easier to replace the whole directory than go through them again

The code I saw above has the non-ssl port hard coded. I may be looking at the wrong code though. What I'm doing will work with either SSL or non-SSL, without referrers since those are very unreliable.
yep - set it up to be hard ssl - or hard non-ssl. We have to go with the lower security here. I have found that you either want ssl, or you don't. having support for both doesn't make sense. Either way - everything gets coded for ssl or everything doesnt.

keep in mind that if a referrer fails the way I set it up it will drop back to the original cpanel webmail login - happens when you change the password too(no surprise there). For me, the only reliability issue is we can't know if an update will push out for header.html - but even then, all that happens is we revert back to a 2-click login, still better than 3 :)

On my TODO list is investigating integrating the forms directly into the Horde interface. With the cPanel module I wrote, it may be easy enough to do this.
Throw in administration too? I still would love being able to add/mod/delete/list email users without logging into cpanel.

I look forward to seeing that tarball - you should test out what I slapped together - I will put it into a tarball of my own I think - it's actually pretty simple now that I got all the details worked out.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
yep - set it up to be hard ssl - or hard non-ssl. We have to go with the lower security here. I have found that you either want ssl, or you don't. having support for both doesn't make sense. Either way - everything gets coded for ssl or everything doesnt.
That's in part because of doing everything in javascript, although even there it is 'easy' enough to code it for both. It's slightly easier Serverside in PHP.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Been rather busy the last few weeks to work on this. Found some time today though. Attached is a replacement file for /usr/local/cpanel/base/horde/login.php

It:

1. Bypasses the silly language drop-down menu
2. Fixes some of the language problems that garble the display

One problem I've noted so far:

Sometimes Horde has problems logging into the IMAP server, or even connecting, in those cases you will still revieve the page with the language drop down. To resolve this will require some rewrite/rethinking of this login script. If your left bar menu appears fine, but the main part of the page displays the language drop down, simply select something from the left bar menu. You are actually logged in, it's simply some oddity with Horde/IMAP.
 

Attachments

allwebnow

Well-Known Member
Jan 8, 2007
65
0
156
wow, that works great! Is this going to be in any future releases of cpanel? I hope so cuz everytime you upgrade cpanel, you'll have to apply this login.php to horde.
 

kemis

Well-Known Member
Feb 17, 2005
104
0
166
Austin, TX
cPanel Access Level
Reseller Owner
Yeah, I really like it too. Installed it the day after he posted it & haven't heard any complaints yet. Sure makes it a LOT easier for my clients. I really hope this gets pushed into an upcoming cPanel release.

Matt
 

mmscwebmaster

Member
Mar 6, 2007
14
0
151
UK
Been rather busy the last few weeks to work on this. Found some time today though. Attached is a replacement file for /usr/local/cpanel/base/horde/login.php

It:

1. Bypasses the silly language drop-down menu
2. Fixes some of the language problems that garble the display

One problem I've noted so far:

Sometimes Horde has problems logging into the IMAP server, or even connecting, in those cases you will still revieve the page with the language drop down. To resolve this will require some rewrite/rethinking of this login script. If your left bar menu appears fine, but the main part of the page displays the language drop down, simply select something from the left bar menu. You are actually logged in, it's simply some oddity with Horde/IMAP.
I am new to running a website but would like this facility. Please explain how to get to /usr/local/cpanel/base/horde/login.php
 

Solokron

Well-Known Member
Aug 8, 2003
852
2
168
Seattle
cPanel Access Level
DataCenter Provider
LOL I copied this over and unfortunately receive an onslaught of error messages when clicking Horde from the webmail screen in cPanel.

Been rather busy the last few weeks to work on this. Found some time today though. Attached is a replacement file for /usr/local/cpanel/base/horde/login.php

It:

1. Bypasses the silly language drop-down menu
2. Fixes some of the language problems that garble the display

One problem I've noted so far:

Sometimes Horde has problems logging into the IMAP server, or even connecting, in those cases you will still revieve the page with the language drop down. To resolve this will require some rewrite/rethinking of this login script. If your left bar menu appears fine, but the main part of the page displays the language drop down, simply select something from the left bar menu. You are actually logged in, it's simply some oddity with Horde/IMAP.