-
Notifications
You must be signed in to change notification settings - Fork 2
/
my_images.php
51 lines (42 loc) · 1.46 KB
/
my_images.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* my images
*
* @copyright (c) 2004-15 bitweaver.org
*
* @package users
* @subpackage functions
*/
/**
* required setup
*/
require_once( '../kernel/includes/setup_inc.php' );
// User preferences screen
$gBitSystem->verifyFeature( 'users_preferences' );
if( !$gBitUser->isRegistered() ) {
$gBitSystem->fatalError( tra( "You are not logged in" ));
}
include_once( USERS_PKG_INCLUDE_PATH.'lookup_user_inc.php' );
if( $gQueryUser->mUserId != $gBitUser->mUserId && !$gBitUser->hasPermission( 'p_users_admin' ) ) {
$gBitSystem->fatalError( tra( "You do not have permission to edit this user's images" ));
}
$_REQUEST["user_id"] = $gQueryUser->mUserId;
// Upload avatar is processed here
if( !empty( $_REQUEST['store'] )) {
$gQueryUser->storeImages( $_REQUEST );
bit_redirect( $gQueryUser->getDisplayUrl( $gQueryUser->mInfo['login'] ));
} elseif( !empty( $_REQUEST['delete_portrait'] )) {
$gQueryUser->purgePortrait();
$gQueryUser->load();
} elseif( !empty( $_REQUEST['delete_avatar'] )) {
$gQueryUser->purgeAvatar();
$gQueryUser->load();
} elseif( !empty( $_REQUEST['delete_logo'] )) {
$gQueryUser->purgeLogo();
$gQueryUser->load();
}
// 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->assignByRef( 'gQueryUser', $gQueryUser );
$gBitSystem->display( 'bitpackage:users/my_images.tpl', tra( 'Personal Images' ), array( 'display_mode' => 'display' ));
?>