소스 검색

Make the settings ajax calls use the router

tags/v5.0.0alpha1
Bart Visscher 11 년 전
부모
커밋
bb136b9adf

+ 6
- 1
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/';
}

+ 1
- 13
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}')

+ 0
- 3
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');

+ 0
- 2
settings/ajax/changepassword.php 파일 보기

@@ -1,7 +1,5 @@
<?php

// Init owncloud
require_once '../../lib/base.php';
OCP\JSON::callCheck();

$username = isset($_POST["username"]) ? $_POST["username"] : OC_User::getUser();

+ 0
- 2
settings/ajax/creategroup.php 파일 보기

@@ -1,7 +1,5 @@
<?php

// Init owncloud
require_once '../../lib/base.php';
OCP\JSON::callCheck();

// Check if we are a user

+ 0
- 2
settings/ajax/createuser.php 파일 보기

@@ -1,7 +1,5 @@
<?php

// Init owncloud
require_once '../../lib/base.php';
OCP\JSON::callCheck();

// Check if we are a user

+ 0
- 2
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();

+ 0
- 2
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();

+ 0
- 3
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;

+ 0
- 2
settings/ajax/lostpassword.php 파일 보기

@@ -1,7 +1,5 @@
<?php

// Init owncloud
require_once '../../lib/base.php';
OC_JSON::checkLoggedIn();
OCP\JSON::callCheck();


+ 0
- 3
settings/ajax/openid.php 파일 보기

@@ -1,8 +1,5 @@
<?php

// Init owncloud
require_once '../../lib/base.php';

$l=OC_L10N::get('settings');

OC_JSON::checkLoggedIn();

+ 0
- 3
settings/ajax/removegroup.php 파일 보기

@@ -1,8 +1,5 @@
<?php

// Init owncloud
require_once '../../lib/base.php';

OC_JSON::checkAdminUser();
OCP\JSON::callCheck();


+ 0
- 3
settings/ajax/removeuser.php 파일 보기

@@ -1,8 +1,5 @@
<?php

// Init owncloud
require_once '../../lib/base.php';

OC_JSON::checkSubAdminUser();
OCP\JSON::callCheck();


+ 0
- 3
settings/ajax/setlanguage.php 파일 보기

@@ -1,8 +1,5 @@
<?php

// Init owncloud
require_once '../../lib/base.php';

$l=OC_L10N::get('settings');

OC_JSON::checkLoggedIn();

+ 0
- 1
settings/ajax/setloglevel.php 파일 보기

@@ -5,7 +5,6 @@
* See the COPYING-README file.
*/

require_once '../../lib/base.php';
OC_Util::checkAdminUser();
OCP\JSON::callCheck();


+ 0
- 3
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();


+ 0
- 3
settings/ajax/togglegroups.php 파일 보기

@@ -1,8 +1,5 @@
<?php

// Init owncloud
require_once '../../lib/base.php';

OC_JSON::checkSubAdminUser();
OCP\JSON::callCheck();


+ 1
- 4
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();
OC_JSON::success();

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

+ 1
- 1
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);

+ 62
- 0
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_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…
취소
저장