Tech List

[index] [prev] [next] [options] [help]
See the Mailing Lists Page for how to subscribe and unsubscribe.

eprints_tech messages

Please note: this page shows emails that have been sent to the eprints_tech mailing list. Some of these may be spam emails we have failed to filter.

[EP-tech] Re: Updating user details

From: Guy Knights <g.knights AT qut.edu.au>
Date: Fri, 7 Nov 2008 09:56:46 +1000


Threading: [EP-tech] Re: Updating user details from g.knights AT qut.edu.au
      • This Message

http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** EPrints community wiki - http://wiki.eprints.org/
Hi John,

Thanks for your reply, but what I'm actually after is updating the name in the 
'user' table - that is, the list of people who are registered to deposit in 
EPrints. If I try and use Tim's suggestion of $dataobj->set_value( 
"fieldname", $value ) and $dataobj->commit(), it doesn't seem to 
work for the fields 'name_given' and 'name_family' in table 'users'.

Cheers,
Guy

Guy Knights
Computer Systems Officer
Library Systems, QUT
Phone: (07) 3138 3910
Email: g.knights AT qut.edu.au


-----Original Message-----
From: eprints-tech-bounces AT ecs.soton.ac.uk [mailto:eprints-tech-bounces AT 
ecs.soton.ac.uk] On Behalf Of John Salter
Sent: Tuesday, 4 November 2008 7:37 PM
To: eprints-tech AT ecs.soton.ac.uk
Subject: [EP-tech] Re: Updating user details

http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** EPrints community wiki - http://wiki.eprints.org/
Guy,
I had all sorts of fun trying to get an automatic author-name into an
eprint.
This is the code I ended with - it may help you? (although this is
pulling the name from the user and putting it in the creator)

if( $user->is_set("name"))
{
	my $name = $user->get_value( "name" );
	my $email = $user->get_value( "email" );

	my  AT creator = {};
	push  AT creator, { name => { family => $name->{family}, given =>
$name->{given} }, id => $email };

	$eprint->set_value( "creators", \ AT creator );
}


Cheers,
John

-----Original Message-----
From: eprints-tech-bounces AT ecs.soton.ac.uk
[mailto:eprints-tech-bounces AT ecs.soton.ac.uk] On Behalf Of Guy Knights
Sent: 04 November 2008 01:31
To: eprints-tech AT ecs.soton.ac.uk
Subject: [EP-tech] Re: Updating user details


http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** EPrints community wiki - http://wiki.eprints.org/
Thanks Tim, I tried that and for the most part it worked ('org' and
'email' update ok). However, if I try and update the user's first name
(name_given) and surname (name_family), for some reason it won't update.

Any thoughts?

Thanks again,
Guy

Guy Knights
Computer Systems Officer
Library Systems, QUT
Phone: (07) 3138 3910
Email: g.knights AT qut.edu.au

-----Original Message-----
From: eprints-tech-bounces AT ecs.soton.ac.uk
[mailto:eprints-tech-bounces AT ecs.soton.ac.uk] On Behalf Of Tim Brody
Sent: Monday, 3 November 2008 9:08 PM
To: eprints-tech AT ecs.soton.ac.uk
Subject: [EP-tech] Re: Updating user details

http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** EPrints community wiki - http://wiki.eprints.org/
Guy Knights wrote:
> http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
> *** EPrints community wiki - http://wiki.eprints.org/
>   
>
> ----------------------------------------------------------------------
> --
>
> Hi all,
>
> Can anyone tell me how to update user details in the database via the
> User object? I can add a user to the database using 
> create_from_data(), but I'm not sure how to go about updating the 
> user's details after their account has been created.
>
As with all EPrint objects,

$dataobj->set_value( "fieldname", $value );

When you've changed everything you want to,

$dataobj->commit();


What $value looks like will depend on the field - whether it's multiple,

compound etc.

All the best,
Tim.




[index] [prev] [next] [options] [help]