From: kriswarner <kri...@so...> - 2007-11-29 20:21:30
|
Paul Lesniewski wrote: > > > First, make sure you review this: > > http://squirrelmail.org/wiki/EmbeddedSquirrelMailLogin > > In addition to any setup suggested by that wiki page, your code needs > to execute any and all SquirrelMail plugin hooks used by any plugin > you are trying to get working. View the plugin's setup.php file to > find out which ones those are, then look at where those plugin hooks > are used in src/login.php, and add them accordingly to your custom > login page. > > The only two hooks in the login_auto plugin that are also in src/login.php are "login_cookie" and "login_form". I added these to my custom login page, but it didn't work right. The "remember my username..." part is now displayed, but users are not logged in automatically when they go to the page. However, if you just click the "log in" button, you then get logged in, without having to enter name and password. So, apparently the cookies are being remembered, but the page isn't automatically redirecting. Thoughts? (I'll re-attach code so you can see where I entered the hooks - though I think they are in the correct place.) The other 3 hooks used by the plugin are "login_verified," "login_bottom," and "logout", but those aren't used in src/login.php, so I think I'm right to not include those in my page. I tried them anyway at one point, but no difference. code: <? /** * Path for SquirrelMail required files. * @ignore */ define('SM_PATH','mail/'); /* SquirrelMail required files. (not sure if all of these are needed) */ require_once(SM_PATH . 'functions/global.php'); require_once(SM_PATH . 'functions/strings.php'); require_once(SM_PATH . 'config/config.php'); require_once(SM_PATH . 'functions/i18n.php'); require_once(SM_PATH . 'functions/plugin.php'); require_once(SM_PATH . 'functions/constants.php'); require_once(SM_PATH . 'functions/page_header.php'); require_once(SM_PATH . 'functions/html.php'); require_once(SM_PATH . 'functions/forms.php'); do_hook('login_cookie'); ?> <head> <script language="JavaScript" type="text/javascript"> <!-- function squirrelmail_loginpage_onload() { document.forms[0].js_autodetect_results.value = '1'; for (i = 0; i < document.forms[0].elements.length; i++) { if (document.forms[0].elements[i].type == "text" || document.forms[0].elements[i].type == "password") { document.forms[0].elements[i].focus(); break; } } } // --> </script> </head> <body onload="squirrelmail_loginpage_onload()"> <form method="post" action="mail/src/redirect.php"> <input type="hidden" name="js_autodetect_results" value="0"> <input type="hidden" name="just_logged_in" value="1"> Username:<br> <input type="text" name="login_username" size="18"><br> Password:<br> <input type="password" name="secretkey" size="18"><br> <input type="submit" value="Log In"><br> <?do_hook('login_form');?> </form> </body> -- View this message in context: http://www.nabble.com/login_auto%2C-embedding-in-custom-page-tf4839086.html#a14033827 Sent from the squirrelmail-plugins mailing list archive at Nabble.com. |