hi andy,
you helped me with the 'scalar' error when i was trying to show user list in select box on form. after playing with script more, i find it unfriendly that when i click Admin link in menu, it automatically brings up MY info from user table. i would prefer that the name, password, permissions etc be empty when i load the admin form. i want to either select a user from the list to edit an existing user OR type a new username and fill in the blanks to add a new user. when i'm ready to turn this database over to someone, i'm afraid they will constantly give admin permissions to new users, overwrite their own info, etc.
i believe the red line below is what loads my info. if i comment it out, i get the error in the subject of this post. don't know what to do!!!
#---------------------------------------------------------------------
# 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
});
}
you helped me with the 'scalar' error when i was trying to show user list in select box on form. after playing with script more, i find it unfriendly that when i click Admin link in menu, it automatically brings up MY info from user table. i would prefer that the name, password, permissions etc be empty when i load the admin form. i want to either select a user from the list to edit an existing user OR type a new username and fill in the blanks to add a new user. when i'm ready to turn this database over to someone, i'm afraid they will constantly give admin permissions to new users, overwrite their own info, etc.
i believe the red line below is what loads my info. if i comment it out, i get the error in the subject of this post. don't know what to do!!!
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
});
}