[ Index ]
 

Code source de CMS made simple 1.0.5

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/admin/ -> deleteuserplugin.php (source)

   1  <?php
   2  #CMS - CMS Made Simple
   3  #(c)2004 by Ted Kulp (wishy@users.sf.net)
   4  #This project's homepage is: http://cmsmadesimple.sf.net
   5  #
   6  #This program is free software; you can redistribute it and/or modify
   7  #it under the terms of the GNU General Public License as published by
   8  #the Free Software Foundation; either version 2 of the License, or
   9  #(at your option) any later version.
  10  #
  11  #This program is distributed in the hope that it will be useful,
  12  #but WITHOUT ANY WARRANTY; without even the implied warranty of
  13  #MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14  #GNU General Public License for more details.
  15  #You should have received a copy of the GNU General Public License
  16  #along with this program; if not, write to the Free Software
  17  #Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  18  #
  19  #$Id: deleteuserplugin.php 3601 2006-12-20 21:04:54Z calguy1000 $
  20  
  21  $CMS_ADMIN_PAGE=1;
  22  
  23  require_once ("../include.php");
  24  
  25  check_login();
  26  
  27  global $gCms;
  28  $db =& $gCms->GetDb();
  29  
  30  $userplugin_id = -1;
  31  if (isset($_GET["userplugin_id"])) {
  32  
  33      $userplugin_id = $_GET["userplugin_id"];
  34      $userplugin_name = "";
  35      $userid = get_userid();
  36      $access = check_permission($userid, 'Modify User-defined Tags');
  37  
  38      if ($access) {
  39  
  40          $query = "SELECT userplugin_name FROM ".cms_db_prefix()."userplugins WHERE userplugin_id = ?";
  41          $result = $db->Execute($query, array($userplugin_id));
  42  
  43          if ($result && $result->RecordCount()) {
  44              $row = $result->FetchRow();
  45              $userplugin_name = $row['userplugin_name'];
  46          }
  47  
  48          Events::SendEvent('Core', 'DeleteUserDefinedTagPre', array('id' => $userplugin_id, 'name' => &$userplugin_name));
  49          $query = "DELETE FROM ".cms_db_prefix()."userplugins where userplugin_id = ?";
  50          $result = $db->Execute($query,array($userplugin_id));
  51          if ($result)
  52          {
  53              Events::SendEvent('Core', 'DeleteUserDefinedTagPost', array('id' => $userplugin_id, 'name' => &$userplugin_name));
  54              audit($userplugin_id, $userplugin_name, 'Deleted User Defined Tag');
  55          }
  56      }
  57  }
  58  
  59  redirect('listusertags.php?message=usertagdeleted');
  60  
  61  # vim:ts=4 sw=4 noet
  62  ?>


Généré le : Tue Apr 3 18:50:37 2007 par Balluche grâce à PHPXref 0.7