Search The ForumSearch   RegisterRegister  LoginLogin

AfterLogic WebMail Pro

 AfterLogic Forum : AfterLogic WebMail Pro
Subject Topic: Own login & logout form Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
bobleponge
Newbie
Newbie
Avatar

Joined: 16 October 2013
Location: France
Online Status: Offline
Posts: 3
Posted: 16 October 2013 at 9:51am | IP Logged Quote bobleponge

Hi,

I've found how to provide my own login form. Digging into the code, I even figured out how to logout (with ApiIntegratorManager->LogoutAccount()) from my own page.

However, if a user logout from the webmail, then it's redirected to the default login page (not mine).
Also, if the user is not logged in, and type the complete webmail address, it's also redirected to the default login page (not mine).

I would like to hook into this behavior to insert the appropriate "Location: " header (or javascript code) to redirect to my own login page. How can I do this ?

(The ugly solution is to modify the template view to run a script with "window.location = mypage;" code, but I would like to avoid even loading the framework/ flashing a screen, I would prefer a solution where the initial PHP's index.php code sends a "Location: " header so it's transparent to the user)

I've tried to figure out where you detect if an account is logged in in the code, but so far, failed miserably.

Thanks.
Back to Top View bobleponge's Profile Search for other posts by bobleponge
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6088
Posted: 16 October 2013 at 10:29pm | IP Logged Quote Igor

You can make WebMail open page of your choice when users click Logout link, that's done by adding an option in config.php file as described in this forum thread. However, if user enters direct WebMail URL, they will see the actual login page, there are no workarounds here unless you tweak the actual source.

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

Joined: 16 October 2013
Location: France
Online Status: Offline
Posts: 3
Posted: 17 October 2013 at 3:03am | IP Logged Quote bobleponge

Thanks Igor.

By reading your answer, I realized I was not precise enough in my question. Fortunately your answer unlocked me, and I was able to do what I expected.
Here's what I expected:
- Have a custom-login-url (added this in app.js and the required hooks in the manager.php)
The window is redirected to this url upon login.
- Have a custom-logout-url (you gave this one)
- Have a custom-back-url (added this everywhere, I'll private mail you to send this code), that is, when the user click on this back url, it's redirected to my CMS -- BUT not logged out. Login/logout is done by the CMS for all its module, webmail being only one of them.

I'll send you the code by PM I made for these changes, hopefully, you'll be able to integrate it in a later version.   

Back to Top View bobleponge's Profile Search for other posts by bobleponge
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6088
Posted: 17 October 2013 at 3:10am | IP Logged Quote Igor

That's really interesting, I must say! Please feel free to send the code modifications to support(at)afterlogic(dot)com address or through our HelpDesk. Developers will have those reviewed and implemented into regular release if it's found feasible. But even if it doesn't make it into regular release, we can post it in special documentation section made of user-contributed materials, see this forum thread for details.

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

Joined: 16 October 2013
Location: France
Online Status: Offline
Posts: 3
Posted: 17 October 2013 at 10:10am | IP Logged Quote bobleponge

Ok, sent.
Back to Top View bobleponge's Profile Search for other posts by bobleponge
 

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