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

Source for file pnadmin.php

Documentation is available at pnadmin.php

  1. <?php
  2. /**
  3.  * Zikula Application Framework
  4.  *
  5.  * @copyright (c) 2002, Zikula Development Team
  6.  * @link http://www.zikula.org
  7.  * @version $Id: pnadmin.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 AuthLDAP
  11.  */
  12.  
  13. /**
  14.  * The main administration function
  15.  * This function is the default function, and is called whenever the
  16.  * module is initiated without defining arguments.  As such it can
  17.  * be used for a number of things, but most commonly it either just
  18.  * shows the module menu and returns or calls whatever the module
  19.  * designer feels should be the default function (often this is the
  20.  * view() function)
  21.  * @author Mike Goldfinger <MikeGoldfinger@linuxmail.org>
  22.  * @link http://authldap.ch.vu
  23.  * @return string HTML ouptput
  24.  */
  25. {
  26.     // Security check
  27.     if (!SecurityUtil::checkPermission('AuthLDAP::''::'ACCESS_ADMIN)) {
  28.         return LogUtil::registerPermissionError();
  29.     }
  30.  
  31.     // Create output object
  32.     $pnRender pnRender::getInstance('AuthLDAP'false);
  33.  
  34.     // Return the output that has been generated by this function
  35.     return $pnRender->fetch('authldap_admin_main.htm');
  36. }
  37.  
  38. /**
  39.  * This is a standard function to modify the configuration parameters of the
  40.  * module
  41.  * @author Mike Goldfinger <MikeGoldfinger@linuxmail.org>
  42.  * @link http://authldap.ch.vu
  43.  * @return string HTML ouptput
  44.  * @todo change group list to dropdown
  45.  */
  46. {
  47.      // Security check
  48.     if (!SecurityUtil::checkPermission('AuthLDAP::''::'ACCESS_ADMIN)) {
  49.         return LogUtil::registerPermissionError();
  50.     }
  51.  
  52.     // Create output object
  53.     $pnRender pnRender::getInstance('AuthLDAP'false);
  54.  
  55.     // assign module vars
  56.     $pnRender->assign(pnModGetVar('AuthLDAP'));
  57.  
  58.     // Return the output that has been generated by this function
  59.     return $pnRender->fetch('authldap_admin_modifyconfig.htm');
  60. }
  61.  
  62. /**
  63.  * This is a standard function that is called with the results of the
  64.  * form supplied by template_admin_new() to create a new item
  65.  * @author Mike Goldfinger <MikeGoldfinger@linuxmail.org>
  66.  * @link http://authldap.ch.vu
  67.  * @param 'authldap_pnldap' the authentication type
  68.  * @param 'authldap_serveradr' the ip address of the ldap server
  69.  * @param 'basedn' base container in directory
  70.  * @param 'authldap_bindas' user to bind to directory as if required
  71.  * @param 'authldap_bindpass' password of user to bind as
  72.  * @param 'authldap_searchdn' search container
  73.  * @param 'authldap_searchattr' search the User using tis Attribute
  74.  * @return bool true if item created, false otherwise
  75.  */
  76. {
  77.      // Security check
  78.     if (!SecurityUtil::checkPermission('AuthLDAP::''::'ACCESS_ADMIN)) {
  79.         return LogUtil::registerPermissionError();
  80.     }
  81.  
  82.     // Confirm authorisation code.
  83.     if (!SecurityUtil::confirmAuthKey()) {
  84.         return LogUtil::registerAuthidError (pnModURL('authldap','admin','main'));
  85.     }
  86.  
  87.     // Update module variables.
  88.     $authldap_pnldap FormUtil::getPassedValue('authldap_pnldap''pn''POST');
  89.     pnModSetVar('AuthLDAP''authldap_pnldap'$authldap_pnldap);
  90.  
  91.     $authldap_serveradr FormUtil::getPassedValue('authldap_serveradr''127.0.0.1''POST');
  92.     pnModSetVar('AuthLDAP''authldap_serveradr'$authldap_serveradr);
  93.  
  94.     $authldap_basedn FormUtil::getPassedValue('authldap_basedn''dc=foo,dc=bar''POST');
  95.     pnModSetVar('AuthLDAP''authldap_basedn'$authldap_basedn);
  96.  
  97.     $authldap_bindas FormUtil::getPassedValue('authldap_bindas''''POST');
  98.     pnModSetVar('AuthLDAP''authldap_bindas'$authldap_bindas);
  99.  
  100.     $authldap_bindpass FormUtil::getPassedValue('authldap_bindpass''''POST');
  101.     pnModSetVar('AuthLDAP''authldap_bindpass'$authldap_bindpass);
  102.  
  103.     $authldap_searchdn FormUtil::getPassedValue('authldap_searchdn''''POST');
  104.     pnModSetVar('AuthLDAP''authldap_searchdn'$authldap_searchdn);
  105.  
  106.     $authldap_searchattr FormUtil::getPassedValue('authldap_searchattr''uid''POST');
  107.     pnModSetVar('AuthLDAP''authldap_searchattr'$authldap_searchattr);
  108.  
  109.     // Let any other modules know that the modules configuration has been updated
  110.     pnModCallHooks('module','updateconfig''AuthLDAP'array('module' => 'AuthLDAP'));
  111.  
  112.     // the module configuration has been updated successfuly
  113.  
  114.     // This function generated no output, and so now it is complete we redirect
  115.     // the user to an appropriate page for them to carry on their work
  116.     return pnRedirect(pnModURL('AuthLDAP''admin''main'));
  117. }

Documentation generated on Fri, 18 Jul 2008 21:50:29 +0200 by phpDocumentor 1.4.1