aboutsummaryrefslogtreecommitdiffstats
path: root/apps/gallery/ajax/createAlbum.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gallery/ajax/createAlbum.php')
-rw-r--r--apps/gallery/ajax/createAlbum.php9
1 files changed, 3 insertions, 6 deletions
diff --git a/apps/gallery/ajax/createAlbum.php b/apps/gallery/ajax/createAlbum.php
index 3a490bdc3bd..610f761b72a 100644
--- a/apps/gallery/ajax/createAlbum.php
+++ b/apps/gallery/ajax/createAlbum.php
@@ -1,14 +1,11 @@
<?php
require_once('../../../lib/base.php');
-
-if( !OC_User::isLoggedIn()){
- echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => 'You need to log in.')));
- exit();
-}
+OC_JSON::checkLoggedIn();
+OC_JSON::checkAppEnabled('gallery');
$stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums ("uid_owner", "album_name") VALUES ("'.OC_User::getUser().'", "'.$_GET['album_name'].'")');
$stmt->execute(array());
-echo json_encode(array( 'status' => 'success', 'name' => $_GET['album_name']));
+OC_JSON::success(array('name' => $_GET['album_name']));
?>