/**
  * Process notifications from the ACS server when an item is checked out
  * or returned.
  **/
 function launch()
 {
     $id = $_REQUEST['id'];
     //Setup JSON response
     header('Content-type: text/plain');
     header('Cache-Control: no-cache, must-revalidate');
     // HTTP/1.1
     header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
     // Date in the past
     require_once ROOT_DIR . '/Drivers/EContentDriver.php';
     $driver = new EContentDriver();
     $result = $driver->reactivateHold($id);
     echo json_encode($result);
     exit;
 }
Exemple #2
0
 /**
  * Activates a frozen eContent hold.
  *
  * 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>id - Theid of the eContent record to activate the hold for.</li>
  * </ul>
  *
  * Returns:
  * <ul>
  * <li>success � true if the account is valid and the hold could be frozen, false if the username or password were incorrect or the hold could not be frozen.</li>
  * <li>title � The title of the record.</li>
  * <li>message � More information about the reactivation process.</li>
  * </ul>
  *
  * Sample Call:
  * <code>
  * http://catalog.douglascountylibraries.org/API/UserAPI?method=activateEContentHold&username=23025003575917&password=1234&ids=532
  * </code>
  *
  * Sample Response:
  * <code>
  * {"result":{
  *   "title":"Toothful tales how we survived the sweet attack \/",
  *   "result":true,
  *   "message":"Your hold was activated successfully."
  * }}
  * </code>
  *
  * @author Mark Noble <*****@*****.**>
  */
 function activateEContentHold()
 {
     $username = $_REQUEST['username'];
     $password = $_REQUEST['password'];
     global $user;
     $user = UserAccount::validateAccount($username, $password);
     if ($user && !PEAR_Singleton::isError($user)) {
         require_once ROOT_DIR . '/Drivers/EContentDriver.php';
         $eContentDriver = new EContentDriver();
         $id = $_REQUEST['id'];
         $reactivateResult = $eContentDriver->reactivateHold($id);
         return $reactivateResult;
     } else {
         return array('success' => false, 'message' => 'Login unsuccessful');
     }
 }