Re: small problem about retrieving variable from SESSION
lichen970 <lichen970 <at> hotmail.com>
2012-08-21 00:54:59 GMT
Maybe there's some format issue in my first post. So just repost it as below.
Hi, all,
I am new to Squirrel mail and not sure if this is the right place to ask
questions. In a research project, I need for some reason to modify the sm
code. Specifically, I need to modify the right_main.php, so that each time
when I click "inbox" it will not call sqimap_login() again if we already
have one imap session remaining. I do not logout from imap explicitly.
Only the first time we need to create a imap connection. My problem is, with
the below code(the output followed), I cannot get back the imapConnection
when I click inbox or simply refresh the page.
Any suggestions? Thanks very much.
/* Open a connection on the imap port (143) */
global $imapConnection;
//var_dump("$username");
//var_dump("$imapConnection");
sqgetGlobalVar('imap',$imapConnection,SQ_SESSION);
echo "Before: "; var_dump("$imapConnection");echo "<br />";
//echo "Before: $imapConnection <br />";
if(empty($imapConnection)) {
$imapConnection = sqimap_login($username, $key, $imapServerAddress,
$imapPort, 0);
sqsession_register($imapConnection,'imap');
sqgetGlobalVar('imap',$imap,SQ_SESSION);//check if I've put imap
connection descriptor to SESSION successfully.
var_dump("$imap");
}
echo "After:"; var_dump("$imapConnection");
The output is :
Before: string(1) "0"
string(15) "Resource id #65" After:string(15) "Resource id #65"
Thanks
--
--
View this message in context: http://old.nabble.com/small-problem-about-retrieving-variable-from-SESSION%E2%80%8F-tp34322640p34327147.html
Sent from the squirrelmail-devel mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-devel <at> lists.sourceforge.net
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel