Beispiel #1
0
 private function verifyForm()
 {
     if ($_SESSION['userid'] == "") {
         echo "<script>\r\n\t\t\talert('Session variable not working');\r\n\t\t\t</script>";
     }
     if (!isset($this->albumName) || $this->albumName == '' || (!isset($this->pictureName) || $this->pictureName == '') || (!isset($this->userName) || $this->userName == '') || (!isset($this->tagName) || $this->tagName == '')) {
         //something's missing
         $this->PrintError(0);
         return false;
     }
     $model = new APIModel();
     $result = $model->verifyPerson($this->userName);
     if ($result != "Person Exists") {
         //something's missing
         $this->PrintError(4);
         return false;
     }
     $userid = $model->getID($this->userName);
     $result = $model->verifyAlbum($userid, $this->albumName);
     if ($result != "Album Exists") {
         //something's missing
         $this->PrintError(3);
         return false;
     }
     $albumID = $model->getAlbumID($userid, $this->albumName);
     $result = $model->verifyPicture($albumID, $this->pictureName);
     if ($result != "Picture Exists") {
         //something's missing
         $this->PrintError(5);
         return false;
     } else {
         return true;
     }
 }