Subversion Repositories eFlore/Applications.cel

Rev

Rev 1386 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1386 Rev 1527
Line 376... Line 376...
376
				exit();
376
				exit();
377
			}
377
			}
378
		}
378
		}
379
	}
379
	}
Line -... Line 380...
-
 
380
	
-
 
381
	public function controleAppelIpAutorisee() {
-
 
382
		$ips_autorisees = explode(',', $this->config['jrest_admin']['ip_autorisees']);
-
 
383
		$ip_appelante = $_SERVER['REMOTE_ADDR'];
-
 
384
		if(!in_array($ip_appelante, $ips_autorisees) && $ip_appelante != $_SERVER['SERVER_ADDR']) {
-
 
385
			header('HTTP/1.0 401 Unauthorized');
-
 
386
			echo 'Accès interdit';
-
 
387
			exit(0);
-
 
388
		}
-
 
389
		return true;
-
 
390
	}
380
 
391
 
381
	public function logger($index,$chaine) {
392
	public function logger($index,$chaine) {
382
		if(!class_exists('Log')) {
393
		if(!class_exists('Log')) {
383
			Log::getInstance();
394
			Log::getInstance();