Quote: |
Enclosed are the files to allow better integration of SquirrelMail with
PHP-Nuke. Integration may be a bit of an exaggeration, but it allows one
to use SquirrelMail instead of the WebMail that comes with PHP-Nuke.
The enclosed files are all that I have in the WebMail modules directory.
Everything else I deleted (especially the attachments directory).
Note that I did not include the contents of the images and language directories
in this zip, but I did leave them intact on my system.
I only modified 2 files - index.php and mailheader.php
In the index.php file, I changed it to call SquirrelMail -
echo "<center><form method=\"post\" action=\"/webmail/src/redirect.php\">";
Note also that I wanted to use the stored values for email username and
password that get set in the PHP-Nuke Webmail system. So I just query those
out of the database and use them (in clear text using a hidden html item).
As in:
echo "<input type=\"hidden\" name=\"login_username\" value=\"$username\">";
echo "<input type=\"hidden\" name=\"secretkey\" value=\"$password\">";
This is not the most secure way to do this, but it was the least amount of
coding. If this is a problem, I would suggest using the SquirrelMail login
php file instead.
You will notice that I also removed the ability to have WebMail use multiple
email accounts. I still use the same settings for defining the webmail, but
I assume that the users will be using a specific name for the WebMail account.
We use "school", (since this was put together for the faculty and staff at our
elementary and Middle School). So the sql changed in the index.php to:
$query = "select * from $prefix"._popsettings." where uid = $userid and account='school'";
You can of couse make it whatever you would like. You could also allow multiple
accounts as well using the old sql syntax and provide a listing several
different choices to the user. I chose to simply list the number of messages
in the inbox, and providing a single button to click to go to the inbox using
SquirrelMail.
I also changed the mailheader.php file to remove the compose, inbox and exit
items from the Webmail page. They were either redundant or no longer needed.
Finally, there is a replacement script for the SquirrelMail signout.php file.
This file goes in the src directory in your WebMail install.
The changes in signout.php prevent users from inadvertantly siging out of the
PHPNuke site and allowing users to go back in the browser history and getting
back in to SquirrelMail without a password.
Note that you can also set the variable $signout in the config.php file.
This will bypass the signout.php file and return the user to the pathname specified.
So if you set $signout = '/' then when they click the signout url in SquirrelMail,
they will be returned to the home page of PHP-Nuke.
Hope this makes sense.
Enjoy.
Tom yarmas
tyarmas@yahoo.com
|