this line: $output .= "<a href='$url&do=owner&oid=$owner'>Owner</a>";
calls this routine:
#----------------------------------------------------------------------
#
my $tags = GT::Template->tags;
my $record = $tags->{owner}[$tags->{row_num}-1];
my $output = "<table border=0 cellpadding=1 cellspacing=2 width=100%>";
my $c = $tags->{home}->{sql}->table($tags->{home}->{cfg}->{'user_table_use'})->cols;
my $order;
foreach my $col ( sort {
defined ($c->{$a}->{pos}) or warn "No pos for $a\n";
defined ($c->{$b}->{pos}) or warn "No pos for $b\n";
$c->{$a}->{'pos'} <=> $c->{$b}->{'pos'}
} keys %$c ) {
($col =~ m/[_p]+/ or $col eq 'Password') and next;
$output .= "<tr><td width=20%>$col:</td><td width=80%>$record->{$col}</td></tr>";
}
return "$output</table>";
}i want to add another link like the first one and have tried: $output .= " <a href='$url&do=admin_form&username=$owner'>Admin $owner</a>";
to call:
#---------------------------------------------------------------------
# show admin form
#
my ($self, $user, $msg) = @_;
return $self->home($self->_language('PER_ADMIN')) unless ( $self->{user}->{admin_p} );
$user = admin_init_hash($self->{user}) if ( !$user );
return ('admin_form.html', {
header => $self->_language('HEA_ADMIN'), %$user,
db => $self->{cgi}->{db},
password_confirm => $self->{cgi}->{password_confirm},
msg => $msg
});
}the first line displays the user's info from the user table and works fine. i want the second line to bring up the admin form to change the selected user's info from the user table. but it always brings up the logged in user's info. pls help!
calls this routine:
Code:
sub generate_owner_info { #----------------------------------------------------------------------
#
my $tags = GT::Template->tags;
my $record = $tags->{owner}[$tags->{row_num}-1];
my $output = "<table border=0 cellpadding=1 cellspacing=2 width=100%>";
my $c = $tags->{home}->{sql}->table($tags->{home}->{cfg}->{'user_table_use'})->cols;
my $order;
foreach my $col ( sort {
defined ($c->{$a}->{pos}) or warn "No pos for $a\n";
defined ($c->{$b}->{pos}) or warn "No pos for $b\n";
$c->{$a}->{'pos'} <=> $c->{$b}->{'pos'}
} keys %$c ) {
($col =~ m/[_p]+/ or $col eq 'Password') and next;
$output .= "<tr><td width=20%>$col:</td><td width=80%>$record->{$col}</td></tr>";
}
return "$output</table>";
}
to call:
Code:
sub admin_form { #---------------------------------------------------------------------
# show admin form
#
my ($self, $user, $msg) = @_;
return $self->home($self->_language('PER_ADMIN')) unless ( $self->{user}->{admin_p} );
$user = admin_init_hash($self->{user}) if ( !$user );
return ('admin_form.html', {
header => $self->_language('HEA_ADMIN'), %$user,
db => $self->{cgi}->{db},
password_confirm => $self->{cgi}->{password_confirm},
msg => $msg
});
}