From 1d55829ba6398dcdabc84282007f2d779d319409 Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Fri, 21 Dec 2012 00:54:31 +0100 Subject: multiSelect: Modified users.js to only update other multiSelects. --- settings/js/users.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'settings/js') diff --git a/settings/js/users.js b/settings/js/users.js index b0e30feb80c..d1917267980 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -177,9 +177,9 @@ var UserList = { } else { checkHandeler = false; } - var addGroup = function (group) { + var addGroup = function (select, group) { $('select[multiple]').each(function (index, element) { - if ($(element).find('option[value="' + group + '"]').length == 0) { + if ($(element).find('option[value="' + group + '"]').length === 0 && select.data('msid') !== $(element).data('msid')) { $(element).append(''); } }) -- cgit v1.2.3 From 5f795d3aac1db8981874e06e56c7cb18eed9ae7c Mon Sep 17 00:00:00 2001 From: Thomas Tanghus Date: Fri, 21 Dec 2012 06:18:45 +0100 Subject: Users: Show selected groups first in list. --- settings/js/users.js | 1 + 1 file changed, 1 insertion(+) (limited to 'settings/js') diff --git a/settings/js/users.js b/settings/js/users.js index d1917267980..fa6f058d923 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -193,6 +193,7 @@ var UserList = { element.multiSelect({ createCallback:addGroup, createText:label, + selectedFirst:true, checked:checked, oncheck:checkHandeler, onuncheck:checkHandeler, -- cgit v1.2.3 From 594d388ad9121c2c2808e83ca77513390853a355 Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Fri, 4 Jan 2013 23:37:21 +0100 Subject: new javascript notification functions used within users.js --- settings/js/users.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'settings/js') diff --git a/settings/js/users.js b/settings/js/users.js index b0e30feb80c..a01b4cab952 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -26,9 +26,8 @@ var UserList = { UserList.deleteCanceled = false; // Provide user with option to undo - $('#notification').html(t('users', 'deleted') + ' ' + uid + '' + t('users', 'undo') + ''); $('#notification').data('deleteuser', true); - $('#notification').fadeIn(); + OC.Notification.showHtml(t('users', 'deleted') + ' ' + uid + '' + t('users', 'undo') + ''); }, /** @@ -53,7 +52,7 @@ var UserList = { success:function (result) { if (result.status == 'success') { // Remove undo option, & remove user from table - $('#notification').fadeOut(); + OC.Notification.hide(); $('tr').filterAttr('data-uid', UserList.deleteUid).remove(); UserList.deleteCanceled = true; if (ready) { @@ -401,13 +400,13 @@ $(document).ready(function () { ); }); // Handle undo notifications - $('#notification').hide(); + OC.Notification.hide(); $('#notification .undo').live('click', function () { if ($('#notification').data('deleteuser')) { $('tbody tr').filterAttr('data-uid', UserList.deleteUid).show(); UserList.deleteCanceled = true; } - $('#notification').fadeOut(); + OC.Notification.hide(); }); UserList.useUndo = ('onbeforeunload' in window) $(window).bind('beforeunload', function () { -- cgit v1.2.3 From b5d1dfcdc91e9192b50752714b5beeda49bbeadf Mon Sep 17 00:00:00 2001 From: Thomas Mueller Date: Fri, 4 Jan 2013 23:38:07 +0100 Subject: javascript syntax error fixed on the way --- settings/js/users.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'settings/js') diff --git a/settings/js/users.js b/settings/js/users.js index a01b4cab952..2ccb56ab0e3 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -195,7 +195,7 @@ var UserList = { checked:checked, oncheck:checkHandeler, onuncheck:checkHandeler, - minWidth:100, + minWidth:100 }); } if ($(element).attr('class') == 'subadminsselect') { @@ -230,7 +230,7 @@ var UserList = { checked:checked, oncheck:checkHandeler, onuncheck:checkHandeler, - minWidth:100, + minWidth:100 }); } } @@ -387,7 +387,7 @@ $(document).ready(function () { { username:username, password:password, - groups:groups, + groups:groups }, function (result) { if (result.status != 'success') { -- cgit v1.2.3 From 466cdab680d74cad2cbb902efa3e3c2f9e35f767 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 11 Jan 2013 14:18:51 +0100 Subject: Add security section to admin menu Currently it only allows the admin to enable or disable the HTTPS enforcement, but in the future it could be expanded to further options. The HTTPS enforcement only allows the admin to enforce it, if he is connected via HTTPS. (To prevent admins to enable it without a proper SSL setup) --- settings/admin.php | 10 ++++++++++ settings/ajax/setsecurity.php | 13 +++++++++++++ settings/js/admin.js | 4 ++++ settings/routes.php | 2 ++ settings/templates/admin.php | 27 +++++++++++++++++++++++++++ 5 files changed, 56 insertions(+) create mode 100644 settings/ajax/setsecurity.php (limited to 'settings/js') diff --git a/settings/admin.php b/settings/admin.php index 04905391138..4d9685ab920 100755 --- a/settings/admin.php +++ b/settings/admin.php @@ -33,6 +33,16 @@ $tmpl->assign('internetconnectionworking', OC_Util::isinternetconnectionworking( $tmpl->assign('islocaleworking', OC_Util::issetlocaleworking()); $tmpl->assign('backgroundjobs_mode', OC_Appconfig::getValue('core', 'backgroundjobs_mode', 'ajax')); $tmpl->assign('shareAPIEnabled', OC_Appconfig::getValue('core', 'shareapi_enabled', 'yes')); + +// Check if connected using HTTPS +if (OC_Request::serverProtocol() == 'https') { + $connectedHTTPS = true; +} else { + $connectedHTTPS = false; +} +$tmpl->assign('isConnectedViaHTTPS', $connectedHTTPS); +$tmpl->assign('enforceHTTPSEnabled', OC_Config::getValue( "forcessl", false)); + $tmpl->assign('allowLinks', OC_Appconfig::getValue('core', 'shareapi_allow_links', 'yes')); $tmpl->assign('allowResharing', OC_Appconfig::getValue('core', 'shareapi_allow_resharing', 'yes')); $tmpl->assign('sharePolicy', OC_Appconfig::getValue('core', 'shareapi_share_policy', 'global')); diff --git a/settings/ajax/setsecurity.php b/settings/ajax/setsecurity.php new file mode 100644 index 00000000000..16a85aade81 --- /dev/null +++ b/settings/ajax/setsecurity.php @@ -0,0 +1,13 @@ + + * This file is licensed under the Affero General Public License version 3 or later. + * See the COPYING-README file. + */ + +OC_Util::checkAdminUser(); +OCP\JSON::callCheck(); + +OC_Config::setValue( 'forcessl', filter_var($_POST['enforceHTTPS'], FILTER_VALIDATE_BOOLEAN)); + +echo 'true'; \ No newline at end of file diff --git a/settings/js/admin.js b/settings/js/admin.js index 95b7a503c27..ab218377fb3 100644 --- a/settings/js/admin.js +++ b/settings/js/admin.js @@ -30,4 +30,8 @@ $(document).ready(function(){ } OC.AppConfig.setValue('core', $(this).attr('name'), value); }); + + $('#security').change(function(){ + $.post(OC.filePath('settings','ajax','setsecurity.php'), { enforceHTTPS: $('#enforceHTTPSEnabled').val() },function(){} ); + }); }); diff --git a/settings/routes.php b/settings/routes.php index 8239fe005db..595b83c313e 100644 --- a/settings/routes.php +++ b/settings/routes.php @@ -58,6 +58,8 @@ $this->create('settings_ajax_getlog', '/settings/ajax/getlog.php') ->actionInclude('settings/ajax/getlog.php'); $this->create('settings_ajax_setloglevel', '/settings/ajax/setloglevel.php') ->actionInclude('settings/ajax/setloglevel.php'); +$this->create('settings_ajax_setsecurity', '/settings/ajax/setsecurity.php') + ->actionInclude('settings/ajax/setsecurity.php'); // apps/user_openid $this->create('settings_ajax_openid', '/settings/ajax/openid.php') diff --git a/settings/templates/admin.php b/settings/templates/admin.php index 26335063d4b..94df359b052 100644 --- a/settings/templates/admin.php +++ b/settings/templates/admin.php @@ -132,6 +132,33 @@ if (!$_['internetconnectionworking']) { +
+ t('Security');?> + + + + +
+ + /> +
+ t('Enforces the clients to connect to ownCloud via an encrypted connection.'); ?> + "; + echo $l->t('Please connect to this ownCloud instance via HTTPS to enable or disable the SSL enforcement.'); + echo ""; + } + ?> +
+
+
t('Log');?> t('Log level');?> Date: Mon, 21 Jan 2013 22:18:42 +0100 Subject: External JSON for the Apps --- settings/apps.php | 1 + settings/js/apps-custom.php | 24 ++++++++++++++++++++++++ settings/routes.php | 2 ++ settings/templates/apps.php | 10 +++------- 4 files changed, 30 insertions(+), 7 deletions(-) create mode 100644 settings/js/apps-custom.php (limited to 'settings/js') diff --git a/settings/apps.php b/settings/apps.php index 9de7bdc80a7..384e92bfbb7 100644 --- a/settings/apps.php +++ b/settings/apps.php @@ -42,6 +42,7 @@ function app_sort( $a, $b ) { } +$combinedApps = OC_App::listAllApps(); usort( $combinedApps, 'app_sort' ); $tmpl = new OC_Template( "settings", "apps", "user" ); diff --git a/settings/js/apps-custom.php b/settings/js/apps-custom.php new file mode 100644 index 00000000000..e0e7a2d6c79 --- /dev/null +++ b/settings/js/apps-custom.php @@ -0,0 +1,24 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +// Check if admin user +OC_Util::checkAdminUser(); + +// Set the content type to JSON +header('Content-type: application/json'); + +// Disallow caching +header("Cache-Control: no-cache, must-revalidate"); +header("Expires: Sat, 26 Jul 1997 05:00:00 GMT"); + +$combinedApps = OC_App::listAllApps(); + +foreach($combinedApps as $app) { + echo("appData_".$app['id']."=".json_encode($app)); + echo("\n"); +} \ No newline at end of file diff --git a/settings/routes.php b/settings/routes.php index bac1f61fc50..1c766837dd1 100644 --- a/settings/routes.php +++ b/settings/routes.php @@ -53,6 +53,8 @@ $this->create('settings_ajax_disableapp', '/settings/ajax/disableapp.php') ->actionInclude('settings/ajax/disableapp.php'); $this->create('settings_ajax_navigationdetect', '/settings/ajax/navigationdetect.php') ->actionInclude('settings/ajax/navigationdetect.php'); +$this->create('apps_custom', '/settings/js/apps-custom.js') + ->actionInclude('settings/js/apps-custom.php'); // admin $this->create('settings_ajax_getlog', '/settings/ajax/getlog.php') ->actionInclude('settings/ajax/getlog.php'); diff --git a/settings/templates/apps.php b/settings/templates/apps.php index 0490f63fb67..98b0e6c725c 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -3,9 +3,8 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */?> - + +
t('Add your App');?> t('More Apps');?> @@ -15,9 +14,6 @@
  • data-id="" data-type="" data-installed="1"> - 3rd party' ?>
  • @@ -32,4 +28,4 @@
    - + \ No newline at end of file -- cgit v1.2.3 From 48949ba04acacd5cc4039ba15266619ebe61a52b Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Wed, 23 Jan 2013 11:21:27 +0100 Subject: Move appid to external file --- settings/apps.php | 2 -- settings/js/apps-custom.php | 4 +++- settings/templates/apps.php | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) (limited to 'settings/js') diff --git a/settings/apps.php b/settings/apps.php index 384e92bfbb7..b6426a31c97 100644 --- a/settings/apps.php +++ b/settings/apps.php @@ -26,10 +26,8 @@ OC_App::loadApps(); // Load the files we need OC_Util::addStyle( "settings", "settings" ); -OC_Util::addScript( "settings", "apps" ); OC_App::setActiveNavigationEntry( "core_apps" ); - function app_sort( $a, $b ) { if ($a['active'] != $b['active']) { diff --git a/settings/js/apps-custom.php b/settings/js/apps-custom.php index e0e7a2d6c79..9ec2a758ee3 100644 --- a/settings/js/apps-custom.php +++ b/settings/js/apps-custom.php @@ -21,4 +21,6 @@ $combinedApps = OC_App::listAllApps(); foreach($combinedApps as $app) { echo("appData_".$app['id']."=".json_encode($app)); echo("\n"); -} \ No newline at end of file +} + +echo ("var appid =\"".$_GET['appid']."\";"); \ No newline at end of file diff --git a/settings/templates/apps.php b/settings/templates/apps.php index 98b0e6c725c..d418b9a66a1 100644 --- a/settings/templates/apps.php +++ b/settings/templates/apps.php @@ -3,7 +3,8 @@ * This file is licensed under the Affero General Public License version 3 or later. * See the COPYING-README file. */?> - + +
    t('Add your App');?> -- cgit v1.2.3