"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/web/lib/fog/fogpage.class.php" between
fogproject-1.5.7.tar.gz and fogproject-1.5.8.tar.gz

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.

fogpage.class.php  (fogproject-1.5.7):fogpage.class.php  (fogproject-1.5.8)
skipping to change at line 502 skipping to change at line 502
$find = ''; $find = '';
if ('Host' === $this->childClass) { if ('Host' === $this->childClass) {
$find = array( $find = array(
'pending' => array(0, '') 'pending' => array(0, '')
); );
} }
Route::listem($this->childClass); Route::listem($this->childClass);
$items = json_decode(Route::getData()); $items = json_decode(Route::getData());
$type = $node.'s'; $type = $node.'s';
$items = $items->$type; $items = $items->$type;
if (count($items) > 0) { if (is_array($items) && count($items) > 0) {
array_walk($items, static::$returnData); array_walk($items, static::$returnData);
} }
$event = sprintf( $event = sprintf(
'%s_DATA', '%s_DATA',
strtoupper($this->node) strtoupper($this->node)
); );
self::$HookManager->processEvent( self::$HookManager->processEvent(
$event, $event,
array( array(
'data' => &$this->data, 'data' => &$this->data,
skipping to change at line 545 skipping to change at line 545
$this->attributes $this->attributes
); );
} else { } else {
$vals = function (&$value, $key) { $vals = function (&$value, $key) {
return sprintf( return sprintf(
'%s : %s', '%s : %s',
$key, $key,
$value $value
); );
}; };
if (count($args) > 0) { if (is_array($args) && count($args) > 0) {
array_walk($args, $vals); array_walk($args, $vals);
} }
printf( printf(
'Index page of: %s%s', 'Index page of: %s%s',
get_class($this), get_class($this),
( (
count($args) ? (is_array($args) && count($args)) ?
sprintf( sprintf(
', Arguments = %s', ', Arguments = %s',
implode( implode(
', ', ', ',
$args $args
) )
) : ) :
'' ''
) )
); );
skipping to change at line 773 skipping to change at line 773
if (self::$ajax) { if (self::$ajax) {
echo json_encode( echo json_encode(
array( array(
'data' => $this->data, 'data' => $this->data,
'templates' => $this->templates, 'templates' => $this->templates,
'headerData' => $this->headerData, 'headerData' => $this->headerData,
'title' => $this->title, 'title' => $this->title,
'attributes' => $this->attributes, 'attributes' => $this->attributes,
'form' => $this->form, 'form' => $this->form,
'actionbox' => ( 'actionbox' => (
count($this->data) > 0 ? (is_array($this->data) && count($this->data) > 0) ?
$actionbox : $actionbox :
'' ''
), ),
) )
); );
exit; exit;
} }
if (!count($this->templates)) { if (!count($this->templates)) {
throw new Exception( throw new Exception(
_('Requires templates to process') _('Requires templates to process')
skipping to change at line 905 skipping to change at line 905
} }
/** /**
* Builds the header row * Builds the header row
* *
* @return string * @return string
*/ */
public function buildHeaderRow() public function buildHeaderRow()
{ {
unset($this->atts); unset($this->atts);
$this->_setAtts(); $this->_setAtts();
if (count($this->headerData) < 1) { if (is_array($this->headerData) && count($this->headerData) < 1) {
return; return;
} }
ob_start(); ob_start();
echo '<tr class="header' echo '<tr class="header'
. ( . (
is_array($this->data) && count($this->data) < 1 ? is_array($this->data) && count($this->data) < 1 ?
' hiddeninitially' : ' hiddeninitially' :
'' ''
) )
. '">'; . '">';
skipping to change at line 1422 skipping to change at line 1422
echo '<input type="text" name="scheduleCronDOW" ' echo '<input type="text" name="scheduleCronDOW" '
. 'placeholder="dow" autocomplete="off" ' . 'placeholder="dow" autocomplete="off" '
. 'class="form-control scheduleCronDOW cronInput"/>'; . 'class="form-control scheduleCronDOW cronInput"/>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
echo '</div>'; echo '</div>';
} }
if (count($this->data)) { if (is_array($this->data) && count($this->data)) {
echo '<div class="col-xs-12">'; echo '<div class="col-xs-12">';
echo '<label class="control-label col-xs-4" for="taskingbtn">'; echo '<label class="control-label col-xs-4" for="taskingbtn">';
echo _('Create'); echo _('Create');
echo ' '; echo ' ';
echo $TaskType->get('name'); echo $TaskType->get('name');
echo ' '; echo ' ';
echo _('Tasking'); echo _('Tasking');
echo '</label>'; echo '</label>';
echo '<div class="col-xs-8">'; echo '<div class="col-xs-8">';
echo '<button type="submit" class="btn btn-info btn-block" id=' echo '<button type="submit" class="btn btn-info btn-block" id='
skipping to change at line 1718 skipping to change at line 1718
'imageID' 'imageID'
); );
$orig_hosts = $this->get('hosts'); $orig_hosts = $this->get('hosts');
$hostIDs = self::getSubObjectIDs( $hostIDs = self::getSubObjectIDs(
'Host', 'Host',
array( array(
'id' => $this->obj->get('hosts'), 'id' => $this->obj->get('hosts'),
'imageID' => $imageIDs 'imageID' => $imageIDs
) )
); );
if (count($hostIDs) < 1) { if (is_array($hostIDs) && count($hostIDs) < 1) {
throw new Exception( throw new Exception(
sprintf( sprintf(
'%s/%s.', '%s/%s.',
_('No valid hosts found and'), _('No valid hosts found and'),
_('or no valid images specified') _('or no valid images specified')
) )
); );
} }
$this->obj->set('hosts', $hostIDs); $this->obj->set('hosts', $hostIDs);
} }
skipping to change at line 1995 skipping to change at line 1995
'input' => '<a href="?node=' 'input' => '<a href="?node='
. $node . $node
. '&sub=edit&id=' . '&sub=edit&id='
. $object->id . $object->id
. '">' . '">'
. $object->name . $object->name
. '</a>' . '</a>'
); );
unset($object); unset($object);
} }
if (count($this->data) < 1) { if (is_array($this->data) && count($this->data) < 1) {
self::redirect('?node=' . $node); self::redirect('?node=' . $node);
} }
$this->data[] = array( $this->data[] = array(
'field' => '<label for="delete">' 'field' => '<label for="delete">'
. _('Remove these items?') . _('Remove these items?')
. '</label>', . '</label>',
'input' => '<button class="btn btn-danger btn-block" type="submit" ' 'input' => '<button class="btn btn-danger btn-block" type="submit" '
. 'name="delete" id="delete">' . 'name="delete" id="delete">'
. _('Delete') . _('Delete')
. '</button>', . '</button>',
skipping to change at line 2253 skipping to change at line 2253
$ADDomain = $this->obj->get('ADDomain'); $ADDomain = $this->obj->get('ADDomain');
} }
if (empty($ADOU)) { if (empty($ADOU)) {
$ADOU = trim($this->obj->get('ADOU')); $ADOU = trim($this->obj->get('ADOU'));
$ADOU = str_replace(';', '', $ADOU); $ADOU = str_replace(';', '', $ADOU);
} }
if (empty($ADUser)) { if (empty($ADUser)) {
$ADUser = $this->obj->get('ADUser'); $ADUser = $this->obj->get('ADUser');
} }
if (empty($ADPass)) { if (empty($ADPass)) {
$ADPass = $this->obj->get('ADPass'); $ADPass = (
$this->obj->get('ADPass') ?
'********************************' :
''
);
} }
if (empty($ADPassLegacy)) { if (empty($ADPassLegacy)) {
$ADPassLegacy = $this->obj->get('ADPassLegacy'); $ADPassLegacy = $this->obj->get('ADPassLegacy');
} }
} }
$OUs = array_unique( $OUs = array_unique(
array_filter( array_filter(
explode( explode(
'|', '|',
self::getSetting('FOG_AD_DEFAULT_OU') self::getSetting('FOG_AD_DEFAULT_OU')
) )
) )
); );
$ADOU = trim($ADOU); $ADOU = trim($ADOU);
$ADOU = str_replace(';', '', $ADOU); $ADOU = str_replace(';', '', $ADOU);
$optFound = $ADOU; $optFound = $ADOU;
if (count($OUs) > 1) { if (is_array($OUs) && count($OUs) > 1) {
ob_start(); ob_start();
printf( printf(
'<option value="">- %s -</option>', '<option value="">- %s -</option>',
self::$foglang['PleaseSelect'] self::$foglang['PleaseSelect']
); );
foreach ((array)$OUs as &$OU) { foreach ((array)$OUs as &$OU) {
$OU = trim($OU); $OU = trim($OU);
$ou = str_replace(';', '', $OU); $ou = str_replace(';', '', $OU);
if (!$optFound && $ou === $ADOU) { if (!$optFound && $ou === $ADOU) {
$optFound = $ou; $optFound = $ou;
skipping to change at line 2664 skipping to change at line 2668
/** /**
* Hands out the login information * Hands out the login information
* such as version and number of users * such as version and number of users
* *
* @return void * @return void
*/ */
public function loginInfo() public function loginInfo()
{ {
$urls = array( $urls = array(
'https://fogproject.org/globalusers', 'https://fogproject.org/globalusers',
'https://fogproject.org/version/index.php?stable&dev&svn' 'https://fogproject.org/version/index.php?stable&dev'
); );
$resp = self::$FOGURLRequests->process($urls); $resp = self::$FOGURLRequests->process($urls);
$data['sites'] = array_shift($resp); $data['sites'] = array_shift($resp);
$data['version'] = array_shift($resp); $data['version'] = array_shift($resp);
echo json_encode($data); echo json_encode($data);
exit; exit;
} }
/** /**
* Gets the associated info from the mac addresses * Gets the associated info from the mac addresses
* *
skipping to change at line 3346 skipping to change at line 3350
$this->childClass $this->childClass
); );
Route::search( Route::search(
$this->childClass, $this->childClass,
filter_input(INPUT_POST, 'crit') filter_input(INPUT_POST, 'crit')
); );
$items = json_decode(Route::getData()); $items = json_decode(Route::getData());
$type = $this->node $type = $this->node
.'s'; .'s';
$search = $items->$type; $search = $items->$type;
if (count($search) > 0) { if (is_array($search) && count($search) > 0) {
array_walk($search, static::$returnData); array_walk($search, static::$returnData);
} }
$event = sprintf( $event = sprintf(
'%s_DATA', '%s_DATA',
strtoupper($this->node) strtoupper($this->node)
); );
self::$HookManager->processEvent( self::$HookManager->processEvent(
$event, $event,
array( array(
'data' => &$this->data, 'data' => &$this->data,
skipping to change at line 3621 skipping to change at line 3625
* *
* @return void * @return void
*/ */
public function wakeEmUp() public function wakeEmUp()
{ {
$mac = filter_input(INPUT_POST, 'mac'); $mac = filter_input(INPUT_POST, 'mac');
if (!$mac) { if (!$mac) {
$mac = filter_input(INPUT_GET, 'mac'); $mac = filter_input(INPUT_GET, 'mac');
} }
$macs = self::parseMacList($mac); $macs = self::parseMacList($mac);
if (count($macs) < 1) { if (is_array($macs) && count($macs) < 1) {
return; return;
} }
self::getClass('WakeOnLan', implode('|', $macs))->send(); self::getClass('WakeOnLan', implode('|', $macs))->send();
} }
/** /**
* Presents the relevant class items for export * Presents the relevant class items for export
* *
* @return void * @return void
*/ */
public function export() public function export()
 End of changes. 13 change blocks. 
13 lines changed or deleted 17 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)