[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [cgiapp] logging in with CGI::Session and CGI::Application


cool, I'll give that a shot..


OK, I knocked up this:

Please let me know if you see any holes in it..  

thanks heaps.

rgds

Frank

 sub display_menu
 {
 	 my $self=shift;
 	 my $form_parameters = $self->query();
 	 my $menu_display = HTML::Template->new(filename => 'menu.tmpl',
	 						 path => "$template_dir");
	 						 
         my $user_name  = $form_parameters->param('username');
         my $pass_word = $form_parameters->param('password'); 
         
         my ($user_id, $session) = get_ID($form_parameters);
         # Validate the username..
         unless ($session->param("logged_in"))
         {
              # Replace this later with comparison to DB values.
              if (($user_name ne $user_name) || ($pass_word ne $password))
              {
              return $self->display_login();
              }
              else
              {
              $session->param('logged_in', 'yes');
              }
         }					 
  
	      # Default feilds for display.					 
	      $menu_display->param(ScriptHome => $script_name);						 
	      $menu_display->param(Date => $date);
	      $menu_display->param(ID => $user_id);
	      
	      my $output_html=$menu_display->output;
	      return $output_html;	 						 
  }




Thanks again


regards

Frank

-----Original Message-----
From: Cory Trese [mailto:suppressed
Sent: Tuesday, 17 December 2002 12:00 AM
To: Franki; suppressed
Subject: RE: [cgiapp] logging in with CGI::Session and CGI::Application


> How can I achive the same results as $self->prerun_mode('mode_1');
> inside a normal runmode? in other words, how can I use the menu
> runmode code
> to send the person back to the login screen if they have entered an
> incorrect username/password?


the code would be

[in run mode 2]

# start perl

	return $self->mode_1( );

# end perl



I think. This would take the user in run mode 2 and show them run mode 1,
from inside of any part of run mode 2.



Thanks,


Cory Trese
Lead Web Application Developer

O'NEIL & ASSOCIATES, INC.
495 Byers Rd.
Miamisburg, Ohio 45342-3662
Phone: (937) 865-0800 ext. 3038
Fax: (937) 865-5858
E-mail: suppressed


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed



---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/suppressed/
To unsubscribe, e-mail: suppressed
For additional commands, e-mail: suppressed


Mail converted by mhonarc 2.6.15
This archive provided courtesy of JSW4.NET, Internet Hosting Services for Small Business.