summaryrefslogtreecommitdiff
path: root/attachments.php
diff options
context:
space:
mode:
authorMax Kremmel <xing@synapse.plus.com>2006-11-26 12:51:58 +0000
committerMax Kremmel <xing@synapse.plus.com>2006-11-26 12:51:58 +0000
commit550bd1ca526bec8747df6e6fe3e318fbcd8207dd (patch)
treed8d003de0221d1284e533e5bada92031f13f605b /attachments.php
parente60710ab7165adb3402a1cc39f8f4efe0b6eb2a5 (diff)
downloadliberty-550bd1ca526bec8747df6e6fe3e318fbcd8207dd.tar.gz
liberty-550bd1ca526bec8747df6e6fe3e318fbcd8207dd.tar.bz2
liberty-550bd1ca526bec8747df6e6fe3e318fbcd8207dd.zip
move getAttachmentList function to LibertyAttachable, where it belongs and add a basic page to list all available attachments - only admin may view attachments from other users as well. - functionally still somewhat lacking...
Diffstat (limited to 'attachments.php')
-rw-r--r--attachments.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/attachments.php b/attachments.php
new file mode 100644
index 0000000..f3ba489
--- /dev/null
+++ b/attachments.php
@@ -0,0 +1,42 @@
+<?php
+/**
+ * attachment_browser
+ *
+ * @author spider <spider@steelsun.com>
+ * @version $Revision: 1.1 $
+ * @package liberty
+ * @subpackage functions
+ */
+
+/**
+ * bit setup
+ */
+require_once("../bit_setup_inc.php");
+
+$gContent = new LibertyAttachable();
+
+if( !$gBitUser->isRegistered() ) {
+ $gBitSystem->fatalError( 'You need to be logged in to view this page.' );
+}
+
+$feedback = array();
+$listHash = &$_REQUEST;
+if( $gBitUser->isAdmin() ) {
+ if( !empty( $listHash['login'] ) ) {
+ if( $userInfo = $gBitUser->getUserInfo( array( 'login' => $listHash['login'] ) ) ) {
+ $listHash['user_id'] = $userInfo['user_id'];
+ } else {
+ $feedback['error'] = tra( 'That user does not exist.' );
+ }
+ }
+} else {
+ $listHash['user_id'] = $gBitUser->mUserId;
+}
+
+$attachments = $gContent->getAttachmentList( $listHash );
+
+$gBitSmarty->assign( 'listInfo', $listHash['listInfo'] );
+$gBitSmarty->assign( 'attachments', $attachments );
+$gBitSmarty->assign( 'feedback', $feedback );
+$gBitSystem->display( 'bitpackage:liberty/attachments.tpl' );
+?>