addsiteuser.hook.php (fogproject-1.5.5) | : | addsiteuser.hook.php (fogproject-1.5.6) | ||
---|---|---|---|---|
skipping to change at line 101 | skipping to change at line 101 | |||
global $sub; | global $sub; | |||
if (!in_array($this->node, (array)self::$pluginsinstalled)) { | if (!in_array($this->node, (array)self::$pluginsinstalled)) { | |||
return; | return; | |||
} | } | |||
if ($node != 'user') { | if ($node != 'user') { | |||
return; | return; | |||
} | } | |||
if ($sub == 'pending') { | if ($sub == 'pending') { | |||
return; | return; | |||
} | } | |||
if (!in_array('accesscontrol', (array)self::$pluginsinstalled)) { | /* | |||
$insertIndex = 3; | if (!in_array('accesscontrol', (array)self::$pluginsinstalled)) | |||
} else { | { | |||
$insertIndex = 4; | $insertIndex = 3; | |||
} | } else { | |||
$insertIndexRestricted = $insertIndex + 1; | $insertIndex = 4; | |||
foreach ((array)$arguments['headerData'] as $index => &$str) { | } | |||
if ($index == $insertIndex) { | $insertIndexRestricted = $insertIndex + 1; | |||
$arguments['headerData'][$index] = _('Associated Sites'); | foreach ((array)$arguments['headerData'] as $index => &$str) { | |||
$arguments['headerData'][] = $str; | if ($index == $insertIndex) { | |||
} | $arguments['headerData'][$index] = _('Associated Sites') | |||
unset($str); | ; | |||
} | $arguments['headerData'][] = $str; | |||
foreach ((array)$arguments['headerData'] as $index => &$str) { | } | |||
if ($index == $insertIndexRestricted) { | unset($str); | |||
$arguments['headerData'][$index] = _('Is restricted'); | } | |||
$arguments['headerData'][] = $str; | foreach ((array)$arguments['headerData'] as $index => &$str) { | |||
} | if ($index == $insertIndexRestricted) { | |||
unset($str); | $arguments['headerData'][$index] = _('Is restricted'); | |||
} | $arguments['headerData'][] = $str; | |||
} | ||||
unset($str); | ||||
} | ||||
*/ | ||||
$arguments['headerData'][] = _('Associated Sites'); | ||||
$arguments['headerData'][] = _('Is restricted'); | ||||
} | } | |||
/** | /** | |||
* This function modifies the data of the user page. | * This function modifies the data of the user page. | |||
* Add one column calls 'Associated Sites' | * Add one column calls 'Associated Sites' | |||
* | * | |||
* @param mixed $arguments The arguments to modify. | * @param mixed $arguments The arguments to modify. | |||
* | * | |||
* @return void | * @return void | |||
*/ | */ | |||
public function userData($arguments) | public function userData($arguments) | |||
skipping to change at line 143 | skipping to change at line 147 | |||
global $sub; | global $sub; | |||
if (!in_array($this->node, (array)self::$pluginsinstalled)) { | if (!in_array($this->node, (array)self::$pluginsinstalled)) { | |||
return; | return; | |||
} | } | |||
if ($node != 'user') { | if ($node != 'user') { | |||
return; | return; | |||
} | } | |||
if ($sub == 'pending') { | if ($sub == 'pending') { | |||
return; | return; | |||
} | } | |||
if (!in_array('accesscontrol', (array)self::$pluginsinstalled)) { | /* | |||
$insertIndex = 3; | if (!in_array('accesscontrol', (array)self::$pluginsinstalled)) | |||
} else { | { | |||
$insertIndex = 4; | $insertIndex = 3; | |||
} | } else { | |||
$insertIndexRestricted = $insertIndex + 1; | $insertIndex = 4; | |||
foreach ((array)$arguments['attributes'] as $index => &$str) { | } | |||
if ($index == $insertIndex || $index == $insertIndex + 1) { | $insertIndexRestricted = $insertIndex + 1; | |||
$arguments['attributes'][$index] = array(); | foreach ((array)$arguments['attributes'] as $index => &$str) { | |||
$arguments['attributes'][] = $str; | if ($index == $insertIndex || $index == $insertIndex + 1) { | |||
} | $arguments['attributes'][$index] = array(); | |||
unset($str); | $arguments['attributes'][] = $str; | |||
} | } | |||
foreach ((array)$arguments['attributes'] as $index => &$str) { | unset($str); | |||
if ($index == $insertIndexRestricted || $index == $insertIndex + 1) | } | |||
{ | foreach ((array)$arguments['attributes'] as $index => &$str) { | |||
$arguments['attributes'][$index] = array(); | if ($index == $insertIndexRestricted || $index == $insertInd | |||
$arguments['attributes'][] = $str; | ex + 1) { | |||
} | $arguments['attributes'][$index] = array(); | |||
unset($str); | $arguments['attributes'][] = $str; | |||
} | } | |||
foreach ((array)$arguments['templates'] as $index => &$str) { | unset($str); | |||
if ($index == $insertIndex) { | } | |||
$arguments['templates'][$index] = '${site}'; | foreach ((array)$arguments['templates'] as $index => &$str) { | |||
$arguments['templates'][] = $str; | if ($index == $insertIndex) { | |||
} | $arguments['templates'][$index] = '${site}'; | |||
unset($str); | $arguments['templates'][] = $str; | |||
} | } | |||
foreach ((array)$arguments['templates'] as $index => &$str) { | unset($str); | |||
if ($index == $insertIndexRestricted) { | } | |||
$arguments['templates'][$index] = '${isRestricted}'; | foreach ((array)$arguments['templates'] as $index => &$str) { | |||
$arguments['templates'][] = $str; | if ($index == $insertIndexRestricted) { | |||
} | $arguments['templates'][$index] = '${isRestricted}'; | |||
unset($str); | $arguments['templates'][] = $str; | |||
} | } | |||
unset($str); | ||||
} | ||||
*/ | ||||
$arguments['attributes'][] = array(); | ||||
$arguments['templates'][] = '${site}'; | ||||
$arguments['attributes'][] = array(); | ||||
$arguments['templates'][] = '${isRestricted}'; | ||||
foreach ((array)$arguments['data'] as $index => &$vals) { | foreach ((array)$arguments['data'] as $index => &$vals) { | |||
$find = array( | $find = array( | |||
'userID' => $vals['id'] | 'userID' => $vals['id'] | |||
); | ); | |||
$Sites = self::getSubObjectIDs( | $Sites = self::getSubObjectIDs( | |||
'SiteUserAssociation', | 'SiteUserAssociation', | |||
$find, | $find, | |||
'siteID' | 'siteID' | |||
); | ); | |||
$isRestricted = self::getSubObjectIDs( | $isRestricted = self::getSubObjectIDs( | |||
skipping to change at line 256 | skipping to change at line 267 | |||
'userID' => $arguments['User']->get('id') | 'userID' => $arguments['User']->get('id') | |||
), | ), | |||
'isRestricted' | 'isRestricted' | |||
); | ); | |||
if (empty($isRestricted)) { | if (empty($isRestricted)) { | |||
$isRestricted = 0; | $isRestricted = 0; | |||
} else { | } else { | |||
$isRestricted = $isRestricted[0]; | $isRestricted = $isRestricted[0]; | |||
} | } | |||
self::arrayInsertAfter( | self::arrayInsertAfter( | |||
_('User Name'), | '<label for="name">' | |||
. _('User Name') | ||||
. '</label>', | ||||
$arguments['fields'], | $arguments['fields'], | |||
_('Is Restricted User '), | _('Is Restricted User '), | |||
sprintf( | sprintf( | |||
'<input type="checkbox" name="isRestricted" id="isRestricted"%s/ >' | '<input type="checkbox" name="isRestricted" id="isRestricted"%s/ >' | |||
. '<label for="isRestricted"></label>', | . '<label for="isRestricted"></label>', | |||
( | ( | |||
$isRestricted ? | $isRestricted ? | |||
' checked' : | ' checked' : | |||
'' | '' | |||
) | ) | |||
End of changes. 3 change blocks. | ||||
56 lines changed or deleted | 72 lines changed or added |