diff --git a/ajax/settings.php b/ajax/settings.php
new file mode 100644
--- /dev/null
+++ b/ajax/settings.php
@@ -0,0 +1,39 @@
+ array( "message" => $l->t("Not submitted for us.") )));
+ return false;
+}
+
+OCP\JSON::success(array('data' => array( 'message' => $l->t('Application settings successfully stored.') )));
+return true;
diff --git a/css/settings.css b/css/settings.css
new file mode 100644
--- /dev/null
+++ b/css/settings.css
@@ -0,0 +1,14 @@
+.statusmessage {
+ background-color: #DDDDFF;
+}
+.errormessage {
+ background-color: #FFDDDD;
+}
+.successmessage {
+ background-color: #DDFFDD;
+}
+.statusmessage,.errormessage,.successmessage{
+ display:none;
+ padding: 1;
+}
+
diff --git a/js/settings.js b/js/settings.js
--- a/js/settings.js
+++ b/js/settings.js
@@ -1,1 +1,45 @@
-//
+// declare namespace
+var user_sql = user_sql || {};
+
+/**
+ * init admin settings view
+ */
+user_sql.adminSettingsUI = function() {
+
+ if ($('#sql').length > 0) {
+ // enable tabs on settings page
+ $('#sql').tabs();
+
+ $('#sqlSubmit').click(function(event) {
+ event.preventDefault();
+
+ var self = $(this);
+ var post = $('#sqlForm').serialize();
+ $('#sql_update_message').show();
+ $('#sql_success_message').hide();
+ $('#sql_error_message').hide();
+ // Ajax foobar
+ $.post(OC.filePath('user_sql', 'ajax', 'settings.php'), post, function(data) {
+ $('#sql_update_message').hide();
+ if (data.status == 'success') {
+ $('#sql_success_message').html(data.data.message);
+ $('#sql_success_message').show();
+ window.setTimeout(function() {
+ $('#sql_success_message').hide();
+ }, 10000);
+ } else {
+ $('#sql_error_message').html(data.data.message);
+ $('#sql_error_message').show();
+ }
+ }, 'json');
+ return false;
+ });
+ }
+}
+
+$(document).ready(function() {
+ if ($('#sql')) {
+ user_sql.adminSettingsUI();
+ }
+});
+
diff --git a/settings.php b/settings.php
--- a/settings.php
+++ b/settings.php
@@ -1,64 +1,75 @@
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
* License as published by the Free Software Foundation; either
* version 3 of the License, or any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
*
* You should have received a copy of the GNU Affero General Public
* License along with this library. If not, see