Jump to content

User fields default.pl

From EPrints Documentation
Revision as of 00:23, 31 January 2022 by Drn@ecs.soton.ac.uk (talk | contribs) (Added page about config file)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Back to cfg.d

user_fields_default.pl contains configuration to set the default values for user fields through the set_user_defaults function. This usually happens when a user is created but before it can be edited for the first time.

  • $data is a hash reference of the metadata which will make up the user object. Each field name is a key in the hash.
  • $repository is a Repository object.

Example[edit]

In this example, the default for hideemail is set to true and the default columns to be shown the user is on their Items and Editorial Review pages.

$c->{set_user_defaults} = sub
{
    my( $data, $repository ) = @_;

    $data->{hideemail} = "TRUE";

    # Default columns shown in Items and Editorial Review screens
    $data->{items_fields} = [ "lastmod", "title", "type", "eprint_status" ];
    $data->{review_fields} = [ "status_changed", "title", "type", "userid" ];
};