Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

LoginboxV5.4_in_header


Mookie_Jam

Recommended Posts

hi!

 

I am having problems wih this wonderful contribution: it's loggin button doesn't work!

 

If I log throuht the OsC normal login page, it works perfectly, but I want it to work it all by it's own in te header.

 

 

Any help much appreciated! Thanks.

 

 

(here is the code of the contrib, by the way...)

 

<?php
/*
IMPORTANT NOTE:

 This is not part of the official osC distribution
 but an add-on contributed to the osC community. Please
 read the README and  INSTALL documents that are provided
 with this file for further information and installation notes.

 This puts a login request in a box with a login button.
 If already logged in, will not show anything.

 Modified to utilize SSL to bypass Security Alert

 Loginbox_in_header http://avzwebdesign.nl/oscommerce/
*/

if ( (!strstr($_SERVER['PHP_SELF'],'login.php')) 
and 
(!strstr($_SERVER['PHP_SELF'],'create_account.php')) 
and 
!tep_session_is_registered('customer_id') 
) 	 {
?>
<!-- loginbox //-->
<?php 
if (!tep_session_is_registered('customer_id')) {
?>
<table width="310"><tr> <td>
<?php

$loginboxcontent = tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL'))
								 . '<table width="310" border="0" cellspacing="0" cellpadding="0"><tr><td colspan="3" class="smallText">'
							 .'<tr><td class="smallText">'
							 . tep_draw_separator('pixel_trans.gif', '2', '1') 
							 . BOX_LOGINBOXH_EMAIL
							 . '</td><td  class="smallText" colspan="3">'
					 		 . tep_draw_input_field('email_address', '', 'size="10" maxlength="100" style="width: ' . (BOX_WIDTH-30) . 'px"') 
							 .'</td></tr><tr><td class="smallText">'
							 . tep_draw_separator('pixel_trans.gif', '2', '1') 
							 . BOX_LOGINBOXH_PASSWORD
							 . '</td><td class="smallText">'
							 . tep_draw_password_field('password', '', 'size="10" maxlength="40" style="width: ' . (BOX_WIDTH-30) . 'px"')
							 . '</td><td class="smallText">'
							 . '<a href="'
							 . tep_href_link(FILENAME_PASSWORD_FORGOTTEN, '', 'SSL')
							 . '">'
							 . BOX_LOGINBOXH_FORGOT_PASSWORD 
							 . '</a></td></tr><tr><td class="smallText" colspan="3">'
							 . tep_draw_separator('pixel_trans.gif', '5', '25')
							 . tep_image_submit('button_login.gif', IMAGE_BUTTON_LOGIN)
							   . '</form>'
							 . tep_draw_separator('pixel_trans.gif', '5', '1')
							 .  BOX_LOGINBOXH_TEXT_NEW
							 . '<a href="'
							 . tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL')
							 . '">'
							 . BOX_LOGINBOXH_NEW
							 . '</a></td></tr></table>' 
							;								 

$info_box_contents = array();
$info_box_contents[] = array('align' => '',
							 'text'  => $loginboxcontent);
new infoBox($info_box_contents);
?>
		</td>
	  </tr></table>
<?php
 } else {
 // If you want to display anything when the user IS logged in, put it
 // in here...  Possibly a "You are logged in as :" box or something.
 }
?>
<!-- loginbox_eof //-->
<?php
// WebMakers.com Added: My Account Info Box
} else {
 if (tep_session_is_registered('customer_id')) {
?>

<!-- my_account_info //-->
 <table width="310"><tr>
		<td>
<?php


 $info_box_contents = array();
 $info_box_contents[] = array('align' => 'left',
						   'text'  => '<table width="310" border="0" cellspacing="0" cellpadding="0"><tr><td class="smallText" colspan="2">'
						   . tep_draw_separator('pixel_trans.gif', '2', '1')
						   . '<b><center>' 
						   . tep_customer_greeting() 
						   .'</b></center></td></tr><tr><td class="smallText">'
						   . '<tr><td class="smallText" colspan="2">'
						   . tep_draw_separator('pixel_trans.gif', '2', '20')
						   . '<b>' 
						   . BOX_HEADING_LOGIN_BOX_MY_ACCOUNT 
						   .'</b></td></tr><tr><td class="smallText">'
						   . tep_draw_separator('pixel_trans.gif', '2', '15') .
 '<a href="' . tep_href_link(FILENAME_ACCOUNT, '', 'SSL') .'">' . LOGIN_BOX_MY_ACCOUNT . '</a><td class="smallText">' .
									  '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') .'">' . LOGIN_BOX_ACCOUNT_EDIT . '</a></td></tr><tr><td class="smallText">' . tep_draw_separator('pixel_trans.gif', '2', '1') .
									  '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') .'">' . LOGIN_BOX_ACCOUNT_HISTORY . '</a><td class="smallText">' . 
									  '<a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') .'">' . LOGIN_BOX_ADDRESS_BOOK . '</a></td></tr><tr><td class="smallText">'  . tep_draw_separator('pixel_trans.gif', '', '1') . 
									  '<a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'NONSSL') .'">' . LOGIN_BOX_PRODUCT_NOTIFICATIONS . '</a><td class="smallText">' . 
									  '<a href="' . tep_href_link(FILENAME_LOGOFF, '', 'NONSSL') .'">' . LOGIN_BOX_LOGOFF . '</a></td></tr></table>');
 new infoBox($info_box_contents);
?>
		</td>
	  </tr></table>
<!-- my_account_info_eof //-->

<?php 
 } // END-IF SESSION REGISTERED

} // END-IF

?>

Link to comment
Share on other sites

I noticed this problem a while back to. I had it working for a long time ... than it stopped working but I don't know when. I think it might have been after I installed update patches for oscommerce MS2 .. but not sure. Alot of the updates had changed tep functions for input and login forms etc.

 

I still have not figured out why it just stopped working.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...