Single Signon

 
<?php
echo "test ".random(10,20);
//This is your user object, the avatar is optional
$user = array(
   "id" => 1154,
   "username" => "JohnIDoe",
   "email" => "[email protected]",       
   "avatar"=> "http://didine66.d.i.pic.centerblog.net/e1d055e5.gif");
   
   //Your secret key
   $secret = "8b1a9859c46412s6pp27qbg8d27404d7";
   //This is how you sign the user oject
   $timestamp = time();
   $message = base64_encode(json_encode($user));
   $hmac = hash_hmac('sha1', "$message $timestamp", $secret);

   //Create a string with encoded object, signature and timestamp
   $userData = $message."|".$timestamp."|".$hmac;
?>
 
How to pass the user data
After encoding and signing the user data string as described above, simply add a parameter called “user” where you pass the variable $userData:
 
<script type="text/javascript">
var reziew_options = {
   shortname: "your_shortname", 
   /* Fill in your options here */
   user: "<?php echo $userData; ?>"
   };
</script>
 
Why does the user object need to be encoded?
Only you with the private key you get can sign the user Object. If somebody tries to pass a fake accout, it won’t be accepted.
Caution
Please make sure the id for the user you pass is unique to your site