예제 #1
0
파일: albums.php 프로젝트: shifter/ospap2
                    $objAlbumMember->set('allow_create_subalbum', NO);
                    $objAlbumGuest->set('allow_view', NO);
                    $objAlbumGuest->set('allow_rate', NO);
                    $objAlbumGuest->set('allow_post_picture', NO);
                    $objAlbumGuest->set('allow_post_comment', NO);
                    $objAlbumGuest->set('allow_delete_picture', NO);
                    $objAlbumGuest->set('allow_create_subalbum', NO);
                    break;
            }
            $objAlbumGuest->save();
            $objAlbumMember->save();
            $objAlbumGroup->save();
            $objAlbum->set('albumpolicy_guest_id', $objAlbumGuest->get('id'));
            $objAlbum->set('albumpolicy_member_id', $objAlbumMember->get('id'));
            $objAlbum->set('albumpolicy_group_id', $objAlbumGroup->get('id'));
            $objAlbum->remove('simple_permissions');
        }
        $objAlbum->save();
        header('Location: index.php?action=albums&' . $objAlbum->getIDPair());
    } else {
        $strSubAction = 'edit';
    }
}
if ($strSubAction == 'delete') {
    $objAlbum->getFromRequest();
    $objAlbum->load();
    if (!$objAlbum->canEdit($objUser)) {
        throw new exception('exception_accessdenied');
    }
    $objAlbum->delete();
    $objAlbum->save();