"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "packages/web/lib/fog/host.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.

host.class.php  (fogproject-1.5.7):host.class.php  (fogproject-1.5.8)
skipping to change at line 321 skipping to change at line 321
array( array(
'hostID' => $this->get('id'), 'hostID' => $this->get('id'),
'primary' => 1 'primary' => 1
), ),
'mac' 'mac'
); );
if (count($CurrPriMAC) === 1 if (count($CurrPriMAC) === 1
&& $CurrPriMAC[0] != $RealPriMAC && $CurrPriMAC[0] != $RealPriMAC
) { ) {
self::getClass('MACAddressAssociationManager') self::getClass('MACAddressAssociationManager')
->update( ->destroy(
array( array(
'mac' => $CurrPriMAC[0],
'hostID' => $this->get('id'), 'hostID' => $this->get('id'),
'primary' => 1 'mac' => $CurrPriMAC[0]
), )
'',
array('primary' => 0)
); );
} }
$HostWithMAC = array_diff( $HostWithMAC = array_diff(
(array)$this->get('id'), (array)$this->get('id'),
(array)self::getSubObjectIDs( (array)self::getSubObjectIDs(
'MACAddressAssociation', 'MACAddressAssociation',
array('mac' => $RealPriMAC), array('mac' => $RealPriMAC),
'hostID' 'hostID'
) )
); );
skipping to change at line 1695 skipping to change at line 1692
*/ */
public function addPriMAC($mac) public function addPriMAC($mac)
{ {
$mac = self::parseMacList($mac); $mac = self::parseMacList($mac);
if (count($mac) < 1) { if (count($mac) < 1) {
throw new Exception(_('No viable macs to use')); throw new Exception(_('No viable macs to use'));
} }
if (is_array($mac) && count($mac) > 0) { if (is_array($mac) && count($mac) > 0) {
$mac = array_shift($mac); $mac = array_shift($mac);
} }
$host = $mac->getHost();
if ($host instanceof Host && $host->isValid()) {
throw new Exception(
sprintf(
"%s: %s",
_('MAC address is already in use by another host'),
$host->get('name')
)
);
}
return $this->set('mac', $mac); return $this->set('mac', $mac);
} }
/** /**
* Adds pending mac * Adds pending mac
* *
* @param string $mac the mac to add * @param string $mac the mac to add
* *
* @return obect * @return obect
*/ */
public function addPendMAC($mac) public function addPendMAC($mac)
skipping to change at line 2073 skipping to change at line 2080
$domain = '', $domain = '',
$ou = '', $ou = '',
$user = '', $user = '',
$pass = '', $pass = '',
$override = false, $override = false,
$nosave = false, $nosave = false,
$legacy = '', $legacy = '',
$productKey = '', $productKey = '',
$enforce = '' $enforce = ''
) { ) {
$adpasspat = "/^\*{32}$/";
$pass = (preg_match($adpasspat, $pass) ? $this->get('ADPass') : $pass);
if ($this->get('id')) { if ($this->get('id')) {
if (!$override) { if (!$override) {
if (empty($useAD)) { if (empty($useAD)) {
$useAD = $this->get('useAD'); $useAD = $this->get('useAD');
} }
if (empty($domain)) { if (empty($domain)) {
$domain = trim($this->get('ADDomain')); $domain = trim($this->get('ADDomain'));
} }
if (empty($ou)) { if (empty($ou)) {
$ou = trim($this->get('ADOU')); $ou = trim($this->get('ADOU'));
 End of changes. 5 change blocks. 
6 lines changed or deleted 15 lines changed or added

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