예제 #1
0
 //new object
 if (isset($_POST['album_type'])) {
     $album_type = intval($_POST['album_type']) == AT_PA_TYPE_MY_ALBUM ? AT_PA_TYPE_MY_ALBUM : AT_PA_TYPE_COURSE_ALBUM;
 } else {
     //default is "my album" 'cause normally user can't create course album.
     $album_type = AT_PA_TYPE_MY_ALBUM;
 }
 //private or shared album?
 if (isset($_POST['album_permission'])) {
     $album_permission = $_POST['album_permission'] == AT_PA_SHARED_ALBUM ? AT_PA_SHARED_ALBUM : AT_PA_PRIVATE_ALBUM;
 } else {
     $album_permission = AT_PA_PRIVATE_ALBUM;
 }
 if (isset($_POST['album_name']) && $_POST['album_name'] != '') {
     //TODO: photo_id = 0, should default to use the first one after multi-file uploader works
     $result = $pa->editAlbum($_POST['album_name'], $_POST['album_location'], $_POST['album_description'], $album_type, $album_permission);
     if (!$result) {
         $msg->addError('PA_EDIT_ALBUM_FAILED');
     }
 } else {
     //album name can't be empty
     $msg->addError('EMPTY_ALBUM_NAME');
 }
 $msg->addFeedback('ACTION_COMPLETED_SUCCESSFULLY');
 if (admin_authenticate(AT_ADMIN_PRIV_PHOTO_ALBUM, true)) {
     //if admin
     header('Location: index_admin.php');
     exit;
 }
 //header('Location: albums.php?id='.intval($_POST['aid']));
 header('Location: index.php');