• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login
    1. Home
    2. iteixido
    I
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 3
    • Best 1
    • Controversial 0
    • Groups 0

    iteixido

    @iteixido

    1
    Reputation
    1
    Profile views
    3
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    iteixido Unfollow Follow

    Best posts made by iteixido

    • [Sites plugin] Sites shown when adding or editing a host

      Hi!
      I have installed Fog 1.5.8 with the Sites plugin.
      When an unprivileged user tries to add or edit a host, the site selection box shows all sites, not just the sites of which the user is a part.
      It would be great if only the sites to which the user belongs are displayed.

      I have implemented it by adding the following code to line 262 of the file /var/www/html/fog/lib/plugins/site/hooks/addsitehost.hook.php

      $UserIsRestricted = self::getSubObjectIDs(
          'SiteUserRestriction',
          array('userID' => self::$FOGUser->get('id')),
          'isRestricted'
      )[0];
      if ($UserIsRestricted == 1) {
          $SitesFiltered = array_diff(
              self::getSubObjectIDs(
                  'Site',
                  '',
                  'id'
              ),
              self::getSubObjectIDs(
                  'SiteUserAssociation',
                  array('userID' => self::$FOGUser->get('id')),
                  'siteID'
              )
          );
      } else {
          $SitesFiltered = '';
      }
      

      And modifying lines 284 of the file /var/www/html/fog/lib/plugins/site/hooks/addsitehost.hook.php by:

      $sID,
      '',
      'name',
      $SitesFiltered
      

      Thanks!

      posted in Bug Reports
      I
      iteixido

    Latest posts made by iteixido

    • [Sites plugin] Hosts links in site menu

      Hi!
      I have installed Fog 1.5.8 with the Sites plugin.
      I have detected an error when I list the hosts associated to a site. When I go to “Hosts Associated” tab in Sites menu, the hosts are linked to users profiles.
      I was able to solve the error modifying the line 464 in file /var/www/html/fog/lib/plugins/site/pages/sitemanagementpage.class.php by:

      '<a href="?node=host&sub=edit&id=${host_id}">'
      

      Thanks!

      posted in Bug Reports
      I
      iteixido
    • [Sites plugin] Bug when import CSV file

      Hi!
      I have installed Fog 1.5.8 with the Sites plugin.
      I have detected an error when I try to import a CSV hosts file. Most of the time the server gives a 500 error code when the file is imported, and when it doesn’t give an error the site is not assigned correctly.

      I was able to solve the error editing the file /var/www/html/fog/lib/plugins/site/hooks/addsitehost.hook.php decreasing the value assigned to the insertIndex variable in lines 372 and 374 by 1 and modifying lines 372 and 374 by this code:

      self::getClass('SiteHostAssociation')
          ->set('hostID', $arguments['Host']->get('id'))
      
      posted in Bug Reports
      I
      iteixido
    • [Sites plugin] Sites shown when adding or editing a host

      Hi!
      I have installed Fog 1.5.8 with the Sites plugin.
      When an unprivileged user tries to add or edit a host, the site selection box shows all sites, not just the sites of which the user is a part.
      It would be great if only the sites to which the user belongs are displayed.

      I have implemented it by adding the following code to line 262 of the file /var/www/html/fog/lib/plugins/site/hooks/addsitehost.hook.php

      $UserIsRestricted = self::getSubObjectIDs(
          'SiteUserRestriction',
          array('userID' => self::$FOGUser->get('id')),
          'isRestricted'
      )[0];
      if ($UserIsRestricted == 1) {
          $SitesFiltered = array_diff(
              self::getSubObjectIDs(
                  'Site',
                  '',
                  'id'
              ),
              self::getSubObjectIDs(
                  'SiteUserAssociation',
                  array('userID' => self::$FOGUser->get('id')),
                  'siteID'
              )
          );
      } else {
          $SitesFiltered = '';
      }
      

      And modifying lines 284 of the file /var/www/html/fog/lib/plugins/site/hooks/addsitehost.hook.php by:

      $sID,
      '',
      'name',
      $SitesFiltered
      

      Thanks!

      posted in Bug Reports
      I
      iteixido