コード例 #1
0
ファイル: UserAPI.php プロジェクト: bryandease/VuFind-Plus
 /**
  * Renews all items that have been checked out to the user from the ILS.
  * Returns a count of the number of items that could be renewed.
  *
  * Parameters:
  * <ul>
  * <li>username - The barcode of the user.  Can be truncated to the last 7 or 9 digits.</li>
  * <li>password - The pin number for the user. </li>
  * </ul>
  *
  * Sample Call:
  * <code>
  * http://catalog.douglascountylibraries.org/API/UserAPI?method=renewAll&username=23025003575917&password=7604
  * </code>
  *
  * Sample Response:
  * <code>
  * {"result":{
  *   "success":true,
  *   "renewalMessage":"0006 of 8 items were renewed successfully."
  * }}
  * </code>
  *
  * @author Mark Noble <*****@*****.**>
  */
 function renewAll()
 {
     $username = $_REQUEST['username'];
     $password = $_REQUEST['password'];
     global $user;
     $user = UserAccount::validateAccount($username, $password);
     if ($user && !PEAR_Singleton::isError($user)) {
         $renewalMessage = $this->catalog->renewAll($user->cat_username);
         return array('success' => $renewalMessage['result'], 'renewalMessage' => $renewalMessage['message']);
     } else {
         return array('success' => false, 'message' => 'Login unsuccessful');
     }
 }