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

Source for file page_permissions.php

Documentation is available at page_permissions.php

  1. <?php
  2. /**
  3.  * $Header: /cvsroot/bitweaver/_bit_wiki/page_permissions.php,v 1.8 2006/07/18 14:18:01 squareing Exp $
  4.  *
  5.  * Copyright (c) 2004 bitweaver.org
  6.  * Copyright (c) 2003 tikwiki.org
  7.  * Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
  8.  * All Rights Reserved. See copyright.txt for details and a complete list of authors.
  9.  * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details
  10.  *
  11.  * $Id: page_permissions.php,v 1.8 2006/07/18 14:18:01 squareing Exp $
  12.  * @package wiki
  13.  * @subpackage functions
  14.  */
  15.  
  16. /**
  17.  * required setup
  18.  */
  19. include_once'../bit_setup_inc.php' );
  20. include_onceWIKI_PKG_PATH.'BitPage.php');
  21. include_onceWIKI_PKG_PATH.'BitBook.php');
  22. include_onceKERNEL_PKG_PATH.'notification_lib.php' );
  23. include_onceWIKI_PKG_PATH.'lookup_page_inc.php' );
  24. include_onceWIKI_PKG_PATH.'page_setup_inc.php' );
  25.  
  26. $gBitSystem->verifyPackage'wiki' );
  27.  
  28. // Make sure $gContent is set
  29. if!$gContent->isValid() ) {
  30.     $gBitSmarty->assign('msg'tra"No page indicated" ) );
  31.     $gBitSystem->display'error.tpl' );
  32.     die;
  33. }
  34.  
  35. // Let creator set permissions
  36. if$gBitSystem->isFeatureActive'wiki_creator_admin' && $gContent->isOwner() ) {
  37.     $gBitUser->setPreference'p_wiki_admin'TRUE );
  38. }
  39.  
  40. // Now check permissions to access this page
  41. if!$gBitUser->hasPermission'p_wiki_admin' ) ) {
  42.     $gBitSmarty->assign'msg'tra"Permission denied you cannot assign permissions for this page" ) );
  43.     $gBitSystem->display'error.tpl' );
  44.     die;
  45. }
  46.  
  47. ifisset$_REQUEST["addemail") ) {
  48.     $notificationlib->add_mail_event'wiki_page_changes'$gContent->mInfo['content_type_guid'$gContent->mContentId$_REQUEST["email");
  49. }
  50. ifisset$_REQUEST["removeemail") ) {
  51.     $notificationlib->remove_mail_event'wiki_page_changes'$gContent->mInfo['content_type_guid'$gContent->mContentId$_REQUEST["removeemail");
  52. }
  53.  
  54. $emails $notificationlib->get_mail_events'wiki_page_changes'$gContent->mInfo['content_type_guid'$gContent->mContentId );
  55. $gBitSmarty->assign'emails'$emails );
  56.  
  57. if!$gBitUser->isAdmin() ) {
  58.     foreach$gBitUser->mPerms as $key => $perm {
  59.         if$perm['package'== 'wiki' {
  60.             $assignPerms[$key$perm;
  61.         }
  62.     }
  63. }
  64.  
  65. require_onceLIBERTY_PKG_PATH.'content_permissions_inc.php' );
  66.  
  67. $gBitSystem->display'bitpackage:wiki/page_permissions.tpl'tra'Page Permissions' ) );
  68. ?>

Documentation generated on Thu, 15 Feb 2007 20:46:32 +0000 by phpDocumentor 1.3.0