Ejemplo n.º 1
0
 /**
  * test grabbing a volunteer by an org id that does not exist
  */
 public function testGetInvalidVolunteerByOrgId()
 {
     //grab an organization that does not exists
     $volunteer = Volunteer::getVolunteerByOrgId($this->getPDO(), "10000000000000000");
     $this->assertSame($volunteer->getSize(), 0);
 }
Ejemplo n.º 2
0
                     $volunteer = Volunteer::getVolunteerByVolPhone($pdo, $phone);
                     if ($volunteer !== null && $volunteer->getOrgId() === $_SESSION["volunteer"]->getOrgId()) {
                     }
                     $reply->data = $volunteer;
                 } else {
                     if (empty($emailActivation) === false) {
                         $volunteer = Volunteer::getVolunteerByVolEmailActivation($pdo, $emailActivation);
                         if ($volunteer !== null && $volunteer->getOrgId() === $_SESSION["volunteer"]->getOrgId()) {
                             $reply->data = $volunteer;
                         }
                     } else {
                         if (empty($current) === false) {
                             $volunteer = Volunteer::getVolunteerByVolId($pdo, $_SESSION["volunteer"]->getVolId());
                             $reply->data = $volunteer;
                         } else {
                             $reply->data = Volunteer::getVolunteerByOrgId($pdo, $_SESSION["volunteer"]->getOrgId())->toArray();
                         }
                     }
                 }
             }
         }
     }
 }
 // if the session belongs to an admin, allow post, put, and delete methods.
 if (empty($_SESSION["volunteer"]) === false && $_SESSION["volunteer"]->getVolIsAdmin() === true) {
     if ($method === "PUT" || $method === "POST") {
         //verifyXsrf();
         $requestContent = file_get_contents("php://input");
         $requestObject = json_decode($requestContent);
         //make sure all fields are present, in order to prevent database issues
         if (empty($requestObject->volEmail) === true) {