Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Cant get into admin


KJ666

Recommended Posts

I was adding the add on Administration Access Level Accounts.

http://addons.oscommerce.com/info/1359

 

But i cant get into the admin area stright after adding it, says use admin@localhost and admin as password but that dont work :(

Any ideas, also when i click on password forgotten i just end up on the login page if i type it in the url bar it takes me to the login page ?

Link to comment
Share on other sites

I sorted it im in at last, next is i have this error when clicking on categories.

 

Parse error: syntax error, unexpected T_IF in /home/******/public_html/****/admin/categories.php on line 177

 

 

        if (USE_CACHE == 'true') {
         tep_reset_cache_block('categories');
         tep_reset_cache_block('also_purchased');
       }

       tep_redirect(tep_href_link(FILENAME_CATEGORIES, 'cPath=' . $cPath . '&cID=' . $categories_id));
       break;
     case 'delete_category_confirm'
       if (isset($HTTP_POST_VARS['categories_id'])) {
         $categories_id = tep_db_prepare_input($HTTP_POST_VARS['categories_id']);

       //$categories = tep_get_category_tree($categories_id, '', '0', '',true);
         $categories = tep_get_category_tree($categories_id, '', '0', '', '',true);

         $products = array();
         $products_delete = array();

 

Line 177 is:

if (isset($HTTP_POST_VARS['categories_id'])) {

Link to comment
Share on other sites

Thanks.

Next question anyone using this add on that can help or know a fix, for why i cant login most the times, like somtimes it works somtimes dont. Just re loads the login screen.

 

Please help i cant get in at all now :(

Here is my login_admin.php

<?php

 require('includes/application_top.php');

 if (isset($HTTP_GET_VARS['action'])) {
   $email_address = tep_db_prepare_input($HTTP_POST_VARS['email_address']);
   $password = tep_db_prepare_input($HTTP_POST_VARS['password']);

// Check if email exists
   $check_admin_query = tep_db_query("select admin_id as login_id, admin_groups_id as login_groups_id, admin_firstname as login_firstname, admin_email_address as login_email_address, 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_email_address = '" . tep_db_input($email_address) . "'");
   if (!tep_db_num_rows($check_admin_query)) {
     $HTTP_GET_VARS['login'] = 'fail';
   } else {
     $check_admin = tep_db_fetch_array($check_admin_query);
     // Check that password is good
     if (!tep_validate_password($password, $check_admin['login_password'])) {
       $HTTP_GET_VARS['login'] = 'fail';
     } else {
       if (tep_session_is_registered('password_forgotten')) {
         tep_session_unregister('password_forgotten');
       }

       $login_id = $check_admin['login_id'];
       $login_groups_id = $check_admin['login_groups_id'];
       $login_firstname = $check_admin['login_firstname'];
       $login_email_address = $check_admin['login_email_address'];
       $login_logdate = $check_admin['login_logdate'];
       $login_lognum = $check_admin['login_lognum'];
       $login_modified = $check_admin['login_modified'];

       tep_session_register('login_id');
       tep_session_register('login_groups_id');
       tep_session_register('login_first_name');

       //$date_now = date('Ymd');
       tep_db_query("update " . TABLE_ADMIN . " set admin_logdate = now(), admin_lognum = admin_lognum+1 where admin_id = '" . $login_id . "'");

       if (($login_lognum == 0) || !($login_logdate) || ($login_email_address == 'admin@localhost') || ($login_modified == '0000-00-00 00:00:00')) {
         tep_redirect(tep_href_link(FILENAME_ADMIN_ACCOUNT));
       } else {
   if (isset($HTTP_GET_VARS['url'])) {
         tep_redirect($HTTP_GET_VARS['url']);
   } else {
         tep_redirect(tep_href_link(FILENAME_DEFAULT));
   }
       }

     }
   }
 }

 @include(DIR_WS_LANGUAGES . $language . '/' . FILENAME_LOGIN_ADMIN);
?>
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html <?php echo HTML_PARAMS; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
<title><?php echo TITLE; ?></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>

<?php
 $languages = tep_get_languages();
 $languages_array = array();
 $languages_selected = DEFAULT_LANGUAGE;
 for ($i = 0, $n = sizeof($languages); $i < $n; $i++) {
   $languages_array[] = array('id' => $languages[$i]['code'],
                              'text' => $languages[$i]['name']);
   if ($languages[$i]['directory'] == $language) {
     $languages_selected = $languages[$i]['code'];
   }
 }
?>

<table border="0" width="600" height="100%" cellspacing="0" cellpadding="0" align="center" valign="middle">
 <tr>
   <td>
   	<table border="0" width="600" height="440" cellspacing="0" cellpadding="1" align="center" valign="middle">

	<tr>
		<td>
			<table border="0" width="100%" cellspacing="0" cellpadding="2">
		  	<tr><?php echo tep_draw_form('languages', 'login_admin.php', '', 'get'); ?>
			<td class="heading"><?php echo HEADING_TITLE; ?></td>
			<td align="right"><?php echo tep_draw_pull_down_menu('language', $languages_array, $languages_selected, 'onChange="this.form.submit();"'); ?></td>
		  	</form></tr>
			</table>
		</td>
       </tr>

     	<tr class="mainback">
       	<td>
         	<table border="0" width="600" height="440" cellspacing="0" cellpadding="0">
         		<tr class="logo-head" height="50">
             	<td height="50" align="left"><?php echo tep_image(DIR_WS_IMAGES . 'oscommerce.gif', 'osCommerce', '204', '50'); ?></td>
           		<td align="right" class="nav-head" nowrap><?php echo '<a href="' . tep_catalog_href_link() . '">' . HEADER_TITLE_ONLINE_CATALOG; ?>  </td>

<?php echo tep_draw_form('login', FILENAME_LOGIN, 'action=process'); ?>
         		</tr>
         		<tr class="main">
	            <td colspan="2" align="center" valign="middle">
<?php 
if (isset($HTTP_GET_VARS['url'])) {
echo tep_draw_form('login', FILENAME_LOGIN_ADMIN, 'action=process&url=' . $HTTP_GET_VARS['url']); 
} else {
echo tep_draw_form('login', FILENAME_LOGIN_ADMIN, 'action=process'); 
}
?>
               	<table width="280" border="2" cellspacing="0" cellpadding="2">
                 	<tr>
                   	<td class="login_heading" valign="top"> <?php echo HEADING_RETURNING_ADMIN; ?></td>
                   </tr>
                   <tr>
                     <td height="100%" valign="top" align="center">
                     	<table border="0" height="100%" cellspacing="0" cellpadding="1" class="login_form_bg">
                       	<tr>
                         	<td>
                           	<table width="100%" height="100%" cellspacing="3" cellpadding="2" class="login_form">
															<?php
															  if ($HTTP_GET_VARS['login'] == 'fail') {
															    $info_message = TEXT_LOGIN_ERROR;
															  }
                                 if (isset($info_message)) {
															?>
                             	<tr>
                               	<td colspan="2" class="smallText" align="center"><?php echo $info_message; ?></td>
                               </tr>
<?php
 } else {
?>
                               <tr>
                               	<td colspan="2"><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
                               </tr>
<?php
 }
?>
                               <tr>
                               	<td class="login"><?php echo ENTRY_EMAIL_ADDRESS; ?></td>
                                 <td class="login"><?php echo tep_draw_input_field('email_address'); ?></td>
                               </tr>
                               <tr>
                               	<td class="login"><?php echo ENTRY_PASSWORD; ?></td>
                                 <td class="login"><?php echo tep_draw_password_field('password'); ?></td>
                               </tr>
                               <tr>
                               	<td colspan="2" align="right" valign="top"><?php echo tep_image_submit('button_confirm.gif', IMAGE_BUTTON_LOGIN); ?></td>
                               </tr>
                             </table>
													</td>
												</tr>
                       </table>
                     </td>
                   </tr>
                   <tr>
                   	<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"> </span>'; ?></td>
                   </tr>
                 </table>
               </form>
               </td>
         		</tr>
       		</table>
				</td>
     	</tr>

     	<tr>
       	<td><?php require(DIR_WS_INCLUDES . 'footer.php'); ?></td>
     	</tr>
   	</table>
	</td>
 </tr>
</table>

</body>

</html>

 

I have gone though the files over and over again and i dont see why i cant login, and where i have gone wrong it lets me login somtimes but now (i have done no changes just loged out and closed exploar), and cant get in so requested a new password and that dont work, it just goes back to login page ?? no error just like you just gone to the login page.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...