public function delete()
 {
     if (in_array($_GET['id'], array('1', '2'))) {
         $this->error('本部门不允许删除');
     }
     parent::delete();
 }
 public function afterDelete()
 {
     if ($this->content !== null) {
         $this->content->delete();
     }
     parent::afterDelete();
 }
Beispiel #3
0
 function delete($id = FALSE)
 {
     if ($id) {
         $content = new Content($id);
         $content->delete();
         set_notify('success', lang('delete_data_complete'));
     }
     redirect($_SERVER['HTTP_REFERER']);
 }
Beispiel #4
0
 /**
  * Deletes a profile and associated users
  */
 public function delete()
 {
     $this->db->query('DELETE FROM `login` 
     WHERE `profile_id`=' . intval($this->data['id']), \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
     $this->db->query('DELETE FROM `facebook_graph` 
     WHERE `userID` IN (SELECT `userID` FROM `facebook` WHERE `profile_id`=' . intval($this->data['id']) . ')', \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
     $this->db->query('DELETE FROM `facebook` 
     WHERE `profile_id`=' . intval($this->data['id']), \Zend\Db\Adapter\Adapter::QUERY_MODE_EXECUTE);
     parent::delete();
 }
Beispiel #5
0
 public function delete()
 {
     if (in_array($_GET['id'], array('1'))) {
         $this->error('初始用户不允许删除');
     }
     /**
      * 将被删除用户的任务设置为删除状态
      * 这样做是为了保留数据统计的完整性
      */
     $this->db('task')->where('task_user_id = :task_user_id')->update(array('noset' => array('task_user_id' => $_GET['id']), 'task_delete' => '1'));
     parent::delete();
 }
 /**
  * calls Content::delete() to soft delete a content
  * Soft delete is being performed here
  * set $this->content_id at the time of calling this method
  */
 public function delete()
 {
     Logger::log("Enter: Announcement::delete");
     Logger::log("Calling: Content::delete");
     $sql = 'UPDATE { announcements } SET is_active = ?, position = ?, status = ? WHERE content_id = ?';
     $data = array(0, 0, 0, $this->content_id);
     $res = Dal::query($sql, $data);
     parent::delete();
     Logger::log("Exit: Announcement::delete");
     return;
 }
Beispiel #7
0
 /**
  * Deletes a File object
  *
  * @param string $errmsg Reference to error message
  *
  * @return bool True if deletion was successful
  * @internal Persistent content will not be deleted
  */
 public function delete(&$errmsg)
 {
     if ($this->isPersistent() == false) {
         // Unlink BLOB if any exists
         $blob_oid = $this->getBinaryDataOid();
         if ($blob_oid) {
             $errmsg = "Deleting BLOB OID : {$blob_oid}";
             if ($this->mBd->UnlinkLargeObject($blob_oid) == false) {
                 $errmsg = _("Unable to successfully unlink BLOB OID : {$blob_oid} !");
                 return false;
             }
         }
         $this->mBd->execSqlUpdate("DELETE FROM content_file WHERE files_id = '" . $this->getId() . "'", false);
     } else {
         $errmsg = _("Could not delete this file, since it is persistent");
     }
     return parent::delete($errmsg);
 }
Beispiel #8
0
 public function delete()
 {
     parent::delete();
     Navigation::redirect("admin/menu_top");
     exit;
 }
 /**
  * delete sb content in the object
  * @access public
  */
 public function delete()
 {
     Logger::log("Enter: SBMicroContent::delete | Arg: \$content_id = {$content_id}");
     Logger::log("Calling: Content::delete | Param: \$content_id = {$content_id}");
     parent::delete();
     $sql = "DELETE FROM {contents_sbmicrocontents} WHERE content_id = ? ";
     $data = array($this->content_id);
     $res = Dal::query($sql, $data);
     if (PEAR::isError($res)) {
         Logger::log(" Throwing exception DB_QUERY_FAILED | Message: {$res->getMessage}()", LOGGER_ERROR);
         throw new PAException(DB_QUERY_FAILED, $res->getMessage());
     }
     Logger::log("Exit: SBMicrocontent::delete");
     return;
 }
 /**
  * 删除 
  */
 public function delete()
 {
     if (IS_POST) {
         $catid = (int) $this->_get("catid");
         if (!$catid) {
             $this->error("缺少栏目ID!");
         }
         if (empty($_POST['ids'])) {
             $this->error("没有信息被选中!");
         }
         import('Content');
         $Content = new Content();
         foreach ($_POST['ids'] as $id) {
             $Content->delete($id, $catid);
         }
         $this->success("删除成功!");
     } else {
         $catid = (int) $this->_get("catid");
         $id = (int) $this->_get("id");
         if (!$catid) {
             $this->error("缺少栏目ID!");
         }
         //检查是否锁定
         $this->locking($catid, $id);
         import('Content');
         $Content = new Content();
         if ($Content->delete($id, $catid)) {
             $this->success("删除成功!");
         } else {
             $this->error("删除失败!");
         }
     }
 }
Beispiel #11
0
<?php

require_once "../bd.php";
// Include connect to BD
require_once '../classes/base.php';
// Include main classes
//If DELETE comment
if (isset($_GET['name']) == 'comment') {
    $id = $_GET['id'];
    $deleteObject = new Comments();
    if ($deleteObject->delete($id)) {
        echo '<script>window.location.href="../index.php"</script>';
    } else {
        echo 'False';
    }
}
//If DELETE etries
if (isset($_GET['name']) == 'entries') {
    $id = $_GET['id'];
    $deleteObject = new Content();
    if ($deleteObject->delete($id)) {
        echo '<script>window.location.href="../index.php"</script>';
    } else {
        echo 'False';
    }
}
 /**
  * 删除 
  */
 public function delete()
 {
     $id = (int) $this->_get("id");
     $catid = (int) $this->_get("catid");
     $member_content = M("MemberContent");
     $mb_con = $member_content->where(array("content_id" => $id, "catid" => $catid, "userid" => AppframeAction::$Cache['uid']))->find();
     if ($mb_con) {
         $category = $this->categorys[$catid];
         $setting = unserialize($category['setting']);
         //模型ID
         $modelid = $category['modelid'];
         $tablename = ucwords($this->Model[$modelid]['tablename']);
         $status = M($tablename)->where(array("id" => $id, "catid" => $catid, "sysadd" => 0))->getField("status");
         if ($status) {
             //审核通过的文章
             if ($status == 99) {
                 if ((int) $setting['member_admin'] == 4 || (int) $setting['member_admin'] == 6) {
                     import('Content');
                     $Content = new Content();
                     if ($Content->delete($id, $catid)) {
                         $this->success("删除成功!");
                     } else {
                         $this->error("删除失败!");
                     }
                 } else {
                     $this->error("你没有权限操!");
                 }
             } else {
                 if ((int) $setting['member_admin'] == 1 || (int) $setting['member_admin'] == 3 || (int) $setting['member_admin'] == 6) {
                     import('Content');
                     $Content = new Content();
                     if ($Content->delete($id, $catid)) {
                         $this->success("删除成功!");
                     } else {
                         $this->error("删除失败!");
                     }
                 } else {
                     $this->error("你没有权限操!");
                 }
             }
         } else {
             $this->error("出现错误,系统找不到该信息的相关记录!");
         }
     } else {
         $this->error("该信息不存在!");
     }
 }
 /** Delete article
  */
 public function deleteAction()
 {
     if ($this->_request->isPost()) {
         $id = (int) $this->_request->getPost('id');
         $del = $this->_request->getPost('del');
         if ($del == 'Yes' && $id > 0) {
             $contents = new Content();
             $where = 'id = ' . $id;
             $contents->delete($where);
             $this->_flashMessenger->addMessage('Record deleted!');
             $this->_helper->solrUpdater->deleteById('beocontent', $id);
         }
         $this->_redirect('/admin/content/');
     } else {
         $id = (int) $this->_request->getParam('id');
         if ($id > 0) {
             $contents = new Content();
             $this->view->content = $contents->fetchRow('id=' . $id);
         }
     }
 }
 /** Delete this Content from the database */
 public function delete(&$errmsg)
 {
     $user = User::getCurrentUser();
     if (!$this->DEPRECATEDisOwner($user) || !$user->DEPRECATEDisSuperAdmin()) {
         $errmsg = _('Access denied!');
     }
     if ($this->isPersistent() == false) {
         $this->mBd->execSqlUpdate("DELETE FROM content_flickr_photostream WHERE flickr_photostream_id = '" . $this->getId() . "'", false);
     }
     return parent::delete($errmsg);
 }
Beispiel #15
0
 public function delete()
 {
     parent::delete();
     Navigation::redirect($this->my_redirect);
     exit;
 }
Beispiel #16
0
 public function delete()
 {
     parent::delete();
     Navigation::redirect("admin/home/banner");
     exit;
 }
Beispiel #17
0
 public function delete()
 {
     $content = new Content();
     $result = $content->delete();
     header("Location: " . $_GET["app"]);
 }
Beispiel #18
0
 public function afterDelete()
 {
     $this->content->delete();
     parent::afterDelete();
 }
 /**
  * calls Content::delete() to soft delete a content
  * soft delete
  */
 public function delete()
 {
     Logger::log("Enter: Video::delete");
     Logger::log("Calling: Content::delete");
     parent::delete();
     Logger::log("Exit: Video::delete");
     return;
 }
Beispiel #20
0
 public function delete($id)
 {
     $c = new Content($id);
     if ($c->exists()) {
         $c->delete();
         $this->add_info(lang('system_content_deleted'));
     } else {
         show_404();
     }
 }
Beispiel #21
0
 public function delete()
 {
     $ReturnResult = parent::delete();
     Navigation::redirect("backend/client/show/");
 }
Beispiel #22
0
 /**
  * Delete layer
  */
 public function delete()
 {
     //array_map('unlink', glob($this->getPublicStoragePath()."/*"));
     parent::delete();
 }
Beispiel #23
0
<?php

$ci =& get_instance();
$id = $ci->uri->segment(5);
$c = new Content();
$c->get_by_id($id);
if ($c->exists()) {
    if ($c->can_delete()) {
        $c->delete();
        $ci->app->add_info('Content deleted');
    } else {
        $ci->app->add_error('permission denied! please check your root adminstrator');
    }
} else {
    $ci->app->add_error('Content not found');
}
Beispiel #24
0
 function delete($object = '')
 {
     if (empty($object)) {
         $c = $this->children();
         foreach ($c as $item) {
             $item->delete();
         }
     }
     return parent::delete($object);
 }
 /**
  * Deletes a ContentGroupElement object
  *
  * @param string $errmsg Reference to error message
  *
  * @return bool True if deletion was successful
  * @internal Persistent content will not be deleted
  *
  * @todo Implement proper access control
  */
 public function delete(&$errmsg)
 {
     if ($this->isPersistent() == false && !empty($this->content_group_element_row['displayed_content_id'])) {
         $displayed_content = self::getObject($this->content_group_element_row['displayed_content_id']);
         $displayed_content->delete($errmsg);
         parent::delete($errmsg);
     }
 }
Beispiel #26
0
 /**
  * Delete this Content from the database
  */
 public function delete(&$errmsg)
 {
     if ($this->isPersistent() == false) {
         foreach ($this->getElements() as $element) {
             $element->delete($errmsg);
         }
     }
     return parent::delete($errmsg);
 }
Beispiel #27
0
 public function delete()
 {
     parent::delete();
     Navigation::redirect("admin/contact");
     exit;
 }
 /**
  * Deletes a embedded content object
  *
  * @param string $errmsg Reference to error message
  *
  * @return bool True if deletion was successful
  * @internal Persistent content will not be deleted
  */
 public function delete(&$errmsg)
 {
     if ($this->isPersistent() == false) {
         if (!empty($this->embedded_content_row['embedded_file_id'])) {
             $embedded_content_file = self::getObject($this->embedded_content_row['embedded_file_id']);
             $embedded_content_file->delete($errmsg);
         }
         if (!empty($this->embedded_content_row['fallback_content_id'])) {
             $fallback_content = self::getObject($this->embedded_content_row['fallback_content_id']);
             $fallback_content->delete($errmsg);
         }
     } else {
         $errmsg = _("Content is persistent (you must make it non persistent before you can delete it)");
     }
     return parent::delete($errmsg);
 }
Beispiel #29
0
 public function delete()
 {
     $ReturnResult = parent::delete();
     Navigation::redirect("backend/info_segmento/show/");
 }
Beispiel #30
0
 public function delete()
 {
     $ReturnResult = parent::delete();
     Navigation::redirect("backend/product/family/show/");
 }