Subversion Repositories eFlore/Applications.cel

Rev

Rev 1386 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1386 Rev 1527
Line 324... Line 324...
324
		return $this->restClient;
324
		return $this->restClient;
325
	}
325
	}
Line 326... Line 326...
326
 
326
 
327
	//+----------------------------------------------------------------------------------------------------------------+
327
	//+----------------------------------------------------------------------------------------------------------------+
328
	// GESTION DE L'IDENTIFICATION
328
	// GESTION DE L'IDENTIFICATION
329
 
329
	
330
	protected function getAuthIdentifiant() {
330
	protected function getAuthIdentifiant() {
331
		$id = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : null;
331
		$id = (isset($_SERVER['PHP_AUTH_USER'])) ? $_SERVER['PHP_AUTH_USER'] : null;
332
		return $id;
332
		return $id;
Line 375... Line 375...
375
				print 'Accès interdit';
375
				print 'Accès interdit';
376
				exit();
376
				exit();
377
			}
377
			}
378
		}
378
		}
379
	}
379
	}
-
 
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
	}
Line 380... Line 391...
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();