You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by pa...@emc.com on 2002/08/03 02:23:33 UTC

Some wierd problem with mod_perl and Apache

I have been trying to debug this for some time, and am not
sure what is happening or why it is happening.

I have a simple gui that takes in old and new passwd and changes
it. For this I have a "change password" button. Now the problem
that I see is sometimes.....when I enter the values in the form and
click on the "change password" button, the same screen comes back to
me without the change actually happening. After doing this couple of 
times, I would actually succeed. Why is my form getting resetted sometimes ?
It does not make a difference if I use IE or Netscape.

Below is the code ...that does most of the work and seems to be the 
problematic code(this is very similar to the examples given in
Stein's and MacEachern's book on Apache modules):

package Apache::ChangePassword;

use strict;
use Apache::Constants qw(:common);
use CGI '-autoload';


sub handler {
      my $r = shift;
      my($oldpass, $newpass1, $confirmpass) = map { param($_) } qw(password
newpassword1 confirmpassword);
      my $request_uri_go = param('request_uri') ||
        ($r->prev ? $r->prev->uri : cookie('request_uri'));     
       
      if($user && $oldpass && $newpass1 && $confirmpass)
      {
        #Do some authentication. But I never come here the first couple of
        #times when I click "change password"
 
      }
      
	make_passwd_screen($msg, $request_uri_go);
      return OK;
}

sub make_passwd_screen {
    my($msg, $request_uri) = @_;
    print header(),
    start_html(-title => 'Change Password', -bgcolor => 'white'),
    h1('Please Change Password');
    print  h2(font({color => 'red'}, "Error: $msg")) if $msg;
    print start_form(-action => script_name()),
    table(
          Tr(td(['Password', password_field(-name => 'password')])),
          Tr(td(['New Password', password_field(-name => 'newpassword1')])),
          Tr(td(['Confirm New Password', password_field(-name =>
'confirmpassword')]))
          ),
              hidden(-name => 'request_uri', -value => $request_uri),
              submit('Change Password'), p(),
              end_form(),
              em('Note: '),
              "Passwords are case sensitive. Passwords sghould be atleast 5
characters in length, and preferably contain a numeral or a special
character.<BR>Your password
        will <B>NOT</B> be displayed as you type it.";
    }


Any help will be appreciated much :-)

thanks.

-Tushar



      
     

Re: Some wierd problem with mod_perl and Apache

Posted by Stas Bekman <st...@stason.org>.
Ged Haywood wrote:
> Hi there,
> 
> On Fri, 2 Aug 2002 pandit_tushar@emc.com wrote:
> 
> 
>>sometimes.....when I enter the values in the form and click on the
>>"change password" button, the same screen comes back to me without
>>the change actually happening. After doing this couple of times, I
>>would actually succeed.
> 
> 
> Have you checked out the Guide?
> 
> http://perl.apache.org/guide/debug.html

BTW, while /guide is still working, the real url is now 
/docs/1.0/guide/, so I'd rather see people use that, because you should 
remember that we enter the era of co-existence of mod_perl 1.0 and 2.0, 
so /guide is not the *only* guide anymore. Moreover parts of the /guide 
that aren't specific to 1.0 have moved into /docs/general/.



__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: Some wierd problem with mod_perl and Apache

Posted by Ged Haywood <ge...@www2.jubileegroup.co.uk>.
Hi there,

On Fri, 2 Aug 2002 pandit_tushar@emc.com wrote:

> sometimes.....when I enter the values in the form and click on the
> "change password" button, the same screen comes back to me without
> the change actually happening. After doing this couple of times, I
> would actually succeed.

Have you checked out the Guide?

http://perl.apache.org/guide/debug.html

73,
Ged.