home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 May / INTERNET103.ISO / pc / software / windows / building / php_nuke / html / modules / webmail / index.php < prev    next >
Encoding:
PHP Script  |  2002-09-16  |  4.0 KB  |  101 lines

  1. <?php
  2.  
  3. /*************************************************************************/
  4.  #  Mailbox 0.9.2a   by Sivaprasad R.L (http://netlogger.net)             #
  5.  #  eMailBox 0.9.3   by Don Grabowski  (http://ecomjunk.com)              #
  6.  #          --  A pop3 client addon for phpnuked websites --              #
  7.  #                                                                        #
  8.  # This program is distributed in the hope that it will be useful,        #
  9.  # but WITHOUT ANY WARRANTY; without even the implied warranty of         #
  10.  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          #
  11.  # GNU General Public License for more details.                           #
  12.  #                                                                        #
  13.  # You should have received a copy of the GNU General Public License      #
  14.  # along with this program; if not, write to the Free Software            #
  15.  # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.              #
  16.  #                                                                        #
  17.  #             Copyright (C) by Sivaprasad R.L                            #
  18.  #            Script completed by Ecomjunk.com 2001                       #
  19. /*************************************************************************/
  20.  
  21. if (!eregi("modules.php", $PHP_SELF)) {
  22.     die ("You can't access this file directly...");
  23. }
  24.  
  25. if(!is_user($user)) {
  26.     Header("Location: modules.php?name=Your_Account");
  27.     exit();
  28. }
  29.  
  30. require_once("mainfile.php");
  31. $module_name = basename(dirname(__FILE__));
  32. get_lang($module_name);
  33.  
  34. $pagetitle = "- "._WEBMAILSERVICE."";
  35.  
  36. include ("header.php");
  37. parse_str(base64_decode($pop3_cookie));
  38. require ("modules/$module_name/pop3.php");
  39. require ("modules/$module_name/decodemessage.php");
  40. include ("modules/$module_name/mailheader.php");
  41. include ("modules/$module_name/class.rc4crypt.php");
  42. $user1 = base64_decode($user);
  43. $userdata = explode(":", $user1);
  44. $userid = $userdata[0];
  45.  
  46. if ($numaccounts == -1 OR $numaccounts > 1) {
  47.     $welcome_msg = _MAILWELCOME1;
  48. } elseif ($numaccounts == 1) {
  49.     $welcome_msg = _MAILWELCOME2;
  50. }
  51.  
  52. $query = "select * from $prefix"._popsettings." where uid = $userid";
  53. $res = sql_query($query, $dbi);
  54. if(sql_num_rows($res, $dbi) < 1) {
  55.     OpenTable();
  56.     echo "<table width=\"95%\" border=\"0\" align=\"center\"><tr><td>"
  57.     ."<b>"._MAILWELCOME3." $sitename!</b><br><br>"
  58.         .""._CLICKONSETTINGS."<br><br>$welcome_msg"
  59.         ."</td></tr></table>";
  60.     CloseTable();
  61.     include ("modules/$module_name/mailfooter.php");
  62.     return;
  63. }
  64. echo "<script language=javascript>
  65.     function mailbox(num) {
  66.     formname = 'inbox' + num;
  67.     window.document.forms[formname].submit();
  68.     }
  69.     </script>";
  70. $count = 0;
  71. OpenTable();
  72. echo "<center><b>"._MAILBOXESFOR." $userdata[1]</b></center>";
  73. echo "<br><table border=\"1\" align=\"center\" width=\"80%\">"
  74.     ."<tr><td bgcolor=\"$bgcolor2\" width=\"33%\"> <b>"._ACCOUNT."</b></td><td bgcolor=\"$bgcolor2\" width=\"33%\" align=\"center\"> <b>"._EMAILS."</b></td><td bgcolor=\"$bgcolor2\" width=\"33%\" align=\"center\"> <b>"._TOTALSIZE."</b></td></tr>";
  75. while($row = sql_fetch_array($res, $dbi)) {
  76.     $count++;
  77.     $server = $row[popserver];
  78.     $port = $row[port];
  79.     $username = $row[uname];
  80.     $rc4 = new rc4crypt();
  81.     $password = $rc4->endecrypt($username,$row[passwd],"de");
  82.     $account = $row[account];
  83.     $serverid = $row[id];
  84.     $pop3=new POP3($server,$username,$password);
  85.     $pop3->Open();
  86.     $stats = $pop3->Stats();
  87.     $mailsum = $stats["message"];
  88.     $mailmem = round($stats["size"]/1024);
  89.     echo "<tr>"
  90.     ."<td align=\"left\"> "
  91.         ."<a href=\"modules.php?name=$module_name&file=inbox&id=$serverid\">$account</a></td>"
  92.         ."<td align=\"center\">$mailsum</td>"
  93.         ."<td align=\"center\">$mailmem Kbytes</td></tr>";
  94.     $pop3->Close();
  95. }
  96. echo "</table><br><br>"
  97.     ."<center>"._SELECTACCOUNT."</center>";
  98. CloseTable();
  99. include ("modules/$module_name/mailfooter.php");
  100.  
  101. ?>