Ejemplo n.º 1
0
 /**
  * @param string $get_array
  * @return string
  * @throws SampleException
  * @throws SampleSecurityException
  * @throws SampleIDMissingException
  */
 public static function delete_handler($get_array)
 {
     global $user;
     if ($get_array) {
         $_GET = unserialize($get_array);
     }
     if ($_GET['sample_id']) {
         if ($user->is_admin()) {
             $sample = new Sample($_GET['sample_id']);
             if ($sample->delete() == true) {
                 return "1";
             } else {
                 throw new SampleDeleteException();
             }
         } else {
             throw new SampleSecurityAccessDeniedExcpetion();
         }
     } else {
         throw new SampleIDMissingException();
     }
 }