Zikula_System_Modules
[ class tree: Zikula_System_Modules ] [ index: Zikula_System_Modules ] [ all elements ]

Source for file pnadminapi.php

Documentation is available at pnadminapi.php

  1. <?php
  2. /**
  3.  * Zikula Application Framework
  4.  *
  5.  * @copyright (c) 2001, Zikula Development Team
  6.  * @link http://www.zikula.org
  7.  * @version $Id: pnadminapi.php 24342 2008-06-06 12:03:14Z markwest $
  8.  * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
  9.  * @package Zikula_System_Modules
  10.  * @subpackage AntiCracker
  11.  */
  12.  
  13. /**
  14.  * delete a AntiCracker item
  15.  * @author Mark West
  16.  * @param int $args['hid'] ID of the item
  17.  * @return bool true on success, false on failure
  18.  */
  19. {
  20.     // Argument check
  21.     if !isset($args['hid']|| !is_numeric($args['hid']) ) {
  22.         return LogUtil::registerError (_MODARGSERROR);
  23.     }
  24.  
  25.     // get the existing item
  26.     $item pnModAPIFunc('SecurityCenter''user''get'array('hid' => $args['hid']));
  27.  
  28.     if (!$item{
  29.         return LogUtil::registerError (_NOSUCHITEM);
  30.     }
  31.  
  32.     // Security check
  33.     if (!SecurityUtil::checkPermission('SecurityCenter::'"$item[hid]::$item[hacktime]"ACCESS_DELETE)) {
  34.         return LogUtil::registerPermissionError();
  35.     }
  36.  
  37.     if (!DBUtil::deleteObjectByID('sc_anticracker'$args['hid']'hid')) {
  38.         return LogUtil::registerError (_DELETEFAILED);
  39.     }
  40.  
  41.     // Let any hooks know that we have deleted an item.
  42.     pnModCallHooks('item''delete'$args['hid']array('module' => 'SecurityCenter'));
  43.  
  44.     // Let the calling process know that we have finished successfully
  45.     return true;
  46. }
  47.  
  48. /**
  49.  * get available admin panel links
  50.  *
  51.  * @author Mark West
  52.  * @return array array of admin links
  53.  */
  54. {
  55.     $links array();
  56.  
  57.     pnModLangLoad('SecurityCenter''admin');
  58.  
  59.     if (SecurityUtil::checkPermission('SecurityCenter::''::'ACCESS_ADMIN)) {
  60.         $args array();
  61.         $args['ot''log_event';
  62.  
  63.         $links[array('url' => pnModURL('SecurityCenter''admin''view')'text' => pnML('_SECURITYCENTER_VIEWHACKATTEMPTSFROMDB'array('i' => _SECURITYCENTER_HACKATTEMPTS)));
  64.         $links[array('url' => pnModURL('SecurityCenter''admin''viewobj'$args)'text' => _SECURITYCENTER_VIEWLOGGEDEVENTS);
  65.         $links[array('url' => pnModURL('SecurityCenter''admin''modifyconfig')'text' => _MODIFYCONFIG);
  66.     }
  67.  
  68.     return $links;
  69. }

Documentation generated on Fri, 18 Jul 2008 21:51:37 +0200 by phpDocumentor 1.4.1