diff options
Diffstat (limited to 'engine/lib/widgets.php')
-rw-r--r-- | engine/lib/widgets.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engine/lib/widgets.php b/engine/lib/widgets.php index 2660cc240..a455f8068 100644 --- a/engine/lib/widgets.php +++ b/engine/lib/widgets.php @@ -232,8 +232,12 @@ $widget = new ElggWidget;
$widget->owner_guid = $user_guid;
- $widget->access_id = ACCESS_LOGGED_IN;
- if (!$widget->save())
+ $widget->access_id = get_default_access();
+ // private widgets don't makes sense, correct?
+ if ($widget->access_id == ACCESS_PRIVATE)
+ $widget->access_id = ACCESS_LOGGED_IN; // change to ACCESS_FRIENDS when implemented
+
+ if (!$widget->save())
return false;
$widget->handler = $handler;
|