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)  

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

Public Member Functions

 __construct ()
 
 names ($class, $whereItems=[])
 
 ids ($class, $whereItems=[], $getField='id')
 
- Public Member Functions inherited from FOGBase
 __toString ()
 
 orderBy (&$orderBy)
 

Static Public Member Functions

static setMatches ()
 
static getMatches ()
 
static runMatches ()
 
static sendResponse ($code, $msg=false)
 
static status ()
 
static listem ( $class, $sortby='name', $bypass=false, $find=array(), $item='')
 
static listdetails ( $class, $item, $sortby='name', $bypass=false, $find=array())
 
static search ($class, $item)
 
static indiv ($class, $id, $item='')
 
static edit ($class, $id)
 
static task ($class, $id)
 
static create ($class)
 
static cancel ($class, $id)
 
static getsearchbody ($class)
 
static active ($class)
 
static delete ($class, $id)
 
static setErrorMessage ($message, $code=false)
 
static getData ()
 
static printer ($data, $code=false)
 
static getter ($classname, $class, $item='')
 
static deletemass ($class, $whereItems=[])
 
- 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

static $router = null
 
static $matches = array()
 
static $data
 
static $validClasses
 
static $validTaskingClasses
 
static $validActiveTasks
 
- 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

static defineRoutes ()
 
- 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 Private Member Functions

static _testToken ()
 
static _testAuth ()
 

Static Private Attributes

static $_enabled = false
 
static $_token = ''
 

Additional Inherited Members

- Protected Member Functions inherited from FOGBase
 isLoaded ($key)
 
 setRequest ()
 
 sendData ( $datatosend, $service=true, $array=array())
 
- Protected Attributes inherited from FOGBase
 $isLoaded = array()
 
- 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 route.class.php.

Constructor & Destructor Documentation

◆ __construct()

Route::__construct ( )

Initialize element.

Returns
void

If API is not enabled redirect to home page.

Test our token.

Test our authentication.

Ensure api has unlimited time.

Define the event so plugins/hooks can modify what/when/where.

If the router is already defined, don't re-instantiate it.

Reimplemented from FOGBase.

Definition at line 141 of file route.class.php.

References $data, _testAuth(), _testToken(), defineRoutes(), exit, FOGBase\getSubObjectIDs(), printer(), runMatches(), and setMatches().

Member Function Documentation

◆ _testAuth()

static Route::_testAuth ( )
staticprivate

Test authentication.

Returns
void

Definition at line 371 of file route.class.php.

References FOGBase\getClass(), HTTPResponseCodes\HTTP_UNAUTHORIZED, and sendResponse().

Referenced by __construct().

◆ _testToken()

static Route::_testToken ( )
staticprivate

Test token information.

Returns
void

Definition at line 355 of file route.class.php.

References HTTPResponseCodes\HTTP_FORBIDDEN, and sendResponse().

Referenced by __construct().

◆ active()

static Route::active (   $class)
static

◆ cancel()

static Route::cancel (   $class,
  $id 
)
static

Cancels a task element.

Parameters
string$classThe class to work with.
int$idThe id of the item.
Returns
void

Definition at line 1018 of file route.class.php.

References FOGBase\$Host, FOGBase\fastmerge(), getsearchbody(), FOGBase\getSubObjectIDs(), HTTPResponseCodes\HTTP_NOT_FOUND, and sendResponse().

◆ create()

static Route::create (   $class)
static

Creates an item.

Parameters
string$classThe class to work with.
Returns
void

Definition at line 889 of file route.class.php.

References $exists, $foglang, $val, FOGBase\getClass(), HTTPResponseCodes\HTTP_EXPECTATION_FAILED, HTTPResponseCodes\HTTP_INTERNAL_SERVER_ERROR, indiv(), sendResponse(), and setErrorMessage().

◆ defineRoutes()

static Route::defineRoutes ( )
staticprotected

Defines our standard routes.

Returns
void

Definition at line 230 of file route.class.php.

Referenced by __construct().

◆ delete()

static Route::delete (   $class,
  $id 
)
static

Deletes an element.

Parameters
string$classThe class to work with.
int$idThe id of class to remove.
Returns
void

Definition at line 1143 of file route.class.php.

References $data, HTTPResponseCodes\HTTP_NOT_FOUND, and sendResponse().

◆ deletemass()

static Route::deletemass (   $class,
  $whereItems = [] 
)
static

Delete items in mass.

Parameters
string$classThe class we're to remove items.
array$whereItemsThe items we're removing.
Returns
void

Definition at line 1631 of file route.class.php.

References $data, and FOGBase\getClass().

Referenced by FOGController\assocSetter(), and Site\assocSetter().

◆ edit()

static Route::edit (   $class,
  $id 
)
static

Enables editing/updating a specified object.

Parameters
string$classThe class to work with.
int$idThe id of the item.
Returns
void

Definition at line 595 of file route.class.php.

References $exists, $val, FOGBase\getClass(), getData(), HTTPResponseCodes\HTTP_INTERNAL_SERVER_ERROR, HTTPResponseCodes\HTTP_NOT_FOUND, ids(), indiv(), sendResponse(), and setErrorMessage().

◆ getData()

static Route::getData ( )
static

Gets json data

Returns
string

Definition at line 1173 of file route.class.php.

References $data.

Referenced by DashboardPage\__construct(), PluginManagementPage\__construct(), SubnetgroupManagementPage\__construct(), FOGService\__construct(), TaskManagementPage\_advanced(), MulticastManager\_serviceLoop(), TaskManagementPage\active(), TaskManagementPage\activemulticast(), TaskManagementPage\activescheduled(), TaskManagementPage\activesnapins(), AddSubnetgroupHost\addSubnetgroupHost(), AccessControlManagementPage\assocRule(), FOGController\assocSetter(), Site\assocSetter(), FOGPage\basictasksOptions(), MulticastSession\cancel(), FOGService\checkIfNodeMaster(), FOGConfigurationPage\clientupdater(), MulticastSession\complete(), Group\createImagePackage(), FOGConfigurationPage\customizepxe(), Image\deleteFile(), FOGPage\deletemulti(), AccessControlManagementPage\deletemultiRule(), FOGPage\deploy(), edit(), ServiceConfigurationPage\edit(), FOGPage\export(), Equipment_Loan\file(), Product_Keys\file(), Virus_History\file(), User_Tracking\filedisp(), History_Report\filePost(), Host_List\filePost(), Hosts_And_Users\filePost(), Imaging_Log\filePost(), Inventory_Report\filePost(), Snapin_Log\filePost(), User_Tracking\filePost(), MulticastTask\getAllMulticastTasks(), StorageGroup\getMasterStorageNode(), StorageGroup\getOptimalStorageNode(), GroupManagementPage\groupPrinters(), GroupManagementPage\groupService(), GroupManagementPage\groupSnapins(), AddHostModel\hostData(), AddHostSerial\hostData(), AddLocationHost\hostExport(), AddSiteHost\hostExport(), HostManagementPage\hostImageHistory(), HostManagementPage\hostLoginHistory(), HostManagementPage\hostlogins(), HostManagementPage\hostPMDisplay(), HostManagementPage\hostPrinters(), HostManagementPage\hostService(), HostManagementPage\hostSnapinHistory(), HostManagementPage\hostSnapins(), HostManagementPage\hostVirus(), ImageManagementPage\imageStoragegroups(), FOGPage\index(), StorageManagementPage\index(), GroupManagementPage\inventory(), PrinterClient\json(), TaskManagementPage\listgroups(), TaskManagementPage\listhosts(), FOGConfigurationPage\logviewer(), FOGPage\membership(), AccessControlManagementPage\membership(), SiteManagementPage\membership(), WindowsKeyManagementPage\membership(), SiteManagementPage\membershipHost(), ImageManagementPage\multicast(), HostManagementPage\pending(), RemoveSubnetgroupGroup\removeSubnetgroupGroup(), FOGService\replicateItems(), AccessControlManagementPage\ruleList(), PluginManagementPage\run(), FOGPage\searchPost(), PrinterClient\send(), FOGConfigurationPage\settings(), FOGConfigurationPage\settingsPost(), SnapinManagementPage\snapinStoragegroups(), StorageManagementPage\storageGroup(), ChangeItems\storageNodeSetting(), MulticastTask\updateStats(), and FOGConfigurationPage\version().

◆ getMatches()

static Route::getMatches ( )
static

Gets the matches.

Returns
array

Definition at line 326 of file route.class.php.

References $matches.

◆ getsearchbody()

static Route::getsearchbody (   $class)
static

Get's the json body and sets our vars.

Parameters
string$classThe class to get vars for/from.
Returns
array

Definition at line 1076 of file route.class.php.

References FOGBase\getClass().

Referenced by active(), AddWindowskeyAPI\adjustMassInfo(), and cancel().

◆ getter()

static Route::getter (   $classname,
  $class,
  $item = '' 
)
static

This is a commonizing element so list/search/getinfo will operate in the same fasion.

Parameters
string$classnameThe name of the class.
object$classThe class to work with.
Returns
object|array

Definition at line 1216 of file route.class.php.

References $data, $pass, $passtest, $productKey, $productKeytest, FOGBase\aesdecrypt(), and FOGBase\fastmerge().

Referenced by active(), AddLocationAPI\adjustGetter(), indiv(), listem(), and search().

◆ ids()

Route::ids (   $class,
  $whereItems = [],
  $getField = 'id' 
)

Returns only the ids of the class.

Parameters
string$classThe class to get list of.
array$whereItemsThe items to filter.
string$getFieldThe field to get.
Returns
void

Definition at line 1567 of file route.class.php.

References $data, $data, $val, and FOGBase\getClass().

Referenced by MulticastManager\_serviceLoop(), FOGController\assocSetter(), Site\assocSetter(), MulticastSession\cancel(), MulticastSession\complete(), edit(), and MulticastTask\getAllMulticastTasks().

◆ indiv()

static Route::indiv (   $class,
  $id,
  $item = '' 
)
static

Displays the individual item.

Parameters
string$classThe class to work with.
int$idThe id of the item.
Returns
void

Definition at line 562 of file route.class.php.

References $data, getter(), HTTPResponseCodes\HTTP_NOT_FOUND, and sendResponse().

Referenced by TaskManagementPage\activesnapins(), create(), edit(), MulticastTask\getAllMulticastTasks(), HostManagementPage\hostImageHistory(), FOGConfigurationPage\logviewer(), and FOGService\replicateItems().

◆ listdetails()

static Route::listdetails (   $class,
  $item,
  $sortby = 'name',
  $bypass = false,
  $find = array() 
)
static

Presents the equivalent of a detailed page list.

Parameters
string$classThe class to work with.
string$sortbyHow to sort the data.
bool$bypassAllow showing hidden data.
array$findAdditional filter items.
Returns
void

Definition at line 508 of file route.class.php.

References listem().

◆ listem()

static Route::listem (   $class,
  $sortby = 'name',
  $bypass = false,
  $find = array(),
  $item = '' 
)
static

Presents the equivalent of a page's list all.

Parameters
string$classThe class to work with.
string$sortbyHow to sort the data.
bool$bypassAllow showing hidden data.
array$findAdditional filter items.
Returns
void

Definition at line 429 of file route.class.php.

References $data, $test, FOGBase\fastmerge(), FOGBase\getClass(), and getter().

Referenced by DashboardPage\__construct(), PluginManagementPage\__construct(), SubnetgroupManagementPage\__construct(), FOGService\__construct(), TaskManagementPage\_advanced(), AddSubnetgroupHost\addSubnetgroupHost(), AccessControlManagementPage\assocRule(), FOGPage\basictasksOptions(), FOGService\checkIfNodeMaster(), FOGConfigurationPage\clientupdater(), Group\createImagePackage(), FOGConfigurationPage\customizepxe(), Image\deleteFile(), FOGPage\deletemulti(), AccessControlManagementPage\deletemultiRule(), FOGPage\deploy(), ServiceConfigurationPage\edit(), FOGPage\export(), Equipment_Loan\file(), Product_Keys\file(), Virus_History\file(), User_Tracking\filedisp(), History_Report\filePost(), Host_List\filePost(), Hosts_And_Users\filePost(), Imaging_Log\filePost(), Inventory_Report\filePost(), Snapin_Log\filePost(), User_Tracking\filePost(), StorageGroup\getMasterStorageNode(), StorageGroup\getOptimalStorageNode(), GroupManagementPage\groupPrinters(), GroupManagementPage\groupService(), GroupManagementPage\groupSnapins(), AddHostModel\hostData(), AddHostSerial\hostData(), AddLocationHost\hostExport(), AddSiteHost\hostExport(), HostManagementPage\hostImageHistory(), HostManagementPage\hostLoginHistory(), HostManagementPage\hostlogins(), HostManagementPage\hostPMDisplay(), HostManagementPage\hostPrinters(), HostManagementPage\hostService(), HostManagementPage\hostSnapinHistory(), HostManagementPage\hostSnapins(), HostManagementPage\hostVirus(), ImageManagementPage\imageStoragegroups(), FOGPage\index(), StorageManagementPage\index(), GroupManagementPage\inventory(), PrinterClient\json(), listdetails(), TaskManagementPage\listgroups(), TaskManagementPage\listhosts(), FOGConfigurationPage\logviewer(), AccessControlManagementPage\membership(), SiteManagementPage\membership(), WindowsKeyManagementPage\membership(), SiteManagementPage\membershipHost(), HostManagementPage\pending(), RemoveSubnetgroupGroup\removeSubnetgroupGroup(), FOGService\replicateItems(), AccessControlManagementPage\ruleList(), PluginManagementPage\run(), PrinterClient\send(), FOGConfigurationPage\settings(), FOGConfigurationPage\settingsPost(), SnapinManagementPage\snapinStoragegroups(), StorageManagementPage\storageGroup(), ChangeItems\storageNodeSetting(), MulticastTask\updateStats(), and FOGConfigurationPage\version().

◆ names()

Route::names (   $class,
  $whereItems = [] 
)

Returns only the ids and names of the class passed in.

Parameters
string$classThe class to get list of.
string$whereItemsIf we want to filter items.
Returns
void

Definition at line 1499 of file route.class.php.

References $data, $data, $val, and FOGBase\getClass().

Referenced by FOGPage\membership().

◆ printer()

static Route::printer (   $data,
  $code = false 
)
static

Generates a default means to print data to screen.

Parameters
mixed$dataThe data to print.
bool | int$codeSend custom error code.
Returns
void

Definition at line 1190 of file route.class.php.

References $data, HTTPResponseCodes\HTTP_SUCCESS, and sendResponse().

Referenced by __construct(), and setErrorMessage().

◆ runMatches()

static Route::runMatches ( )
static

Runs the matches.

Returns
void

Definition at line 335 of file route.class.php.

References HTTPResponseCodes\HTTP_NOT_IMPLEMENTED, and sendResponse().

Referenced by __construct().

◆ search()

static Route::search (   $class,
  $item 
)
static

Presents the equivalent of a page's search.

Parameters
string$classThe class to work with.
string$itemThe "search".
Returns
void

Definition at line 526 of file route.class.php.

References $data, FOGBase\getClass(), and getter().

Referenced by FOGPage\searchPost().

◆ sendResponse()

static Route::sendResponse (   $code,
  $msg = false 
)
static

Sends the response code through break head as needed.

Parameters
int$codeThe code to break head on.
int$msgThe message to send.
Returns
void

Definition at line 400 of file route.class.php.

References $msg, and HTTPResponseCodes\breakHead().

Referenced by _testAuth(), _testToken(), cancel(), create(), delete(), edit(), indiv(), printer(), runMatches(), status(), and task().

◆ setErrorMessage()

static Route::setErrorMessage (   $message,
  $code = false 
)
static

Sets an error message.

Parameters
string$messageThe error message to pass.
bool | int$codeSend custom error code.
Returns
void

Definition at line 1163 of file route.class.php.

References $data, and printer().

Referenced by create(), edit(), and task().

◆ setMatches()

static Route::setMatches ( )
static

Sets the matches variable

Returns
void

Definition at line 317 of file route.class.php.

Referenced by __construct().

◆ status()

static Route::status ( )
static

Presents status to show up or down state.

Returns
void

Definition at line 412 of file route.class.php.

References HTTPResponseCodes\HTTP_SUCCESS, and sendResponse().

◆ task()

static Route::task (   $class,
  $id 
)
static

Generates our task element.

Parameters
string$classThe class to work with.
int$idThe id of the item.
Returns
void

Definition at line 831 of file route.class.php.

References $TaskType, FOGBase\getSubObjectIDs(), HTTPResponseCodes\HTTP_INTERNAL_SERVER_ERROR, HTTPResponseCodes\HTTP_NOT_FOUND, HTTPResponseCodes\HTTP_NOT_IMPLEMENTED, FOGController\isValid(), sendResponse(), and setErrorMessage().

Member Data Documentation

◆ $_enabled

Route::$_enabled = false
staticprivate

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

◆ $_token

Route::$_token = ''
staticprivate

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

◆ $data

Route::$data
static

Definition at line 53 of file route.class.php.

Referenced by deletemass(), getter(), ids(), names(), and printer().

◆ $matches

Route::$matches = array()
static

Definition at line 47 of file route.class.php.

Referenced by getMatches().

◆ $router

Route::$router = null
static

Definition at line 41 of file route.class.php.

◆ $validActiveTasks

Route::$validActiveTasks
static
Initial value:
= array(
'multicastsession',
'scheduledtask',
'snapinjob',
'snapintask',
'task'
)

Definition at line 129 of file route.class.php.

◆ $validClasses

Route::$validClasses
static

Definition at line 59 of file route.class.php.

◆ $validTaskingClasses

Route::$validTaskingClasses
static
Initial value:
= array(
'group',
'host',
'multicastsession',
'scheduledtask',
'snapinjob',
'snapintask',
'task'
)

Definition at line 115 of file route.class.php.


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