| Author | 
         | 
         
      
        
         
         Ramon Newbie 
          
 
  Joined: 11 October 2012
 Online Status: Offline Posts: 7
          | 
        
         
          
           | Posted: 22 October 2012 at 8:12am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
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 | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Ramon Newbie 
          
 
  Joined: 11 October 2012
 Online Status: Offline Posts: 7
          | 
        
         
          
           | Posted: 23 October 2012 at 1:01am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
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 | 
         
          
         | 
       
       
       
        |   | 
      
        
         
         Igor AfterLogic Support 
          
 
  Joined: 24 June 2008 Location: United States
 Online Status: Offline Posts: 6168
          | 
        
         
          
           | Posted: 23 October 2012 at 1:20am | IP Logged
		     | 
                    
            		  
           | 
           
          
           
  | 
           
          
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 | 
         
          
         | 
       
       
       
        |   |