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.
  Fossies Dox: fogproject-1.5.9.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

Snapin Class Reference
Inheritance diagram for Snapin:
[legend]
Collaboration diagram for Snapin:
[legend]

Public Member Functions

 destroy ($key='id')
 
 save ()
 
 deleteFile ()
 
 addHost ($addArray)
 
 removeHost ($removeArray)
 
 addGroup ($addArray)
 
 removeGroup ($removeArray)
 
 getStorageGroup ()
 
 getPrimaryGroup ($groupID)
 
 setPrimaryGroup ($groupID)
 
- Public Member Functions inherited from FOGController
 __construct ($data='')
 
 __destruct ()
 
 __toString ()
 
 get ($key='')
 
 set ($key, $value)
 
 add ($key, $value)
 
 remove ($key, $value)
 
 load ($key='id')
 
 getcolumns (&$fields)
 
 key (&$key)
 
 isValid ()
 
 buildQuery (&$join, &$whereArrayAnd, &$c, $not=false, $compare='=')
 
 setQuery (&$queryData)
 
 getManager ()
 
 assocSetter ($assocItem, $alterItem='', $implicitCall=false)
 
- Public Member Functions inherited from FOGBase
 __construct ()
 
 orderBy (&$orderBy)
 

Protected Member Functions

 loadHosts ()
 
 loadHostsnotinme ()
 
 loadStoragegroups ()
 
 loadStoragegroupsnotinme ()
 
 loadPath ()
 
- Protected Member Functions inherited from FOGController
 loadItem ($key)
 
 addRemItem ($key, $array, $array_type)
 
- Protected Member Functions inherited from FOGBase
 isLoaded ($key)
 
 setRequest ()
 
 sendData ( $datatosend, $service=true, $array=array())
 

Protected Attributes

 $databaseTable = 'snapins'
 
 $databaseFields
 
 $databaseFieldsRequired
 
 $additionalFields
 
- Protected Attributes inherited from FOGController
 $data = array()
 
 $autoSave = false
 
 $databaseTable = ''
 
 $databaseFields = array()
 
 $databaseFieldsRequired = array()
 
 $additionalFields = array()
 
 $databaseFieldsFlipped = array()
 
 $databaseFieldsToIgnore
 
 $aliasedFields = array()
 
 $databaseFieldClassRelationships = array()
 
 $loadQueryTemplate = 'SELECT %s FROM `%s` %s WHERE `%s`=%s %s'
 
 $insertQueryTemplate = 'INSERT INTO `%s` (%s) VALUES (%s) %s %s'
 
 $destroyQueryTemplate = 'DELETE FROM `%s` WHERE %s=%s%s'
 
- Protected Attributes inherited from FOGBase
 $isLoaded = array()
 

Additional Inherited Members

- Static Public Member Functions inherited from FOGBase
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 Public Attributes inherited from FOGBase
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 Protected Member Functions inherited from FOGBase
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)
 
- Static Protected Attributes inherited from FOGBase
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
 

Detailed Description

Definition at line 22 of file snapin.class.php.

Member Function Documentation

◆ addGroup()

Snapin::addGroup (   $addArray)

Adds groups to this object.

Parameters
array$addArraythe items to add
Returns
object

Definition at line 288 of file snapin.class.php.

References FOGController\addRemItem().

◆ addHost()

Snapin::addHost (   $addArray)

Add hosts to snapin object.

Parameters
array$addArraythe items to add
Returns
object

Definition at line 222 of file snapin.class.php.

References FOGController\addRemItem().

◆ deleteFile()

Snapin::deleteFile ( )

Deletes the snapin file.

Returns
bool

Definition at line 161 of file snapin.class.php.

References $foglang, $ip, $pass, and $user.

◆ destroy()

Snapin::destroy (   $key = 'id')

Removes the item from the database.

Parameters
string$keythe key to remove
Exceptions
Exception
Returns
object

Reimplemented from FOGController.

Definition at line 87 of file snapin.class.php.

References FOGBase\getClass(), and FOGBase\getSubObjectIDs().

◆ getPrimaryGroup()

Snapin::getPrimaryGroup (   $groupID)

Gets the snapin's primary group.

Parameters
int$groupIDthe group id to check
Returns
bool

Definition at line 364 of file snapin.class.php.

References FOGBase\getClass(), FOGBase\getSubObjectIDs(), and setPrimaryGroup().

Referenced by getStorageGroup().

◆ getStorageGroup()

Snapin::getStorageGroup ( )

Gets the storage group.

Exceptions
Exception
Returns
object

Definition at line 330 of file snapin.class.php.

References $count, $groupids, getPrimaryGroup(), and FOGBase\getSubObjectIDs().

◆ loadHosts()

Snapin::loadHosts ( )
protected

Loads hosts.

Returns
void

Definition at line 202 of file snapin.class.php.

References FOGBase\getSubObjectIDs().

◆ loadHostsnotinme()

Snapin::loadHostsnotinme ( )
protected

Loads items not with this object.

Returns
void

Definition at line 250 of file snapin.class.php.

◆ loadPath()

Snapin::loadPath ( )
protected

Loads the Path as the file for commonality in some methods.

Returns
void

Definition at line 449 of file snapin.class.php.

◆ loadStoragegroups()

Snapin::loadStoragegroups ( )
protected

Loads storage groups with this object.

Returns
void

Definition at line 263 of file snapin.class.php.

References $groupids, and FOGBase\getSubObjectIDs().

◆ loadStoragegroupsnotinme()

Snapin::loadStoragegroupsnotinme ( )
protected

Loads groups not with this snapin.

Returns
void

Definition at line 316 of file snapin.class.php.

◆ removeGroup()

Snapin::removeGroup (   $removeArray)

Removes groups from this object.

Parameters
array$removeArraythe items to remove
Returns
object

Definition at line 303 of file snapin.class.php.

References FOGController\addRemItem().

◆ removeHost()

Snapin::removeHost (   $removeArray)

Remove hosts from snapin object.

Parameters
array$removeArraythe items to remove
Returns
object

Definition at line 237 of file snapin.class.php.

References FOGController\addRemItem().

◆ save()

Snapin::save ( )

Stores data into the database.

Returns
bool|object

Reimplemented from FOGController.

Definition at line 135 of file snapin.class.php.

References FOGBase\getSubObjectIDs(), FOGController\load(), and setPrimaryGroup().

◆ setPrimaryGroup()

Snapin::setPrimaryGroup (   $groupID)

Sets the primary group for the snapin.

Parameters
int$groupIDthe id to set as primary
Returns
array

Unset all current groups to non-primary

Set the passed group as primary

Definition at line 402 of file snapin.class.php.

References $exists, FOGBase\getClass(), and FOGBase\getSubObjectIDs().

Referenced by getPrimaryGroup(), and save().

Member Data Documentation

◆ $additionalFields

Snapin::$additionalFields
protected
Initial value:
= array(
'hosts',
'hostsnotinme',
'storagegroups',
'storagegroupsnotinme',
'path',
)

Definition at line 71 of file snapin.class.php.

◆ $databaseFields

Snapin::$databaseFields
protected
Initial value:
= array(
'id' => 'sID',
'name' => 'sName',
'description' => 'sDesc',
'file' => 'sFilePath',
'args' => 'sArgs',
'createdTime' => 'sCreateDate',
'createdBy' => 'sCreator',
'reboot' => 'sReboot',
'shutdown' => 'sShutdown',
'runWith' => 'sRunWith',
'runWithArgs' => 'sRunWithArgs',
'protected' => 'snapinProtect',
'isEnabled' => 'sEnabled',
'toReplicate' => 'sReplicate',
'hide' => 'sHideLog',
'timeout' => 'sTimeout',
'packtype' => 'sPackType',
'hash' => 'sHash',
'size' => 'sSize',
'anon3' => 'sAnon3',
)

Definition at line 35 of file snapin.class.php.

◆ $databaseFieldsRequired

Snapin::$databaseFieldsRequired
protected
Initial value:
= array(
'name',
'file',
)

Definition at line 62 of file snapin.class.php.

◆ $databaseTable

Snapin::$databaseTable = 'snapins'
protected

Definition at line 29 of file snapin.class.php.


The documentation for this class was generated from the following file: