From: Kris W. <kri...@so...> - 2007-11-19 20:06:59
|
Shoot...sorry, restarted my post and forgot to add the subject to it again. Hello. I have the squirrelmail login page embedded into a custom login page. I also have the login_auto plugin enabled, but that will only show in redirect.php or login.php. Is there a way to embed the login_auto in a custom form? I checked out the readme and also looked through the list - couldn't find anything about this. Here is the code I use to embed the login in my custom page: <body onload="squirrelmail_loginpage_onload()"> <form method="post" action="/mail/src/redirect.php" name="login"> <input type="hidden" name="js_autodetect_results" value="0"> <b>Username:</b><br> <input type="text" name="login_username" size="18"> <b>Password:</b><br> <input type="password" name="secretkey" size="18"> <br> <input type="submit" value="Sign In"><br> </form> and this is in the <head> section: <head> <script language="JavaScript" type="text/javascript"> <!--  function squirrelmail_loginpage_onload() {    document.forms[0].js_autodetect_results.value = '1';  } --> </script> </head> Using squirrelmail 1.4.11 Thanks ----------------------------------------- Sign up for free at http://www.solidaritymail.com |
From: Paul L. <pa...@sq...> - 2007-11-19 23:46:25
|
On Nov 19, 2007 12:06 PM, Kris Warner <kri...@so...> wrote: > Shoot...sorry, restarted my post and forgot to add the subject to it > again. > > Hello. > I have the squirrelmail login page embedded > into a custom > login page. I also have the login_auto plugin > enabled, but that will > only show in redirect.php or login.php. > Is there a way to embed the > login_auto in a custom form? I > checked out the readme and also > looked through the list - couldn't > find anything about this. 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. > Here is the code I use to > embed the login in my custom page: > > <body > onload="squirrelmail_loginpage_onload()"> > <form > method="post" > action="/mail/src/redirect.php" > name="login"> > <input type="hidden" > name="js_autodetect_results" > value="0"> > <b>Username:</b><br> > <input > type="text" name="login_username" > size="18"> > <b>Password:</b><br> > <input type="password" name="secretkey" > size="18"> > <br> > <input > type="submit" value="Sign In"><br> > </form> > > and this is in the <head> section: > <head> > <script language="JavaScript" > type="text/javascript"> > <!-- > > function > squirrelmail_loginpage_onload() { > > > document.forms[0].js_autodetect_results.value = > '1'; > } > > --> > </script> > > </head> > > Using > squirrelmail 1.4.11 > |
From: Vincent D. <vin...@ya...> - 2007-11-20 09:23:58
|
I NEED A MAILER, CAN YOU GET ME ONE... Kris Warner <kri...@so...> wrote: Shoot...sorry, restarted my post and forgot to add the subject to it again. Hello. I have the squirrelmail login page embedded into a custom login page. I also have the login_auto plugin enabled, but that will only show in redirect.php or login.php. Is there a way to embed the login_auto in a custom form? I checked out the readme and also looked through the list - couldn't find anything about this. Here is the code I use to embed the login in my custom page: <body onload="squirrelmail_loginpage_onload()"> <form method="post" action="/mail/src/redirect.php" name="login"> <input type="hidden" name="js_autodetect_results" value="0"> <b>Username:</b><br> <input type="text" name="login_username" size="18"> <b>Password:</b><br> <input type="password" name="secretkey" size="18"> <br> <input type="submit" value="Sign In"><br> </form> and this is in the <head> section: <head> <script language="JavaScript" type="text/javascript"> <!-- function squirrelmail_loginpage_onload() { document.forms[0].js_autodetect_results.value = '1'; } --> </script> </head> Using squirrelmail 1.4.11 Thanks ----------------------------------------- Sign up for free at http://www.solidaritymail.com ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/----- squirrelmail-plugins mailing list Posting guidelines: http://squirrelmail.org/postingguidelines List address: squ...@li... List archives: http://news.gmane.org/gmane.mail.squirrelmail.plugins List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins --------------------------------- Be a better pen pal. Text or chat with friends inside Yahoo! Mail. See how. |
From: Fredrik J. <jer...@sq...> - 2007-11-20 13:06:34
|
"Vincent Davis": > I NEED A MAILER, CAN YOU GET ME ONE... This post violates the posting guidelines in oh so many ways. I assume that you haven't read through the documentation at <squirrelmail.org>, and in that case the answer is "no - we can't". Sincerely, Fredrik |
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. |
From: Paul L. <pa...@sq...> - 2007-11-30 02:00:46
|
> > 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? Watch your IMAP and web server logs when you hit your login page. What errors might you see? Put some test output in the Login Auto plugin code just before the redirect to see if it is even being executed. Use something like this: echo "HELLO WORLD!<hr />"; exit; Add any variables to the string needed to see if they are working. You can also debug in your page too... > (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) */ This is what is in the core for 1.4.12; seems as if you would do well to have the same: require_once(SM_PATH . 'functions/global.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'); > 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'); You can try to make sure the plugins are set up correctly at this point by putting this: global $squirrelmail_plugin_hooks; sm_print_r($squirrelmail_plugin_hooks); exit; > 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> |
From: kriswarner <kri...@so...> - 2007-11-30 05:40:16
|
I discovered the problem. The code from my last post works, it's just that the cookies are stored in mail/ rather than the root folder of my site. So if I put my login form in, say, mail/src/, it works. I'd rather not move all of my site files into the mail/ subdirectory though, so is there a way that I can access these cookies from the directory above mail/? Or can I have the cookies stored in two different directories? At any rate, this is problem in case any future questions about this come up. -- View this message in context: http://www.nabble.com/login_auto%2C-embedding-in-custom-page-tf4839086.html#a14041045 Sent from the squirrelmail-plugins mailing list archive at Nabble.com. |
From: Paul L. <pa...@sq...> - 2007-12-01 03:14:51
|
Please do not erase the thread context. Keep the relevant parts of the conversation. Don't assume you are the only person we are having conversations with on the mailing list and that we remember every last detail of your environment and problem. Keep context, and post in-line with your replies. On 11/29/07, kriswarner <kri...@so...> wrote: > > I discovered the problem. The code from my last post works, it's just that > the cookies are stored in mail/ rather than the root folder of my site. For the plugin to work, that is exactly where the cookie belongs. All the other SM cookies should also be placed there. If your login page is storing cookies *outside* the SM directory, then that might be a problem, although a bit strange since the plugin uses $base_dir, which should be correct.... although maybe when it is run from an embedded login page it is not (test it and print it out and let us know so we can ponder other ways to deal with that). A hack to get it back in the SM directory would be to go in the plugin and replace $base_uri in the functions file for all the setcookie() calls with the actual path you need, such as "/mail/". If your problem is that cookies ARE being created against the SM directory, I am not sure I understand what your issue is. Seems right to me. > So > if I put my login form in, say, mail/src/, it works. I'd rather not move > all of my site files into the mail/ subdirectory though, so is there a way > that I can access these cookies from the directory above mail/? Or can I > have the cookies stored in two different directories? At any rate, this is > problem in case any future questions about this come up. Usually you can specify the path to the desired directory in the setcookie() call anywhere you want as long as the domain is the same. |
From: kriswarner <kri...@so...> - 2007-12-01 06:52:14
|
Paul Lesniewski wrote: > > Please do not erase the thread context. Keep the relevant parts of > the conversation. Don't assume you are the only person we are having > conversations with on the mailing list and that we remember every last > detail of your environment and problem. Keep context, and post > in-line with your replies. > My deepest apologies. Paul Lesniewski wrote: > > > On 11/29/07, kriswarner <kri...@so...> wrote: >> >> I discovered the problem. The code from my last post works, it's just >> that >> the cookies are stored in mail/ rather than the root folder of my site. > > For the plugin to work, that is exactly where the cookie belongs. All > the other SM cookies should also be placed there. If your login page > is storing cookies *outside* the SM directory, then that might be a > problem, although a bit strange since the plugin uses $base_dir, which > should be correct.... although maybe when it is run from an embedded > login page it is not (test it and print it out and let us know so we > can ponder other ways to deal with that). A hack to get it back in > the SM directory would be to go in the plugin and replace $base_uri in > the functions file for all the setcookie() calls with the actual path > you need, such as "/mail/". > > If your problem is that cookies ARE being created against the SM > directory, I am not sure I understand what your issue is. Seems right > to me. > Yes, this last part is the problem. The issue is that my custom login form isn't located in the subdirectory of mail/ (the SM directory), but the directory above that, so the cookies that are set by the login_auto plugin aren't available to my custom login page. Like I said, when I put the custom login page in the mail/ subdirectory, it works fine, but I don't want to relocate all my own pages to that directory, so I need to figure out a way for my custom login page (located in the directory above mail/) to get the cookies, so the page can automatically redirect. I think this is now a matter of PHP/cookies/locating things in the proper directory, rather than Squirrelmail, but figured I'd post these comments for future users who might come across this issue. Paul Lesniewski wrote: > >> So >> if I put my login form in, say, mail/src/, it works. I'd rather not move >> all of my site files into the mail/ subdirectory though, so is there a >> way >> that I can access these cookies from the directory above mail/? Or can I >> have the cookies stored in two different directories? At any rate, this >> is >> problem in case any future questions about this come up. > > Usually you can specify the path to the desired directory in the > setcookie() call anywhere you want as long as the domain is the same. > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: The Future of Linux Business White Paper > from Novell. From the desktop to the data center, Linux is going > mainstream. Let it simplify your IT future. > http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4 > ----- > squirrelmail-plugins mailing list > Posting guidelines: http://squirrelmail.org/postingguidelines > List address: squ...@li... > List archives: http://news.gmane.org/gmane.mail.squirrelmail.plugins > List info (subscribe/unsubscribe/change options): > https://lists.sourceforge.net/lists/listinfo/squirrelmail-plugins > > -- View this message in context: http://www.nabble.com/login_auto%2C-embedding-in-custom-page-tf4839086.html#a14102757 Sent from the squirrelmail-plugins mailing list archive at Nabble.com. |
From: Paul L. <pa...@sq...> - 2007-12-01 08:07:19
|
> > On 11/29/07, kriswarner <kri...@so...> wrote: > >> > >> I discovered the problem. The code from my last post works, it's just > >> that > >> the cookies are stored in mail/ rather than the root folder of my site. > > > > For the plugin to work, that is exactly where the cookie belongs. All > > the other SM cookies should also be placed there. If your login page > > is storing cookies *outside* the SM directory, then that might be a > > problem, although a bit strange since the plugin uses $base_dir, which > > should be correct.... although maybe when it is run from an embedded > > login page it is not (test it and print it out and let us know so we > > can ponder other ways to deal with that). A hack to get it back in > > the SM directory would be to go in the plugin and replace $base_uri in > > the functions file for all the setcookie() calls with the actual path > > you need, such as "/mail/". > > > > If your problem is that cookies ARE being created against the SM > > directory, I am not sure I understand what your issue is. Seems right > > to me. > > > > Yes, this last part is the problem. The issue is that my custom login form > isn't located in the subdirectory of mail/ (the SM directory), but the > directory above that, so the cookies that are set by the login_auto plugin > aren't available to my custom login page. Oh right. That's my fault - I was thinking *setting* cookies, which should work if you want to set them for another directory, but of course the directory where you are trying to *retrieve* them from won't see them in this case. > Like I said, when I put the > custom login page in the mail/ subdirectory, it works fine, but I don't want > to relocate all my own pages to that directory, so I need to figure out a > way for my custom login page (located in the directory above mail/) to get > the cookies, so the page can automatically redirect. The solution is to open plugins/login_auto/functions.php, and for every "setcookie" command you find, create another duplicate of it and change $base_uri (or whatever directory the cookie is being set in) to the location of your pages. Perhaps the next version of this plugin could include a configurable setting to help with this. > I think this is now a > matter of PHP/cookies/locating things in the proper directory, rather than > Squirrelmail, but figured I'd post these comments for future users who might > come across this issue. > > > Paul Lesniewski wrote: > > > >> So > >> if I put my login form in, say, mail/src/, it works. I'd rather not move > >> all of my site files into the mail/ subdirectory though, so is there a > >> way > >> that I can access these cookies from the directory above mail/? Or can I > >> have the cookies stored in two different directories? At any rate, this > >> is > >> problem in case any future questions about this come up. > > > > Usually you can specify the path to the desired directory in the > > setcookie() call anywhere you want as long as the domain is the same. > > |