src/Shell/MaintenanceModeShell.php
public function whitelist() {
		if ($this->params['remove']) {
			$this->Maintenance->clearWhitelist();
		}

		$ips = $this->args;
		if (!empty($ips)) {
			foreach ($ips as $ip) {
				if (!Validation::ip($ip)) {
					$this->abort($ip . ' is not a valid IP address.');
				}
			}
			if ($this->params['remove']) {
				$this->Maintenance->clearWhitelist($ips);
			} else {
				$this->Maintenance->whitelist($ips, $this->params['debug']);
			}
			$this->out('Done!', 2);
		}

		$this->out('Current whitelist:');
		$ips = $this->Maintenance->whitelist();
		if (!$ips) {
			$this->out('n/a');
		} else {
			$this->out($ips);
		}
	}
public function whitelist() {
		if ($this->params['remove']) {
			$this->Maintenance->clearWhitelist();
		}

		$ips = $this->args;
		if (!empty($ips)) {
			foreach ($ips as $ip) {
				if (!Validation::ip($ip)) {
					$this->abort($ip . ' is not a valid IP address.');
				}
			}
			if ($this->params['remove']) {
				$this->Maintenance->clearWhitelist($ips);
			} else {
				$this->Maintenance->whitelist($ips, $this->params['debug']);
			}
			$this->out('Done!', 2);
		}

		$this->out('Current whitelist:');
		$ips = $this->Maintenance->whitelist();
		if (!$ips) {
			$this->out('n/a');
		} else {
			$this->out($ips);
		}
	}
public function whitelist ( ) { if ( $ this -> params [ 'remove' ] ) { $ this -> Maintenance -> clearWhitelist ( ) ; } $ ips = $ this -> args ; if ( ! empty ( $ ips ) ) { foreach ( $ ips as $ ip ) { if ( ! Validation :: ip ( $ ip ) ) { $ this -> abort ( $ ip . ' is not a valid IP address.' ) ; } } if ( $ this -> params [ 'remove' ] ) { $ this -> Maintenance -> clearWhitelist ( $ ips ) ; } else { $ this -> Maintenance -> whitelist ( $ ips , $ this -> params [ 'debug' ] ) ; } $ this -> out ( 'Done!' , 2 ) ; } $ this -> out ( 'Current whitelist:' ) ; $ ips = $ this -> Maintenance -> whitelist ( ) ; if ( ! $ ips ) { $ this -> out ( 'n/a' ) ; } else { $ this -> out ( $ ips ) ; } }
Whitelist specific IPs. Each argument is a single IP.
Not passing any argument will output the current whitelist.

@return int|null
Whitelist specific IPs . Each argument is a single IP . Not passing any argument will output the current whitelist .