Fix specifying owner as an array quietly failed

This commit is contained in:
Nathan Gray 2015-11-23 18:01:21 +00:00
parent f87c905777
commit 2b6eacd472
2 changed files with 6 additions and 2 deletions

View File

@ -304,7 +304,7 @@ class calendar_ui
if ($state == 'owner')
{
// only change the owners of the same resource-type as given in set_state[owner]
$set_owners = explode(',',$set_states['owner']);
$set_owners = is_array($set_states['owner']) ? $set_states['owner'] : explode(',',$set_states['owner']);
if ((string)$set_owners[0] === '0') // set exactly the specified owners (without the 0)
{
if ($set_states['owner'] === '0,r0') // small fix for resources

View File

@ -96,10 +96,14 @@ class calendar_uiforms extends calendar_ui
{
if ($owner) // make an owner who is no user or we have no add-rights a participant
{
if(!is_array($owner))
{
$owner = explode(',',$owner);
}
// if we come from ressources we don't need any users selected in calendar
if (!isset($_GET['participants']) || $_GET['participants'][0] != 'r')
{
foreach(explode(',',$owner) as $uid)
foreach($owner as $uid)
{
// only add users or a single ressource, not all ressources displayed by a category
if (is_numeric($uid) || $owner == $uid)