Difference between revisions of "API:EPrints/DataObj/User"
Line 1: | Line 1: | ||
<!-- Pod2Wiki=_preamble_ | <!-- Pod2Wiki=_preamble_ | ||
This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost. | This page has been automatically generated from the EPrints source. Any wiki changes made between the 'Pod2Wiki=*' and 'End of Pod2Wiki' comments will be lost. | ||
− | -->{{API:Source|file=EPrints/DataObj/User.pm|package_name=EPrints::DataObj::User}}[[Category:API|User]]<!-- End of Pod2Wiki --> | + | -->{{Pod2Wiki}}{{API:Source|file=EPrints/DataObj/User.pm|package_name=EPrints::DataObj::User}}[[Category:API|User]]<!-- End of Pod2Wiki --> |
− | <!-- Pod2Wiki=head_name -->'''EPrints::DataObj::User''' - Class representing a single user. | + | <!-- Pod2Wiki=head_name -->=NAME= |
− | + | '''EPrints::DataObj::User''' - Class representing a single user. | |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=head_description -->=DESCRIPTION= | <!-- Pod2Wiki=head_description -->=DESCRIPTION= | ||
− | This class represents a single eprint user record and the metadata associated with it. | + | This class represents a single eprint user record and the metadata associated with it. |
− | EPrints::DataObj::User is a subclass of EPrints::DataObj with the | + | |
+ | EPrints::DataObj::User is a subclass of EPrints::DataObj with the following metadata fields (plus those defined in ArchiveMetadataFieldsConfig: | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=head_system_metadata -->=SYSTEM METADATA= | <!-- Pod2Wiki=head_system_metadata -->=SYSTEM METADATA= | ||
Line 16: | Line 19: | ||
The unique ID number of this user record. Unique within the current repository. | The unique ID number of this user record. Unique within the current repository. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_rev_number -->==rev_number== | <!-- Pod2Wiki=item_rev_number -->==rev_number== | ||
Line 21: | Line 25: | ||
rev_number (int) | rev_number (int) | ||
− | The revision number of this record. Each time it is changed the | + | The revision number of this record. Each time it is changed the revision number is increased. This is not currently used for anything but it may be used for logging later. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_username -->==username== | <!-- Pod2Wiki=item_username -->==username== | ||
Line 27: | Line 32: | ||
username (text) | username (text) | ||
− | The username of this user. Used for logging into the system. Unique | + | The username of this user. Used for logging into the system. Unique within this repository. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_password -->==password== | <!-- Pod2Wiki=item_password -->==password== | ||
Line 33: | Line 39: | ||
password (secret) | password (secret) | ||
− | The password of this user encoded with crypt. This may be ignored if | + | The password of this user encoded with crypt. This may be ignored if the repository is using an alternate authentication system, eg. LDAP. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_usertype -->==usertype== | <!-- Pod2Wiki=item_usertype -->==usertype== | ||
Line 40: | Line 47: | ||
The type of this user. The options are configured in metadata-phrases.xml. | The type of this user. The options are configured in metadata-phrases.xml. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_newemail -->==newemail== | <!-- Pod2Wiki=item_newemail -->==newemail== | ||
Line 46: | Line 54: | ||
Used to store a new but as yet unconfirmed email address. | Used to store a new but as yet unconfirmed email address. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_newpassword -->==newpassword== | <!-- Pod2Wiki=item_newpassword -->==newpassword== | ||
Line 52: | Line 61: | ||
Used to store a new but as yet unconfirmed password. | Used to store a new but as yet unconfirmed password. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_pin -->==pin== | <!-- Pod2Wiki=item_pin -->==pin== | ||
Line 57: | Line 67: | ||
pin (text) | pin (text) | ||
− | A code required to confirm a new username or password. This code is | + | A code required to confirm a new username or password. This code is emailed to the user to confirm they are who they say they are. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_pinsettime -->==pinsettime== | <!-- Pod2Wiki=item_pinsettime -->==pinsettime== | ||
Line 64: | Line 75: | ||
When the pin code was set, so we can make it time out. | When the pin code was set, so we can make it time out. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_joined -->==joined== | <!-- Pod2Wiki=item_joined -->==joined== | ||
Line 69: | Line 81: | ||
joined (time) | joined (time) | ||
− | The date and time that the user account was created. Before EPrints 2.4 | + | The date and time that the user account was created. Before EPrints 2.4 this was a date field so users created before the upgrade will appear to have been created at midnight. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_email -->==email== | <!-- Pod2Wiki=item_email -->==email== | ||
Line 76: | Line 89: | ||
The email address of this user. Unique within the repository. | The email address of this user. Unique within the repository. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_lang -->==lang== | <!-- Pod2Wiki=item_lang -->==lang== | ||
Line 81: | Line 95: | ||
lang (namedset) | lang (namedset) | ||
− | The ID of the prefered language of this user. Only really used in | + | The ID of the prefered language of this user. Only really used in multilingual repositories. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_editperms -->==editperms== | <!-- Pod2Wiki=item_editperms -->==editperms== | ||
Line 87: | Line 102: | ||
editperms (search, multiple) | editperms (search, multiple) | ||
− | This field is used to filter what eprints a staff member can approve and modify. If it's unset then they can modify any (given the correct privs. | + | This field is used to filter what eprints a staff member can approve and modify. If it's unset then they can modify any (given the correct privs. but if it is set then an eprint must match at least one of the searches to be within their scope. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_frequency -->==frequency== | <!-- Pod2Wiki=item_frequency -->==frequency== | ||
Line 93: | Line 109: | ||
frequency (set) | frequency (set) | ||
− | Only relevant to staff accounts. Is the frequency they want to be mailed about eprints matching their scope that are in editorial review. never, daily, weekly or monthly. | + | Only relevant to staff accounts. Is the frequency they want to be mailed about eprints matching their scope that are in editorial review. never, daily, weekly or monthly. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_mailempty -->==mailempty== | <!-- Pod2Wiki=item_mailempty -->==mailempty== | ||
Line 99: | Line 116: | ||
mailempty (boolean) | mailempty (boolean) | ||
− | Only relevant to staff accounts. If set to true then emails are | + | Only relevant to staff accounts. If set to true then emails are sent even if there are no items matching the scope. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=head_methods -->=METHODS= | <!-- Pod2Wiki=head_methods -->=METHODS= | ||
Line 107: | Line 125: | ||
$field_info = EPrints::DataObj::User->get_system_field_info | $field_info = EPrints::DataObj::User->get_system_field_info | ||
− | Return an array describing the system metadata of the this dataset. | + | Return an array describing the system metadata of the this dataset. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_new -->==new== | <!-- Pod2Wiki=item_new -->==new== | ||
Line 113: | Line 132: | ||
$user = EPrints::DataObj::User->new( $session, $userid ) | $user = EPrints::DataObj::User->new( $session, $userid ) | ||
− | Load the user with the ID of $userid from the database and | + | Load the user with the ID of $userid from the database and return it as an EPrints::DataObj::User object. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_new_from_data -->==new_from_data== | <!-- Pod2Wiki=item_new_from_data -->==new_from_data== | ||
Line 119: | Line 139: | ||
$user = EPrints::DataObj::User->new_from_data( $session, $data ) | $user = EPrints::DataObj::User->new_from_data( $session, $data ) | ||
− | Construct a new EPrints::DataObj::User object based on the $data hash reference of metadata. | + | Construct a new EPrints::DataObj::User object based on the $data hash reference of metadata. |
+ | |||
Used to create an object from the data retrieved from the database. | Used to create an object from the data retrieved from the database. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_get_defaults -->==get_defaults== | <!-- Pod2Wiki=item_get_defaults -->==get_defaults== | ||
Line 133: | Line 149: | ||
Return default values for this object based on the starting data. | Return default values for this object based on the starting data. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_user_with_email -->==user_with_email== | <!-- Pod2Wiki=item_user_with_email -->==user_with_email== | ||
Line 138: | Line 155: | ||
$user = EPrints::DataObj::User::user_with_email( $session, $email ) | $user = EPrints::DataObj::User::user_with_email( $session, $email ) | ||
− | Return the EPrints::user with the specified $email, or undef if | + | Return the EPrints::user with the specified $email, or undef if they are not found. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_user_with_username -->==user_with_username== | <!-- Pod2Wiki=item_user_with_username -->==user_with_username== | ||
Line 144: | Line 162: | ||
$user = EPrints::DataObj::User::user_with_username( $session, $username ) | $user = EPrints::DataObj::User::user_with_username( $session, $username ) | ||
− | Return the EPrints::user with the specified $username, or undef if they are not found. | + | Return the EPrints::user with the specified $username, or undef if they are not found. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_validate -->==validate== | <!-- Pod2Wiki=item_validate -->==validate== | ||
Line 150: | Line 169: | ||
$problems = $thing->validate | $problems = $thing->validate | ||
− | Validate the user - find out if all the required fields are | + | Validate the user - find out if all the required fields are filled out, and that what's been filled in is OK. Returns a reference to an array of problem descriptions. |
+ | |||
If there are no probelms then the array is empty. | If there are no probelms then the array is empty. | ||
+ | |||
The problems are XHTML DOM objects describing the problem. | The problems are XHTML DOM objects describing the problem. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_commit -->==commit== | <!-- Pod2Wiki=item_commit -->==commit== | ||
Line 159: | Line 181: | ||
Write this object to the database. | Write this object to the database. | ||
− | If $force isn't true then it only actually modifies the | + | |
+ | If $force isn't true then it only actually modifies the database if one or more fields have been changed. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_remove -->==remove== | <!-- Pod2Wiki=item_remove -->==remove== | ||
Line 165: | Line 189: | ||
$success = $user->remove | $success = $user->remove | ||
− | Remove this user from the database. Also, remove their saved searches,but do not remove their eprints. | + | Remove this user from the database. Also, remove their saved searches, but do not remove their eprints. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_get_eprints -->==get_eprints== | <!-- Pod2Wiki=item_get_eprints -->==get_eprints== | ||
Line 171: | Line 196: | ||
$list = $user->get_eprints( $dataset ) | $list = $user->get_eprints( $dataset ) | ||
− | Return EPrints in the given EPrints::DataSet which have this | + | Return EPrints in the given EPrints::DataSet which have this user as their creator. |
+ | |||
Since 2.4 this returns an EPrints::List object, not an array of eprints. | Since 2.4 this returns an EPrints::List object, not an array of eprints. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_get_editable_eprints -->==get_editable_eprints== | <!-- Pod2Wiki=item_get_editable_eprints -->==get_editable_eprints== | ||
Line 178: | Line 205: | ||
$list = $user->get_editable_eprints | $list = $user->get_editable_eprints | ||
− | Return eprints currently in the editorial review buffer. If this | + | Return eprints currently in the editorial review buffer. If this user has editperms set then only return those records which match. |
+ | |||
Since 2.4 this returns an EPrints::List object, not an array of eprints. | Since 2.4 this returns an EPrints::List object, not an array of eprints. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_get_owned_eprints -->==get_owned_eprints== | <!-- Pod2Wiki=item_get_owned_eprints -->==get_owned_eprints== | ||
Line 185: | Line 214: | ||
$list = $user->get_owned_eprints( $dataset ); | $list = $user->get_owned_eprints( $dataset ); | ||
− | Return a list of the eprints which this user owns. This is by | + | Return a list of the eprints which this user owns. This is by default the same as $user->get_eprints( $dataset) but may be over-ridden by get_users_owned_eprints. |
+ | |||
Since 2.4 this returns an EPrints::List object, not an array of eprints. | Since 2.4 this returns an EPrints::List object, not an array of eprints. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_has_owner -->==has_owner== | <!-- Pod2Wiki=item_has_owner -->==has_owner== | ||
Line 193: | Line 224: | ||
True if the users are the same record. | True if the users are the same record. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_mail -->==mail== | <!-- Pod2Wiki=item_mail -->==mail== | ||
Line 199: | Line 231: | ||
Send an email to this user. | Send an email to this user. | ||
+ | |||
$subjectid is the ID of a phrase to use as the subject of this email. | $subjectid is the ID of a phrase to use as the subject of this email. | ||
+ | |||
$message is an XML DOM object describing the message in simple XHTML. | $message is an XML DOM object describing the message in simple XHTML. | ||
− | $replyto is the reply to address for this email, if different to | + | |
− | $email is the email address to send this email to if different | + | $replyto is the reply to address for this email, if different to the repository default. |
+ | |||
+ | $email is the email address to send this email to if different from this users configured email address. | ||
+ | |||
Return true if the email was sent OK. | Return true if the email was sent OK. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_render -->==render== | <!-- Pod2Wiki=item_render -->==render== | ||
Line 209: | Line 247: | ||
( $page, $title ) = $user->render | ( $page, $title ) = $user->render | ||
− | Render this user into HTML using the "user_render" method | + | Render this user into HTML using the "user_render" method in ArchiveRenderConfig.pm. Returns both the rendered information and the title as XHTML DOM. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_render_full -->==render_full== | <!-- Pod2Wiki=item_render_full -->==render_full== | ||
Line 215: | Line 254: | ||
( $page, $title ) = $user->render_full | ( $page, $title ) = $user->render_full | ||
− | The same as $user->render, but renders all fields, not just those intended for public viewing. This is the admin view of the user. | + | The same as $user->render, but renders all fields, not just those intended for public viewing. This is the admin view of the user. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_get_url -->==get_url== | <!-- Pod2Wiki=item_get_url -->==get_url== | ||
Line 222: | Line 262: | ||
Return the URL which will display information about this user. | Return the URL which will display information about this user. | ||
− | If $staff is true then return the URL for an administrator to | + | |
+ | If $staff is true then return the URL for an administrator to view and modify this record. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_get_type -->==get_type== | <!-- Pod2Wiki=item_get_type -->==get_type== | ||
Line 228: | Line 270: | ||
$type = $user->get_type | $type = $user->get_type | ||
− | Return the type of this user. Equivalent of $user->get_value( "usertype" ); | + | Return the type of this user. Equivalent of $user->get_value( "usertype" ); |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_get_saved_searches -->==get_saved_searches== | <!-- Pod2Wiki=item_get_saved_searches -->==get_saved_searches== | ||
Line 234: | Line 277: | ||
@saved_searches = $eprint->get_saved_searches | @saved_searches = $eprint->get_saved_searches | ||
− | Return an array of all EPrint::DataObj::SavedSearch objects associated with | + | Return an array of all EPrint::DataObj::SavedSearch objects associated with this user. |
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_send_out_editor_alert -->==send_out_editor_alert== | <!-- Pod2Wiki=item_send_out_editor_alert -->==send_out_editor_alert== | ||
Line 240: | Line 284: | ||
$user->send_out_editor_alert | $user->send_out_editor_alert | ||
− | Called on users who are editors, when it's time to send their | + | Called on users who are editors, when it's time to send their update on what items are in the editorial review buffer. |
+ | |||
Sends the email if needed. | Sends the email if needed. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_process_editor_alerts -->==process_editor_alerts== | <!-- Pod2Wiki=item_process_editor_alerts -->==process_editor_alerts== | ||
Line 248: | Line 294: | ||
Static method. | Static method. | ||
− | Called to send out all editor alerts of a given frequency (daily,weekly, monthly) for the current repository. | + | |
+ | Called to send out all editor alerts of a given frequency (daily, weekly, monthly) for the current repository. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=item_allow -->==allow== | <!-- Pod2Wiki=item_allow -->==allow== | ||
Line 254: | Line 302: | ||
$result = $user->allow( $priv, [$item] ) | $result = $user->allow( $priv, [$item] ) | ||
− | + | Rleturns true if $user can perform this action/view this screen. | |
− | A true result is 1..15 where the value indicates what about the | + | |
− | 1 = anybody (not currently used)2 = only if logged in 4 = only if owner of | + | A true result is 1..15 where the value indicates what about the user allowed the priv to be performed. This is used for filtering owner/ editor actions in eprint control screens. |
+ | |||
+ | 1 = anybody (not currently used) 2 = only if logged in 4 = only if owner of item 8 = only if editor of item | ||
+ | |||
For non item related privs the result will normally be 2. | For non item related privs the result will normally be 2. | ||
− | Nb. That create eprint is NOT a priv related to an eprint, as you don't own it at that stage. | + | |
+ | Nb. That create eprint is NOT a priv related to an eprint, as you don't own it at that stage. | ||
+ | |||
<!-- End of Pod2Wiki --> | <!-- End of Pod2Wiki --> | ||
<!-- Pod2Wiki=head_undocumented_methods -->=UNDOCUMENTED METHODS= | <!-- Pod2Wiki=head_undocumented_methods -->=UNDOCUMENTED METHODS= |
Revision as of 18:29, 11 August 2009
Latest Source Code (3.4, 3.3) | Revision Log | Before editing this page please read Pod2Wiki
Contents
- 1 NAME
- 2 DESCRIPTION
- 3 SYSTEM METADATA
- 4 METHODS
- 4.1 get_system_field_info
- 4.2 new
- 4.3 new_from_data
- 4.4 get_defaults
- 4.5 user_with_email
- 4.6 user_with_username
- 4.7 validate
- 4.8 commit
- 4.9 remove
- 4.10 get_eprints
- 4.11 get_editable_eprints
- 4.12 get_owned_eprints
- 4.13 has_owner
- 4.14 mail
- 4.15 render
- 4.16 render_full
- 4.17 get_url
- 4.18 get_type
- 4.19 get_saved_searches
- 4.20 send_out_editor_alert
- 4.21 process_editor_alerts
- 4.22 allow
- 5 UNDOCUMENTED METHODS
NAME
EPrints::DataObj::User - Class representing a single user.
DESCRIPTION
This class represents a single eprint user record and the metadata associated with it.
EPrints::DataObj::User is a subclass of EPrints::DataObj with the following metadata fields (plus those defined in ArchiveMetadataFieldsConfig:
SYSTEM METADATA
userid
userid (int)
The unique ID number of this user record. Unique within the current repository.
rev_number
rev_number (int)
The revision number of this record. Each time it is changed the revision number is increased. This is not currently used for anything but it may be used for logging later.
username
username (text)
The username of this user. Used for logging into the system. Unique within this repository.
password
password (secret)
The password of this user encoded with crypt. This may be ignored if the repository is using an alternate authentication system, eg. LDAP.
usertype
usertype (namedset)
The type of this user. The options are configured in metadata-phrases.xml.
newemail
newemail (email)
Used to store a new but as yet unconfirmed email address.
newpassword
newpassword (secret)
Used to store a new but as yet unconfirmed password.
pin
pin (text)
A code required to confirm a new username or password. This code is emailed to the user to confirm they are who they say they are.
pinsettime
pinsettime (int)
When the pin code was set, so we can make it time out.
joined
joined (time)
The date and time that the user account was created. Before EPrints 2.4 this was a date field so users created before the upgrade will appear to have been created at midnight.
email (email)
The email address of this user. Unique within the repository.
lang
lang (namedset)
The ID of the prefered language of this user. Only really used in multilingual repositories.
editperms
editperms (search, multiple)
This field is used to filter what eprints a staff member can approve and modify. If it's unset then they can modify any (given the correct privs. but if it is set then an eprint must match at least one of the searches to be within their scope.
frequency
frequency (set)
Only relevant to staff accounts. Is the frequency they want to be mailed about eprints matching their scope that are in editorial review. never, daily, weekly or monthly.
mailempty
mailempty (boolean)
Only relevant to staff accounts. If set to true then emails are sent even if there are no items matching the scope.
METHODS
get_system_field_info
$field_info = EPrints::DataObj::User->get_system_field_info
Return an array describing the system metadata of the this dataset.
new
$user = EPrints::DataObj::User->new( $session, $userid )
Load the user with the ID of $userid from the database and return it as an EPrints::DataObj::User object.
new_from_data
$user = EPrints::DataObj::User->new_from_data( $session, $data )
Construct a new EPrints::DataObj::User object based on the $data hash reference of metadata.
Used to create an object from the data retrieved from the database.
get_defaults
$defaults = EPrints::DataObj::User->get_defaults( $session, $data )
Return default values for this object based on the starting data.
user_with_email
$user = EPrints::DataObj::User::user_with_email( $session, $email )
Return the EPrints::user with the specified $email, or undef if they are not found.
user_with_username
$user = EPrints::DataObj::User::user_with_username( $session, $username )
Return the EPrints::user with the specified $username, or undef if they are not found.
validate
$problems = $thing->validate
Validate the user - find out if all the required fields are filled out, and that what's been filled in is OK. Returns a reference to an array of problem descriptions.
If there are no probelms then the array is empty.
The problems are XHTML DOM objects describing the problem.
commit
$user->commit( [$force] )
Write this object to the database.
If $force isn't true then it only actually modifies the database if one or more fields have been changed.
remove
$success = $user->remove
Remove this user from the database. Also, remove their saved searches, but do not remove their eprints.
get_eprints
$list = $user->get_eprints( $dataset )
Return EPrints in the given EPrints::DataSet which have this user as their creator.
Since 2.4 this returns an EPrints::List object, not an array of eprints.
get_editable_eprints
$list = $user->get_editable_eprints
Return eprints currently in the editorial review buffer. If this user has editperms set then only return those records which match.
Since 2.4 this returns an EPrints::List object, not an array of eprints.
get_owned_eprints
$list = $user->get_owned_eprints( $dataset );
Return a list of the eprints which this user owns. This is by default the same as $user->get_eprints( $dataset) but may be over-ridden by get_users_owned_eprints.
Since 2.4 this returns an EPrints::List object, not an array of eprints.
has_owner
$boolean = $user->has_owner( $possible_owner )
True if the users are the same record.
$ok = $user->mail( $subjectid, $message, [$replyto], [$email] )
Send an email to this user.
$subjectid is the ID of a phrase to use as the subject of this email.
$message is an XML DOM object describing the message in simple XHTML.
$replyto is the reply to address for this email, if different to the repository default.
$email is the email address to send this email to if different from this users configured email address.
Return true if the email was sent OK.
render
( $page, $title ) = $user->render
Render this user into HTML using the "user_render" method in ArchiveRenderConfig.pm. Returns both the rendered information and the title as XHTML DOM.
render_full
( $page, $title ) = $user->render_full
The same as $user->render, but renders all fields, not just those intended for public viewing. This is the admin view of the user.
get_url
$url = $user->get_url
Return the URL which will display information about this user.
If $staff is true then return the URL for an administrator to view and modify this record.
get_type
$type = $user->get_type
Return the type of this user. Equivalent of $user->get_value( "usertype" );
get_saved_searches
@saved_searches = $eprint->get_saved_searches
Return an array of all EPrint::DataObj::SavedSearch objects associated with this user.
send_out_editor_alert
$user->send_out_editor_alert
Called on users who are editors, when it's time to send their update on what items are in the editorial review buffer.
Sends the email if needed.
process_editor_alerts
EPrints::DataObj::User::process_editor_alerts( $session, $frequency );
Static method.
Called to send out all editor alerts of a given frequency (daily, weekly, monthly) for the current repository.
allow
$result = $user->allow( $priv, [$item] )
Rleturns true if $user can perform this action/view this screen.
A true result is 1..15 where the value indicates what about the user allowed the priv to be performed. This is used for filtering owner/ editor actions in eprint control screens.
1 = anybody (not currently used) 2 = only if logged in 4 = only if owner of item 8 = only if editor of item
For non item related privs the result will normally be 2.
Nb. That create eprint is NOT a priv related to an eprint, as you don't own it at that stage.