Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Problem with: register.php?mode=update

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-16-2004, 11:24 AM
 
rjackson7799 rjackson7799 is offline
 

Member
  
Join Date: Jan 2004
Location: Los Angeles
Posts: 24
 

Default Problem with: register.php?mode=update

When my customers click on the modify button to change their personal info they are taken to register.php?mode=update. However after they make the modification and click the submit button, they get the error:

Access denied !
You are not allowed to access that resource!

In customer/main/register.tpl I commented out the membership section below because I don't need members. However, if I don't comment this section out, updating the form is successful. But if I comment it out, I get the access denied error. Any suggestions?


<!--

<tr valign=middle>
<td height=20 colspan=3>{$lng.lbl_username_n_password}<hr size=1 noshade></td>
</tr>
{if $userinfo.login eq $login and $login and $userinfo.usertype ne "C"}
<input type=hidden name=membership value="{$userinfo.membership}"></d>
<input type=hidden name=pending_membership value="{$userinfo.pending_membership}"></d>
{else}
{if $config.General.membership_signup eq "Y" and ($usertype eq "C" or ($active_modules.Simple_Mode ne "" and $usertype eq "P") or $usertype eq "A")}
{include file="admin/main/membership_signup.tpl"}
{/if}
{if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode ne "")}
{include file="admin/main/membership.tpl"}
{/if}
{/if}

{if $anonymous ne "" and $config.General.disable_anonymous_checkout ne "Y"}
{* Anonymous account *}
<tr>
<td colspan=3>{$lng.txt_anonymous_account_msg}</TD>
</tr>
<tr valign=middle>
<td align=right>{$lng.lbl_username}</td>
<td></td>
<td nowrap>
<input type=text name=uname size=32 maxlength=32 value="{$userinfo.login}">
</td>
</tr>

<tr valign=middle>
<td align=right>{$lng.lbl_password}</td>
<td></td>
<td nowrap><input type=password name=passwd1 size=32 maxlength=32 value="{$userinfo.passwd1}">
</td>
</tr>

<tr valign=middle>
<td align=right>{$lng.lbl_confirm_password}</td>
<td></td>
<td nowrap><input type=password name=passwd2 size=32 maxlength=32 value="{$userinfo.passwd2}">
</td>
</tr>
{else}
{* NOT anonymous account *}
<tr valign=middle>
<td align=right>{$lng.lbl_username}</td>
<td><font class=Star>*</font></td>
<td nowrap>
{if $smarty.get.mode eq "update" or $smarty.post.mode eq "update"}
{$userinfo.login}
<input type=hidden name=uname value="{$userinfo.login}">
{else}
<input type=text name=uname size=32 maxlength=32 value="{$userinfo.login}">
{if $reg_error ne "" and $userinfo.login eq ""}<font class=Star>&lt;&lt;</font>{/if}
{/if}
</td>
</tr>

<tr valign=middle>
<td align=right>{$lng.lbl_password}</td>
<td><font class=Star>*</font></td>
<td nowrap><input type=password name=passwd1 size=32 maxlength=32 value="{$userinfo.passwd1}">
{if $reg_error ne "" and $userinfo.passwd1 eq ""}<font class=Star>&lt;&lt;</font>{/if}
</td>
</tr>

<tr valign=middle>
<td align=right>{$lng.lbl_confirm_password}</td>
<td><font class=Star>*</font></td>
<td nowrap><input type=password name=passwd2 size=32 maxlength=32 value="{$userinfo.passwd2}">
{if $reg_error ne "" and $userinfo.passwd2 eq ""}<font class=Star>&lt;&lt;</font>{/if}
</td>
</tr>
{/if}

{*
<tr valign=middle>
<td align=right>{$lng.lbl_password_hint}</td>
<td></td>
<td nowrap><input type=text name=password_hint size=32 maxlength=32 value="{$userinfo.password_hint}"></td>
</tr>

<tr valign=middle>
<td align=right>{$lng.lbl_password_hint_answer}</td>
<td></td>
<td nowrap><input type=text name=password_hint_answer size=32 maxlength=32 value="{$userinfo.password_hint_answer}"></td>
</tr>
*}

{if ($active_modules.Simple_Mode ne "" and $usertype eq "P") or $usertype eq "A"}

<tr valign=middle>
<td colspan="2"></td>
<td nowrap>
<input type=checkbox name=change_password value="Y" {if $userinfo.change_password eq "Y"}CHECKED {/if}>
{$lng.lbl_reg_chpass}
</td>
</tr>

{/if}
-->
__________________
X-Cart 4.4.0
PHP 5.2.5
Reply With Quote
  #2  
Old 09-16-2004, 07:41 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Code:
<!-- <tr valign=middle> <td height=20 colspan=3>{$lng.lbl_username_n_password}<hr size=1 noshade></td> </tr> {if $userinfo.login eq $login and $login and $userinfo.usertype ne "C"} <input type=hidden name=membership value="{$userinfo.membership}"></d> <input type=hidden name=pending_membership value="{$userinfo.pending_membership}"></d> {else} {if $config.General.membership_signup eq "Y" and ($usertype eq "C" or ($active_modules.Simple_Mode ne "" and $usertype eq "P") or $usertype eq "A")} {include file="admin/main/membership_signup.tpl"} {/if} {if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode ne "")} {include file="admin/main/membership.tpl"} {/if} {/if} {if $anonymous ne "" and $config.General.disable_anonymous_checkout ne "Y"} {* Anonymous account *} <tr> <td colspan=3>{$lng.txt_anonymous_account_msg}</TD> </tr> <tr valign=middle> <td align=right>{$lng.lbl_username}</td> <td></td> <td nowrap> <input type=text name=uname size=32 maxlength=32 value="{$userinfo.login}"> </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_password}</td> <td></td> <td nowrap><input type=password name=passwd1 size=32 maxlength=32 value="{$userinfo.passwd1}"> </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_confirm_password}</td> <td></td> <td nowrap><input type=password name=passwd2 size=32 maxlength=32 value="{$userinfo.passwd2}"> </td> </tr> {else} {* NOT anonymous account *} <tr valign=middle> <td align=right>{$lng.lbl_username}</td> <td><font class=Star>*</font></td> <td nowrap> {if $smarty.get.mode eq "update" or $smarty.post.mode eq "update"} {$userinfo.login} <input type=hidden name=uname value="{$userinfo.login}"> {else} <input type=text name=uname size=32 maxlength=32 value="{$userinfo.login}"> {if $reg_error ne "" and $userinfo.login eq ""}<font class=Star>&lt;&lt;</font>{/if} {/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_password}</td> <td><font class=Star>*</font></td> <td nowrap><input type=password name=passwd1 size=32 maxlength=32 value="{$userinfo.passwd1}"> {if $reg_error ne "" and $userinfo.passwd1 eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_confirm_password}</td> <td><font class=Star>*</font></td> <td nowrap><input type=password name=passwd2 size=32 maxlength=32 value="{$userinfo.passwd2}"> {if $reg_error ne "" and $userinfo.passwd2 eq ""}<font class=Star>&lt;&lt;</font>{/if} </td> </tr> {/if} {* <tr valign=middle> <td align=right>{$lng.lbl_password_hint}</td> <td></td> <td nowrap><input type=text name=password_hint size=32 maxlength=32 value="{$userinfo.password_hint}"></td> </tr> <tr valign=middle> <td align=right>{$lng.lbl_password_hint_answer}</td> <td></td> <td nowrap><input type=text name=password_hint_answer size=32 maxlength=32 value="{$userinfo.password_hint_answer}"></td> </tr> *} {if ($active_modules.Simple_Mode ne "" and $usertype eq "P") or $usertype eq "A"} <tr valign=middle> <td colspan="2"></td> <td nowrap> <input type=checkbox name=change_password value="Y" {if $userinfo.change_password eq "Y"}CHECKED {/if}> {$lng.lbl_reg_chpass} </td> </tr> {/if} -->

There. Now THAT is easier to read.
Reply With Quote
  #3  
Old 09-16-2004, 07:43 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

This is my code from 3.5.10.

It works. Look in skin1/customer/main/reigister.tpl

Code:
{if $config.General.membership_signup eq "Y" and ($usertype eq "C" or ($active_modules.Simple_Mode ne "" and $usertype eq "P") or $usertype eq "A")} {* include file="admin/main/membership_signup.tpl" *} {/if} {if $usertype eq "A" or ($usertype eq "P" and $active_modules.Simple_Mode ne "")} {include file="admin/main/membership.tpl"} {/if} {/if}

I commented out one line with {* code *}

Code:
{* include file="admin/main/membership_signup.tpl" *}
Reply With Quote
  #4  
Old 09-16-2004, 07:45 PM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

You can't comment out all of the password code. I think you have too much caffeine in your diet. Maybe it is time for a vacation.
Reply With Quote
  #5  
Old 09-17-2004, 11:10 AM
 
rjackson7799 rjackson7799 is offline
 

Member
  
Join Date: Jan 2004
Location: Los Angeles
Posts: 24
 

Default

Yeah you're right. I don't know what I was thinking, looking for a quick fix i guess.. What's the easiest way to hide the username password stuff on the registration form?
__________________
X-Cart 4.4.0
PHP 5.2.5
Reply With Quote
  #6  
Old 09-17-2004, 11:15 AM
  adpboss's Avatar 
adpboss adpboss is offline
 

X-Man
  
Join Date: Feb 2003
Location: Ontario, Canada
Posts: 2,389
 

Default

Why in God's great name would you want to eliminate user names and passwords?
Reply With Quote
  #7  
Old 09-17-2004, 12:12 PM
 
rjackson7799 rjackson7799 is offline
 

Member
  
Join Date: Jan 2004
Location: Los Angeles
Posts: 24
 

Default

I don't have repeat customers because I only have three products. Creating a username/password isn't necessary because the customer won't need to log in in the future so I want to hide it.
__________________
X-Cart 4.4.0
PHP 5.2.5
Reply With Quote
  #8  
Old 09-18-2004, 12:18 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

why not just remove any links to the registration page so that the only place that will get to it is in the checkout, then make sure anon checkout is ticked, in your registration template change the login and password fields to hidden fields and either remove the login and password txt labels or just blank them in the language editor.
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
  #9  
Old 09-18-2004, 10:46 AM
 
rjackson7799 rjackson7799 is offline
 

Member
  
Join Date: Jan 2004
Location: Los Angeles
Posts: 24
 

Default

did all the above and it worked, thanks! Originially I tried putting the username/password section in a div tag and setting the visibility to hidden, but that didn't work. So I followed your suggestion and deleted the labels and set the fields to hidden and it worked with no problems.
__________________
X-Cart 4.4.0
PHP 5.2.5
Reply With Quote
  #10  
Old 09-18-2004, 10:49 AM
 
cotc2001 cotc2001 is offline
 

X-Man
  
Join Date: Feb 2003
Location: Shrewsbury, UK
Posts: 2,351
 

Default

Glad I could help
__________________
x-cart 4.0.5 (live and heavily modded)
Server: freebsd
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:23 PM.

   

 
X-Cart forums © 2001-2020