Zikula 1.0.1
[ class tree: Zikula 1.0.1 ] [ index: Zikula 1.0.1 ] [ all elements ]

Source for file admin.php

Documentation is available at admin.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: admin.php 24342 2008-06-06 12:03:14Z markwest $
  8.  * @license GNU/GPL - http://www.gnu.org/copyleft/gpl.html
  9.  * @deprecated
  10.  * @note This file can be removed if not using any non pnAPI compliant modules
  11.  */
  12.  
  13. // include base api
  14. include 'includes/pnAPI.php';
  15.  
  16. // start PN
  17.  
  18.     // Session has expired, display warning
  19.     header('HTTP/1.0 403 Access Denied');
  20.     include 'header.php';
  21.     echo pnModAPIFunc('Users''user''expiredsession');
  22.     include 'footer.php';
  23.     pnShutDown();
  24. }
  25.  
  26. // Get module
  27. $module FormUtil::getPassedValue('module''''GETPOST');
  28.  
  29. if (empty($module)) {
  30.     // call for admin.php without module parameter
  31.     pnRedirect(pnModURL('Admin''admin','adminpanel'));
  32.     pnShutDown();
  33. else if (!pnModAvailable($module|| !SecurityUtil::checkPermission("$module::"'::'ACCESS_EDIT)) {
  34.     // call for an unavailable module - either not available or not authorized
  35.     header('HTTP/1.0 403 Access Denied');
  36.     include ('header.php');
  37.     echo 'Module <strong>' DataUtil::formatForDisplay($module'</strong> not available';
  38.     include ('footer.php');
  39.     pnShutDown();
  40. }
  41.  
  42. // get the module information
  43. $modinfo pnModGetInfo(pnModGetIDFromName($module));
  44.  
  45. if ($modinfo['type'== || $modinfo['type'== 3{
  46.     // Redirect to new style admin panel
  47.     pnRedirect(pnModURL($module'admin'));
  48.     pnShutDown();
  49. }
  50.  
  51.  
  52. if (!file_exists($adminfile='modules/' DataUtil::formatForOS($modinfo['directory']'/admin.php')) {
  53.     // Module claims to be old-style, but no admin.php present - quit here
  54.     header('HTTP/1.0 404 Not Found');
  55.     include ('header.php');
  56.     echo 'Wrong call for Adminfunction in Module <strong>' DataUtil::formatForDisplay($module'</strong>';
  57.     include ('footer.php');
  58.     pnShutDown();
  59. }
  60.  
  61.  
  62. /**
  63.  * old style module administration
  64.  */
  65.  
  66. $func FormUtil::getPassedValue('func''''GETPOST');
  67. $op   FormUtil::getPassedValue('op''''GETPOST');
  68. $name FormUtil::getPassedValue('name''''GETPOST');
  69. $file FormUtil::getPassedValue('file''''GETPOST');
  70. $type FormUtil::getPassedValue('type''''GETPOST');
  71.  
  72. // load the legacy includes
  73. Loader::includeOnce('system/Admin/pnlegacy/tools.php');
  74.  
  75. // set a constant so we can check the correct entry point later
  76. define('LOADED_AS_MODULE''1');
  77.  
  78. $ModName $module;
  79. include $adminfile;
  80.  
  81. // ensure that the module table information is available
  82. pnModDBInfoLoad($modinfo['name']$modinfo['directory']);
  83.  
  84. $function $module '_admin_';
  85. if (empty($op)) {
  86.     $op 'main';
  87. }
  88. $function_op $function $op;
  89. $function_main $function 'main';
  90.  
  91. if (function_exists($function_op)) {
  92.     $function_op($_REQUEST);
  93. elseif (function_exists($function_main)) {
  94.     $function_main($_REQUEST);
  95. else {
  96.     // neither function_admin_op nor function_admin_main are available
  97.     header('HTTP/1.0 404 Not Found');
  98.     include ('header.php');
  99.     echo 'Admin function <strong>'.DataUtil::formatForDisplay($function_op).'</strong> in Module <strong>'.DataUtil::formatForDisplay($module).'</strong> not available';
  100.     include ('footer.php');
  101.     pnShutDown();
  102. }

Documentation generated on Fri, 18 Jul 2008 21:38:41 +0200 by phpDocumentor 1.4.1