summaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2012-10-27 11:58:02 +0200
committerBart Visscher <bartv@thisnet.nl>2012-10-27 11:58:02 +0200
commit0120f3fd629e772d9a7493e5289c1d6708ba92d5 (patch)
treedbee6eba6d11afe887a6235375119b7a6bd71b69 /settings
parent74665faec533430be37879bfc0ef24aa7f211f6e (diff)
parentbeaaf5425dc2dfb7456efa934fa8eb91ac28c677 (diff)
downloadnextcloud-server-0120f3fd629e772d9a7493e5289c1d6708ba92d5.tar.gz
nextcloud-server-0120f3fd629e772d9a7493e5289c1d6708ba92d5.zip
Merge branch 'routing'
Conflicts: core/lostpassword/index.php core/lostpassword/resetpassword.php
Diffstat (limited to 'settings')
-rwxr-xr-xsettings/admin.php2
-rw-r--r--settings/ajax/apps/ocs.php3
-rw-r--r--settings/ajax/changepassword.php3
-rw-r--r--settings/ajax/creategroup.php2
-rw-r--r--settings/ajax/createuser.php2
-rw-r--r--settings/ajax/disableapp.php2
-rw-r--r--settings/ajax/enableapp.php2
-rw-r--r--settings/ajax/getlog.php3
-rw-r--r--settings/ajax/lostpassword.php2
-rw-r--r--settings/ajax/openid.php3
-rw-r--r--settings/ajax/removegroup.php3
-rw-r--r--settings/ajax/removeuser.php5
-rw-r--r--settings/ajax/setlanguage.php3
-rw-r--r--settings/ajax/setloglevel.php1
-rw-r--r--settings/ajax/setquota.php3
-rw-r--r--settings/ajax/togglegroups.php3
-rw-r--r--settings/ajax/togglesubadmins.php5
-rw-r--r--settings/ajax/userlist.php4
-rw-r--r--settings/apps.php2
-rw-r--r--settings/help.php3
-rw-r--r--settings/js/users.js2
-rw-r--r--settings/personal.php2
-rw-r--r--settings/routes.php62
-rw-r--r--settings/settings.php2
-rw-r--r--settings/users.php4
25 files changed, 73 insertions, 55 deletions
diff --git a/settings/admin.php b/settings/admin.php
index a36f2190386..9cb70353f9c 100755
--- a/settings/admin.php
+++ b/settings/admin.php
@@ -5,8 +5,8 @@
* See the COPYING-README file.
*/
-require_once '../lib/base.php';
OC_Util::checkAdminUser();
+OC_App::loadApps();
OC_Util::addStyle( "settings", "settings" );
OC_Util::addScript( "settings", "admin" );
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 12d3b67037a..a0fe5947b6d 100644
--- a/settings/ajax/changepassword.php
+++ b/settings/ajax/changepassword.php
@@ -1,8 +1,5 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
-
// Check if we are a user
OCP\JSON::callCheck();
OC_JSON::checkLoggedIn();
diff --git a/settings/ajax/creategroup.php b/settings/ajax/creategroup.php
index 431b449a811..0a79527c219 100644
--- a/settings/ajax/creategroup.php
+++ b/settings/ajax/creategroup.php
@@ -1,7 +1,5 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
OCP\JSON::callCheck();
OC_JSON::checkAdminUser();
diff --git a/settings/ajax/createuser.php b/settings/ajax/createuser.php
index b3e5c23de54..c87ff422f61 100644
--- a/settings/ajax/createuser.php
+++ b/settings/ajax/createuser.php
@@ -1,7 +1,5 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
OCP\JSON::callCheck();
OC_JSON::checkSubAdminUser();
diff --git a/settings/ajax/disableapp.php b/settings/ajax/disableapp.php
index 977a536af21..a39b06b9c7d 100644
--- a/settings/ajax/disableapp.php
+++ b/settings/ajax/disableapp.php
@@ -1,6 +1,4 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
OC_JSON::setContentTypeHeader();
diff --git a/settings/ajax/enableapp.php b/settings/ajax/enableapp.php
index c3b3491db93..f4d5c53adef 100644
--- a/settings/ajax/enableapp.php
+++ b/settings/ajax/enableapp.php
@@ -1,7 +1,5 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
OC_JSON::setContentTypeHeader();
diff --git a/settings/ajax/getlog.php b/settings/ajax/getlog.php
index 9b9240f8253..22128ef57b5 100644
--- a/settings/ajax/getlog.php
+++ b/settings/ajax/getlog.php
@@ -5,9 +5,6 @@
* See the COPYING-README file.
*/
-// Init owncloud
-require_once '../../lib/base.php';
-
OC_JSON::checkAdminUser();
$count=(isset($_GET['count']))?$_GET['count']:50;
diff --git a/settings/ajax/lostpassword.php b/settings/ajax/lostpassword.php
index 2a40ba09a8a..b5f47bbceab 100644
--- a/settings/ajax/lostpassword.php
+++ b/settings/ajax/lostpassword.php
@@ -1,7 +1,5 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
OC_JSON::checkLoggedIn();
OCP\JSON::callCheck();
diff --git a/settings/ajax/openid.php b/settings/ajax/openid.php
index ecec085383c..23c43c3c48e 100644
--- a/settings/ajax/openid.php
+++ b/settings/ajax/openid.php
@@ -1,8 +1,5 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
-
$l=OC_L10N::get('settings');
OC_JSON::checkLoggedIn();
diff --git a/settings/ajax/removegroup.php b/settings/ajax/removegroup.php
index 33e1a514c88..798d7916e61 100644
--- a/settings/ajax/removegroup.php
+++ b/settings/ajax/removegroup.php
@@ -1,8 +1,5 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
-
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
diff --git a/settings/ajax/removeuser.php b/settings/ajax/removeuser.php
index 1e3cd2993b0..9ffb32a0b23 100644
--- a/settings/ajax/removeuser.php
+++ b/settings/ajax/removeuser.php
@@ -1,8 +1,5 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
-
OC_JSON::checkSubAdminUser();
OCP\JSON::callCheck();
@@ -25,4 +22,4 @@ if( OC_User::deleteUser( $username )) {
}
else{
OC_JSON::error(array("data" => array( "message" => $l->t("Unable to delete user") )));
-} \ No newline at end of file
+}
diff --git a/settings/ajax/setlanguage.php b/settings/ajax/setlanguage.php
index 42eea7a96fd..aebb1b31b6f 100644
--- a/settings/ajax/setlanguage.php
+++ b/settings/ajax/setlanguage.php
@@ -1,8 +1,5 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
-
$l=OC_L10N::get('settings');
OC_JSON::checkLoggedIn();
diff --git a/settings/ajax/setloglevel.php b/settings/ajax/setloglevel.php
index 982899e106a..542219f86c6 100644
--- a/settings/ajax/setloglevel.php
+++ b/settings/ajax/setloglevel.php
@@ -5,7 +5,6 @@
* See the COPYING-README file.
*/
-require_once '../../lib/base.php';
OC_Util::checkAdminUser();
OCP\JSON::callCheck();
diff --git a/settings/ajax/setquota.php b/settings/ajax/setquota.php
index 2352ae9e427..4b32585b306 100644
--- a/settings/ajax/setquota.php
+++ b/settings/ajax/setquota.php
@@ -5,9 +5,6 @@
* See the COPYING-README file.
*/
-// Init owncloud
-require_once '../../lib/base.php';
-
OC_JSON::checkSubAdminUser();
OCP\JSON::callCheck();
diff --git a/settings/ajax/togglegroups.php b/settings/ajax/togglegroups.php
index 65747968c17..de941f99132 100644
--- a/settings/ajax/togglegroups.php
+++ b/settings/ajax/togglegroups.php
@@ -1,8 +1,5 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
-
OC_JSON::checkSubAdminUser();
OCP\JSON::callCheck();
diff --git a/settings/ajax/togglesubadmins.php b/settings/ajax/togglesubadmins.php
index 5f7126dca34..7aaa90aad5f 100644
--- a/settings/ajax/togglesubadmins.php
+++ b/settings/ajax/togglesubadmins.php
@@ -1,8 +1,5 @@
<?php
-// Init owncloud
-require_once '../../lib/base.php';
-
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
@@ -16,4 +13,4 @@ if(OC_SubAdmin::isSubAdminofGroup($username, $group)) {
OC_SubAdmin::createSubAdmin($username, $group);
}
-OC_JSON::success(); \ No newline at end of file
+OC_JSON::success();
diff --git a/settings/ajax/userlist.php b/settings/ajax/userlist.php
index 840b6d72dc7..61b1a388fc3 100644
--- a/settings/ajax/userlist.php
+++ b/settings/ajax/userlist.php
@@ -20,8 +20,6 @@
*
*/
-require_once '../../lib/base.php';
-
OC_JSON::callCheck();
OC_JSON::checkSubAdminUser();
if (isset($_GET['offset'])) {
@@ -49,4 +47,4 @@ if (OC_Group::inGroup(OC_User::getUser(), 'admin')) {
'quota' => 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/apps.php b/settings/apps.php
index a1c1bf6aa53..8134b44143a 100644
--- a/settings/apps.php
+++ b/settings/apps.php
@@ -21,8 +21,8 @@
*
*/
-require_once '../lib/base.php';
OC_Util::checkAdminUser();
+OC_App::loadApps();
// Load the files we need
OC_Util::addStyle( "settings", "settings" );
diff --git a/settings/help.php b/settings/help.php
index 9157308dd57..69a5ec9c146 100644
--- a/settings/help.php
+++ b/settings/help.php
@@ -5,9 +5,8 @@
* See the COPYING-README file.
*/
-require_once '../lib/base.php';
OC_Util::checkLoggedIn();
-
+OC_App::loadApps();
// Load the files we need
OC_Util::addStyle( "settings", "settings" );
diff --git a/settings/js/users.js b/settings/js/users.js
index 20bd94993bc..1474ebcdd81 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.Router.generate('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/personal.php b/settings/personal.php
index 2031edd8df8..f28ab2ae755 100644
--- a/settings/personal.php
+++ b/settings/personal.php
@@ -5,8 +5,8 @@
* See the COPYING-README file.
*/
-require_once '../lib/base.php';
OC_Util::checkLoggedIn();
+OC_App::loadApps();
// Highlight navigation entry
OC_Util::addScript( 'settings', 'personal' );
diff --git a/settings/routes.php b/settings/routes.php
new file mode 100644
index 00000000000..4f4f83e4542
--- /dev/null
+++ b/settings/routes.php
@@ -0,0 +1,62 @@
+<?php
+/**
+ * Copyright (c) 2012 Bart Visscher <bartv@thisnet.nl>
+ * 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_ajax_userlist', '/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');
diff --git a/settings/settings.php b/settings/settings.php
index 68c07ff60f0..add94b5b011 100644
--- a/settings/settings.php
+++ b/settings/settings.php
@@ -5,9 +5,9 @@
* See the COPYING-README file.
*/
-require_once '../lib/base.php';
OC_Util::checkLoggedIn();
OC_Util::verifyUser();
+OC_App::loadApps();
OC_Util::addStyle( 'settings', 'settings' );
OC_App::setActiveNavigationEntry( 'settings' );
diff --git a/settings/users.php b/settings/users.php
index e76505cc78d..6eaae474538 100644
--- a/settings/users.php
+++ b/settings/users.php
@@ -5,8 +5,8 @@
* See the COPYING-README file.
*/
-require_once '../lib/base.php';
OC_Util::checkSubAdminUser();
+OC_App::loadApps();
// We have some javascript foo!
OC_Util::addScript( 'settings', 'users' );
@@ -57,4 +57,4 @@ $tmpl->assign( 'subadmins', $subadmins);
$tmpl->assign( 'numofgroups', count($accessiblegroups));
$tmpl->assign( 'quota_preset', $quotaPreset);
$tmpl->assign( 'default_quota', $defaultQuota);
-$tmpl->printPage(); \ No newline at end of file
+$tmpl->printPage();