Extend User and Registration process

Adrian Räuchle Posted in Component Development 7 years ago

hey guys. What if i want to achieve the following:

Extending the User entity with some additional fields. After the user has activated his account i want him to be redirect to a new page which i created were he should enter his new data.

Can someone guide me on how i can do this?

:)

Replies
Indonesian Arsalan Shah Replied 7 years ago

Yes, you can use that :

$profile = ossn_user_by_guid($user->guid)
OssnSession::assign('OSSN_USER', $profile);
$url = $profile->profileURL("/address");
header("Location: {$url}"); ;
German Adrian Räuchle Replied 7 years ago
Indonesian Arsalan Shah Replied 7 years ago

You should try this :

    $profile = ossn_loggedin_user();
    $url = $profile->profileURL("/address");
    header("Location: {$url}"); ;
German Adrian Räuchle Replied 7 years ago
German Adrian Räuchle Replied 7 years ago
Indonesian Arsalan Shah Replied 7 years ago

Here is method you can do that :

  1. Register the page handler for uservalidate and copy the user validation code from ossn.lib.initilize.php (you should see function ossn_uservalidate_pagehandler)

  2. In your new code after if($user->ValidateRegistration()){... you can add redirect('yournewpage'); that shows the fields you wanted to add. After activation you can login the user automatically,

  3. To add new user fields, please take a look at signup fields component.