Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Lite 7

 AfterLogic Forum : AfterLogic WebMail Lite 7
Subject Topic: Login automatically Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
ThomasH
Newbie
Newbie


Joined: 29 January 2018
Location: Germany
Online Status: Offline
Posts: 7
Posted: 29 January 2018 at 2:50am | IP Logged Quote ThomasH

Hello All,
I have an question regarding the Login form.
I want to login the user automatically depending on the Microsoft AD groupmembership. I am using IIS 8 and the latest Webmail version.
So far I have managed to get the code working to know the current User which connects to IIS and query the AD for the group. Depending on the group, Webmail should login automatically with a defined useraccount, which can be defined in php code. There are 4 AD Groups with 4 associated logins.
My Problem is, I do not know where to place this code (also to survive updates). I read already about SSO and "Custom Mapping" of E-Mail addresses, but this is not exactly what I need.
Thanks in advance for your ideas.
Back to Top View ThomasH's Profile Search for other posts by ThomasH
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 29 January 2018 at 3:36am | IP Logged Quote Igor

Assuming your code knows email address and password you need to log into, you can use the standard PHP integration approach described at:

Logging in programmatically

The code used there is supposed to be placed into a separate file which isn't affected by updates.

You could use Single Sign-On as well, but you're saying that's not exactly what you're looking for - can you explain what exactly about these approaches doesn't meet your requirements?

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


Joined: 29 January 2018
Location: Germany
Online Status: Offline
Posts: 7
Posted: 31 January 2018 at 7:58am | IP Logged Quote ThomasH

Dear Igor,
thank you for your response. I am not a perfect php developer. After reading and investigating a bit further I think now I understand the concept and use the sso-login.php from the example. I put the code there. Get current AD user and group and do the login. Working great.
Only missing pice is signature. I try the global-signature plugin and create the signature with data pulled from AD. It is working, but the Signature is not visible during editing and when replying it is appended at the very end of the message.
I found in the settings > identity > signature the possibility to add an signature which is at the right place in the message but it is static. Is it possible to make this dynamically also with data pulled from AD?
Another php file which contains the code for the signature and is added when create new mail or reply and forward would be perfect.

thanks and best regards
Thomas
Back to Top View ThomasH's Profile Search for other posts by ThomasH
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6038
Posted: 01 February 2018 at 1:26am | IP Logged Quote Igor

Well there is no easy way to meddle with fetching signature from the database when composing the message, without modifying the source code directly which would be a problem for further updates, but I think there is another option.

Would it be possible for you to use Logging in programmatically approach rather than Integration via Single Sign-On? With that one, you could fetch signature from external source and insert it into the account properties, right after logging in; so it won't be done on composing each new message, only when logging user in, which should be good enough for most cases.

Once you have an Account object, updating the signature is rather straightforward:

Code:
$oApiUsersManager = CApi::Manager('users');
$oAccount->Signature = "My signature goes here";
$oApiUsersManager->UpdateAccount($oAccount);


I've uploaded a complete sample here. Hope it helps.

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


Joined: 29 January 2018
Location: Germany
Online Status: Offline
Posts: 7
Posted: 12 February 2018 at 8:50am | IP Logged Quote ThomasH

Dear Igor,
this was exactly what I was looking for. Working perfectly now.
Thanks and best regards
Thomas
Back to Top View ThomasH's Profile Search for other posts by ThomasH
 

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