[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/admin/ -> login.php (source)

   1  <?php
   2  /*

   3  $Id: login.php 3 2006-05-27 04:59:07Z user $

   4  

   5    osCMax Power E-Commerce

   6    http://oscdox.com

   7  

   8    Copyright 2009 osCMax

   9  

  10    Released under the GNU General Public License

  11  */
  12  
  13    require ('includes/application_top.php');
  14  
  15    if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'process')) {
  16      $username = tep_db_prepare_input($HTTP_POST_VARS['username']);
  17      $password = tep_db_prepare_input($HTTP_POST_VARS['password']);
  18  
  19  // Check if usename exists

  20      $check_admin_query = tep_db_query("select admin_id as login_id, admin_groups_id as login_groups_id, admin_username as login_username, admin_password as login_password, admin_modified as login_modified, admin_logdate as login_logdate, admin_lognum as login_lognum from " . TABLE_ADMIN . " where admin_username = '" . tep_db_input($username) . "'");
  21      if (!tep_db_num_rows($check_admin_query)) {
  22        $HTTP_GET_VARS['login'] = 'fail';
  23      } else {
  24        $check_admin = tep_db_fetch_array($check_admin_query);
  25        // Check that password is good

  26        if (!tep_validate_password($password, $check_admin['login_password'])) {
  27          $HTTP_GET_VARS['login'] = 'fail';
  28        } else {
  29          if (tep_session_is_registered('password_forgotten')) {
  30            tep_session_unregister('password_forgotten');
  31          }
  32  
  33          $login_id = $check_admin['login_id'];
  34          $login_groups_id = $check_admin[login_groups_id];
  35          $login_username = $check_admin['login_username'];
  36          $login_logdate = $check_admin['login_logdate'];
  37          $login_lognum = $check_admin['login_lognum'];
  38          $login_modified = $check_admin['login_modified'];
  39  
  40          tep_session_register('login_id');
  41          tep_session_register('login_groups_id');
  42          tep_session_register('login_username');
  43  
  44          //$date_now = date('Ymd');

  45          tep_db_query("update " . TABLE_ADMIN . " set admin_logdate = now(), admin_lognum = admin_lognum+1 where admin_id = '" . $login_id . "'");
  46  
  47  // There is no more default ADMIN - so don't need to check for DEFAULT user

  48  //      if (($login_lognum == 0) || !($login_logdate) || ($login_email_address == '[email protected]') || ($login_modified == '0000-00-00 00:00:00')) {

  49  //        tep_redirect(tep_href_link(FILENAME_ADMIN_ACCOUNT));

  50  //      } else {

  51            tep_redirect(tep_href_link(FILENAME_DEFAULT));
  52  //      }

  53  
  54        }
  55      }
  56    }
  57  
  58    @include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN);
  59  ?>
  60  <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  61  <html <?php echo HTML_PARAMS; ?>>
  62  <head>
  63  <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  64  <meta name="robots" content="noindex,nofollow">
  65  <title><?php echo TITLE; ?></title>
  66  <link rel="stylesheet" type="text/css" href="style.css">
  67  </head>
  68  <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0" bgcolor="#FFFFFF">
  69  
  70  <table border="0" width="600" height="100%" cellspacing="0" cellpadding="0" align="center" valign="middle">
  71    <tr>
  72      <td><table border="0" width="600" height="440" cellspacing="0" cellpadding="1" align="center" valign="middle">
  73        <tr bgcolor="#000000">
  74          <td><table border="0" width="600" height="440" cellspacing="0" cellpadding="0">
  75            <tr bgcolor="#ffffff" height="50">
  76              <td height="50"><?php echo '<a href="http://www.oscmax.com">' . tep_image(DIR_WS_IMAGES . 'oscmax-logo.png', 'osCMax v2.0', '85', '80') . '</a>'; ?></td>
  77              <td align="right" class="text" nowrap><?php echo '&nbsp;&nbsp;<a href="http://www.aabox.com/" target="_blank" class="headerLink">osCMax Hosting</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="http://www.oscdox.com" class="headerLink">' . HEADER_TITLE_OSCDOX . '</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . HEADER_TITLE_ADMINISTRATION . '</a>&nbsp;&nbsp;|&nbsp;&nbsp;<a href="' . tep_catalog_href_link() . '">' . HEADER_TITLE_ONLINE_CATALOG . '</a>'; ?>&nbsp;&nbsp;</td>
  78            </tr>
  79            <tr bgcolor="#E7E7E7">
  80              <td colspan="2" align="center" valign="middle">
  81                            <?php echo tep_draw_form('login', FILENAME_LOGIN, 'action=process'); ?>
  82                              <table width="280" border="0" cellspacing="0" cellpadding="2">
  83                                <tr>
  84                                  <td class="login_heading" valign="top">&nbsp;<b><?php echo HEADING_RETURNING_ADMIN; ?></b></td>
  85                                </tr>
  86                                <tr>
  87                                  <td height="100%" valign="top" align="center">
  88                                  <table border="0" height="100%" cellspacing="0" cellpadding="1" bgcolor="#666666">
  89                                    <tr><td>
  90                                      <table border="0" width="100%" height="100%" cellspacing="3" cellpadding="2" bgcolor="#F3F3F3">
  91  <?php
  92    if ($HTTP_GET_VARS['login'] == 'fail') {
  93      $info_message = TEXT_LOGIN_ERROR;
  94    }
  95  
  96    if (isset($info_message)) {
  97  ?>
  98                              <tr>
  99                                <td colspan="2" class="smallText" align="center"><?php echo $info_message; ?></td>
 100                              </tr>
 101  <?php
 102    } else {
 103  ?>
 104                              <tr>
 105                                <td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
 106                              </tr>
 107  <?php
 108    }
 109  ?>
 110                              <tr>
 111                                <td class="login"><?php echo ENTRY_USERNAME; ?></td>
 112                                <td class="login"><?php echo tep_draw_input_field('username'); ?></td>
 113                              </tr>
 114                              <tr>
 115                                <td class="login"><?php echo ENTRY_PASSWORD; ?></td>
 116                                <td class="login"><?php echo tep_draw_password_field('password'); ?></td>
 117                              </tr>
 118                              <tr>
 119                                <td colspan="2" align="right" valign="top"><?php echo tep_image_submit('button_confirm.gif', IMAGE_BUTTON_LOGIN); ?></td>
 120                              </tr>
 121                            </table>
 122                          </td></tr>
 123                        </table>
 124                      </td>
 125                    </tr>
 126                    <tr>
 127                      <td valign="top" align="right"><?php echo '<a class="sub" href="' . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL') . '">' . TEXT_PASSWORD_FORGOTTEN . '</a><span class="sub">&nbsp;</span>'; ?></td>
 128                    </tr>
 129                  </table>
 130                </form>
 131              </td>
 132            </tr>
 133          </table></td>
 134        </tr>
 135        <tr>
 136          <td><?php require (DIR_WS_INCLUDES . 'footer.php'); ?></td>
 137        </tr>
 138      </table></td>
 139    </tr>
 140  </table>
 141  
 142  </body>
 143  
 144  </html>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7