package WebGUI::Macro::User1; #------------------------------------------------------------------- # WebGUI is Copyright 2001-2004 Plain Black Corporation. #------------------------------------------------------------------- # Please read the legal notices (docs/legal.txt) and the license # (docs/license.txt) that came with this distribution before using # this software. #------------------------------------------------------------------- # http://www.plainblack.com info@plainblack.com #------------------------------------------------------------------- use strict; use WebGUI::Session; use WebGUI::User; use WebGUI::ProfileField; use WebGUI::Grouping; #------------------------------------------------------------------ # Adapted by Gerald Young. View any user's profile field. # sample: ^User1(email,Ha$hI); # This doesn't error check, so it expects some real values. # wguser1@gwy.org # Updated 12/17/05 to handle 6.8.2+ # Updated 12/19/05 bugs. # Rewrite provided by Matthew Wilson #------------------------------------------------------------------- sub process { my $u = WebGUI::User->new($_[1]); my $p = WebGUI::ProfileField->new($_[0]); return unless ($u && $p); return $u->profileField($p->getId) if ($p->isViewable || WebGUI::Grouping::isInGroup(3)); return ''; } 1;