Commit info for scoop/lib/Scoop/Admin:
Modified Files:
AdminStories.pm Ads.pm Blocks.pm SiteControls.pm EditUser.pm
Topics.pm Users.pm Logging.pm
Log Message:
More bug fixes. The list is below. I also cleaned up some HTML in the code as I
went over it, but that was pretty minor. This is just copied out of the list I
was working off of, it might not make any sense.
code changes:
| if hide_rating_value is 0 or blank, min_rating - 1 is used. if min_rating
isn't 1, then there's no way to get hide_rating to be 0
| op=user;tool=prefs;uid=1 doesn't work anymore (editing user info)
| safe_mode should send back a 503 Service Unavailable
| requesting a non-existent user doesn't display an error message
| file uploads page shows subdirs as files. should not show them, or allow
using them
| autoformat won't linkify bars URLs anymore
| key impressions is requested by all ad emails but doesn't exist in db and
isn't used
| subscribe block isn't used anymore (hardcoded in Subscription.pm)
| subscribe_intro_text has a default code value, but it's duplicated in the
default database
| when creating a new ad template, properties get set but it can't be active
until an example ad is created, and it displays that error even if the admin
didn't try to mark it active
| in Ads::Submit, in structure on line 50: the value '5' isn't caught
| mail_ad_almost_done and mail_ad_done (and other blocks that use
escape_adjudge_mail) can only handle k5 style ads, even though the code can
handle other keys
| blocks admin tool needs /g on its description interpolate regexp
| digest_subjects is a block, but cron.pm looks in vars
| in the comment block, the special key "user_info" contains the value of the
special key "edit_user", even though "edit_user" is recognised as a separate
special key
| the mark_<group> blocks are only applied if subscriptions are on
| auto-post uses 4 queries to get votes instead of just one:
select count(vote) as score,vote,section_only from storymoderate where
sid='$sid' group by vote,section_only
| when calculating comment score, 1 is hard coded as the hidden comment
threshold instead of using the rating_min var
| upload_max_file_size in Utility.pm should be enforced (make sure $size isn't
greater, then only read in $size bytes)
| advertiser_group/req_extra_advertiser_info needs to work.
(/newuser/advertiser needs to be an op template to work)
| site controls links don't always work. model after blocks
(admin/tool/mode/item, not admin/tool/category)
| need instructions/link to blocks for creating a new ad template
| when editting a single block, links to other themes should take you to that
same block. if no block in that theme, blank form
| topics interface should use a checkbox to delete (like sections does)
database changes:
| user op EVAL needs a $p->{uid} = $uid; near the end
| user_box needs to test upload_user and upload_admin perms to add 'Your Files'
| story_info uses a special key (comment_controls) that isn't recognized. that
needs to be removed, as it's added elsewhere
| in poll_block, |hotlist| is used but it apparently isn't a valid key. |info|
isn't used either. remove these from the default
| block comment needs to have %%user_info%% changed to %%user_info%%
%%edit_user%%
| update admin/vars op template to be /tool/mode/item
| hook var needs update. user_new(username, is_advertiser) is the new one
| old box ops need to be converted to new format: buyimpressions_box,
fzdisplay,
renewad_box, submit_rdf. "This is a pretty easy change, just put that box
name
in the op definition, indicate that it's a box, and set the page template to
default_template or something similar. Then delete the four page template
blocks that were used before."
| subpay_paypal and ad_pay_paypal have paypal account name/email hard-coded in
boxes. should be a var
| submit_ad_pay_box should show whichever payment options have been turned on
by ads_use_cc and ads_use_paypal, instead of neither
| set newuser's template to /tool/
| poll_archive cron should run every 1M, not 1m
| pendingstory_bg isn't used in any code or box (remove it)
| missing blocks (in code only): donate_email_pledge, donate_email_success,
next_previous_links, rating_format
| in patches but missing from scoop.sql: author_edit_instructions
| comment_toggle(sid,cid,tool), file_upload(path), and user_confirm(nick)
missing from hook var
| block poll_box isn't used box poll_box's template (it uses plain). remove
poll_box block
| remove poll_guidelines, preview_text_ad_template, renew_confirm_message
| ads_use_cc and ads_use_payal (vars) don't exist. needed for payments
| remove column comment from storymoderate
Index: AdminStories.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Admin/AdminStories.pm,v
retrieving revision 1.128
retrieving revision 1.129
diff -r1.128 -r1.129
1695c1695,1696
<
---
>
> my $rating_min = $S->dbh->quote($S->{UI}->{VARS}->{rating_min});
1700c1701
< WHERE => qq|points IS NOT NULL and points >= 1 and sid = "$sid" and pending = 0|,
---
> WHERE => qq|points IS NOT NULL and points >= $rating_min and sid = "$sid" and pending = 0|,
1718c1719
<
---
>
1719a1721
> my ($dump, $dontcare, $section, $frontpage);
1721,1746c1723,1739
< WHAT => 'COUNT(*)',
< FROM => 'storymoderate',
< WHERE => qq|sid = "$sid" and vote = "-1"|});
< my $dump = $sth->fetchrow();
< $sth->finish();
<
< ($rv, $sth) = $S->db_select({
< WHAT => 'COUNT(*)',
< FROM => 'storymoderate',
< WHERE => qq|sid = "$sid" and vote = 0|});
< my $dontcare = $sth->fetchrow();
< $sth->finish();
<
< ($rv, $sth) = $S->db_select({
< WHAT => 'COUNT(*)',
< FROM => 'storymoderate',
< WHERE => qq|sid = "$sid" and vote = 1 and section_only = "Y"|});
< my $section = $sth->fetchrow();
< $sth->finish();
<
< ($rv, $sth) = $S->db_select({
< WHAT => 'COUNT(*)',
< FROM => 'storymoderate',
< WHERE => qq|sid = "$sid" and vote = 1 and section_only = "N"|});
< my $frontpage = $sth->fetchrow();
< $sth->finish();
---
> WHAT => 'COUNT(vote) AS score, vote, section_only',
> FROM => 'storymoderate',
> WHERE => qq|sid = '$sid'|,
> GROUP_BY => 'vote, section_only'
> });
> while ($sth->fetchrow_array) {
> if ($_[1] == -1) {
> $dump = $_[0];
> } elsif ($_[1] == 0) {
> $dontcare = $_[0];
> } elsif ($_[1] == 1 && $_[2] == 'Y') {
> $section = $_[0];
> } elsif ($_[1] == 1 && $_[2] == 'N') {
> $frontpage = $_[0];
> }
> }
> $sth->finish;
Index: Ads.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Admin/Ads.pm,v
retrieving revision 1.30
retrieving revision 1.31
diff -r1.30 -r1.31
193,197c193,197
< <tr><TH bgcolor="%%title_bgcolor%%">%%title_font%%<b>Template name</b>%%title_font_end%%</TH>
< <TH bgcolor="%%title_bgcolor%%"><b> </b></TH>
< <TH bgcolor="%%title_bgcolor%%"><b> </b></TH>
< <TH bgcolor="%%title_bgcolor%%"><b> </b></TH>
< <TH bgcolor="%%title_bgcolor%%">%%title_font%%<b>Use Count</b>%%title_font_end%%</TH></TR>
---
> <tr><th bgcolor="%%title_bgcolor%%">%%title_font%%<b>Template name</b>%%title_font_end%%</th>
> <th bgcolor="%%title_bgcolor%%"><b> </b></th>
> <th bgcolor="%%title_bgcolor%%"><b> </b></th>
> <th bgcolor="%%title_bgcolor%%"><b> </b></th>
> <th bgcolor="%%title_bgcolor%%">%%title_font%%<b>Use Count</b>%%title_font_end%%</th></tr>
213d212
<
216c215,219
< $list .= q|</table></td></TR>|;
---
> $list .= q|
> </table>
> <p>%%norm_font%%To add a new template, use the <a href="%%rootdir%%/admin/blocks">block editor</a> to create a block with a name ending with "_ad_template".%%norm_font_end%%</p>
> </td></tr>
> |;
1724c1727
< unless ($ad_ex_hash->{example} == 1) {
---
> if ($ad_ex_hash->{example} != 1 && $val_hash->{active}) {
Index: Blocks.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Admin/Blocks.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -r1.8 -r1.9
107,108c107,108
< my $html_checked = "CHECKED" if $check_html;
< $html = qq{Check HTML <INPUT name="check_html" type="checkbox" $html_checked>};
---
> my $html_checked = 'checked="checked"' if $check_html;
> $html = qq{Check HTML <input name="check_html" type="checkbox" $html_checked />};
120c120
< $themesel .= qq{ <A href="%%rootdir%%/admin/blocks/multi/$th/$item">$th</A>};
---
> $themesel .= qq{ <a href="%%rootdir%%/admin/blocks/multi/$th/$item">$th</A>};
122c122
< $themesel .= qq{ <A href="%%rootdir%%/admin/blocks/edit/$th">$th</A>};
---
> $themesel .= qq{ <a href="%%rootdir%%/admin/blocks/edit/$th/$item">$th</A>};
139,140d138
<
<
186,189c184,187
< <input type="hidden" name="mode" value="edit">
< <input type="hidden" name="item" value="$bid">
< <SELECT NAME="block" SIZE=1>
< <OPTION VALUE="new">Add New Block};
---
> <input type="hidden" name="mode" value="edit" />
> <input type="hidden" name="item" value="$bid" />
> <select name="block" size="1">
> <option value="new">Add New Block</option>};
212c210
< $selected = $block->{bid} eq $bid ? 'selected' : '';
---
> $selected = $block->{bid} eq $bid ? 'selected="selected"' : '';
214c212
< <OPTION VALUE="$block->{bid}" $selected>$block->{bid} |;
---
> <option value="$block->{bid}" $selected>$block->{bid}</option>|;
217c215
< $blockselect .= "</SELECT>";
---
> $blockselect .= "</select>";
222c220
< <SELECT NAME="catsel" SIZE=3 multiple>
---
> <select name="catsel" size="3" multiple="multiple">
231c229
< <OPTION VALUE="$cat" $selected>$cat|;
---
> <option value="$cat" $selected>$cat</option>|;
233c231
< $catselect .= '</SELECT>';
---
> $catselect .= '</select>';
250c248
< $content =~ s/%%description%%/$description/;
---
> $content =~ s/%%description%%/$description/g;
340,342c338,340
< <input type="hidden" name="item" value="$item">
< <input type="hidden" name="theme" value="$curr_theme">
< <input type="hidden" name="mode" value="catedit">};
---
> <input type="hidden" name="item" value="$item" />
> <input type="hidden" name="theme" value="$curr_theme" />
> <input type="hidden" name="mode" value="catedit" />};
385c383
< $value = qq| <TEXTAREA name="$block->{bid}" cols="60" rows="20" wrap="soft">$block->{value}</TEXTAREA> <INPUT type="hidden" name="inform_$block->{bid}" value="1"> |;
---
> $value = qq| <textarea name="$block->{bid}" cols="60" rows="20" wrap="soft">$block->{value}</textarea> <input type="hidden" name="inform_$block->{bid}" value="1" /> |;
Index: SiteControls.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Admin/SiteControls.pm,v
retrieving revision 1.8
retrieving revision 1.9
diff -r1.8 -r1.9
18a19,20
>
> my $item = $S->{CGI}->param('item');
22c24
< my $category = $S->{CGI}->param('cat') || 'Add New';
---
> my $mode = $S->{CGI}->param('mode') || 'Add New';
55,58c57,62
< if( $save && $save eq 'Save' && ! $delete) {
< $update_msg = $S->_save_var_changes( \@var_array, $category );
< } elsif( $save && $save eq 'Save' && $delete ) {
< $update_msg = $S->_delete_var();
---
> if ($save && $save eq 'Save') {
> if ($delete) {
> $update_msg = $S->_delete_var();
> } else {
> $update_msg = $S->_save_var_changes(\@var_array, $mode, $item);
> }
67c71
< if( $category eq 'Add New' ) {
---
> if ($mode eq 'Add New' || $mode eq 'edit') {
69c73
< $form_body = $S->_make_newvar_tool( \@var_array, $edit );
---
> $form_body = $S->_make_newvar_tool( \@var_array, $edit, $mode, $item );
72c76
< $form_body = $S->_make_var_table( \@var_array, $category );
---
> $form_body = $S->_make_var_table( \@var_array, $item );
77c81
< $content =~ s/%%category%%/$category/g;
---
> $content =~ s/%%category%%/$item/g;
92c96,98
<
---
> my $mode = shift;
> my $item = shift;
>
106a113,114
>
> $v = $item if $v eq '';
127,128c135,138
< <SELECT NAME="var" SIZE=1>
< <OPTION VALUE="new">Add New Variable};
---
> <input type="hidden" name="mode" value="edit" />
> <input type="hidden" name="item" value="$v" />
> <select name="var" size="1">
> <option value="new">Add New Variable</option>};
135c145,146
< if( $var->{name} eq $S->{CGI}->param('var') && $edit && $edit eq 'Get' ) {
---
> # if( $var->{name} eq $S->{CGI}->param('var') && $edit && $edit eq 'Get' ) {
> if( $var->{name} eq $v && (($edit && $edit eq 'Get') || $mode eq 'edit')) {
139c150
< $description = $var->{description};
---
> $description = $var->{description};
144c155
< $selected = $var->{name} eq $name ? 'selected' : '';
---
> $selected = $var->{name} eq $name ? 'selected="selected"' : '';
146c157
< <OPTION VALUE="$var->{name}" $selected>$var->{name} |;
---
> <option value="$var->{name}" $selected>$var->{name}</option> |;
149c160
< $varselect .= "</SELECT>";
---
> $varselect .= "</select>";
154c165
< <SELECT NAME="catsel" SIZE=3 multiple>
---
> <select name="catsel" size="3" multiple="multiple">
159c170
< my $selected = ( $category =~ /$cat/ ? 'selected' : '' );
---
> my $selected = ( $category =~ /$cat/ ? 'selected="selected"' : '' );
162c173
< <OPTION VALUE="$cat" $selected>$cat|;
---
> <option value="$cat" $selected>$cat|;
164c175
< $catselect .= '</SELECT>';
---
> $catselect .= '</select>';
170c181
< $bselect = 'selected';
---
> $bselect = 'selected="selected"';
172c183
< $nselect = 'selected';
---
> $nselect = 'selected="selected"';
174c185
< $taselect = 'selected';
---
> $taselect = 'selected="selected"';
179,184c190,195
< <SELECT NAME="type" SIZE=1>
< <OPTION VALUE="text">Text
< <OPTION VALUE="num" $nselect>Number
< <OPTION VALUE="bool" $bselect>Boolean
< <OPTION VALUE="tarea" $taselect>Textarea
< </SELECT> |;
---
> <select name="type" size="1">
> <option value="text">Text</option>
> <option value="num" $nselect>Number</option>
> <option value="bool" $bselect>Boolean</option>
> <option value="tarea" $taselect>Textarea</option>
> </select> |;
228c239
< $catrow =~ s/%%item_url%%/All/;
---
> $catrow =~ s/%%item_url%%/multi\/All/;
254c265
< $catrow =~ s/%%item_url%%/$urlcat/;
---
> $catrow =~ s/%%item_url%%/multi\/$urlcat/;
309,311c320,322
< my $checked = ($var->{value} == 1) ? 'checked' : '';
< $name = qq|<a href="%%rootdir%%/admin/vars?edit=Get;var=$var->{name}">$var->{name}</a>|;
< $value = qq|<INPUT type="checkbox" name="$var->{name}" value="1" $checked><INPUT type="hidden" name="inform_$var->{name}" value="1">|;
---
> my $checked = ($var->{value} == 1) ? 'checked="checked"' : '';
> $name = qq|<a href="%%rootdir%%/admin/vars/edit/$var->{name}">$var->{name}</a>|;
> $value = qq|<input type="checkbox" name="$var->{name}" value="1" $checked /><input type="hidden" name="inform_$var->{name}" value="1" />|;
322,323c333,334
< $name = qq|<a href="%%rootdir%%/admin/vars?edit=Get;var=$var->{name}">$var->{name}</a>|;
< $value = qq|<INPUT type="text" name="$var->{name}" value="$var->{value}" size="3"><INPUT type="hidden" name="inform_$var->{name}" value="1">|;
---
> $name = qq|<a href="%%rootdir%%/admin/vars/edit/$var->{name}">$var->{name}</a>|;
> $value = qq|<input type="text" name="$var->{name}" value="$var->{value}" size="3" /><input type="hidden" name="inform_$var->{name}" value="1" />|;
334,335c345,346
< $name = qq|<a href="%%rootdir%%/admin/vars?edit=Get;var=$var->{name}">$var->{name}</a>|;
< $value = qq|<INPUT type="text" name="$var->{name}" value="$var->{value}" size-"25"> <INPUT type="hidden" name="inform_$var->{name}" value="1">|;
---
> $name = qq|<a href="%%rootdir%%/admin/vars/edit/$var->{name}">$var->{name}</a>|;
> $value = qq|<input type="text" name="$var->{name}" value="$var->{value}" size="25" /> <input type="hidden" name="inform_$var->{name}" value="1" />|;
345,346c356,357
< $name = qq|<a href="%%rootdir%%/admin/vars?edit=GET;var=$var->{name}">$var->{name}</a>|;
< $value = qq|<INPUT type="hidden" name="inform_$var->{name}" value="1"><TEXTAREA name="$var->{name}" cols="60" rows="20" wrap="soft">$var->{value}</TEXTAREA>|;
---
> $name = qq|<a href="%%rootdir%%/admin/vars/edit/$var->{name}">$var->{name}</a>|;
> $value = qq|<input type="hidden" name="inform_$var->{name}" value="1" /><textarea name="$var->{name}" cols="60" rows="20" wrap="soft">$var->{value}</textarea>|;
357c368,370
< $content = "
---
> $content = qq|
> <input type="hidden" name="item" value="$category" />
> <input type="hidden" name="mode" value="catedit" />
362c375
< ";
---
> |;
412c425
<
---
>
426c439
< $update_msg = qq|<FONT color="green">$var_to_del deleted.</FONT><BR>\n Note: the var you just deleted will still be in the list, due to caching. It will not be there the next time you reload this page, however. |;
---
> $update_msg = qq|<font color="green">$var_to_del deleted.</font><br />\n Note: the var you just deleted will still be in the list, due to caching. It will not be there the next time you reload this page, however. |;
435d447
<
440c452,453
< my $category = shift;
---
> my $mode = shift;
> my $item = shift;
449,450c462
< if( $category eq 'Add New' ) {
<
---
> if( $mode eq 'Add New' || $mode eq 'edit' ) {
612c624
< if ( $category ne 'Add New' and $varlist ne '' ) {
---
> if ( $mode ne 'Add New' and $varlist ne '' ) {
614c626
< } elsif( $category eq 'Add New' ) {
---
> } elsif( $mode eq 'Add New' ) {
Index: EditUser.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Admin/EditUser.pm,v
retrieving revision 1.130
retrieving revision 1.131
diff -r1.130 -r1.131
33c33
<
---
>
38,39c38,44
< } elsif (!$uid && !$nick) {
< $uid = $S->{UID};
---
> # we might not need to know the nick, but we need to see if the user
> # exists. finding the nick from the uid accomplishes this
> } elsif (!$nick && $uid) {
> $nick = $S->get_nick_from_uid($uid);
> } else {
> $uid = $S->{UID};
> $nick = $S->{NICK};
42c47
< unless ($uid) {
---
> unless ($uid && $nick) {
50c55
<
---
>
167,168d171
< my $file_counter = 2;
< my $file_total_count = 0;
182,185c185,186
<
< $file_total_count = (scalar @files) - 2;
< while ($file_counter < ($file_total_count + 2) ) {
< my $file_name = $files[$file_counter];
---
> my $file_total_count = scalar @files;
> foreach my $file_name (@files) {
193d193
< $file_counter++;
195c195
< $file_total_count = 0 if $file_total_count < 0;
---
>
256c256
< $user_tools = qq|%%norm_font%%${nick}'s uid is <b>$uid</b> [<A HREF="%%rootdir%%/?op=user;tool=prefs;uid=$uid">Edit User</A>]%%end_norm_font%%|;
---
> $user_tools = qq|%%norm_font%%${nick}'s uid is <b>$uid</b> [<A HREF="%%rootdir%%/user/uid:$uid/prefs">Edit User</A>]%%end_norm_font%%|;
388c388
<
---
>
Index: Topics.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Admin/Topics.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -r1.14 -r1.15
8c8
<
---
>
11,17c11,19
< my $rv = $S->write_topic;
< $error = qq|<B>$rv</B>| if $rv;
< } elsif ($update eq 'Delete') {
< my $rv = $S->delete_topic;
< my $badtid = $S->{CGI}->param('tid');
< unless ($rv) {
< $error = qq|<B>Error! While Deleting Topic "$badtid"</B>|;
---
> if ($S->{CGI}->param('delete')) {
> my $rv = $S->delete_topic;
> my $badtid = $S->{CGI}->param('tid');
> unless ($rv) {
> $error = qq|<b>Error! While Deleting Topic "$badtid"</b>|;
> }
> } else {
> my $rv = $S->write_topic;
> $error = qq|<b>$rv</b>| if $rv;
20c22
<
---
>
22c24
< <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>|;
---
> <table border="0" cellpadding="0" cellspacing="0" width="100%">|;
27,34c29,36
< <TR>
< <TD COLSPAN=2 BGCOLOR="%%title_bgcolor%%">%%title_font%%<B>Edit Topics</B>%%title_font_end%%</TD>
< </TR>
< <TR>
< <TD COLSPAN=2>%%norm_font%%$error%%norm_font_end%%</TD></TR>
< <TR>
< <TD valign="top">$editform</TD>
< <TD valign="top">|;
---
> <tr>
> <td colspan="2" bgcolor="%%title_bgcolor%%">%%title_font%%<b>Edit Topics</b>%%title_font_end%%</td>
> </tr>
> <tr>
> <td colspan="2">%%norm_font%%$error%%norm_font_end%%</td></tr>
> <tr>
> <td valign="top">$editform</td>
> <td valign="top">|;
37,38c39,40
< <TABLE BORDER=0 CELPADDING=3 align="center">
< <TR>|;
---
> <table border="0" cellpadding"3" align="center">
> <tr>|;
55,57c57,59
< <TD align="center">
< <A HREF="%%rootdir%%/?op=admin;tool=topics;tid=$tidlink"><IMG SRC="%%imagedir%%%%topics%%/$topic->{image}" BORDER=0 HEIGHT="$topic->{height}" WIDTH="$topic->{width}" ALT="$topic->{alttext}"><BR>$topic->{tid}</A>
< </TD>
---
> <td align="center">
> <a href="%%rootdir%%/?op=admin;tool=topics;tid=$tidlink"><img src="%%imagedir%%%%topics%%/$topic->{image}" border="0" height="$topic->{height}" width="$topic->{width}" alt="$topic->{alttext}"><br>$topic->{tid}</a>
> </td>
62c64
< </TR><TR>|;
---
> </tr><tr>|;
69c71
< </TR></TABLE></TD></TR>|;
---
> </tr></table></td></tr>|;
71c73
< </TABLE></FORM>|;
---
> </table></form>|;
107,120c109,121
< <FORM NAME="edittopics" ACTION="%%rootdir%%/" METHOD="POST">
< <INPUT TYPE="hidden" NAME="op" VALUE="admin">
< <INPUT TYPE="hidden" NAME="tool" VALUE="topics">
< <INPUT TYPE="hidden" NAME="tidold" VALUE="$tidold">
< TID:<BR>
< <INPUT type="text" name="tid" value="$tid" maxlength="20"><BR>
< Dimensions (w x h)<BR>
< <INPUT type="text" name="width" value="$topic->{width}" size="4" maxlength="11">
< <INPUT type="text" name="height" value="$topic->{height}" size="4" maxlength="11"><BR>
< Alt Text<BR>
< <INPUT type="text" name="alttext" value="$topic->{alttext}" maxlength="40"><BR>
< Image Name<BR>
< <INPUT type="text" name="image" value="$topic->{image}" maxlength="30"><BR>
< <INPUT type="submit" name="update" value="Write">|;
---
> <form name="edittopics" action="%%rootdir%%/" method="POST">
> <input type="hidden" name="op" value="admin" />
> <input type="hidden" name="tool" value="topics" />
> <input type="hidden" name="tidold" value="$tidold" />
> TID:<br />
> <input type="text" name="tid" value="$tid" maxlength="20" /><br />
> Dimensions (w x h)<br />
> <input type="text" name="width" value="$topic->{width}" size="4" maxlength="11" />
> <input type="text" name="height" value="$topic->{height}" size="4" maxlength="11" /><br />
> Alt Text<br />
> <input type="text" name="alttext" value="$topic->{alttext}" maxlength="40" /><br />
> Image Name<br />
> <input type="text" name="image" value="$topic->{image}" maxlength="30" /><br />|;
123c124,127
< $form .= qq| <br><br>Tid to move stories posted under "$tid" to:<br>|;
---
> $form .= qq|
> <hr align="left" width="50%" noshade="noshade" />
> Delete? <input type="checkbox" name="delete" value="1" /><br />
> Tid to move stories posted under "$tid" to on delete:<br />|;
126c130
< $form .= qq| <SELECT NAME="changeto_tid">
---
> $form .= qq| <select name="changeto_tid">
128,129c132,133
< </SELECT>
< <br><INPUT type="submit" name="update" value="Delete"> |;
---
> </select><br />
> <hr align="left" width="50%" noshade="noshade"/><br />|;
132c136,138
< $form .= qq|%%norm_font_end%%</FORM>|;
---
> $form .= qq|
> <input type="submit" name="update" value="Write" />
> %%norm_font_end%%</form>|;
186,189d191
<
< #
< #
< #
253,256d254
<
< #
< #
< #
273c271
< <OPTION VALUE="$topic->{tid}">$topic->{tid}|;
---
> <option value="$topic->{tid}">$topic->{tid}</option>|;
Index: Users.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Admin/Users.pm,v
retrieving revision 1.54
retrieving revision 1.55
diff -r1.54 -r1.55
245c245
< $is_advertiser = 1 if( $tool eq 'advertiser' ||
---
> $is_advertiser = 1 if ($tool eq 'advertiser' ||
252c252
< <TABLE CELLPADDING=2 CELLSPACING=2 BORDER=0>|;
---
> <table cellpadding="2" cellspacing="2" border="0">|;
298c298
< if( $is_advertiser ) {
---
> if ($is_advertiser) {
309,311c309,314
<
< my $rv = $S->create_user_step_1($uname, $pass1, $email, $is_advertiser) if $really_new_user;
< $S->store_advertiser_info($uname, $email) if($is_advertiser && $rv == 1);
---
> my $rv;
> if ($really_new_user) {
> $rv = $S->create_user_step_1($uname, $pass1, $email);
> } elsif ($is_advertiser) {
> $rv = $S->store_advertiser_info($S->{UID});
> }
315,316c318,319
< $S->run_hook('user_new', $uname);
<
---
> $S->run_hook('user_new', $uname, $is_advertiser);
>
319,321c322,324
< <TABLE CELLPADDING=2 CELLSPACING=2 BORDER=0>
< <TR>
< <TD colspan="2">%%norm_font%%<H2>User Created!</H2><P>
---
> <table cellpadding="2" cellspacing="2" border="0">
> <tr>
> <td colspan="2">%%norm_font%%<h2>User Created!</h2><p>
324c327
< <P>
---
> <p>
327,331c330,335
< </TD>
< </TR>
< </TABLE>|;
<
< $return_page =~ s/%%EMAIL%%/$email/g;
---
> </td>
> </tr>
> </table>|;
>
> my $user_email = $email || $S->get_email_from_uid($S->{UID});
> $return_page =~ s/%%EMAIL%%/$user_email/g;
346,355c350,359
< <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>
---
> <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>
371,372c375,376
< <TR>
< <TD>
---
> <tr>
> <td>
376,380c380,384
< </TD>
< <TD align="right">
< %%norm_font%%<INPUT TYPE="submit" VALUE="Create Account!" SIZE=30></FORM>%%norm_font_end%%
< </TD>
< </TR>} unless( $no_create );
---
> </td>
> <td align="right">
> %%norm_font%%<input type="submit" value="Create Account!" size="30" /></form>%%norm_font_end%%
> </td>
> </tr>} unless( $no_create );
385,386c389,390
< <TR><TD colspan="2"> </TD></TR>
< </TABLE>|;
---
> <tr><td colspan="2"> </td></tr>
> </table>|;
467c471
< my ($nick, $pass, $email, $is_advertiser) = @_;
---
> my ($nick, $pass, $email) = @_;
473c477
< my $default_group = $S->_get_default_group($is_advertiser);
---
> my $default_group = $S->_get_default_group;
547,563c551
< my $uname = shift;
< my $email = shift;
<
< #my $f_uname = $S->{DBH}->quote($uname);
< #my $f_email = $S->{DBH}->quote($email);
<
< #my ($rv,$sth) = $S->db_select({
< # DEBUG => 0,
< # FROM => 'users',
< # WHAT => 'uid',
< # WHERE => "nickname = $f_uname",
< # });
<
< #return q|<br>Couldn't create new advertiser account for $uname| unless $rv;
<
< #my $uid = $sth->fetchrow_hashref->{uid};
< my $uid = $S->get_uid_from_nick($uname);
---
> my $uid = shift;
577,578c565,577
< return q|<br>Couldn't create new advertiser account for $uname| unless $rv;
<
---
> return qq|<br />Couldn't create new advertiser account for $uid| unless $rv;
>
> # find the advertiser's group name
> my $f_group = $S->dbh->quote($S->_get_default_group(1));
> ($rv, $sth) = $S->db_update({
> WHAT => 'users',
> SET => "perm_group = $f_group",
> WHERE => "uid = $uid"
> });
> $sth->finish;
>
> return qq|<br />Couldn't upgrade to advertiser group for $uid| unless $rv;
>
Index: Logging.pm
===================================================================
RCS file: /cvs/scoop/scoop/lib/Scoop/Admin/Logging.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -r1.4 -r1.5
177c177
< <li><a href="%%rootdir%%/admin/vars?edit=Get;var=use_logging">Change logging level</a></li>| if $S->have_perm('edit_vars');
---
> <li><a href="%%rootdir%%/admin/vars/edit/use_logging">Change logging level</a></li>| if $S->have_perm('edit_vars');