Make the settings ajax calls use the router

remotes/origin/stable5
Bart Visscher 13 years ago
parent 210ea4d9d9
commit bb136b9adf
  1. 7
      core/js/js.js
  2. 14
      core/routes.php
  3. 3
      settings/ajax/apps/ocs.php
  4. 2
      settings/ajax/changepassword.php
  5. 2
      settings/ajax/creategroup.php
  6. 2
      settings/ajax/createuser.php
  7. 2
      settings/ajax/disableapp.php
  8. 2
      settings/ajax/enableapp.php
  9. 3
      settings/ajax/getlog.php
  10. 2
      settings/ajax/lostpassword.php
  11. 3
      settings/ajax/openid.php
  12. 3
      settings/ajax/removegroup.php
  13. 3
      settings/ajax/removeuser.php
  14. 3
      settings/ajax/setlanguage.php
  15. 1
      settings/ajax/setloglevel.php
  16. 3
      settings/ajax/setquota.php
  17. 3
      settings/ajax/togglegroups.php
  18. 5
      settings/ajax/togglesubadmins.php
  19. 4
      settings/ajax/userlist.php
  20. 2
      settings/js/users.js
  21. 62
      settings/routes.php

@ -88,7 +88,12 @@ var OC={
}
link+=file;
}else{
link+='/';
if (app == 'settings' && type == 'ajax') {
link+='/index.php/';
}
else {
link+='/';
}
if(!isCore){
link+='apps/';
}

@ -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}')

@ -6,9 +6,6 @@
* See the COPYING-README file.
*/
// Init owncloud
require_once '../../../lib/base.php';
OC_JSON::checkAdminUser();
$l = OC_L10N::get('settings');

@ -1,7 +1,5 @@
<?php
// Init owncloud
require_once '../../lib/base.php';
OCP\JSON::callCheck();
$username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser();

@ -1,7 +1,5 @@
<?php
// Init owncloud
require_once '../../lib/base.php';
OCP\JSON::callCheck();
// Check if we are a user

@ -1,7 +1,5 @@
<?php
// Init owncloud
require_once '../../lib/base.php';
OCP\JSON::callCheck();
// Check if we are a user

@ -1,6 +1,4 @@
<?php
// Init owncloud
require_once '../../lib/base.php';
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
OC_JSON::setContentTypeHeader();

@ -1,7 +1,5 @@
<?php
// Init owncloud
require_once '../../lib/base.php';
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();
OC_JSON::setContentTypeHeader();

@ -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;

@ -1,7 +1,5 @@
<?php
// Init owncloud
require_once '../../lib/base.php';
OC_JSON::checkLoggedIn();
OCP\JSON::callCheck();

@ -1,8 +1,5 @@
<?php
// Init owncloud
require_once '../../lib/base.php';
$l=OC_L10N::get('settings');
OC_JSON::checkLoggedIn();

@ -1,8 +1,5 @@
<?php
// Init owncloud
require_once '../../lib/base.php';
OC_JSON::checkAdminUser();
OCP\JSON::callCheck();

@ -1,8 +1,5 @@
<?php
// Init owncloud
require_once '../../lib/base.php';
OC_JSON::checkSubAdminUser();
OCP\JSON::callCheck();

@ -1,8 +1,5 @@
<?php
// Init owncloud
require_once '../../lib/base.php';
$l=OC_L10N::get('settings');
OC_JSON::checkLoggedIn();

@ -5,7 +5,6 @@
* See the COPYING-README file.
*/
require_once '../../lib/base.php';
OC_Util::checkAdminUser();
OCP\JSON::callCheck();

@ -5,9 +5,6 @@
* See the COPYING-README file.
*/
// Init owncloud
require_once '../../lib/base.php';
OC_JSON::checkSubAdminUser();
OCP\JSON::callCheck();

@ -1,8 +1,5 @@
<?php
// Init owncloud
require_once '../../lib/base.php';
OC_JSON::checkSubAdminUser();
OCP\JSON::callCheck();

@ -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();
OC_JSON::success();

@ -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));
OC_JSON::success(array('data' => $users));

@ -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);

@ -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_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');
Loading…
Cancel
Save