Commit 1db149b7 authored by Dries's avatar Dries
Browse files

- Patch #46126 by killes: properly initialize the user roles array.

parent eb2bed28
...@@ -67,6 +67,7 @@ function user_load($array = array()) { ...@@ -67,6 +67,7 @@ function user_load($array = array()) {
$user = db_fetch_object($result); $user = db_fetch_object($result);
$user = drupal_unpack($user); $user = drupal_unpack($user);
$user->roles = array();
if ($user->uid) { if ($user->uid) {
$user->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user'; $user->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user';
} }
......
...@@ -67,6 +67,7 @@ function user_load($array = array()) { ...@@ -67,6 +67,7 @@ function user_load($array = array()) {
$user = db_fetch_object($result); $user = db_fetch_object($result);
$user = drupal_unpack($user); $user = drupal_unpack($user);
$user->roles = array();
if ($user->uid) { if ($user->uid) {
$user->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user'; $user->roles[DRUPAL_AUTHENTICATED_RID] = 'authenticated user';
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment