From 15b91c7e661d928d8b125ec9cfbda1702319c8b4 Mon Sep 17 00:00:00 2001 From: mensonge Date: Tue, 25 Nov 2008 15:57:29 +0000 Subject: Major refactoring: transform user into object, define parameters used into each file, ... git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@173 b3834d28-1941-0410-a4f8-b48e95affb8f --- ajaxIsAvailable.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'ajaxIsAvailable.php') diff --git a/ajaxIsAvailable.php b/ajaxIsAvailable.php index 80883c6..e9d82e7 100644 --- a/ajaxIsAvailable.php +++ b/ajaxIsAvailable.php @@ -24,11 +24,18 @@ header("Last-Modified: ". gmdate("D, d M Y H:i:s") ." GMT"); header("Cache-Control: no-cache, must-revalidate"); require_once('header.inc.php'); + +/* Service creation: only useful services are created */ $userservice = & ServiceFactory :: getServiceInstance('UserService'); -if ($userservice->isReserved($_GET['username'])) { + +/* Managing all possible inputs */ +isset($_GET['username']) ? define('GET_USERNAME', $_GET['username']): define('GET_USERNAME', ''); + + +if ($userservice->isReserved(GET_USERNAME)) { $result = 'false'; } else { - $result = $userservice->getUserByUsername($_GET['username']) ? 'false' : 'true'; + $result = $userservice->getUserByUsername(GET_USERNAME) ? 'false' : 'true'; } ?> -- cgit v1.2.3