From 8a8e146c3f567d0ff76ef4cd2a60901a4a548f3d Mon Sep 17 00:00:00 2001 From: jerome Date: Thu, 22 Jan 2009 05:23:58 +0000 Subject: [PATCH] web service MDL-12886 rename wsapi.php into external.php --- user/wsapi.php | 107 ------------------------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 user/wsapi.php diff --git a/user/wsapi.php b/user/wsapi.php deleted file mode 100644 index ea839cf9557..00000000000 --- a/user/wsapi.php +++ /dev/null @@ -1,107 +0,0 @@ -descriptions = array(); - ///The desciption of the web service - /// - ///'wsparams' and 'return' are used to described the web services to the end user (can build WSDL file from these information) - /// - ///Note: web services param names have not importance. However 'paramorder' must match the function params order. - ///And all web services param names defined into 'wsparams' should be included into 'paramorder' (otherwise they will not be used) - $this->descriptions['tmp_create_user'] = array( 'wsparams' => array('username'=> PARAM_RAW, 'firstname'=> PARAM_RAW, 'lastname'=> PARAM_RAW, 'email'=> PARAM_RAW, 'password'=> PARAM_RAW), - 'return' => array('userid' => PARAM_RAW)); - - - $this->descriptions['tmp_get_users'] = array( 'wsparams' => array('search'=> PARAM_ALPHANUM), - 'return' => array('user' => array('id' => PARAM_RAW, 'auth' => PARAM_RAW, 'confirmed' => PARAM_RAW, 'username' => PARAM_RAW, 'idnumber' => PARAM_RAW, - 'firstname' => PARAM_RAW, 'lastname' => PARAM_RAW, 'email' => PARAM_RAW, 'emailstop' => PARAM_RAW, - 'lang' => PARAM_RAW, 'theme' => PARAM_RAW, 'timezone' => PARAM_RAW, 'mailformat' => PARAM_RAW))); - - $this->descriptions['tmp_delete_user'] = array( 'wsparams' => array('username'=> PARAM_ALPHANUM, 'mnethostid'=> PARAM_NUMBER), - 'return' => array('result' => PARAM_BOOL)); - - $this->descriptions['tmp_update_user'] = array( 'wsparams' => array('username'=> PARAM_ALPHANUM, 'mnethostid'=> PARAM_NUMBER, 'newusername' => PARAM_ALPHANUM, 'firstname' => PARAM_ALPHANUM), - 'return' => array('result' => PARAM_BOOL)); - } - - /** - * Retrieve all user - * @param string $search - * @return object user - */ - static function tmp_get_users($search) { - $selectioncriteria = new stdClass(); - $selectioncriteria->search = $search; - return user_api::tmp_get_users('firstname ASC', 999999, 0, 'id, auth, confirmed, username, idnumber, firstname, lastname, email, emailstop, lang, theme, timezone, mailformat', $selectioncriteria); - } - - /** - * Create a user - * @param string $username - * @param string $firstname - * @param string $lastname - * @param string $email - * @param string $password - * @return integer id of new user - */ - static function tmp_create_user($username, $firstname, $lastname, $email, $password) { - $user = array(); - $user['username'] = $username; - $user['firstname'] = $firstname; - $user['lastname'] = $lastname; - $user['email'] = $email; - $user['password'] = $password; - return user_api::tmp_create_user($user); - } - - /** - * Delete a user - * @global object $DB - * @param string $username - * @param integer $mnethostid - * @return boolean true if success - */ - static function tmp_delete_user($username, $mnethostid) { - global $DB; - $user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$mnethostid)); - return user_api::tmp_delete_user($user); - } - - /** - * Update some user information - * @global object $DB - * @param string $username - * @param integer $mnethostid - * @param string $newusername - * @param string $firstname - * @return boolean true if success - */ - static function tmp_update_user($username, $mnethostid, $newusername, $firstname) { - global $DB; - $user = $DB->get_record('user', array('username'=>$username, 'mnethostid'=>$mnethostid)); - $user->username = $newusername; - $user->firstname = $firstname; - - return user_api::tmp_update_user($user); - } - -} - -?>