Home : Products : DBMan SQL : Discussion :

Products: DBMan SQL: Discussion: Re: [hoefti] change the data of registration: Edit Log

Here is the list of edits for this post
Re: [hoefti] change the data of registration
Hi,

Sorry about the late reply.
In this case, you should add the script below into Home.pm:

Code:
$COMPILE{profile_form} = <<'END_OF_SUB';
sub profile_form {
my ($self, $msg) = @_;
return ('profile_form.html', { msg => $msg, header => 'Edit Profile' });
}
END_OF_SUB

$COMPILE{profile} = <<'END_OF_SUB';
sub profile {
my $self = shift;
my $user_tab = $self->{cfg}->{'user_table_use'};
my $db = $self->{sql}->table($user_tab);
my $cols = $db->cols;
my $info = {};
foreach my $c ( keys % $cols ) {
next if ( !$self->{cgi}->{"pro_$c"} );
next if ( $c =~ /^Username|Status|view_p|view_p|delete_p|modify_p|admin_p/ );
$info->{$c} = $self->{cgi}->{"pro_$c"};
}
$table->update($info, { Username => $self->{user}->{Username} }) if ( $info );
return home("Your profile was updated successfully!");
}
END_OF_SUB

Find the attached file and put it into the template set which you're using.

Now you can use it Laugh by the link: db.cgi?do=profile_form

Hope that helps,

TheStone.

B.

Last edited by:

TheStone: Aug 13, 2002, 4:38 PM

Edit Log: