summaryrefslogtreecommitdiffstats
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.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/apps/gallery/ajax/createAlbum.php b/apps/gallery/ajax/createAlbum.php
new file mode 100644
index 00000000000..93e3312d324
--- /dev/null
+++ b/apps/gallery/ajax/createAlbum.php
@@ -0,0 +1,14 @@
+<?
+require_once('../../../lib/base.php');
+
+if( !OC_User::isLoggedIn()){
+ echo json_encode( array( 'status' => 'error', 'data' => array( 'message' => 'You need to log in.')));
+ exit();
+}
+
+$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']));
+
+?>