示例#1
0
 /**
  * Removes one or more titles from the user's reading history.
  *
  * 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>
  * <li>selected - A list of record ids to be deleted from the reading history.</li>
  * </ul>
  *
  * Returns:
  * <ul>
  * <li>success � true if the account is valid and the items could be removed from the reading history, false if the username or password were incorrect or the items could not be removed from the reading history.</li>
  * </ul>
  *
  * Sample Call:
  * <code>
  * http://catalog.douglascountylibraries.org/API/UserAPI?method=deleteSelectedFromReadingHistory&username=23025003575917&password=1234&selected[]=25855
  * </code>
  *
  * Sample Response:
  * <code>
  * {"result":{"success":true}}
  * </code>
  *
  * @author Mark Noble <*****@*****.**>
  */
 function deleteSelectedFromReadingHistory()
 {
     $username = $_REQUEST['username'];
     $password = $_REQUEST['password'];
     $selectedTitles = $_REQUEST['selected'];
     global $user;
     $user = UserAccount::validateAccount($username, $password);
     if ($user && !PEAR_Singleton::isError($user)) {
         $this->catalog->doReadingHistoryAction('deleteMarked', $selectedTitles);
         return array('success' => true);
     } else {
         return array('success' => false, 'message' => 'Login unsuccessful');
     }
 }