FOG Project

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

    Making plugin - Function to check if hostname exists

    General
    2
    2
    998
    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.
    • A
      Alipio Luiz last edited by

      Hi there… I’m making a plugin for FOG… I know there is a function called hostsExists to check if a mac address exists in the hosts table… however, is there any function to check if the hostname exists?

      Regards,
      Alipio Luiz

      1 Reply Last reply Reply Quote 0
      • B
        Blackout Developer last edited by

        Code for 0.33 BETA
        [code]// Within a FOG Class
        $hostExists = $this->getClass(‘HostManager’)->exists(array(‘name’ => ‘chicken’)));

        // Outside of a FOG Class
        $hostExists = $GLOBALS[‘FOGCore’]->getClass(‘HostManager’)->exists(array(‘name’ => ‘chicken’)));[/code]

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

        150
        Online

        10.2k
        Users

        16.3k
        Topics

        149.9k
        Posts

        Copyright © 2012-2020 FOG Project