Permalink
Browse files

Fixed some bugs to work under FOG 1.5.5 version

  • Loading branch information...
root
root committed Jan 24, 2019
1 parent 632fc15 commit 90bb813d8612080cee08aef0c28c0c2a335285ed
@@ -77,7 +77,7 @@ public function install()
*/
public function uninstall()
{
self::getClass('SiteHostAssociationManager')->install();
self::getClass('SiteHostAssociationManager')->uninstall();
return parent::uninstall();
}
}
@@ -21,7 +21,7 @@
*/
$fog_plugin = array();
$fog_plugin['name'] = 'site';
$fog_plugin['description'] = 'This plugin restricts the access to the item by site';
$fog_plugin['description'] = 'This plugin restricts the access to the item by site. Version 1.5.5';
$fog_plugin['menuicon'] = 'fa fa-building fa-fw';
$fog_plugin['menuicon_hover'] = null;
$fog_plugin['entrypoint'] = 'html/run.php';
@@ -215,7 +215,7 @@ public function groupAddSite($arguments)
unset($hostID);
}
if (count($insert_values) > 0) {
self::getClass('SiteAssociationManager')
self::getClass('SiteHostAssociationManager')
->insertBatch(
$insert_fields,
$insert_values
@@ -316,12 +316,12 @@ public function hostAddSite($arguments)
'siteID',
'hostID'
);
$insert_valuse = array();
$insert_values = array();
$insert_values[] = array(
$site,
$arguements['Host']->get('id')
$arguments['Host']->get('id')
);
if (count($insert_valeus)) {
if (count($insert_values)) {
self::getClass('SiteHostAssociationManager')
->insertBatch(
$insert_fields,
@@ -98,6 +98,7 @@ public function userTableHeader($arguments)
if ($sub == 'pending') {
return;
}
/*
if (!in_array('accesscontrol', (array)self::$pluginsinstalled)) {
$insertIndex = 3;
} else {
@@ -118,6 +119,9 @@ public function userTableHeader($arguments)
}
unset($str);
}
*/
$arguments['headerData'][] = _('Associated Sites');
$arguments['headerData'][] = _('Is restricted');
}
/**
* This function modifies the data of the user page.
@@ -140,6 +144,7 @@ public function userData($arguments)
if ($sub == 'pending') {
return;
}
/*
if (!in_array('accesscontrol', (array)self::$pluginsinstalled)) {
$insertIndex = 3;
} else {
@@ -174,6 +179,12 @@ public function userData($arguments)
}
unset($str);
}
*/
$arguments['attributes'][] = array();
$arguments['templates'][] = '${site}';
$arguments['attributes'][] = array();
$arguments['templates'][] = '${isRestricted}';
foreach ((array)$arguments['data'] as $index => &$vals) {
$find = array(
'userID' => $vals['id']
@@ -253,7 +264,9 @@ public function userFields($arguments)
$isRestricted = $isRestricted[0];
}
self::arrayInsertAfter(
_('User Name'),
'<label for="name">'
. _('User Name')
. '</label>',
$arguments['fields'],
_('Is Restricted User '),
sprintf(

0 comments on commit 90bb813

Please sign in to comment.