From 220c179a65fbbc973f1b20eecbd61b51d6a2942f Mon Sep 17 00:00:00 2001 From: Tony Cook Date: Wed, 8 Oct 2003 05:11:38 +0000 Subject: [PATCH] 0.14_08 commit --- INSTALL.pod | 12 +++ site/cgi-bin/modules/BSE/AdminSiteUsers.pm | 93 ++++++++++++++++++++- site/cgi-bin/modules/BSE/Edit/Article.pm | 2 + site/cgi-bin/modules/BSE/Sort.pm | 2 +- site/cgi-bin/modules/BSE/Template.pm | 2 +- site/cgi-bin/modules/BSE/Util/Tags.pm | 29 +++++++ site/cgi-bin/modules/DevHelp/Tags.pm | 2 +- site/cgi-bin/modules/SiteUser.pm | 4 +- site/cgi-bin/modules/Squirrel/Template.pm | 3 +- site/cgi-bin/printable.pl | 17 ++-- site/docs/bse.pod | 81 +++++++++++++++++++ site/docs/custom.pod | 94 ++++++++++++++++++++++ site/docs/templates.pod | 8 ++ site/templates/admin/edit_steps.tmpl | 12 +-- site/templates/admin/users/add.tmpl | 19 ++++- site/templates/admin/users/edit.tmpl | 19 ++++- site/templates/admin/users/list.tmpl | 6 +- site/templates/user/nopassword_base.tmpl | 2 +- t/t00smoke.t | 6 +- test.cfg | 15 +++- 20 files changed, 394 insertions(+), 34 deletions(-) create mode 100644 site/docs/custom.pod diff --git a/INSTALL.pod b/INSTALL.pod index dd098aaa..abf9b348 100644 --- a/INSTALL.pod +++ b/INSTALL.pod @@ -64,8 +64,20 @@ Apache::Session =item * +Storable (and this requires Log::Agent sometimes) + +=item * + HTML::Parser +=item * + +URI::Escape + +=item * + +HTML::Entities + =back and their dependants. If you use the CPAN shell to install these then diff --git a/site/cgi-bin/modules/BSE/AdminSiteUsers.pm b/site/cgi-bin/modules/BSE/AdminSiteUsers.pm index 151df57e..aaf01eb9 100644 --- a/site/cgi-bin/modules/BSE/AdminSiteUsers.pm +++ b/site/cgi-bin/modules/BSE/AdminSiteUsers.pm @@ -6,6 +6,7 @@ use SiteUsers; use BSE::Util::Iterate; use BSE::Util::DynSort qw(sorter tag_sorthelp); use BSE::Util::SQL qw/now_datetime/; +use BSE::SubscriptionTypes; use Util; my %actions = @@ -109,6 +110,37 @@ sub tag_if_flag_set { return index($flags, $args[0]) >= 0; } +sub tag_if_subscribed_register { + my ($cgi, $cfg, $subs, $rsub_index) = @_; + + return 0 if $$rsub_index < 0 or $$rsub_index >= @$subs; + my $sub = $subs->[$$rsub_index]; + if ($cgi->param('checkedsubs')) { + my @checked = $cgi->param('subscription'); + return grep($sub->{id} == $_, @checked) != 0; + } + else { + my $def = $cfg->entryBool('site users', 'subscribe_all', 0); + + return $cfg->entryBool('site users', "subscribe_$sub->{id}", $def); + } +} + +sub tag_if_subscribed { + my ($cgi, $subs, $rsub_index, $usersubs) = @_; + + $$rsub_index >= 0 && $$rsub_index < @$subs + or return; + + my $sub = $subs->[$$rsub_index]; + if ($cgi->param('checkedsubs')) { + my @checked = $cgi->param('subscription'); + return grep($sub->{id} == $_, @checked) != 0; + } + + $usersubs->{$sub->{id}}; +} + sub req_edit { my ($class, $req, $msg, $errors) = @_; @@ -140,6 +172,11 @@ sub req_edit { } } + my @subs = grep $_->{visible}, BSE::SubscriptionTypes->all; + my $sub_index; + require BSE::SubscribedUsers; + my @usersubs = BSE::SubscribedUsers->getBy(userId=>$siteuser->{id}); + my %usersubs = map { $_->{subId}, $_ } @usersubs; my %acts; %acts = ( @@ -152,6 +189,10 @@ sub req_edit { ifRequired => [ \&tag_if_required, $req->cfg ], $it->make_iterator([ \&iter_flags, $req->cfg], 'flag', 'flags'), ifFlagSet => [ \&tag_if_flag_set, $siteuser->{flags} ], + $it->make_iterator(undef, 'subscription', 'subscriptions', \@subs, + \$sub_index), + ifSubscribed => + [ \&tag_if_subscribed, $cgi, \@subs, \$sub_index, \%usersubs ], ); my $template = 'admin/users/edit'; @@ -189,7 +230,7 @@ sub req_save { my $saveemail; my $email = $cgi->param('email'); - if (defined $email) { + if (defined $email && $email ne $user->{email}) { if (!$email) { $errors{email} = "Email is a required field"; } @@ -285,6 +326,10 @@ sub req_save { if $cgi->param('saveDisabled') && !defined $cgi->param('disabled'); $user->save; + if ($cgi->param('checkedsubs')) { + $class->save_subs($req, $user); + } + my $custom = Util::custom_class($cfg); $custom->siteusers_changed($cfg); @@ -299,7 +344,7 @@ sub req_save { } else { my @subs = $user->subscriptions; - if (@subs && $newemail) { + if (@subs && !$user->{confirmed}) { $sent_ok = $user->send_conf_request($req->cgi, $req->cfg, \$code, \$msg); } } @@ -349,6 +394,10 @@ sub req_addform { } } + my $it = BSE::Util::Iterate->new; + + my @subs = grep $_->{visible}, BSE::SubscriptionTypes->all; + my $sub_index; my %acts; %acts = ( @@ -358,6 +407,12 @@ sub req_addform { message => $msg, error_img => [ \&tag_error_img, $req->cfg, $errors ], ifRequired => [ \&tag_if_required, $req->cfg ], + $it->make_iterator([ \&iter_flags, $req->cfg], 'flag', 'flags'), + ifFlagSet => 0, + $it->make_iterator(undef, 'subscription', 'subscriptions', \@subs, + \$sub_index), + ifSubscribed => + [ \&tag_if_subscribed_register, $cgi, $req->cfg, \@subs, \$sub_index ], ); my $template = 'admin/users/add'; @@ -489,12 +544,18 @@ sub req_add { $user = SiteUsers->add(@user{@cols}); }; if ($user) { - # my $subs = $self->_save_subs($user, $session, $cfg, $cgi); + my $subs = $class->save_subs($req, $user); my $msg; if ($nopassword) { my $code; my $sent_ok = $user->send_conf_request($cgi, $cfg, \$code, \$msg); } + else { + if ($subs) { + my $code; + my $sent_ok = $user->send_conf_request($cgi, $cfg, \$code, \$msg); + } + } my $custom = Util::custom_class($cfg); $custom->siteusers_changed($cfg); @@ -512,4 +573,30 @@ sub req_add { } } +sub save_subs { + my ($class, $req, $user) = @_; + + my @subs = grep $_->{visible}, BSE::SubscriptionTypes->all; + my %subs = map { $_->{id} => $_ } @subs; + my @subids = $req->cgi->param('subscription'); + $user->removeSubscriptions; + require BSE::SubscribedUsers; + my @cols = BSE::SubscribedUser->columns; + shift @cols; + my $found = 0; + for my $id (@subids) { + if ($subs{$id}) { + my %usersub; + $usersub{subId} = $id; + $usersub{userId} = $user->{id}; + + BSE::SubscribedUsers->add(@usersub{@cols}); + ++$found; + } + } + + $found; +} + + 1; diff --git a/site/cgi-bin/modules/BSE/Edit/Article.pm b/site/cgi-bin/modules/BSE/Edit/Article.pm index ee2bd86e..8bef4bab 100644 --- a/site/cgi-bin/modules/BSE/Edit/Article.pm +++ b/site/cgi-bin/modules/BSE/Edit/Article.pm @@ -481,6 +481,8 @@ sub tag_step_kid { my $kid = $allkids->[$$rallkid_index] or return ''; + $step_kids->{$kid->{id}} + or return; #print STDERR "found kid (want $arg): ", Dumper $kid; escape_html($step_kids->{$kid->{id}}{$arg}); } diff --git a/site/cgi-bin/modules/BSE/Sort.pm b/site/cgi-bin/modules/BSE/Sort.pm index b65aee71..ffbbfd6a 100644 --- a/site/cgi-bin/modules/BSE/Sort.pm +++ b/site/cgi-bin/modules/BSE/Sort.pm @@ -21,7 +21,7 @@ sub bse_sort { while ($opts) { if ($opts =~ s/^\s*sort=//) { while ($opts =~ s/^([+-]?)(\w+)//) { - my ($dir, $field) = @_; + my ($dir, $field) = ($1, $2); if ($types->{$field} && $types->{$field} eq 'n') { push(@sorts, $dir eq '-' ? sub { $b->{$field} <=> $a->{$field} } : sub { $a->{$field} <=> $b->{$field} }); diff --git a/site/cgi-bin/modules/BSE/Template.pm b/site/cgi-bin/modules/BSE/Template.pm index 7231c079..8bd6caf8 100644 --- a/site/cgi-bin/modules/BSE/Template.pm +++ b/site/cgi-bin/modules/BSE/Template.pm @@ -100,7 +100,7 @@ sub template_dirs { my ($class, $cfg) = @_; ref($cfg) eq 'BSE::Cfg' - or confess "Invalid cfg supplied\n"; + or confess "Invalid cfg $cfg supplied\n"; my $base = $cfg->entryVar('paths', 'templates'); my $local = $cfg->entry('paths', 'local_templates'); diff --git a/site/cgi-bin/modules/BSE/Util/Tags.pm b/site/cgi-bin/modules/BSE/Util/Tags.pm index c161ae3d..0d1efe15 100644 --- a/site/cgi-bin/modules/BSE/Util/Tags.pm +++ b/site/cgi-bin/modules/BSE/Util/Tags.pm @@ -36,9 +36,36 @@ sub _get_parms { @out; } +sub iter_cfgsection { + my ($cfg, $args) = @_; + + $args =~ s/^\s*\"([^\"]+)\"\s*// + or return; + my $section = $1; + + my %entries = $cfg->entries($section); + my @entries = map +{ key => $_, value => $entries{$_} }, keys %entries; + + my %types; + + # guess types + unless (grep /\D/, keys %entries) { + $types{key} = 'n'; + } + unless (grep /\D/, values %entries) { + $types{value} = 'n'; + } + + require BSE::Sort; + + return BSE::Sort::bse_sort(\%types, $args, @entries); +} + sub static { my ($class, $acts, $cfg) = @_; + require BSE::Util::Iterate; + my $it = BSE::Util::Iterate->new; return ( date => @@ -133,6 +160,7 @@ sub static { defined $def or $def = ''; $cfg->entry($section, $key, $def); }, + $it->make_iterator([ \&iter_cfgsection, $cfg ], 'cfgentry', 'cfgsection'), kb => sub { my ($arg, $acts, $name, $templater) = @_; @@ -218,6 +246,7 @@ sub static { $out =~ s/\b(\w)/\U$1/g; $out; }, + _format => sub { my ($value, $fmt) = @_; diff --git a/site/cgi-bin/modules/DevHelp/Tags.pm b/site/cgi-bin/modules/DevHelp/Tags.pm index 1299c8c0..8be29f92 100644 --- a/site/cgi-bin/modules/DevHelp/Tags.pm +++ b/site/cgi-bin/modules/DevHelp/Tags.pm @@ -329,7 +329,7 @@ sub get_parms { print STDERR "** Entered get_parms -$args-\n" if DEBUG_GET_PARMS; my @out; - while ($args) { + while (length $args) { if ($args =~ s/^\s*\[\s*(\w+) ( (?:\s+ diff --git a/site/cgi-bin/modules/SiteUser.pm b/site/cgi-bin/modules/SiteUser.pm index 6f3ab78b..74f36372 100644 --- a/site/cgi-bin/modules/SiteUser.pm +++ b/site/cgi-bin/modules/SiteUser.pm @@ -92,6 +92,7 @@ sub send_conf_request { } # check for existing confirmations + require BSE::EmailRequests; my $confirm = BSE::EmailRequests->getBy(genEmail=>$checkemail); if ($confirm) { if ($confirm->{unackedConfMsgs} >= MAX_UNACKED_CONF_MSGS) { @@ -132,7 +133,8 @@ sub send_conf_request { my $email_template = $nopassword ? 'user/email_confirm_nop' : 'user/email_confirm'; my $body = BSE::Template->get_page($email_template, $cfg, \%confacts); - + + require BSE::Mail; my $mail = BSE::Mail->new(cfg=>$cfg); my $subject = $cfg->entry('confirmations', 'subject') || 'Subscription Confirmation'; diff --git a/site/cgi-bin/modules/Squirrel/Template.pm b/site/cgi-bin/modules/Squirrel/Template.pm index e252c959..0946ad75 100644 --- a/site/cgi-bin/modules/Squirrel/Template.pm +++ b/site/cgi-bin/modules/Squirrel/Template.pm @@ -9,6 +9,8 @@ $VERSION="0.07"; sub new { my ($class, %opts) = @_; + $opts{errout} = \*STDOUT; + return bless \%opts, $class; } @@ -95,7 +97,6 @@ sub perform { $args = '' unless defined $args; - #print STDERR "perform $func $args\n"; my $value = $self->low_perform($acts, $func, $args, $orig); unless (defined $value) { diff --git a/site/cgi-bin/printable.pl b/site/cgi-bin/printable.pl index 98c6f2e1..70ed3660 100755 --- a/site/cgi-bin/printable.pl +++ b/site/cgi-bin/printable.pl @@ -48,7 +48,7 @@ else { next unless $work =~ /\S/; $template = $work; $file = file_from_template($work); - last if -e $file; + last if $file && -e $file; } -e $file or error_page("No template available for this page"); $type = BSE::Template->html_type($cfg); @@ -69,12 +69,19 @@ sub error_page { my ($error) = @_; $error ||= "Unknown error"; - require 'Generate.pm'; - my $gen = Generate->new(); + my %article; + my @cols = Article->columns; + @article{@cols} = ('') x @cols; + $article{id} = -10; + $article{title} = "Error"; + $article{parentid} = -1; + + require Generate::Article; + my $gen = Generate::Article->new(cfg=>$cfg, top => \%article); my %acts; %acts = ( - $gen->baseActs('Articles', \%acts), + $gen->baseActs('Articles', \%acts, \%article), error => sub { CGI::escapeHTML($error) }, ); @@ -85,5 +92,5 @@ sub error_page { sub file_from_template { my ($template) = @_; - return BSE::Template->find_source($template, $cfg); + return BSE::Template->find_source("printable/$template", $cfg); } diff --git a/site/docs/bse.pod b/site/docs/bse.pod index d41fca2c..1d3acac9 100644 --- a/site/docs/bse.pod +++ b/site/docs/bse.pod @@ -10,6 +10,87 @@ Maybe I'll add some other bits here. =head1 CHANGES +=head2 0.14_08 + +=over + +=item * + +If the last value of a parsed tag parameter list was an unquoted 0, +the 0 was not passed to the tag for processing. + +=item * + +added the cfgsection iterator. + +=item * + +iterators that allowed sorting/filtering now actually sort on the +right value + +=item * + +the stepkid tag on edit pages now checks the article is a stepkid +before doing a hash lookup, preventing an undefined value warning + +=item * + +the admin/edit_steps template was using invalid article names in +ifUserCan checks + +=item * + +the flags iterator and ifFlagSet tags weren't available on the add +site user page. + +=item * + +saving a site user in nopassword mode would result in a validation +error if the email field was present but no confirmation email field +was present. The confirmation email field is now only required if the +supplied email address is different from that currently stored for the +user. + +=item * + +changing the user's email address in nopassword mode (and possibly in +normal mode with subscriptions) resulted in a server error. + +=item * + +printable.pl wasn't looking in the printable/ directory for it's +templates (#298) + +=item * + +printable.pl's error reporting wasn't supplying the config value to +the templater + +=item * + +printable.pl's error page now uses the article templater rather than +the base templater + +=item * + +added smoke test for errors from printable.pl + +=item * + +added smoke test for admin/siteusers.pl + +=item * + +trying to call "site users" "site members" now. + +=item * + +you can now select subscriptions for a site member with the admin +tool. This still results in a confirmation email if the user hasn't +been confirmed at their email address. + +=back + =head2 0.14_07 You will need to run upgrade_mysql.pl for this release. diff --git a/site/docs/custom.pod b/site/docs/custom.pod new file mode 100644 index 00000000..b5bdede2 --- /dev/null +++ b/site/docs/custom.pod @@ -0,0 +1,94 @@ +=head1 NAME + +custom.pod - guide to customizing BSE + +=head1 SYNOPSIS + +A guide to customizing BSE, including through templating, +configuration and code. + +=head1 DESCRIPTION + +BSE can be customized in several ways: + +=over + +=item * + +templates - this is the most common form of customization, and the one +that most sites will do. The tags are mostly documented in +L, with some tag documentation left by the wayside as +new tags are added. + +=item * + +configuration - + +=back + +=head1 TEMPLATING + +See L for information on customizing templates. + +=head1 CONFIGURATION + +You can configure several types of information in BSE: + +=over + +=item * + +article defaults, based on parent id or level + +=item * + +flags available for articles/catalogs/products + +=item * + +flags available for site users + +=item * + +available payment types + +=item * + +template name translation + +=back + +and more. + +=head2 Article defaults + +You can set default values for article fields by either setting a key +in C<< [children of I] >> to set the default for children +of the given I or in C<< [level I] >>, where +I is the level of the article. + +Currently these values are just used when the value isn't supplied by +the article creation form, for example when the user doesn't have +access to edit them, but they will fill in the defaults on the add +form in the future. + +To set the default *** + +=head1 CODE + +=head1 ADMIN CUSTOMIZATION + +=head2 Permission Sets + +=head2 Reports + +=head1 AUTHOR + +Tony Cook + +=head1 REVISION + +$Revision$ + +=cut + diff --git a/site/docs/templates.pod b/site/docs/templates.pod index c30819f1..b2cc4b1c 100644 --- a/site/docs/templates.pod +++ b/site/docs/templates.pod @@ -697,6 +697,14 @@ I and upper-casing the first letter of I respectively. Converts the first letter of every word in I to uppercase. +=item iterator ... cfgsection "I
" I + +=item cfgentry I + +Iterates over the key definitions in a section of the configuration +file. Possible values for field are C or C. The section +name must be quoted with double quotes. + =back =head2 Base tags diff --git a/site/templates/admin/edit_steps.tmpl b/site/templates/admin/edit_steps.tmpl index 62f23614..1822ac0f 100644 --- a/site/templates/admin/edit_steps.tmpl +++ b/site/templates/admin/edit_steps.tmpl @@ -41,12 +41,12 @@ <:kid id:> <:kid title:> <:ifStepKid:> - <:if UserCan edit_stepkid_save:article,edit_stepparent_save:[stepkid childId]:>" size="10" /><:or UserCan:><:date "%d/%m/%Y" stepkid release:><:eif UserCan:> + <:if UserCan edit_stepkid_save:article,edit_stepparent_save:kid :>" size="10" /><:or UserCan:><:date "%d/%m/%Y" stepkid release:><:eif UserCan:> <:or:> <:eif:> <:ifStepKid:> - <:if UserCan edit_stepkid_save:article,edit_stepparent_save:[stepkid childId]:>" size="10" /><:or UserCan:><:date "%d/%m/%Y" stepkid expire:><:eif UserCan:> + <:if UserCan edit_stepkid_save:article,edit_stepparent_save:kid :>" size="10" /><:or UserCan:><:date "%d/%m/%Y" stepkid expire:><:eif UserCan:> <:or:> <:eif:> - <:edit kid Edit:> <:ifStepKid:><:if UserCan edit_stepkid_delete:article,edit_stepparent_delete:[stepkid childId] :>Delete<:or UserCan:><:eif UserCan:><:or:><:eif:> + <:edit kid Edit:> <:ifStepKid:><:if UserCan edit_stepkid_delete:article,edit_stepparent_delete:kid :>Delete<:or UserCan:><:eif UserCan:><:or:><:eif:> <:movestepkid:> <:iterator end kids:> @@ -115,13 +115,13 @@ parentId:> <:stepparent_targ title:> - <:if UserCan edit_stepparent_save:article,edit_stepkid_save:[stepparent parentId]:>" size="10" /><:or UserCan:><:date "%d/%m/%Y" stepparent release:><:eif UserCan:> + <:if UserCan edit_stepparent_save:article,edit_stepkid_save:stepparent_targ :>" size="10" /><:or UserCan:><:date "%d/%m/%Y" stepparent release:><:eif UserCan:> - <:if UserCan edit_stepparent_save:article,edit_stepkid_save:[stepparent parentId]:>" size="10" /><:or UserCan:><:date "%d/%m/%Y" stepparent expire:><:eif UserCan:> + <:if UserCan edit_stepparent_save:article,edit_stepkid_save:stepparent_targ:>" size="10" /><:or UserCan:><:date "%d/%m/%Y" stepparent expire:><:eif UserCan:> Edit - <:if UserCan edit_stepkid_delete:[stepparent parentId],edit_stepparent_delete:article :>Delete <:or UserCan:><:eif UserCan:> + <:if UserCan edit_stepkid_delete:stepparent_targ,edit_stepparent_delete:article :>Delete <:or UserCan:><:eif UserCan:> <:movestepparent:> <:iterator end stepparents:> diff --git a/site/templates/admin/users/add.tmpl b/site/templates/admin/users/add.tmpl index 561c4d16..2029a1e7 100644 --- a/site/templates/admin/users/add.tmpl +++ b/site/templates/admin/users/add.tmpl @@ -1,8 +1,8 @@ -<:wrap admin/xbase.tmpl title=>"Add Site User":> -

Add Site User

+<:wrap admin/xbase.tmpl title=>"Add Site Member":> +

Add Site Member

| Admin menu | -Site users | +Site Members | Email |

<:ifMessage:> @@ -230,6 +230,19 @@ <:help editsiteuser flags:> <:error_img adminNotes:> <:or Flags:><:eif Flags:> +<:if Subscriptions:> + + Subscriptions: + + <:iterator begin subscriptions:> + checked="checked" <:or:><:eif:>/> <:subscription name:> + <:iterator separator subscriptions:> +
+ <:iterator end subscriptions:> + + <:help editsiteuser subscriptions:> + +<:or Subscriptions:><:eif Subscriptions:> diff --git a/site/templates/admin/users/edit.tmpl b/site/templates/admin/users/edit.tmpl index 06c51932..9ec067f0 100644 --- a/site/templates/admin/users/edit.tmpl +++ b/site/templates/admin/users/edit.tmpl @@ -1,8 +1,8 @@ -<:wrap admin/xbase.tmpl title=>"Edit Site User":> -

Edit Site User

+<:wrap admin/xbase.tmpl title=>"Edit Site Member":> +

Edit Site Member

| Admin menu | -Site users | +Site Members | Email |

<:ifMessage:> @@ -221,6 +221,19 @@ <:help editsiteuser flags:> <:error_img adminNotes:> <:or Flags:><:eif Flags:> +<:if Subscriptions:> + + Subscriptions: + + <:iterator begin subscriptions:> + checked="checked" <:or:><:eif:>/> <:subscription name:> + <:iterator separator subscriptions:> +
+ <:iterator end subscriptions:> + + <:help editsiteuser subscriptions:> + +<:or Subscriptions:><:eif Subscriptions:> <:if UserCan siteuser_changepw:> <:if Cfg "site users" nopassword:><:or Cfg:> diff --git a/site/templates/admin/users/list.tmpl b/site/templates/admin/users/list.tmpl index 3c373228..7ee11031 100644 --- a/site/templates/admin/users/list.tmpl +++ b/site/templates/admin/users/list.tmpl @@ -1,9 +1,9 @@ -<:wrap admin/xbase.tmpl title=>"Admin Site Users":> -

Admin Site Users

+<:wrap admin/xbase.tmpl title=>"Admin Site Members":> +

Admin Site Members

| Admin menu | <:if UserCan siteuser_add :> -Add User |<:or UserCan:><:eif UserCan:> +Add Member |<:or UserCan:><:eif UserCan:> <:ifMessage:>

<:message:>

<:or:><:eif:> diff --git a/site/templates/user/nopassword_base.tmpl b/site/templates/user/nopassword_base.tmpl index e0200e4b..66f734f9 100644 --- a/site/templates/user/nopassword_base.tmpl +++ b/site/templates/user/nopassword_base.tmpl @@ -17,7 +17,7 @@ href="<:script:>?show_register=1">register, or if you've lost the email containing your options link, ask us to send it - again..

+ again.

diff --git a/t/t00smoke.t b/t/t00smoke.t index ba5f84fa..ce0a39a6 100644 --- a/t/t00smoke.t +++ b/t/t00smoke.t @@ -3,7 +3,7 @@ use strict; use BSE::Test qw(make_ua ok fetch_ok base_url config); ++$|; -print "1..51\n"; +print "1..55\n"; my $baseurl = base_url; ok($baseurl =~ /^http:/, "basic check of base url"); my $ua = make_ua; @@ -60,3 +60,7 @@ fetch_ok($ua, "changepw", "$baseurl/cgi-bin/admin/changepw.pl", qr!Change Password|!i); fetch_ok($ua, "printable", "$baseurl/cgi-bin/printable.pl?id=5", qr!sidebar\s+subsection!i); +fetch_ok($ua, "printable error", "$baseurl/cgi-bin/printable.pl?id=5&template=foo", + qr!Invalid\s+template\s+name!i); +fetch_ok($ua, "siteusers", "$baseurl/cgi-bin/admin/siteusers.pl", + qr!Admin Site Members!i); diff --git a/test.cfg b/test.cfg index 88505f38..99fafc36 100644 --- a/test.cfg +++ b/test.cfg @@ -47,11 +47,11 @@ debug.cookies=0 site users.billing_on_main_opts=0 #site users.user_register=0 -paths.libraries=/home/tony/dev/bse/tandb_dealer/cvs/modules -paths.siteuser_passwd=/home/httpd/bsetest/data/supasswd -custom.user_auth=1 +#paths.libraries=/home/tony/dev/bse/tandb_dealer/cvs/modules +#paths.siteuser_passwd=/home/httpd/bsetest/data/supasswd +#custom.user_auth=1 product fields.retailPrice=Dealer Price Inc GST -paths.local_templates=/home/tony/dev/bse/tandb_dealer/cvs/templates +$paths.local_templates=/home/tony/dev/bse/tandb_dealer/cvs/templates shop.payment_types=1,2,10,11,12 payment type names.10=DirectDeposit payment type names.11=FaxProForma @@ -63,3 +63,10 @@ dealer.accountno=77777777 shop.display_facsimile=Fax Number site user flags.a=Access to private pages tandb custom.siteuser_include_flag=a + +#test.1=hello +#test.2=alpha +#test.10=beta +#test.100=gamma +#test.1000=delta + -- 2.39.2