afterlogic / webmail-lite-8

Open-source webmail script for existing IMAP server
https://afterlogic.org/webmail-lite-8
GNU Affero General Public License v3.0
336 stars 72 forks source link

Custom Code on the Header of the Webmail Lite #20

Closed bishu closed 6 years ago

bishu commented 6 years ago

I would like to enter a custom PHP Code on the header section which should be run on every page of the website. I am very confuse where I have to write my custom code.

afterlogic-support commented 6 years ago

I'm sorry, not sure what you're trying to do. PHP code is not executed on the pages, it's done "behind the scenes" to affect HTML and JavaScript content viewed with web browser.

If you require assistance from our developers, that can be arranged in terms of Professional Services: https://afterlogic.works/

bishu commented 6 years ago

As my webmail lite is login using the Login In logging-in-programmatically I don't want my webmail to be open directly if the user are not login in my parent website. So I would like to check whether the user has login or not using the PHP Code as

<?php
include_once "../security.php"; //This is my security class for my parent website
if (!IsLoggedIn()) { // <-- check whether not logged in my parent website.
  // As the user is not login it will redirect to my parent website.
} 
?>

If the above code are fixed on all the page then the user will be redirected to my parent website if they are not login on the parent website.

afterlogic-support commented 6 years ago

Well there's a simpler way. In data/settings/modules/StandardLoginFormWebclient.config.json configuration file, set CustomLoginUrl to the address of the page users need to be redirected if they attempt to open WebMail login page directly.

bishu commented 6 years ago

Thanks you very much sir. It is working Perfect.

Is there anyway for pro-grammatically logout When I logout my parent website then the webmail should also logout automatically.

afterlogic-support commented 6 years ago

You just need to delete or otherwise invalidate AuthToken cookie, that would effectively log the user out.

neoget-dipankar commented 3 years ago

Is there any logout script available?? so I can refer to it. AuthToken invalidation is not working for me and also sometime logout functionality is not working.

afterlogic-support commented 3 years ago

Is there any logout script available?? so I can refer to it. AuthToken invalidation is not working for me and also sometime logout functionality is not working.

Have answered this at: https://github.com/afterlogic/webmail-lite-8/issues/78