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

Source for file attachments.php

Documentation is available at attachments.php

  1. <?php
  2. /**
  3.  * attachment_browser
  4.  *
  5.  * @author   spider <spider@steelsun.com>
  6.  * @version  $Revision$
  7.  * @package  liberty
  8.  * @subpackage functions
  9.  */
  10.  
  11. /**
  12.  * bit setup
  13.  */
  14. require_once("../kernel/setup_inc.php");
  15.  
  16. $gContent = new LibertyMime();
  17.  
  18. if( !$gBitUser->isRegistered() ) {
  19.     $gBitSystem->fatalError( tra( 'You need to be logged in to view this page.' ));
  20. }
  21.  
  22. $feedback = array();
  23. $listHash = &$_REQUEST;
  24. if( $gBitUser->isAdmin() ) {
  25.     if( !empty( $listHash['login'] ) && $listHash['login'] == 'all' ) {
  26.         $listHash['user_id'] = NULL;
  27.     } elseif( !empty( $listHash['login'] ) ) {
  28.         if( $userInfo = $gBitUser->getUserInfo( array( 'login' => $listHash['login'] ) ) ) {
  29.             $listHash['user_id'] = $userInfo['user_id'];
  30.         } else {
  31.             $feedback['error'] = tra( 'That user does not exist.' );
  32.         }
  33.     } else {
  34.         $listHash['user_id'] = $gBitUser->mUserId;
  35.     }
  36. } else {
  37.     $listHash['user_id'] = $gBitUser->mUserId;
  38. }
  39. $attachments = $gContent->getAttachmentList( $listHash );
  40.  
  41. $gBitSmarty->assign( 'listInfo', $listHash['listInfo'] );
  42. $gBitSmarty->assign( 'attachments', $attachments );
  43. $gBitSmarty->assign( 'feedback', $feedback );
  44. $gBitSystem->display( 'bitpackage:liberty/attachments.tpl', tra( 'Attachments' ), array( 'display_mode' => 'display' ));
  45. ?>

Documentation generated on Wed, 29 Jul 2015 13:55:35 +0000 by phpDocumentor 1.5.0-lsces