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

    Making plugin - Function to check if hostname exists

    Scheduled Pinned Locked Moved
    General
    2
    2
    1.1k
    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

        190

        Online

        12.0k

        Users

        17.3k

        Topics

        155.2k

        Posts
        Copyright © 2012-2024 FOG Project