From 57ed44c6555ba4abb39bf3faa3e9ffa674797579 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Sun, 25 Jul 2010 03:45:26 -0500 Subject: [PATCH] Minor - reviewed code (see CT#1395) --- main/cron/user_import/client.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) mode change 100644 => 100755 main/cron/user_import/client.php diff --git a/main/cron/user_import/client.php b/main/cron/user_import/client.php old mode 100644 new mode 100755 index f94eaa0fb4..3d4985946a --- a/main/cron/user_import/client.php +++ b/main/cron/user_import/client.php @@ -10,15 +10,15 @@ * It is triggered by a cron task configured on the server * @uses /main/webservices/user_import/ * @author Eric Marguin + * @package chamilo.cron */ /** * Global cycle: init, execute, output */ -require_once('../../inc/global.inc.php'); +require_once dirname(__FILE__).'/../../inc/global.inc.php'; // check if this client has been called by php_cli (command line or cron) -if(php_sapi_name()!='cli') -{ - echo 'You can\'t call this service throw a browser'; +if (php_sapi_name()!='cli') { + echo 'You can\'t call this service through a browser'; die(); } @@ -30,6 +30,4 @@ $client = new nusoap_client(api_get_path(WEB_CODE_PATH).'cron/user_import/servic // call import_user method $response = $client->call('import_users', array('filepath' => api_get_path(SYS_CODE_PATH)."upload/users_import.csv", 'security_key'=>$_configuration['security_key'])); - -echo $response; -?> +echo $response; \ No newline at end of file