- $tpl->fillin("USER",getpwuid($<));
- $tpl->fillin("GROUP",getgrgid($());
+ if(my $user = getpwuid($uid))
+ {
+ $tpl->fillin("USER",encode_entities($user));
+ $tpl->parse_if_block("user_detected",1);
+ }
+ else
+ {
+ $tpl->parse_if_block("user_detected",0);
+ }
+
+ if(my $group = getgrgid($gid))
+ {
+ $tpl->fillin("GROUP",encode_entities($group));
+ $tpl->parse_if_block("group_detected",1);
+ }
+ else
+ {
+ $tpl->parse_if_block("group_detected",0);
+ }
+
+ # Process umask
+
+ $tpl->fillin("UMASK",sprintf("%04o",umask));