Ejemplo n.º 1
0
 function afterDelete()
 {
     $resource = new Resource();
     if (!empty(Resource::$delete_list) && $this->name != 'Resource') {
         foreach (Resource::$delete_list as $res) {
             $resource->delete($res);
         }
     }
     return true;
 }
Ejemplo n.º 2
0
 public function delete(\Base $f3, $params)
 {
     $this->resource->reset();
     $msg = \Flash::instance();
     if (isset($params['id'])) {
         $this->resource->load(array('_id = ?', $params['id']));
         if ($f3->get('HOST') == 'ikkez.de' && !$this->resource->dry() && $this->resource->username == 'admin') {
             $msg->addMessage("You are not allowed to delete the demo-admin", 'danger');
             $f3->reroute('/admin/' . $params['module']);
             return;
         }
         parent::delete($f3, $params);
     }
     $f3->reroute($f3->get('SESSION.LastPageURL'));
 }
 /**
  * @param \Base $f3
  * @param array $params
  */
 public function delete(\Base $f3, $params)
 {
     $this->resource->reset();
     $msg = \Flash::instance();
     if (isset($params['id'])) {
         $this->resource->load(array('_id = ?', $params['id']));
         parent::delete($f3, $params);
     }
     $f3->reroute($f3->get('SESSION.LastPageURL'));
 }
Ejemplo n.º 4
0
             case 17:
                 $section = "turismb";
                 break;
             case 18:
                 $section = "profile";
                 break;
             case 20:
                 $section = "university";
                 break;
         }
         $file1 = new fFile("../uploads/{$section}/" . $resource->prepareUrl());
         $file1->delete();
         $file1 = new fFile("../uploads/{$section}/thumbs/" . $resource->prepareUrl());
         $file1->delete();
     }
     $resource->delete();
     exit("1");
     break;
 case "load_categories":
     require_once LOAD . 'load_categories.php';
     break;
 case "load_giro":
     require_once LOAD . 'load_giro.php';
     break;
 case "updateStatus":
     require_once LOAD . 'updateStatus.php';
     break;
 case "load_girot":
     require_once LOAD . 'load_girot.php';
     break;
 case "load_vehicle":
 /**
  * Delete Cookies & Files with content from hooking page
  * @param \Base $f3
  * @param array $params
  */
 public function delete(\Base $f3, $params)
 {
     $this->resource->reset();
     $msg = \Flash::instance();
     if (isset($params['id'])) {
         $this->resource->load(array('_id = ?', $params['id']));
         $url1 = $this->resource->vulnerablePageContent;
         $url2 = $this->resource->indirect_target_page;
         $url3 = $this->resource->vulnerableUrl;
         $vulnPage = $f3->ROOT . parse_url($url1, PHP_URL_PATH);
         $targetPage = $f3->ROOT . parse_url($url2, PHP_URL_PATH);
         $attack_script = $f3->ROOT . $f3->BASE . '/scripts/' . parse_url($url3, PHP_URL_HOST) . '.js';
         if (file_exists($vulnPage) || file_exists($targetPage) || file_exists($attack_script)) {
             unlink($vulnPage);
             unlink($targetPage);
             unlink($attack_script);
         }
         parent::delete($f3, $params);
     }
     $f3->reroute($f3->get('SESSION.LastPageURL'));
 }
 /**
  * Delete a specific resource. Returns the resource that was deleted.
  *
  * @deprecated
  * @param Resource $resource
  * @param boolean  $permanent
  * @fires Resource.Deleted
  * @return Resource
  */
 public function delete($resource, $permanent = false)
 {
     if ($permanent) {
         $resource->forceDelete();
     } else {
         $resource->delete();
     }
     return $resource;
 }