fogproject
1.5.9
About: FOG is a Linux-based network computer cloning solution for Windows, Mac OSX and various Linux distributions that ties together a few open-source tools with a PHP-based web interface. FOG doesn’t use any boot disks, or CDs; everything is done via TFTP and PXE.
![]() ![]() |
Public Member Functions | |
__construct ($mac) | |
getMACPrefix () | |
__toString () | |
isValid () | |
isPending () | |
isClientIgnored () | |
isPrimary () | |
isImageIgnored () | |
getHost () | |
wake ($ip, $port=9) | |
![]() | |
__construct () | |
orderBy (&$orderBy) | |
Protected Member Functions | |
setMAC () | |
![]() | |
isLoaded ($key) | |
setRequest () | |
sendData ( $datatosend, $service=true, $array=array()) | |
Static Protected Member Functions | |
static | normalizeMAC ($mac) |
![]() | |
static | getActivePlugins () |
static | fatalError ($txt, $data=array()) |
static | error ($txt, $data=array()) |
static | debug ($txt, $data=array()) |
static | info ($txt, $data=array()) |
static | setMessage ($txt, $data=array()) |
static | getMessages () |
static | redirect ($url='') |
static | arrayInsertBefore ( $key, array &$array, $new_key, $new_value) |
static | arrayInsertAfter ( $key, array &$array, $new_key, $new_value) |
static | arrayRemove ($key, array &$array) |
static | arrayFind ( $needle, array $haystack, $ignorecase=false) |
static | resetRequest () |
static | formatByteSize ($size) |
static | getGlobalModuleStatus ($names=false, $keys=false) |
static | validDate ($date, $format='') |
static | pluralize ($count, $text, $space=false) |
static | diff ($start, $end, $ago=false) |
static | humanify ($diff, $unit) |
static | arrayChangeKey (array &$array, $old_key, $new_key) |
static | byteconvert ($kilobytes) |
static | hex2bin ($hex) |
static | certEncrypt ($data) |
static | certDecrypt ($dataArr, $padding=true) |
static | arrayStrpos ($haystack, $needles, $case=true) |
static | log ( $txt, $curlog, $logfile, $logbrow, $obj, $level=1) |
static | logHistory ($string) |
static | getIPAddress ($force=false) |
Protected Attributes | |
$MAC | |
$tmpMAC | |
![]() | |
$isLoaded = array() | |
Private Attributes | |
$_msg = '' | |
$_Host = null | |
$_MAC = null | |
Static Private Attributes | |
static | $_pattern = '' |
Additional Inherited Members | |
![]() | |
static | getClass ($class, $data='', $props=false) |
static | getHostItem ( $service=true, $encoded=false, $hostnotrequired=false, $returnmacs=false, $override=false, $mac=false) |
static | getAllBlamedNodes ($Host) |
static | niceDate ($date='now', $utc=false) |
static | formatTime ($time, $format=false, $utc=false) |
static | createSecToken () |
static | aesencrypt ( $data, $key=false, $enctype='aes-256-cbc') |
static | aesdecrypt ( $encdata, $key=false, $enctype='aes-128-cbc') |
static | parseMacList ( $stringlist, $image=false, $client=false) |
static | getSubObjectIDs ( $object='Host', $findWhere=array(), $getField='id', $not=false, $operator='AND', $orderBy='name', $groupBy=false, $filter='array_unique') |
static | getSetting ($key) |
static | setSetting ($key, $value) |
static | getQueuedStates () |
static | getQueuedState () |
static | getCheckedInState () |
static | getProgressState () |
static | getCompleteState () |
static | getCancelledState () |
static | stringBetween ($string, $start, $end) |
static | stripAndDecode (&$item) |
static | getMasterInterface ($ip_find) |
static | lasterror () |
static | getFilesize ($path) |
static | wakeUp ($macs) |
static | fastmerge ($array1) |
static | getHash ($file) |
static | attemptLogin ($username, $password) |
static | clearMACLookupTable () |
static | getMACLookupCount () |
static | resolveHostname ($host) |
static | getBroadcast () |
static | randWait () |
![]() | |
static | $locale = '' |
static | $fogpingactive = false |
static | $fogdeleteactive = false |
static | $fogexportactive = false |
static | $pendingMACs = 0 |
static | $pendingHosts = 0 |
static | $defaultscreen = '' |
static | $pluginsinstalled = array() |
static | $useragent |
static | $foglang |
static | $ajax = false |
static | $post = false |
static | $service = false |
static | $json = false |
static | $newService = false |
static | $scriptname |
static | $querystring |
static | $httpreqwith |
static | $reqmethod |
static | $remoteaddr |
static | $httpreferer |
static | $mySchema = 0 |
static | $showhtml = true |
static | $httpproto = false |
static | $httphost = '' |
static | $Host = null |
![]() | |
static | $strlen |
static | $debug = false |
static | $info = false |
static | $buildSelectBox |
static | $selected |
static | $DB |
static | $FOGFTP |
static | $FOGCore |
static | $EventManager |
static | $HookManager |
static | $TimeZone |
static | $FOGUser |
static | $FOGPageManager |
static | $FOGURLRequests |
static | $FOGSubMenu |
static | $ips = array() |
static | $interface = array() |
static | $searchPages |
Definition at line 22 of file macaddress.class.php.
MACAddress::__construct | ( | $mac | ) |
Initializes the mac address class.
string | $mac | the mac item(s) |
Defines our grep/search patterns for validating a MAC Address.
Pull in our base initialized items.
Temp storage of our passed mac address.
Makes our required changes to the mac.
Exception |
If the mac is already registered, sets our MAC Variable to the instance of the db item.
Definition at line 65 of file macaddress.class.php.
References $mac, __toString(), FOGBase\getClass(), and setMAC().
MACAddress::__toString | ( | ) |
How to present the mac as a string.
Splits the mac to be an array for joining together easier. For example, mac 012345abcdef will become: ['01','23','45','ab','cd','ef'].
Joins the array with colons so our mac will be like: 01:23:45:ab:cd:ef
Returns our string
Reimplemented from FOGBase.
Definition at line 243 of file macaddress.class.php.
Referenced by __construct().
MACAddress::getHost | ( | ) |
MACAddress::getMACPrefix | ( | ) |
Gets the first 6 characters of the mac.
Gets the prefix of the mac address.
Splits into the segments for easier joining. For example, 012345 will become: ['01','23','45']
OUI text is in format xx-xx-xx, This puts the string together properly so string will become: 01-23-45
Returns our string.
Definition at line 207 of file macaddress.class.php.
MACAddress::isClientIgnored | ( | ) |
Tests if mac is to be ignored for client.
Definition at line 295 of file macaddress.class.php.
MACAddress::isImageIgnored | ( | ) |
Tests if mac is to be ignored for imaging.
Definition at line 313 of file macaddress.class.php.
MACAddress::isPending | ( | ) |
MACAddress::isPrimary | ( | ) |
MACAddress::isValid | ( | ) |
Tests if the mac is valid.
Tests the pattern to see if we are safe. Returns as bool.
Definition at line 270 of file macaddress.class.php.
Referenced by setMAC().
|
staticprotected |
Normalizes the mac address for us and lowers the case.
string | $mac | The mac to normalize |
Pull out the valid mac addresses in an array format.
Remove the :, -, and/or . and lowercase the characters. Return the string.
Definition at line 175 of file macaddress.class.php.
References $mac.
Referenced by setMAC().
|
protected |
Sets the mac.
Exception |
If the mac is already an instance of MACAddress, MACAddressAssociation, or plain string, normalize our protected MAC as lowercase without ., -, or :.
If the mac is an array, take the first mac address and perform the same as above.
If the mac address is not valid throw Invalid MAC message.
Split the normalized mac into an array using 2 characters as the split. For example: 012345abcdef would become ['01','23,'45','ab','cd','ef']
This creates a portion of the message string for WOL requests.
This creates and combines the message string. Message string is: 6 times inline 0xff 16 times hwAddr
Definition at line 106 of file macaddress.class.php.
References $tmpMAC, isValid(), and normalizeMAC().
Referenced by __construct().
MACAddress::wake | ( | $ip, | |
$port = 9 |
|||
) |
Wakes this MAC address.
string | $ip | the ip to send to |
int | $port | the port to sent from |
Assume return will be true for now.
Create our socket resource
If failed, immediately return.
Set our coket options
If invalid close socket and return immediately.
Send our wake up packet.
If failed set return to false;
Close the socket.
Return value
Definition at line 334 of file macaddress.class.php.
|
private |
Definition at line 41 of file macaddress.class.php.
|
private |
Definition at line 47 of file macaddress.class.php.
|
private |
Definition at line 35 of file macaddress.class.php.
|
staticprivate |
Definition at line 29 of file macaddress.class.php.
|
protected |
Definition at line 53 of file macaddress.class.php.
|
protected |
Definition at line 59 of file macaddress.class.php.
Referenced by setMAC().