Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: login with current domain Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Ramon
Newbie
Newbie


Joined: 11 October 2012
Online Status: Offline
Posts: 7
Posted: 22 October 2012 at 8:12am | IP Logged Quote Ramon

Hi,

We would like to run Webmail Pro (PHP) on different domains.
Loginname is user@domain.ext

But i would like a client to enter just 'user' and automatically append the current domainname ($_SERVER['HTTP_HOST'] for example).

I found one thread http://www.afterlogic.com/forum/forum_posts.asp?TID=3756&KW=LoginAtDomainValue with a solution to set LoginFormType to Login, and DefaultDomainValue empty. But that doesn't seem to work. I also tried editting config.php like <?php return array('Webmail'=>(array('DefaultDomainValue'=>$_SERVER['HTTP_HOST'])); but that doesn't seem to work either...

Any thoughts (besides adding custom javascript to add the domainname in the input field)
Back to Top View Ramon's Profile Search for other posts by Ramon
 
Ramon
Newbie
Newbie


Joined: 11 October 2012
Online Status: Offline
Posts: 7
Posted: 23 October 2012 at 1:01am | IP Logged Quote Ramon

Found out it's not possible using config.php (found the defaults at libraries/afterlogic/common/config.php ).

Right now, i'm altering settings.xml like:
Code:
<LoginFormType>LoginAtDomain</LoginFormType>
<LoginAtDomainValue>domain.ext</LoginAtDomainValue>
<DefaultDomainValue />


and editted the footer with a little javascript which replace domain.ext with the current hostname:
Code:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
<script type="text/javascript" language="javascript">
$(document).ready(function() {
    $('#domain_cont').html('@'+document.location.hostname.replace('www.','')+'<input type=\"hidden\" name=\"sDomainValue\" id=\"sDomainValue\"
value=\"'+document.location.hostname.replace('www.','')+'\" />');
});
</script>


which works okay! But doesn't seem very logic to me and adds a lot of overhead
Am i overlooking a standard setting?
Back to Top View Ramon's Profile Search for other posts by Ramon
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6089
Posted: 23 October 2012 at 1:20am | IP Logged Quote Igor

I'd suggest the following approach which is quite straightforward. In settings.xml file, make sure LoginFormType is set to LoginAtDomain, and LoginAtDomainValue is set to anything non-empty. Then, modify main index.php file, line ~235:

Code:
$sAtDomainValue = hiddenDomainValue($sAtDomainValue);


should be replaced with:

Code:
$sAtDomainValue = hiddenDomainValue($_SERVER['HTTP_HOST']);


You'll need to make sure all the domains are added in AdminPanel and have proper incoming/outgoing mail settings.

Hope this helps!

--
Regards,
Igor, AfterLogic Support
Back to Top View Igor's Profile Search for other posts by Igor
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide