Commit info for scoop/lib/Scoop/Admin:

Modified Files:
	Users.pm 
Log Message:
Bug 38. Patch from janra.
--hulver


Index: Users.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Admin/Users.pm,v
retrieving revision 1.55
retrieving revision 1.56
diff -r1.55 -r1.56
245,246c245
< 	$is_advertiser = 1 if ($tool eq 'advertiser' ||
< 							$S->{CGI}->param('advertiser') == 1 );
---
> 	$is_advertiser = 1 if ($tool eq 'advertiser' || $S->{CGI}->param('advertiser') == 1 );
248,249c247
< 	$is_advertiser = 0 unless(	$S->{UI}->{VARS}->{use_ads}	&&
< 								$S->{UI}->{VARS}->{req_extra_advertiser_info} );
---
> 	$is_advertiser = 0 unless( $S->{UI}->{VARS}->{use_ads} && $S->{UI}->{VARS}->{req_extra_advertiser_info} );
251,252c249
< 	my $new_user_page = qq|
< 		<table cellpadding="2" cellspacing="2" border="0">|;
---
> 	my $new_user_page = "";
255c252,253
< 	$really_new_user = 1 if ($S->have_perm('make_new_accounts'));
---
> 	$really_new_user = 1 if ($S->have_perm('make_new_accounts')); 
> 			#accounts with this perm set will never see the new advertiser page
257,260c255,258
< 	# if this is a person visiting this page not logged in, they get the page to create
< 	# an account.  Otherwise give them an error message tailored to their situation, whether
< 	# they are a normal user trying to create another account or an advertiser trying to
< 	# create another advertising account
---
> 	# if this is a person visiting this page not logged in, or a non-advertiser trying to 
> 	# set up an ad account, they get the page to create an account.  Otherwise give them 
> 	# an error message tailored to their situation, whether they are a normal user trying 
> 	# to create another account or an advertiser trying to create another advertising account
266,267c264
< 		$new_user_page .= qq|
< 		<tr><td colspan="2">Hey!  You already have an account!  I wouldn't worry about creating another.  You must have arrived here in error. Please email %%local_email%% if you're having troubles with this site.</td></tr>|;
---
> 		$new_user_page .= $S->{UI}->{BLOCKS}->{new_user_has_account};
270c267
< 	} elsif( $is_advertiser && $S->{GID} eq 'Advertiser' ) {
---
> 	} elsif( $is_advertiser && $S->{GID} eq $S->{UI}->{VARS}->{advertiser_group} ) {
272,273c269
< 		$new_user_page .= qq|
< 		<tr><td colspan="2">You already have an account that is enabled for advertising. You must have arrived here in error. Please email %%local_email%% if you're having troubles with this site.</td></tr>|;
---
> 		$new_user_page .= $S->{UI}->{BLOCKS}->{new_advertiser_has_account};
275a272,273
> 	} elsif( $is_advertiser ) {	
> 		$new_user_page .= $S->{UI}->{BLOCKS}->{new_advertiser_html};
277c275,278
< 	
---
> 
> 	my $formkey = $S->make_blowfish_formkey();
> 
> 
280c281
< 	# if they click the "Create User" button, create it
---
> 	# if they click the "Create User" button, create the account
320,333c321,322
< 				my $return_page = $S->{UI}->{BLOCKS}->{newuser_confirm_page} ||
< 					qq|
< 					<table cellpadding="2" cellspacing="2" border="0">
< 					<tr>
< 					<td colspan="2">%%norm_font%%<h2>User Created!</h2><p>
< 					You should soon receive an email at %%EMAIL%%. This email will contain your password 
< 					and further instructions.
< 					<p>
< 					Thanks for creating an account at %%SITENAME%%!
< 					%%norm_font_end%%
< 					</td>
< 					</tr>
< 					</table>|;
< 
---
> 				my $return_page = $S->{UI}->{BLOCKS}->{newuser_confirm_page};
> 					
347,364d335
< 	# show them the advertiser account setup form if they need it.
< 	if( $is_advertiser && !$really_new_user ) {	
< 		$new_user_page .= qq{
< 		<tr>
< 		<td colspan="2" bgcolor="%%title_bgcolor%%">%%title_font%%
< 		<b>Upgrade To Advertising Account</b>%%title_font_end%%<p>
< 		<form name="adduser" method="post" action="%%rootdir%%/">
< 		<input type="hidden" name="tool" value="writeuser" />
< 		<input type="hidden" name="op" value="newuser" />
< 		<input type="hidden" name="formkey" value="%%formkey%%" />
< 		</td>
< 		<tr><td colspan="2"><font color="#FF0000"><h3><center>%%error%%</center></h3></font></td></tr>
< 	  </tr>
< 		};
< 	}
< 
< 	my $formkey = $S->make_blowfish_formkey();
< 
370,384d340
< 	if( $is_advertiser ) {
< 		$new_user_page .= $S->{UI}->{BLOCKS}->{new_advertiser_html};
< 	}
< 
< 	$new_user_page .= qq{
<   <tr>
<    <td>
<    %%norm_font%%
<    &nbsp;
<    %%norm_font_end%%
<    </td>
<    <td align="right">
<    %%norm_font%%<input type="submit" value="Create Account!" size="30" /></form>%%norm_font_end%%
<    </td>
<   </tr>} unless( $no_create );
387,390d342
< 	
< 	$S->{UI}->{BLOCKS}->{CONTENT} .= qq|
< 	<tr><td colspan="2">&nbsp;</td></tr>
< 	</table>|;