Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
API:EPrints/DataObj/User
(section)
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===Object Methods=== <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_validate --> ====validate==== $problems = $user->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 problems then the array is empty. The problems are XHTML DOM objects describing the problem. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_commit --> ====commit==== $success = $user->commit( [ $force ] ) Writes this user data object to the database. If <tt>$force</tt> is set and <tt>true</tt> then dave to the database even if no fields have changed. Otherwise, only save if at least one field has changed. Returns a boolean depending on whether the user data object was successfully committed. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_close_non_current_login_tickets --> ====close_non_current_login_tickets==== $user->close_non_current_login_tickets Close all login tickets for this user except the one they are currently logged in on. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_remove --> ====remove==== $success = $user->remove Remove this user from the database. Also, remove their saved searches, but do not remove their eprints. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_is_staff --> ====is_staff==== $bool = $user->is_staff Returns true if the user [[API:EPrints/DataObj/User#has_role|has_role]] is <tt>editor</tt> or <tt>admin</tt>. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_language --> ====language==== $lang = $user->language Get the preferred language of this user. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_owned_eprints_list --> ====owned_eprints_list==== $list = $user->owned_eprints_list( %opts ) Returns a [[API:EPrints/List|EPrints::List]] of all the [[API:EPrints/DataObj/EPrint|EPrints::DataObj::EPrint]]s owned by this user. <tt>%opts</tt> is passed to a [[API:EPrints/Search|EPrints::Search]], which is used to filter the results. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_editable_eprints_list --> ====editable_eprints_list==== $list = $user->editable_eprints_list( %opts ) Returns a [[API:EPrints/List|EPrints::List]] of [[API:EPrints/DataObj/EPrint|EPrints::DataObj::EPrint]]s that match this user's editorial search expressions. If the user has no editorial scope a list of all eprints that match the given <tt>%opts</tt> is returned. <tt>%opts</tt> is passed to a [[API:EPrints/Search|EPrints::Search]] which is used to filter the results. $list = $user->editable_eprints_list( dataset => $repo->dataset( "buffer" ), ); <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_has_owner --> ====has_owner==== $boolean = $user->has_owner( $possible_owner ) Returns <tt>true</tt> if <tt>$possible_owner</tt> is the same as this user. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_mail --> ====mail==== $ok = $user->mail( $subjectid, $message, [$replyto, $email, $cc_list] ) Send an email to this user. <tt>$subjectid</tt> is the ID of a phrase to use as the subject of this email. <tt>$message</tt> is an XML DOM object describing the message in simple XHTML. <tt>$replyto</tt> is the reply to address for this email, if different to the repository default. <tt>$email</tt> is the email address to send this email to if different from this users configured email address. <tt>$cc_list</tt> is an optional CC list (array reference) Returns <tt>true</tt> if the email was sent OK. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_render --> ====render==== ( $page, $title ) = $user->render Returns XHTML DOM renderings of the page and the title for this user's page. This uses the configurable <tt>$user_render</tt> method that can typically be found in <tt>cfg.d/user_render.pl</tt>. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_render_full --> ====render_full==== ( $page, $title ) = $user->render_full The same as [[API:EPrints/DataObj/User#render|render]], but returns page and title renderings for all fields, not just those intended for public viewing. This is the admin view of the user. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_get_url --> ====get_url==== $url = $user->get_url Returns the URL which will display information about this user. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_get_control_url --> ====get_control_url==== $url = $dataobj->get_control_url Returns the URL for the control page for this user. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_get_type --> ====get_type==== $type = $user->get_type Return the type of this user. Alias for: $user->get_value( "usertype" ) <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_get_saved_searches --> ====get_saved_searches==== @saved_searches = $eprint->get_saved_searches Returns an array of all {{API:PodLink|file=EPrint/DataObj/SavedSearch|package_name=EPrint::DataObj::SavedSearch|section=|text=EPrint::DataObj::SavedSearch}} objects associated with this user. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_preference --> ====preference==== $value = $user->preference( $key ) Returns the preference value for <tt>$key</tt>. Otherwise, returns <tt>undef</tt>. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_set_preference --> ====set_preference==== $user->set_preference( $key, $value ) Set a preference <tt>$key</tt> to <tt>$value</tt> for this user. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_send_out_editor_alert --> ====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. Typically called by [[API:EPrints/DataObj/User#process_editor_alerts|process_editor_alerts]]. Only sends the email if needed. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_allow --> ====allow==== $result = $user->allow( $priv, [ $item ] ) Returns <tt>true</tt> if user can perform an action specified by <tt>$priv</tt>. If set, further checks whether the user is permitted to perform the action of <tt>$priv</tt> on a particular <tt>$item</tt> data object. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_has_privilege --> ====has_privilege==== $boolean = $user->has_privilege( $priv ) Returns <tt>true</tt> if <tt>$priv</tt> is in the user's privileges list. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_get_privs --> ====get_privs==== $privs = $user->get_privs Returns the privileges this user has. Currently just based on roles, but could do more later. Returns a reference to a hash. Caching the result to save time in future. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_get_roles --> ====get_roles==== @roles = $user->get_roles; Returns the roles this user has. Each role represents a whole bunch of privileges. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=item_has_role --> ====has_role==== $user->has_role( $roleid ) Returns boolean dependent on whether this user has the role <tt>$roleid</tt>. <div style='background-color: #e8e8f; margin: 0.5em 0em 1em 0em; border: solid 1px #cce; padding: 0em 1em 0em 1em; font-size: 80%; '> <span style='display:none'>User Comments</span> <!-- Edit below this comment --> <!-- Pod2Wiki= --> </div> <!-- Pod2Wiki=head_utility_methods -->
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)