Der folgende Fix behebt das Problem, so daß nur Admins und Album-Moderatoren eingerichtete Gallerien zum Upload verwenden können:
Code: Alles auswählen
#
#-----[ OPEN ]-----
#
album_upload.php
#
#-----[ FIND ]-----
#
// build fake list of personal galleries (these will get created when needed later automatically
$userinfo = album_get_nonexisting_personal_gallery_info();
for($idx=0; $idx < count($userinfo); $idx++)
{
// is user allowed to create this personal gallery ?
// NOTE : that it isn't nesecary to create the $personal_gallery variable first,
// it will be generated inside the album_permissions function if needed
// but here it's done to make the code easier to read
$personal_gallery = init_personal_gallery_cat($userinfo[$idx]['user_id']);
$album_user_access = album_permissions($userinfo[$idx]['user_id'], 0, ALBUM_AUTH_CREATE_PERSONAL, $personal_gallery);
if (album_check_permission($album_user_access, ALBUM_AUTH_CREATE_PERSONAL) == TRUE)
{
$selected = (($userdata['user_id'] == $userinfo[$idx]['user_id'])) ? ' selected="selected"' : '';
$personal_gallery_list .= '<option value="-'.$userinfo[$idx]['user_id'].'" ' . $selected . '>' . sprintf($lang['Personal_Gallery_Of_User'], $userinfo[$idx]['username']) . '</option>';
}
}
if (!empty($personal_gallery_list))
$personal_gallery_list = '<option value="0">------------------------------</option>' . $personal_gallery_list;
}
#
#-----[ REPLACE WITH ]-----
#
if( $userdata['session_logged_in'] )
{
// is user allowed to create this personal gallery ?
// NOTE : that it isn't nesecary to create the $personal_gallery variable first,
// it will be generated inside the album_permissions function if needed
// but here it's done to make the code easier to read
$album_user_access = album_permissions($userdata['user_id'], 0, ALBUM_AUTH_CREATE_PERSONAL, $personal_gallery);
if (album_check_permission($album_user_access, ALBUM_AUTH_CREATE_PERSONAL) == TRUE)
{
$personal_gallery_list .= '<option value="-'.$userdata['user_id'].'" >' . sprintf($lang['Personal_Gallery_Of_User'], $userdata['username']) . '</option>';
}
}
if (!empty($personal_gallery_list))
$personal_gallery_list = '<option value="0">------------------------------</option>' . $personal_gallery_list;
#
#-----[ SAVE/CLOSE ALL FILES ]-----
#
# EoM