summaryrefslogtreecommitdiffstats
path: root/apps/gallery/ajax/createAlbum.php
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2011-10-06 21:22:01 +0200
committerBart Visscher <bartv@thisnet.nl>2011-10-06 21:22:01 +0200
commitb0847a61f52b8056365d26b52d23dddab329b62d (patch)
treee7dbae23e5b7ff6d4388704c4e846bfb6c6e16df /apps/gallery/ajax/createAlbum.php
parent4786ed321e802f8a63cff2bc4cb36461a3385971 (diff)
downloadnextcloud-server-b0847a61f52b8056365d26b52d23dddab329b62d.tar.gz
nextcloud-server-b0847a61f52b8056365d26b52d23dddab329b62d.zip
Start using OC_JSON in gallery app
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']));
?>