Gossamer Forum
Home : Products : Others : Gossamer Community :

Profile update from external application?

Quote Reply
Profile update from external application?
Hi,

Does anyone have experience with updating/creating users in community from external applications?

At this moment i have existing user profiles which must be updated in community and new users created from staff that needs to be inserted in comm database.

I've searched docs but not found a clue :(
Does anybody have tried this?

zaaron

---------
GetLokal Reviews
Quote Reply
Re: [zaaron] Profile update from external application? In reply to
Nevermind,

I solve it Wink

zaaron

---------
GetLokal Reviews
Quote Reply
Re: [zaaron] Profile update from external application? In reply to
I'd be interested in hearing how you solved this

CCUnet
my Christian web
Quote Reply
Re: [ccunet] Profile update from external application? In reply to
Here it is :)

I've dig down in community and found this - cuser_insert and cuser_update
in Community::User.pm and this is my code.

Code:
my $res = Community::User::cuser_insert({
comm_username => $results->{user_username},
comm_password => $results->{user_password},
comm_email => $results->{user_email},
comm_enabled => '1',
prof_first_name => $results->{user_first_name},
prof_last_name => $results->{user_last_name},
});
if (! $res) {
my $error_msg = $Community::error;
comm_debug($error_msg);
}

zaaron

---------
GetLokal Reviews
Quote Reply
Re: [zaaron] Profile update from external application? In reply to
Hi,

Alternatively you can do:

Code:
use Community qw/comm_get_profile comm_set_profile/;

my $user = comm_get_profile( comm_username => 'alex' );
$user->{prof_first_name} = 'Alex';
comm_set_profile($user);

Cheers,

Alex
--
Gossamer Threads Inc.