| 67 | | return true; |
|---|
| | 67 | |
|---|
| | 68 | //since a user name have been created by being defined as a member of a project without having previously logged in |
|---|
| | 69 | //we check if they have a name defined and if not, we update from sso. |
|---|
| | 70 | if($temp = get_record('users','username',$username, 'name', '')) {//if the username exists, but the name is blank |
|---|
| | 71 | |
|---|
| | 72 | $user = new StdClass; |
|---|
| | 73 | $user->ident = $temp->ident; |
|---|
| | 74 | $user->email = $user_info["email"]; |
|---|
| | 75 | $user->name = $user_info["firstname"]; |
|---|
| | 76 | $user->name = $user->name . " " . $user_info["lastname"]; |
|---|
| | 77 | $user->username = $username; |
|---|
| | 78 | $user->password = md5($password); |
|---|
| | 79 | $user->user_type = 'person'; |
|---|
| | 80 | $user->owner = -1; |
|---|
| | 81 | |
|---|
| | 82 | update_record('users',$user); |
|---|
| | 83 | //Since this is the first time the user has logged in, do normal user creation stuff |
|---|
| | 84 | $rssresult = run("weblogs:rss:publish", array($user->ident, false)); |
|---|
| | 85 | $rssresult = run("files:rss:publish", array($user->ident, false)); |
|---|
| | 86 | $rssresult = run("profile:rss:publish", array($user->ident, false)); |
|---|
| | 87 | user_flag_set("emailnotifications", '1', $user->ident); |
|---|
| | 88 | |
|---|
| | 89 | } |
|---|
| | 90 | return true; |
|---|