Example #1
0
 /**
  * @param string $get_array
  * @return string
  * @throws ProjectException
  * @throws ProjectSecurityAccessDeniedException
  * @throws ProjectIDMissingException
  */
 public static function restore_handler($get_array)
 {
     global $user;
     if ($get_array) {
         $_GET = unserialize($get_array);
     }
     if ($_GET['project_id']) {
         $project = new Project($_GET['project_id']);
         if ($user->is_admin() == true) {
             if ($project->get_deleted() == true) {
                 if ($project->mark_as_undeleted() == false) {
                     throw new ProjectException();
                 } else {
                     return "1";
                 }
             } else {
                 throw new ProjectException();
             }
         } else {
             throw new ProjectSecurityAccessDeniedException();
         }
     } else {
         throw new ProjectIDMissingException();
     }
 }