diff --git a/core/js/js.js b/core/js/js.js index 39a58a24599..ffe3507a4eb 100644 --- a/core/js/js.js +++ b/core/js/js.js @@ -88,7 +88,12 @@ var OC={ } link+=file; }else{ - link+='/'; + if (app == 'settings' && type == 'ajax') { + link+='/index.php/'; + } + else { + link+='/'; + } if(!isCore){ link+='apps/'; } diff --git a/core/routes.php b/core/routes.php index 9a84eb64a3b..b0f41dd2861 100644 --- a/core/routes.php +++ b/core/routes.php @@ -6,19 +6,7 @@ * See the COPYING-README file. */ -// Core settings pages -$this->create('settings_help', '/settings/help') - ->actionInclude('settings/help.php'); -$this->create('settings_personal', '/settings/personal') - ->actionInclude('settings/personal.php'); -$this->create('settings_settings', '/settings') - ->actionInclude('settings/settings.php'); -$this->create('settings_users', '/settings/users') - ->actionInclude('settings/users.php'); -$this->create('settings_apps', '/settings/apps') - ->actionInclude('settings/apps.php'); -$this->create('settings_admin', '/settings/admin') - ->actionInclude('settings/admin.php'); +require_once('settings/routes.php'); // Not specifically routed $this->create('app_css', '/apps/{app}/{file}') diff --git a/settings/ajax/apps/ocs.php b/settings/ajax/apps/ocs.php index fb78cc89248..4d6f1116e7d 100644 --- a/settings/ajax/apps/ocs.php +++ b/settings/ajax/apps/ocs.php @@ -6,9 +6,6 @@ * See the COPYING-README file. */ -// Init owncloud -require_once '../../../lib/base.php'; - OC_JSON::checkAdminUser(); $l = OC_L10N::get('settings'); diff --git a/settings/ajax/changepassword.php b/settings/ajax/changepassword.php index b251fea504b..200fdec26de 100644 --- a/settings/ajax/changepassword.php +++ b/settings/ajax/changepassword.php @@ -1,7 +1,5 @@ OC_Preferences::getValue($user, 'files', 'quota', 'default')); } } -OC_JSON::success(array('data' => $users)); \ No newline at end of file +OC_JSON::success(array('data' => $users)); diff --git a/settings/js/users.js b/settings/js/users.js index 20bd94993bc..81a3181ba59 100644 --- a/settings/js/users.js +++ b/settings/js/users.js @@ -130,7 +130,7 @@ var UserList={ if (typeof UserList.offset === 'undefined') { UserList.offset = $('tbody tr').length; } - $.get(OC.filePath('settings', 'ajax', 'userlist.php'), { offset: UserList.offset }, function(result) { + $.get(OC.filePath('settings', 'ajax', 'userlist'), { offset: UserList.offset }, function(result) { if (result.status === 'success') { $.each(result.data, function(index, user) { var tr = UserList.add(user.name, user.groups, user.subadmin, user.quota, false); diff --git a/settings/routes.php b/settings/routes.php new file mode 100644 index 00000000000..b64a357be0e --- /dev/null +++ b/settings/routes.php @@ -0,0 +1,62 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +// Settings pages +$this->create('settings_help', '/settings/help') + ->actionInclude('settings/help.php'); +$this->create('settings_personal', '/settings/personal') + ->actionInclude('settings/personal.php'); +$this->create('settings_settings', '/settings') + ->actionInclude('settings/settings.php'); +$this->create('settings_users', '/settings/users') + ->actionInclude('settings/users.php'); +$this->create('settings_apps', '/settings/apps') + ->actionInclude('settings/apps.php'); +$this->create('settings_admin', '/settings/admin') + ->actionInclude('settings/admin.php'); +// Settings ajax actions +// users +$this->create('settings_admin', '/settings/ajax/userlist') + ->actionInclude('settings/ajax/userlist.php'); +$this->create('settings_ajax_createuser', '/settings/ajax/createuser.php') + ->actionInclude('settings_ajax_createuser'); +$this->create('settings_ajax_removeuser', '/settings/ajax/removeuser.php') + ->actionInclude('settings/ajax/removeuser.php'); +$this->create('settings_ajax_setquota', '/settings/ajax/setquota.php') + ->actionInclude('settings/ajax/setquota.php'); +$this->create('settings_ajax_creategroup', '/settings/ajax/creategroup.php') + ->actionInclude('settings_ajax_creategroup'); +$this->create('settings_ajax_togglegroups', '/settings/ajax/togglegroups.php') + ->actionInclude('settings/ajax/togglegroups.php'); +$this->create('settings_ajax_togglesubadmins', '/settings/ajax/togglesubadmins.php') + ->actionInclude('settings/ajax/togglesubadmins.php'); +$this->create('settings_ajax_removegroup', '/settings/ajax/removegroup.php') + ->actionInclude('settings/ajax/removegroup.php'); +$this->create('settings_ajax_changepassword', '/settings/ajax/changepassword.php') + ->actionInclude('settings/ajax/changepassword.php'); +// personel +$this->create('settings_ajax_lostpassword', '/settings/ajax/lostpassword.php') + ->actionInclude('settings/ajax/lostpassword.php'); +$this->create('settings_ajax_setlanguage', '/settings/ajax/setlanguage.php') + ->actionInclude('settings/ajax/setlanguage.php'); +// apps +$this->create('settings_ajax_apps_ocs', '/settings/ajax/apps/ocs.php') + ->actionInclude('settings/ajax/apps/ocs.php'); +$this->create('settings_ajax_enableapp', '/settings/ajax/enableapp.php') + ->actionInclude('settings/ajax/enableapp.php'); +$this->create('settings_ajax_disableapp', '/settings/ajax/disableapp.php') + ->actionInclude('settings/ajax/disableapp.php'); +// admin +$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'); + +// apps/user_openid +$this->create('settings_ajax_openid', '/settings/ajax/openid.php') + ->actionInclude('settings/ajax/openid.php');