Add adress and phone number attributes
Change-Id: I7e69468ac6e5a05f42120a42bf02b92f18773ca7
diff --git a/redis.php b/redis.php
index 323a74b..45c00b0 100755
--- a/redis.php
+++ b/redis.php
@@ -17,11 +17,13 @@
function redis_get_user($key) {
$redis = connect();
- $data = json_decode($redis->get($key));
- if ($data && gettype($data) == "object") {
+ $data = json_decode($redis->get($key), true);
+ if ($data && gettype($data) == "array") {
$user = new User();
- foreach ($data as $key => $value) $user->{$key} = $value;
- if (isset($data->password)) $user->set_password($data->password);
+ $user->init_from_array($data);
+
+ #foreach ($data as $key => $value) $user->{$key} = $value;
+ #if (isset($data->password)) $user->set_password($data->password);
#$user = new User($data->username, $data->first_name, $data->last_name, $data->email, $data->password, $data->organization);
return $user;
} else {