i'm currently making some user utilities.. so that users can modify their profiles and change their passwords..
but i'm sort of unsure about one thing right now..
to modify a user record.. would this work?
(this is just a simple example)
my $db = new Links: BSQL "$LINKS{admin_root_path}/defs/Users.def";
my $USER = &load_user ($in);
foreach my $key (keys %$USER) {
$original->{$key} = $USER->{$key};
$USER->{$key} = $in->param($key) if ($in->param($key));
}
$USER->{Username} = $original->{Username};
$USER->{Status} = $original->{Status};
my $id = $db->modify_record ($USER);
if (!$id) {
# error: <ul>$Links: BSQL::error</ul>
}
# success
is that right.. the part i'm unsure of is..
jerry
but i'm sort of unsure about one thing right now..
to modify a user record.. would this work?
(this is just a simple example)
Code:
my ($original); my $db = new Links: BSQL "$LINKS{admin_root_path}/defs/Users.def";
my $USER = &load_user ($in);
foreach my $key (keys %$USER) {
$original->{$key} = $USER->{$key};
$USER->{$key} = $in->param($key) if ($in->param($key));
}
$USER->{Username} = $original->{Username};
$USER->{Status} = $original->{Status};
my $id = $db->modify_record ($USER);
if (!$id) {
# error: <ul>$Links: BSQL::error</ul>
}
# success
is that right.. the part i'm unsure of is..
Code:
my $id = $db->modify_record ($USER);jerry