diff options
| author | Max Kremmel <xing@synapse.plus.com> | 2007-09-26 09:24:22 +0000 |
|---|---|---|
| committer | Max Kremmel <xing@synapse.plus.com> | 2007-09-26 09:24:22 +0000 |
| commit | 72a68884f8146e52f127bb9a5838d0ec3299bdd3 (patch) | |
| tree | 91fcfd704f8ff8c34a12eeb1acf6752eeb8c3176 /my_images.php | |
| parent | b5a8aca80f30b0ced8b333441da49ded80fa2e8e (diff) | |
| download | users-72a68884f8146e52f127bb9a5838d0ec3299bdd3.tar.gz users-72a68884f8146e52f127bb9a5838d0ec3299bdd3.tar.bz2 users-72a68884f8146e52f127bb9a5838d0ec3299bdd3.zip | |
move image handling process to a separate function and fix image storing, handling and updating
Diffstat (limited to 'my_images.php')
| -rw-r--r-- | my_images.php | 47 |
1 files changed, 11 insertions, 36 deletions
diff --git a/my_images.php b/my_images.php index b42ec05..48674a0 100644 --- a/my_images.php +++ b/my_images.php @@ -1,6 +1,6 @@ <?php /** - * $Header: /cvsroot/bitweaver/_bit_users/my_images.php,v 1.10 2007/09/21 03:50:27 spiderr Exp $ + * $Header: /cvsroot/bitweaver/_bit_users/my_images.php,v 1.11 2007/09/26 09:24:22 squareing Exp $ * * Copyright (c) 2004 bitweaver.org * Copyright (c) 2003 tikwiki.org @@ -8,12 +8,10 @@ * All Rights Reserved. See copyright.txt for details and a complete list of authors. * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details * - * $Id: my_images.php,v 1.10 2007/09/21 03:50:27 spiderr Exp $ + * $Id: my_images.php,v 1.11 2007/09/26 09:24:22 squareing Exp $ * @package users * @subpackage functions */ -global $gEditMode; -$gEditMode = 'images'; /** * required setup @@ -23,34 +21,22 @@ require_once( '../bit_setup_inc.php' ); // User preferences screen $gBitSystem->verifyFeature( 'users_preferences' ); -if (!$gBitUser->isRegistered()) { - $gBitSmarty->assign('msg', tra("You are not logged in")); - $gBitSystem->display( 'error.tpl' ); - die; +if( !$gBitUser->isRegistered() ) { + $gBitSystem->fatalError( tra( "You are not logged in" )); } -if (!isset($_REQUEST["showall"])) { - $_REQUEST["showall"] = 'n'; -} - -include_once(USERS_PKG_PATH.'lookup_user_inc.php'); +include_once( USERS_PKG_PATH.'lookup_user_inc.php' ); -if ($gQueryUser->mUserId != $gBitUser->mUserId && !$gBitUser->object_has_permission($gBitUser->mUserId, $gQueryUser->mInfo['content_id'], 'bituser', 'p_users_admin')) { - $gBitSmarty->assign('msg', tra('You do not have permission to edit this user\'s images')); - $gBitSystem->display('error.tpl'); - die; +if( $gQueryUser->mUserId != $gBitUser->mUserId ) { + $gBitSystem->fatalError( tra( "You do not have permission to edit this user's images" )); } -$gBitSmarty->assign('showall', $_REQUEST["showall"]); -$userwatch = $gQueryUser->mUsername; -$gBitSmarty->assign('userwatch', $userwatch); -$_REQUEST["user_id"]=$gQueryUser->mUserId; +$_REQUEST["user_id"] = $gQueryUser->mUserId; // Upload avatar is processed here if( !empty( $_REQUEST['fSubmitBio'] ) ) { $gQueryUser->store( $_REQUEST ); - $url = $gQueryUser->getDisplayUrl( $gQueryUser->mInfo['login'] ); - header( "Location: ".$url ); + bit_redirect( $gQueryUser->getDisplayUrl( $gQueryUser->mInfo['login'] ) ); } elseif( isset( $_REQUEST['fSubmitDeletePortait'] ) ) { $gQueryUser->purgePortrait(); $gQueryUser->load(); @@ -62,20 +48,9 @@ if( !empty( $_REQUEST['fSubmitBio'] ) ) { $gQueryUser->load(); } -if (isset($_REQUEST["uselib"])) { - $avatarHash['type'] = AVATAR_TYPE_LIBRARY; - $avatarHash['avatar_lib_name'] = $_REQUEST["avatar"]; - $avatarHash['avatar_name'] = NULL; - $avatarHash['avatar_size'] = NULL; - $avatarHash['avatar_type'] = NULL; - $avatarHash['avatar_data'] = NULL; - $gQueryUser->storeAvatar( $avatarHash ); -} - // For some reason, we have to reassign here to make our changes to gBitUser->mInfo present in smarty. // dunno why, but this fixes the bug. XOXO spiderr -$gBitSmarty->assign_by_ref('gQueryUser', $gQueryUser); - -$gBitSystem->display( 'bitpackage:users/my_images.tpl'); +$gBitSmarty->assign_by_ref( 'gQueryUser', $gQueryUser ); +$gBitSystem->display( 'bitpackage:users/my_images.tpl', tra( 'Personal Images' )); ?> |
