Index: ossp-pkg/tabea/tabea.cgi RCS File: /v/ossp/cvs/ossp-pkg/tabea/tabea.cgi,v rcsdiff -q -kk '-r1.10' '-r1.11' -u '/v/ossp/cvs/ossp-pkg/tabea/tabea.cgi,v' 2>/dev/null --- tabea.cgi 2002/05/10 07:38:47 1.10 +++ tabea.cgi 2002/05/10 12:27:56 1.11 @@ -38,6 +38,9 @@ my $pwdfile = "./tabea.pw"; my $configsdir = "./tabea.d"; my $tabeauser = "tabea"; +my $dialog; +my $copy; +my $view; # establish my configuration my $MY = {}; @@ -123,33 +126,38 @@ "" . $cgi->endform; } -elsif ($form eq 'login') { +elsif ($dialog eq 'login') { # enter Select form &validpassword($username, $password, $pwdfile) || print STDOUT $cgi->redirect(-uri => $cgi->url(-full => 1), -type => "text/html"); + my $templatesfiles = &readdir($configsdir."/".$tabeauser); my $configsfiles = &readdir($configsdir."/".$username); my @templateshash = split(/ /,$templatesfiles); - my $templateslist = ""; + my $templateslist = "["; foreach (@templateshash) { $templateslist .= "'$_', "; } - # $templateslist .= "]"; - + chop($templateslist); + chop($templateslist); + $templateslist .= "]"; + # $page .= $cgi->startform( -method => "POST", -action => $cgi->url(-full => 1)) . $cgi->hidden(-name => 'form', -default => ['']) . # Begin with templates part - $page .= "Templates:

\n" . + "Templates:

\n" . + " Templateslist: $templateslist
" . "" . " " . @@ -157,10 +165,14 @@ "
" . " " . $cgi->scrolling_list( -name => 'templatelist', - -value => ['default', 'sample'], + # -value => ['default', 'sample'], + -value => '\$templateslist', -size => 2 ) . "
" . " " . + " " . " " . " " . + " " . " " . " " . "
" . "
" . $cgi->submit(-name => 'copy', -value => 'Copy') . + "
" . $cgi->submit(-name => 'view', -value => 'View') . + "
" . @@ -214,13 +226,22 @@ "" . - $cgi->endform; + $cgi->endform; +# $dialog = $cgi->param($view) || $cgi->param($copy); } -elsif ($form eq 'select') { +elsif ($dialog eq 'Edit') { # enter Edit form &validpassword($username, $password, $pwdfile) || print STDOUT $cgi->redirect(-uri => $cgi->url(-full => 1), -type => "text/html"); + + $page .= $cgi->startform( -method => "POST", -action => $cgi->url(-full => 1)); } -else { + +elsif ($dialog eq 'View') { + # enter View form + &validpassword($username, $password, $pwdfile) || print STDOUT $cgi->redirect(-uri => $cgi->url(-full => 1), -type => "text/html"); +} else + +{ die "invalid form \"$form\""; }