You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl-cvs@perl.apache.org by ri...@apache.org on 2003/01/16 08:14:36 UTC

cvs commit: embperl/eg/web/db add.epl addsel.epl content.epl epwebapp.pl login.epl loginform.epl

richter     2003/01/15 23:14:35

  Modified:    eg/web   epwebapp.pl
               eg/web/db add.epl addsel.epl content.epl epwebapp.pl
                        login.epl loginform.epl
  Log:
  website updates
  
  Revision  Changes    Path
  1.5       +1 -1      embperl/eg/web/epwebapp.pl
  
  Index: epwebapp.pl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/epwebapp.pl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- epwebapp.pl	8 Jan 2003 06:03:23 -0000	1.4
  +++ epwebapp.pl	16 Jan 2003 07:14:34 -0000	1.5
  @@ -186,7 +186,7 @@
   
       $r -> {imageuri} = ('../' x $depth) . $config -> {imageuri} ;
       $r -> {baseuri}  = ('../' x $depth)  ;
  -    # this is when creating static pages, to let actions point to the write URL
  +    # this is when creating static pages, to let actions point to the correct URL of the dynamic site
       $r -> {action_prefix} = $ENV{ACTION_PREFIX} || '' ; 
   
       my $langs  = $config -> {supported_languages} ;
  
  
  
  1.6       +1 -1      embperl/eg/web/db/add.epl
  
  Index: add.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/add.epl,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- add.epl	16 Jan 2003 05:29:15 -0000	1.5
  +++ add.epl	16 Jan 2003 07:14:35 -0000	1.6
  @@ -17,7 +17,7 @@
   
   [$ if !$r->{error} $]
   
  -<form action="[+ $r -> app -> languri($r, $r -> {action_prefix}?($r->{action_prefix} . dirname($r-> param -> uri) .'/'):'', $r -> param -> language) +]show.epl" method="POST">
  +<form action="[+ $r -> app -> posturl('show.epl') +]" method="POST">
   
   [= add2a =]<br>
   [= add2b =]<br><br>
  
  
  
  1.5       +1 -1      embperl/eg/web/db/addsel.epl
  
  Index: addsel.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/addsel.epl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- addsel.epl	16 Jan 2003 05:29:15 -0000	1.4
  +++ addsel.epl	16 Jan 2003 07:14:35 -0000	1.5
  @@ -74,7 +74,7 @@
   #]
   
   [#
  -<form action="[+ $r -> app -> languri($r, $r -> {action_prefix}?($r->{action_prefix} . dirname($r-> param -> uri) .'/'):'', $r -> param -> language) +]addsel.epl"  OnSubmit="">
  +<form action="[+ $r -> app -> posturl('addsel.epl') +]"  OnSubmit="">
   
   [= addsel2 =]<br> 
   [= addsel3 =]<br><br>
  
  
  
  1.6       +1 -1      embperl/eg/web/db/content.epl
  
  Index: content.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/content.epl,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- content.epl	9 Jan 2003 05:59:02 -0000	1.5
  +++ content.epl	16 Jan 2003 07:14:35 -0000	1.6
  @@ -44,7 +44,7 @@
       <div align="center">
       <p>[= need_login =]</p>
       
  -    [- Execute ('loginform.epl', $r -> {action_prefix} . $r -> param -> uri) ; -]
  +    [- Execute ('loginform.epl', $r -> app -> posturl) ; -]
       </div>
   [$ else $]
       [$if $r -> param -> uri !~ /html?$|epl$/ $]<pre>[$endif$]
  
  
  
  1.10      +27 -0     embperl/eg/web/db/epwebapp.pl
  
  Index: epwebapp.pl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/epwebapp.pl,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- epwebapp.pl	9 Jan 2003 05:59:02 -0000	1.9
  +++ epwebapp.pl	16 Jan 2003 07:14:35 -0000	1.10
  @@ -131,6 +131,33 @@
       }
   
   
  +
  +# ----------------------------------------------------------------------------
  +#
  +# Get url for postings forms
  +#
  +# $dest = path relativ to current uri
  +#
  +
  +sub posturl
  +    {
  +    my ($self, $dest) = @_ ;
  +
  +    my $r = $self -> curr_req ;
  +
  +    return $dest if (!$r -> {action_prefix}) ;
  +
  +
  +    my $buri = $r->{config}{baseuri} ;
  +    my $uri  = $r-> param -> uri ;
  +    my $path = ($uri =~ /$buri(.*?)$/)?$1:$uri ;
  +
  +    return $r -> {action_prefix} . $buri . $r -> param -> language . '/' . $path if (!$dest) ;
  +    return $r -> {action_prefix} . $buri . $r -> param -> language . dirname("/$path") .'/' . $dest ;
  +    }
  +
  +
  +
   # ----------------------------------------------------------------------------
   #
   # check if user is loged in, handle login/out and createing of new users
  
  
  
  1.5       +1 -1      embperl/eg/web/db/login.epl
  
  Index: login.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/login.epl,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- login.epl	9 Jan 2003 06:19:32 -0000	1.4
  +++ login.epl	16 Jan 2003 07:14:35 -0000	1.5
  @@ -3,7 +3,7 @@
   <div align="center">
   <p class="cHeadline">[= login_head =]</p>
   
  -[- Execute ('loginform.epl', ($r -> {action_prefix}?($r->{action_prefix} . dirname($r-> param -> uri) .'/'):'') . 'addsel.epl') ; -]
  +[- Execute ('loginform.epl', $r -> app -> posturl('addsel.epl')) ; -]
   </div>
   
   [#
  
  
  
  1.7       +3 -3      embperl/eg/web/db/loginform.epl
  
  Index: loginform.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/loginform.epl,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- loginform.epl	16 Jan 2003 05:29:45 -0000	1.6
  +++ loginform.epl	16 Jan 2003 07:14:35 -0000	1.7
  @@ -29,7 +29,7 @@
       <p>[= login1 =]</P>
       [$endif$]
   
  -    <form action="[+ $r -> app -> languri($r, $param[0], $r -> param -> language) +]" method="POST" name="login" onSubmit="return epform_validate_login()">
  +    <form action="[+ $param[0] +]" method="POST" name="login" onSubmit="return epform_validate_login()">
           <table>
               <tr>
                   <td class="cText">[= user_email =]</td>
  @@ -55,7 +55,7 @@
   
       <P ALIGN="left">[= login3 =]</P>
   
  -    <form action="[+ $r -> app -> languri($r, $r -> {action_prefix}?($r->{action_prefix} . dirname($r-> param -> uri) .'/'):'', $r -> param -> language) +]login.epl" method="POST" name="newuser" onSubmit="return epform_validate_newuser()">
  +    <form action="[+ $r -> app -> posturl('login.epl') +]" method="POST" name="newuser" onSubmit="return epform_validate_newuser()">
           <table>
               <tr>
                   <td class="cText">[= user_email =]</td>
  @@ -70,7 +70,7 @@
       </form>
       [$ endif $]
     [$ else $]
  -    <form action="[+ $r -> app -> languri($r, $param[0], $r -> param -> language) +]" method="POST">
  +    <form action="[+ $param[0] +]" method="POST">
           <p>
           [= already_logged_in_as =] [+ $udat{user_email} +]
           [$ if $udat{user_admin} $]
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: embperl-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: embperl-cvs-help@perl.apache.org