G
Garp
Guest
Hello All.
I am looking for a way to redirect the users that log out of the Controlpanel (7.5.2) to another page than the default page. The destination should offcourse be our companies website, where we also provide a central login.
Now i know that logout.php3 has something to do with this process and that i can find it in '/usr/local/psa/admin/htdocs', but that's all. I would really appreciate it if someone could point me in the right direction or even know the downright answer.
Anyone fixed this successfully? I STF'ed, but found no real usefull info for 7.5.2
Regards,
Ronald
Update;
Ok, i found something.
make a backup of /usr/local/psa/admin/htdocs/logout.php3
# cd /usr/local/psa/admin/htdocs/
# cp logout.php3 logout_backup.php3
# touch newlogout.php3
# chgrp psaadm newlogout.php3
# chmod 550 newlogout.php3
Script to go into newlogout.php
# vi newlogout.php3
[script]
<?
$sid = "$HTTP_COOKIE_VARS[PLESK_SESSION_ID]";
mysql_connect ("localhost", "admin", "your admin password");
mysql_select_db ("psa");
mysql_query ("DELETE FROM sessions WHERE session_id = '$sid'");
header ("Location: http://www.page-to-redirect.to");
?>
[/script]
# cp newlogout.php3 logout.php3
You should be done now; it works for me. Only thing is doesn't do right is remove the user session.
3 questions remain;
1. Can anyone confirm that this method doesn't create any problems, now or in the future?
2. Who can help me adjust this script so it does actually log out the user?
3. What's the syntax to cat the admin pass in this scipt without actually putting the admin pass in the script?
Any help in creating a working script would be grately appreciated by me and probably a lot of other people....
I am looking for a way to redirect the users that log out of the Controlpanel (7.5.2) to another page than the default page. The destination should offcourse be our companies website, where we also provide a central login.
Now i know that logout.php3 has something to do with this process and that i can find it in '/usr/local/psa/admin/htdocs', but that's all. I would really appreciate it if someone could point me in the right direction or even know the downright answer.
Anyone fixed this successfully? I STF'ed, but found no real usefull info for 7.5.2
Regards,
Ronald
Update;
Ok, i found something.
make a backup of /usr/local/psa/admin/htdocs/logout.php3
# cd /usr/local/psa/admin/htdocs/
# cp logout.php3 logout_backup.php3
# touch newlogout.php3
# chgrp psaadm newlogout.php3
# chmod 550 newlogout.php3
Script to go into newlogout.php
# vi newlogout.php3
[script]
<?
$sid = "$HTTP_COOKIE_VARS[PLESK_SESSION_ID]";
mysql_connect ("localhost", "admin", "your admin password");
mysql_select_db ("psa");
mysql_query ("DELETE FROM sessions WHERE session_id = '$sid'");
header ("Location: http://www.page-to-redirect.to");
?>
[/script]
# cp newlogout.php3 logout.php3
You should be done now; it works for me. Only thing is doesn't do right is remove the user session.
3 questions remain;
1. Can anyone confirm that this method doesn't create any problems, now or in the future?
2. Who can help me adjust this script so it does actually log out the user?
3. What's the syntax to cat the admin pass in this scipt without actually putting the admin pass in the script?
Any help in creating a working script would be grately appreciated by me and probably a lot of other people....