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 2002/10/23 14:29:12 UTC

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

richter     2002/10/23 05:29:12

  Modified:    eg/web   Tag: Embperl2c config.pl epwebapp.pl
               eg/web/db Tag: Embperl2c epwebapp.pl login.epl loginform.epl
  Log:
  made user account creation (incl. mail sending) working (abe)
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.22  +1 -0      embperl/eg/web/config.pl
  
  Index: config.pl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/config.pl,v
  retrieving revision 1.1.2.21
  retrieving revision 1.1.2.22
  diff -u -r1.1.2.21 -r1.1.2.22
  --- config.pl	27 Aug 2002 19:12:41 -0000	1.1.2.21
  +++ config.pl	23 Oct 2002 12:29:11 -0000	1.1.2.22
  @@ -11,6 +11,7 @@
       $self -> {dbdsn}      = $^O eq 'MSWin32'?'dbi:ODBC:embperl':'dbi:mysql:embperl' ;
       $self -> {dbuser}     = 'www' ;
       $self -> {dbpassword} = undef ;
  +    $self -> {adminemail} = 'abe@ecos.de';
   
       # There is normaly no need to change anything below this line
   
  
  
  
  1.1.2.15  +7 -0      embperl/eg/web/epwebapp.pl
  
  Index: epwebapp.pl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/epwebapp.pl,v
  retrieving revision 1.1.2.14
  retrieving revision 1.1.2.15
  diff -u -r1.1.2.14 -r1.1.2.15
  --- epwebapp.pl	29 Jun 2002 20:25:07 -0000	1.1.2.14
  +++ epwebapp.pl	23 Oct 2002 12:29:11 -0000	1.1.2.15
  @@ -311,6 +311,13 @@
           return Embperl::Recipe::Embperl -> get_recipe ($r, $recipe) ;
           }
   
  +    if ($src eq 'mail')
  +        {
  +        $config -> syntax('EmbperlBlocks') ;
  +        return Embperl::Recipe::Embperl -> get_recipe ($r, $recipe) ;
  +        }
  +
  +
       $config -> syntax('Text') ;
       return Embperl::Recipe::Embperl -> get_recipe ($r, $recipe) ;
       }
  
  
  
  No                   revision
  
  
  No                   revision
  
  
  1.1.2.13  +30 -3     embperl/eg/web/db/epwebapp.pl
  
  Index: epwebapp.pl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/epwebapp.pl,v
  retrieving revision 1.1.2.12
  retrieving revision 1.1.2.13
  diff -u -r1.1.2.12 -r1.1.2.13
  --- epwebapp.pl	27 Aug 2002 19:12:41 -0000	1.1.2.12
  +++ epwebapp.pl	23 Oct 2002 12:29:11 -0000	1.1.2.13
  @@ -2,6 +2,7 @@
   
   use DBIx::Recordset ;
   use Data::Dumper ;
  +use Embperl::Mail ;
   
   BEGIN { Execute ({isa => '../epwebapp.pl', syntax => 'Perl'}) ;  }
   
  @@ -177,7 +178,7 @@
               
       if ($fdat{-newuser} && $user -> {id})
           {
  -        $r -> {error} = 'err_user_exists' ;
  +	$r -> {error} = 'err_user_exists';
           return ;
           }
   
  @@ -199,12 +200,38 @@
   
       if ($fdat{-newuser} && $fdat{user_email})
           {
  +	my @errors_user = ();
  +	my @errors_admin = ();
           my $set = DBIx::Recordset -> Insert ({'!DataSource' => $r -> {db}, 
                                                 '!Table'      => 'user', 
                                                 'password'    => $fdat{user_password},
                                                 'email'       => $fdat{user_email}}) ;
  -        #Embperl::Mail::Execute ({inputfile => 'newuser.admin.mail',  to => $self -> {config} -> {adminemail}) ;
  -        #Embperl::Mail::Execute ({inputfile => 'newuser.mail', to => $fdat{user_email}) and $r -> {error} = 'err_mail' ;
  +	$r -> {error} .= 'err_db: '.DBIx::Recordset -> LastError 
  +	    if DBIx::Recordset -> LastError;
  +
  +        $usermail = Embperl::Mail::Execute ({
  +	    inputfile => 'newuser.mail', 
  +	    to => $fdat{user_email}, 
  +	    subject => 'Your Embperl Website Account',
  +	    errors => \@errors_user})
  +	and $r -> {error} .= 'err_mail: '.join('; ',@errors_user) ;
  +
  +        $adminmail = Embperl::Mail::Execute ({
  +	    inputfile => 'newuser.admin.mail',  
  +	    to => $r->{config}->{adminemail},
  +	    subject => ($r->{error} ? 
  +			"Error while creating new Embperl website user '$fdat{user_email}'" :
  +			"New Embperl website user: $fdat{user_email}"),
  +	    errors => \@errors_admin}) 
  +	and $r -> {error} .= 'err_mail: '.join('; ',@errors_admin);
  +
  +#	$r->{error} .= "\n". Dumper($adminmail,
  +#				    \@errors_admin,
  +#				    $r->{config}->{adminemail},
  +#				    $usermail,
  +#				    \@errors_user,
  +#				    $fdat{user_email};
  +
           return ;
           }
   
  
  
  
  1.1.2.2   +9 -2      embperl/eg/web/db/Attic/login.epl
  
  Index: login.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/Attic/login.epl,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- login.epl	22 Oct 2002 17:37:39 -0000	1.1.2.1
  +++ login.epl	23 Oct 2002 12:29:11 -0000	1.1.2.2
  @@ -1,5 +1,12 @@
  -<center>
  +<div align="center">
   <p class="cHeadline">[= login_head =]</p>
   
   [- Execute ('loginform.epl', 'addsel.epl') ; -]
  -</center>
  +</div>
  +
  +[! use Data::Dumper; !]
  +[- $r = shift -]
  +
  +<PRE>
  +[+ Dumper $r->{config} +]
  +</PRE>
  \ No newline at end of file
  
  
  
  1.1.2.2   +1 -1      embperl/eg/web/db/Attic/loginform.epl
  
  Index: loginform.epl
  ===================================================================
  RCS file: /home/cvs/embperl/eg/web/db/Attic/loginform.epl,v
  retrieving revision 1.1.2.1
  retrieving revision 1.1.2.2
  diff -u -r1.1.2.1 -r1.1.2.2
  --- loginform.epl	22 Oct 2002 17:37:39 -0000	1.1.2.1
  +++ loginform.epl	23 Oct 2002 12:29:11 -0000	1.1.2.2
  @@ -18,7 +18,7 @@
               </tr>
               <tr>
                   <td class="cText">[= password =]</td>
  -                <td class="cInput"><input type="text" name="user_password"></td>
  +                <td class="cInput"><input type="password" name="user_password"></td>
               </tr>
           </table>
           <p>
  
  
  

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