Open Source Content Management Framework

PHP midgard_user method get_person

  1. Example

Get person object which is associated with user.

midgard_person get_person(void);

midgard_user method get_person takes no arguments.

Returns midgard_person object which is associated with user.

Person object is associated with midgard_user when authentication is done. There's no need to get person from database by creating new instance. Returned person is a reference to midgard_person object and you should never unset person object.

Example

<?php

$user = midgard_user::auth("john", "secret", "domain"); 

if($user)
{
    $person = $user->get_person();
    echo "Logged in as ".$person->firstname." ".$person->lastname." "; 
} 

?>
Tagged
ragnaroek
vinland
Designed by Nemein, hosted by Kafit