src/php/lib/class.ext_dhcpd3_leases.php
/**
	 * Return result
	 * 
	 * @access public
	 * @return false on failure|array of the leases
	 */
Return result

@access public
@return false on failure|array of the leases
Return result @access public @return false on failure|array of the leases
public function result() {
		if ($this->_res === false) {
			return false;
		}
		$rows = array();
		$rows[] = array(
			'type' => 'header',
			'columns' =>
						!$this->_hide_mac ? array(
				'IP Address',
				'MAC Address',
				'Hostname',
				'Lease Start',
				'Lease End'
			) :
				array(
				'IP Address',
				'Hostname',
				'Lease Start',
				'Lease End'
			)
		);
		for ($i = 0, $num_leases = count($this->_leases); $i < $num_leases; $i++)
			$rows[] = array(
				'type' => 'values',
				'columns' =>
								!$this->_hide_mac ? array(
					$this->_leases[$i]['ip'],
					$this->_leases[$i]['mac'],
					array_key_exists('hostname', $this->_leases[$i]) ?
						$this->_leases[$i]['hostname'] : '<em>unknown</em>',
					date(self::DATE_FORMAT, $this->_leases[$i]['lease_start']),
					date(self::DATE_FORMAT, $this->_leases[$i]['lease_end'])
				):
				array(
					$this->_leases[$i]['ip'],
					array_key_exists('hostname', $this->_leases[$i]) ?
						$this->_leases[$i]['hostname'] : '<em>unknown</em>',
					date(self::DATE_FORMAT, $this->_leases[$i]['lease_start']),
					date(self::DATE_FORMAT, $this->_leases[$i]['lease_end'])
				)
			);
		return array(
			'root_title' => 'DHCPD IP Leases',
			'rows' => $rows
		);
	}
public function result ( ) { if ( $ this -> _res === false ) { return false ; } $ rows = array ( ) ; $ rows [ ] = array ( 'type' => 'header' , 'columns' => ! $ this -> _hide_mac ? array ( 'IP Address' , 'MAC Address' , 'Hostname' , 'Lease Start' , 'Lease End' ) : array ( 'IP Address' , 'Hostname' , 'Lease Start' , 'Lease End' ) ) ; for ( $ i = 0 , $ num_leases = count ( $ this -> _leases ) ; $ i < $ num_leases ; $ i ++ ) $ rows [ ] = array ( 'type' => 'values' , 'columns' => ! $ this -> _hide_mac ? array ( $ this -> _leases [ $ i ] [ 'ip' ] , $ this -> _leases [ $ i ] [ 'mac' ] , array_key_exists ( 'hostname' , $ this -> _leases [ $ i ] ) ? $ this -> _leases [ $ i ] [ 'hostname' ] : '<em>unknown</em>' , date ( self :: DATE_FORMAT , $ this -> _leases [ $ i ] [ 'lease_start' ] ) , date ( self :: DATE_FORMAT , $ this -> _leases [ $ i ] [ 'lease_end' ] ) ) : array ( $ this -> _leases [ $ i ] [ 'ip' ] , array_key_exists ( 'hostname' , $ this -> _leases [ $ i ] ) ? $ this -> _leases [ $ i ] [ 'hostname' ] : '<em>unknown</em>' , date ( self :: DATE_FORMAT , $ this -> _leases [ $ i ] [ 'lease_start' ] ) , date ( self :: DATE_FORMAT , $ this -> _leases [ $ i ] [ 'lease_end' ] ) ) ) ; return array ( 'root_title' => 'DHCPD IP Leases' , 'rows' => $ rows ) ; }
Return result
Return result
// Don't bother if it didn't go well // Store rows here // Start showing connections // Not hiding mac address?
 // Hiding it indeed // Append each lease // Not hiding mac addresses?
 // Hiding them indeed // Give it off