[ Index ]

PHP Cross Reference of Nuke-Evolution v2.0.5

title

Body

[close]

/blocks/ -> block-User_Login.php (source)

   1  <?php
   2  /*=======================================================================
   3   Nuke-Evolution Basic: Enhanced PHP-Nuke Web Portal System
   4   =======================================================================*/
   5  
   6  /*********************************************************************************/
   7  /* CNB Your Account: An Advanced User Management System for phpnuke             */
   8  /* ============================================                                 */
   9  /*                                                                              */
  10  /* Copyright (c) 2004 by Comunidade PHP Nuke Brasil                             */
  11  /* http://dev.phpnuke.org.br & http://www.phpnuke.org.br                        */
  12  /*                                                                              */
  13  /* Contact author: escudero@phpnuke.org.br                                      */
  14  /* International Support Forum: http://ravenphpscripts.com/forum76.html         */
  15  /*                                                                              */
  16  /* This program is free software. You can redistribute it and/or modify         */
  17  /* it under the terms of the GNU General Public License as published by         */
  18  /* the Free Software Foundation; either version 2 of the License.               */
  19  /*                                                                              */
  20  /*********************************************************************************/
  21  /* CNB Your Account it the official successor of NSN Your Account by Bob Marion    */
  22  /*********************************************************************************/
  23  
  24  /********************************************************/
  25  /* User Login Block for PHP-Nuke                        */
  26  /* By: NukeScripts Network (webmaster@nukescripts.net)  */
  27  /* http://www.nukescripts.net                           */
  28  /* Copyright (c) 2000-2004 by NukeScripts Network         */
  29  /********************************************************/
  30  
  31  /*****[CHANGES]**********************************************************
  32  -=[Base]=-
  33        Nuke Patched                             v3.1.0       06/26/2005
  34        Caching System                           v1.0.0       10/31/2005
  35  -=[Mod]=-
  36        Advanced Username Color                  v1.0.5       06/11/2005
  37        Advanced Security Code Control           v1.0.0       12/17/2005
  38   ************************************************************************/
  39  
  40  if(!defined('NUKE_EVO')) exit;
  41  
  42  global $redirect, $mode, $f, $t, $sitekey, $nukeurl, $user, $cookie, $prefix, $user_prefix, $db, $anonymous, $userinfo, $evoconfig;
  43  
  44  $content = '';
  45  
  46  // User Login
  47  if (is_user()) {
  48  /*****[BEGIN]******************************************
  49   [ Mod:    Advanced Username Color             v1.0.5 ]
  50   ******************************************************/
  51      //$memname = $cookie[1];
  52      $memname = UsernameColor($userinfo['username']);
  53  /*****[END]********************************************
  54   [ Mod:    Advanced Username Color             v1.0.5 ]
  55   ******************************************************/
  56      $content .= _BWEL.", <strong>$memname</strong>.<br />(<a href=\"modules.php?name=Your_Account&amp;op=logout\">"._BLOGOUT."</a>)\n";
  57      $content .= "<hr noshade size=\"1\" />\n";
  58      if(is_active('Private_Messages')) {
  59          list($uid) = $db->sql_fetchrow($db->sql_query("select user_id from $user_prefix"._users." where username='$memname'"));
  60          $newpms = $db->sql_numrows($db->sql_query("select privmsgs_to_userid from $prefix"._bbprivmsgs." where privmsgs_to_userid='$uid' and (privmsgs_type='1' OR privmsgs_type='5')"));
  61          $savpms = $db->sql_numrows($db->sql_query("select privmsgs_to_userid from $prefix"._bbprivmsgs." where privmsgs_to_userid='$uid' and privmsgs_type='3'"));
  62          $oldpms = $db->sql_numrows($db->sql_query("select privmsgs_to_userid from $prefix"._bbprivmsgs." where privmsgs_to_userid='$uid' and privmsgs_type='0'"));
  63          $totpms = $newpms + $oldpms + $savpms;
  64          $content .= "<a href=\"modules.php?name=Private_Messages\"><strong>"._BPM.":</strong></a><br />\n";
  65          $content .= "<big><strong>&middot;</strong></big> "._BUNREAD.": <strong>$newpms</strong><br />\n";
  66          $content .= "<big><strong>&middot;</strong></big> "._BREAD.": <strong>$oldpms</strong><br />\n";
  67          $content .= "<big><strong>&middot;</strong></big> "._BSAVED.": <strong>$savpms</strong><br />\n";
  68          $content .= "<big><strong>&middot;</strong></big> "._BTT.": <strong>$totpms</strong><br />\n";
  69          $content .= "<hr noshade size=\"1\">\n";
  70      }
  71  } else {
  72      mt_srand ((double)microtime()*1000000);
  73      $maxran = 10 * intval($ya_config['codesize']);
  74      $random_num = mt_rand(0, $maxran);
  75      $content .= _BWEL.", <strong>$anonymous</strong><br />\n<br />\n";
  76      $content .= "<table border=0 cellpadding=0 cellspacing=0>\n";
  77      $content .= "<tr><td align=\"center\"><form action=\"modules.php?name=Your_Account\" method=\"post\">\n";
  78      $content .= _NICKNAME.": <input type=\"text\" name=\"username\" size=\"10\" maxlength=\"25\" /><br />\n";
  79      $content .= _PASSWORD.": <input type=\"password\" name=\"user_password\" size=\"10\" maxlength=\"20\" /><br />\n";
  80  /*****[BEGIN]******************************************
  81   [ Mod:     Advanced Security Code Control     v1.0.0 ]
  82   ******************************************************/
  83      $gfxchk = array(2,4,5,7);
  84      $content .= security_code($gfxchk);
  85  /*****[END]********************************************
  86   [ Mod:     Advanced Security Code Control     v1.0.0 ]
  87   ******************************************************/
  88     if(!empty($redirect)) {
  89         $content .= "<input type=\"hidden\" name=\"redirect\" value=\"$redirect\" />\n";
  90     }
  91     if(!empty($mode)) {
  92         $content .= "<input type=\"hidden\" name=\"mode\" value=\"$mode\" />\n";
  93     }
  94     if(!empty($f)) {
  95         $content .= "<input type=\"hidden\" name=\"f\" value=\"$f\" />\n";
  96     }
  97     if(!empty($t)) {
  98         $content .= "<input type=\"hidden\" name=\"t\" value=\"$t\" />\n";
  99     }
 100      $content .="<input type=\"hidden\" name=\"op\" value=\"login\" />\n";
 101      $content .= "<input type=\"submit\" value=\""._LOGIN."\" /> (<a href=\"modules.php?name=Your_Account&amp;op=new_user\">"._BREG."</a>)\n";
 102      $content .= "</form></td>\n";
 103      $content .= "</tr>\n";
 104      $content .= "</table>\n";
 105  }
 106  
 107  ?>


Generated: Wed Jun 6 11:38:01 2007 Cross-referenced by PHPXref 0.7