my $form = CGI::FormBuilder->new(
title => "signin",
name => "signin",
- header => 1,
charset => "utf-8",
method => 'POST',
required => 'NONE',
error($@) if $@;
my $form = CGI::FormBuilder->new(
fields => \@fields,
- header => 1,
charset => "utf-8",
method => 'POST',
validate => {
else {
# save page
check_canedit($page, $q, $session);
- if (! -e "$config{srcdir}/$file" &&
- $form->field("do") ne "create") {
+
+ my $exists=-e "$config{srcdir}/$file";
+
+ if ($form->field("do") ne "create" &&
+ ! $exists && ! -e "$config{underlaydir}/$file") {
$form->tmpl_param("page_gone", 1);
$form->field(name => "do", value => "create", force => 1);
$form->tmpl_param("page_select", 0);
print misctemplate($form->title, $form->render(submit => \@buttons));
return;
}
- elsif (-e "$config{srcdir}/$file" &&
- $form->field("do") eq "create") {
+ elsif ($form->field("do") eq "create" && $exists) {
$form->tmpl_param("creation_conflict", 1);
$form->field(name => "do", value => "edit", force => 1);
$form->tmpl_param("page_select", 0);
$message=$form->field('comments');
}
- if ($form->field("do") eq "create") {
+ if (! $exists) {
rcs_add($file);
}