%#-- Begin HTML --# <& '/widgets/wrappers/sharky/header.mc', title => "$disp Profile", context => "Admin | Profile | $disp | $crumb" &>
<& '/widgets/wrappers/sharky/footer.mc', param => \%ARGS &> %#-- End HTML --# <%once>; my $class = 'Bric::Biz::Person::User'; my $section = 'admin'; my $type = 'user'; my $disp = get_disp_name($type); # Grab the length setting for the password fields. my $pass_len = $class->my_meths->{password}{props}{length}; my $pass_max = $class->my_meths->{password}{props}{maxlength}; my $port = LISTEN_PORT == 80 ? '' : ':' . LISTEN_PORT; %once> <%args> $id => undef %args> <%init>; $id = $ARGS{user_id} unless defined $id; # Instantiate an object. my $user = $ARGS{obj} ? $ARGS{obj} : defined $id ? $class->lookup({ id => $id}) : $class->new; $id = $user->get_id unless defined $id; my $isid = defined $id && $id ne ''; # Check authorization - but allow a user to edit his/her own profile. my ($no_edit, $no_del, $is_user, $can_edit); if (defined $id && $id == get_user_id()) { ($no_edit, $no_del, $is_user) = (0, 1, 1); $can_edit = chk_authz($user, ($isid ? EDIT : CREATE), 1); } else { chk_authz($user, $isid ? READ : CREATE); $can_edit = chk_authz($user, ($isid ? EDIT : CREATE), 1); $no_edit = !$can_edit; $no_del = !$id || $no_edit; } # Get the name for the breadcrumb trail. my $crumb = $user->format_name; $crumb = $crumb ? ""$crumb"" : 'New'; # Roll in any changes to the user object if we're just adding contacts. if (exists($ARGS{'addmore_type'}) && $ARGS{'addmore_type'} eq 'contact') { foreach my $meth ($user->my_meths(1)) { $meth->{set_meth}->($user, @{$meth->{set_args}}, $ARGS{$meth->{name}}) if defined $meth->{set_meth}; } } # Establish the return URI. my $return = get_state_name('login') eq 'ssl' ? last_page : 'http://' . $r->hostname . $port . last_page; %init> <%doc> ############################################################################### =head1 NAME /admin/profile/user/dhandler - User Profile. =head1 VERSION $LastChangedRevision$ =head1 DATE $LastChangedDate$ =head1 DESCRIPTION This dhandler manages user profiles. %doc>