• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Change Full Host Registration / QuickImage

    Scheduled Pinned Locked Moved Solved
    Feature Request
    6
    13
    5.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Lee RowlettL
      Lee Rowlett Developer
      last edited by

      [B]“Machine already registered” change:[/B]

      change [I]man.hostexists.php[/I] under [I]/var/www/service[/I] and change it to this (it’s around line 57):
      [CODE]
      $sql = “select hostName, count(*) as cnt from hosts where hostMAC = '” . $mac . “'”;
      $res = mysql_query( $sql, $conn ) or die( mysql_error() );
      while( $ar = mysql_fetch_array( $res ) )
      {
      if ( $ar[“cnt”] == 0 )
      {
      echo “#!ok”;
      }
      else
      echo “”._(“This Machine is already registed as”).": " . $ar[“hostName”] . “”;
      }[/CODE]

      1 Reply Last reply Reply Quote 0
      • D
        djm79
        last edited by

        Works great man thanks

        1 Reply Last reply Reply Quote 0
        • C
          chad-bisd Moderator
          last edited by

          Cool. Blackout integrated this into the codebase moving forward. I have always thoroughly enjoyed the guessing game and lookup when a host exists but I don’t know which one it is. /sarcasm off


          If you would like to make a donation to the Fog project, please do so [U][COLOR=#0000ff][URL='http://sourceforge.net/dona…

          1 Reply Last reply Reply Quote 0
          • BigDawg986B
            BigDawg986
            last edited by

            Yep, love it. Shared with the rest of the FOG evangelists I know.

            1 Reply Last reply Reply Quote 0
            • falkoF
              falko Moderator
              last edited by

              is there anyway to add a similar idea to the ‘Quick Host Reg and inventory’ for when the machine is already registered to show what machine it is? at the moment it just shows host exists

              1 Reply Last reply Reply Quote 0
              • Lee RowlettL
                Lee Rowlett Developer
                last edited by

                yes quite easy actually, without looking at the code, you should be able to use the same principle above but for auto.register.php

                1 Reply Last reply Reply Quote 0
                • falkoF
                  falko Moderator
                  last edited by

                  thanks will take a look when back at work

                  1 Reply Last reply Reply Quote 0
                  • falkoF
                    falko Moderator
                    last edited by

                    Lee (or anyone) are you able to help, I cant seem to find where to edit this?

                    1 Reply Last reply Reply Quote 0
                    • Lee RowlettL
                      Lee Rowlett Developer
                      last edited by

                      change auto.register.php line 77 (dependant on version you’ve got but it’s around there)
                      from:
                      [B]$sql = “select count() as cnt from hosts where hostMAC = ‘" . $mac . "’";[/B]
                      to:
                      [B]$sql = "select hostName, count(
                      ) as cnt from hosts where hostMAC = '” . $mac . “'”;[/B]
                      and then change output on line 264 (again might be diff line - version)
                      from:
                      [B]echo (“Exists”);[/B]
                      to:
                      [B]echo “”.
                      (“This Machine is already registed as”).": " . $ar[“hostName”] . “”;[/B]

                      i haven’t tested this but can’t see why it wouldn’t work 🙂

                      1 Reply Last reply Reply Quote 0
                      • falkoF
                        falko Moderator
                        last edited by

                        Thank you!! This works perfectly using FOG 0.32. This is so handy.

                        I would love to see this put into 0.33 code, I know the above patch has been (not sure if this part has).

                        Thanks again to everyone in thread

                        [quote=“Lee Rowlett, post: 9534, member: 28”]change auto.register.php line 77 (dependant on version you’ve got but it’s around there)
                        from:
                        [B]$sql = “select count() as cnt from hosts where hostMAC = ‘" . $mac . "’";[/B]
                        to:
                        [B]$sql = "select hostName, count(
                        ) as cnt from hosts where hostMAC = '” . $mac . “'”;[/B]
                        and then change output on line 264 (again might be diff line - version)
                        from:
                        [B]echo (“Exists”);[/B]
                        to:
                        [B]echo “”.
                        (“This Machine is already registed as”).": " . $ar[“hostName”] . “”;[/B]

                        i haven’t tested this but can’t see why it wouldn’t work :)[/quote]

                        1 Reply Last reply Reply Quote 0
                        • Tom ElliottT
                          Tom Elliott
                          last edited by

                          Added this to quick inventory screen as it was very simple. Thanks Lee!

                          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG! Get in contact with me (chat bubble in the top right corner) if you want to join in.

                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post

                          208

                          Online

                          12.1k

                          Users

                          17.3k

                          Topics

                          155.4k

                          Posts
                          Copyright © 2012-2024 FOG Project