allow apps to register form for the settings and admin pages
This commit is contained in:
parent
f2229e0427
commit
391e064e67
|
@ -23,6 +23,8 @@
|
||||||
|
|
||||||
require_once('apps/user_ldap/user_ldap.php');
|
require_once('apps/user_ldap/user_ldap.php');
|
||||||
|
|
||||||
|
OC_APP::registerAdmin('user_ldap','settings');
|
||||||
|
|
||||||
// define LDAP_DEFAULT_PORT
|
// define LDAP_DEFAULT_PORT
|
||||||
define("OC_USER_BACKEND_LDAP_DEFAULT_PORT", 389);
|
define("OC_USER_BACKEND_LDAP_DEFAULT_PORT", 389);
|
||||||
|
|
||||||
|
|
|
@ -20,14 +20,6 @@
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
require_once('../../lib/base.php');
|
|
||||||
|
|
||||||
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
|
|
||||||
header( "Location: ".OC_Helper::linkTo( '', "index.php" ));
|
|
||||||
exit();
|
|
||||||
}
|
|
||||||
|
|
||||||
$params = array('ldap_host', 'ldap_port', 'ldap_dn', 'ldap_password', 'ldap_base', 'ldap_filter');
|
$params = array('ldap_host', 'ldap_port', 'ldap_dn', 'ldap_password', 'ldap_base', 'ldap_filter');
|
||||||
|
|
||||||
foreach($params as $param){
|
foreach($params as $param){
|
||||||
|
@ -35,11 +27,9 @@ foreach($params as $param){
|
||||||
OC_Appconfig::setValue('user_ldap', $param, $_POST[$param]);
|
OC_Appconfig::setValue('user_ldap', $param, $_POST[$param]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
OC_App::setActiveNavigationEntry( "user_ldap_settings" );
|
|
||||||
|
|
||||||
|
|
||||||
// fill template
|
// fill template
|
||||||
$tmpl = new OC_Template( 'user_ldap', 'settings', 'admin' );
|
$tmpl = new OC_Template( 'user_ldap', 'settings');
|
||||||
foreach($params as $param){
|
foreach($params as $param){
|
||||||
$value = OC_Appconfig::getValue('user_ldap', $param,'');
|
$value = OC_Appconfig::getValue('user_ldap', $param,'');
|
||||||
$tmpl->assign($param, $value);
|
$tmpl->assign($param, $value);
|
||||||
|
@ -48,4 +38,4 @@ foreach($params as $param){
|
||||||
// ldap_port has a default value
|
// ldap_port has a default value
|
||||||
$tmpl->assign( 'ldap_port', OC_Appconfig::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT));
|
$tmpl->assign( 'ldap_port', OC_Appconfig::getValue('user_ldap', 'ldap_port', OC_USER_BACKEND_LDAP_DEFAULT_PORT));
|
||||||
|
|
||||||
$tmpl->printPage();
|
return $tmpl->fetchPage();
|
||||||
|
|
|
@ -208,8 +208,14 @@ class OC_App{
|
||||||
);
|
);
|
||||||
$settings=array(
|
$settings=array(
|
||||||
array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "help.php" ), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath( "settings", "help.svg" )),
|
array( "id" => "help", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "help.php" ), "name" => $l->t("Help"), "icon" => OC_Helper::imagePath( "settings", "help.svg" )),
|
||||||
array( "id" => "settings", "order" => 1, "href" => OC_Helper::linkTo( "settings", "personal.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.svg" ))
|
array( "id" => "personal", "order" => 1, "href" => OC_Helper::linkTo( "settings", "personal.php" ), "name" => $l->t("Personal"), "icon" => OC_Helper::imagePath( "settings", "personal.svg" ))
|
||||||
);
|
);
|
||||||
|
if(count(self::$settingsForms)>0){
|
||||||
|
$settings[]=array( "id" => "settings", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "settings.php" ), "name" => $l->t("Settings"), "icon" => OC_Helper::imagePath( "settings", "settings.svg" ));
|
||||||
|
}
|
||||||
|
if(count(self::$adminForms)>0){
|
||||||
|
$admin[]=array( "id" => "admin", "order" => 1000, "href" => OC_Helper::linkTo( "settings", "admin.php" ), "name" => $l->t("Admin"), "icon" => OC_Helper::imagePath( "settings", "admin.svg" ));
|
||||||
|
}
|
||||||
if( OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
|
if( OC_Group::inGroup( $_SESSION["user_id"], "admin" )){
|
||||||
$settings=array_merge($admin,$settings);
|
$settings=array_merge($admin,$settings);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once('../lib/base.php');
|
||||||
|
if( !OC_User::isLoggedIn()){
|
||||||
|
header( "Location: ".OC_Helper::linkTo( "", "index.php" ));
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
|
||||||
|
header( "Location: ".OC_Helper::linkTo( '', "index.php" ));
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
OC_Util::addStyle( "settings", "settings" );
|
||||||
|
OC_App::setActiveNavigationEntry( "admin" );
|
||||||
|
|
||||||
|
$tmpl = new OC_Template( 'settings', 'admin', 'user');
|
||||||
|
$forms=OC_App::getForms('admin');
|
||||||
|
$tmpl->assign('forms',array());
|
||||||
|
foreach($forms as $form){
|
||||||
|
$tmpl->append('forms',$form);
|
||||||
|
}
|
||||||
|
$tmpl->printPage();
|
|
@ -57,6 +57,7 @@ if(is_array($catagoryNames)){
|
||||||
'active'=>false,
|
'active'=>false,
|
||||||
'description'=>$app['description'],
|
'description'=>$app['description'],
|
||||||
'author'=>$app['personid'],
|
'author'=>$app['personid'],
|
||||||
|
'licence'=>$app['license'],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2011, Frank Karlitschek karlitschek@kde.org
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/
|
||||||
|
|
||||||
require_once('../lib/base.php');
|
require_once('../lib/base.php');
|
||||||
if( !OC_User::isLoggedIn()){
|
if( !OC_User::isLoggedIn()){
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$('#leftcontent li').each(function(index,li){
|
$('#leftcontent li').each(function(index,li){
|
||||||
var app=$.parseJSON($(this).children('span').text());
|
var app=$.parseJSON($(this).children('span').text());
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
$("#passwordbutton").click( function(){
|
$("#passwordbutton").click( function(){
|
||||||
// Serialize the data
|
// Serialize the data
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/
|
||||||
|
|
||||||
$(document).ready(function(){
|
$(document).ready(function(){
|
||||||
function applyMultiplySelect(element){
|
function applyMultiplySelect(element){
|
||||||
var checked=[];
|
var checked=[];
|
||||||
|
|
|
@ -1,4 +1,10 @@
|
||||||
<?php return array(
|
<?php /**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
return array(
|
||||||
'ab'=>'Abkhazian',
|
'ab'=>'Abkhazian',
|
||||||
'aa'=>'Afar',
|
'aa'=>'Afar',
|
||||||
'af'=>'Afrikaans',
|
'af'=>'Afrikaans',
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/
|
||||||
|
|
||||||
require_once('../lib/base.php');
|
require_once('../lib/base.php');
|
||||||
if( !OC_User::isLoggedIn()){
|
if( !OC_User::isLoggedIn()){
|
||||||
|
@ -9,7 +14,7 @@ if( !OC_User::isLoggedIn()){
|
||||||
// Highlight navigation entry
|
// Highlight navigation entry
|
||||||
OC_Util::addScript( "settings", "personal" );
|
OC_Util::addScript( "settings", "personal" );
|
||||||
OC_Util::addStyle( "settings", "settings" );
|
OC_Util::addStyle( "settings", "settings" );
|
||||||
OC_App::setActiveNavigationEntry( "settings" );
|
OC_App::setActiveNavigationEntry( "personal" );
|
||||||
|
|
||||||
// calculate the disc space
|
// calculate the disc space
|
||||||
$used=OC_Filesystem::filesize('/');
|
$used=OC_Filesystem::filesize('/');
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
require_once('../lib/base.php');
|
||||||
|
if( !OC_User::isLoggedIn()){
|
||||||
|
header( "Location: ".OC_Helper::linkTo( "", "index.php" ));
|
||||||
|
exit();
|
||||||
|
}
|
||||||
|
|
||||||
|
OC_Util::addStyle( "settings", "settings" );
|
||||||
|
OC_App::setActiveNavigationEntry( "settings" );
|
||||||
|
|
||||||
|
$tmpl = new OC_Template( 'settings', 'settings', 'user');
|
||||||
|
$forms=OC_App::getForms('settings');
|
||||||
|
$tmpl->assign('forms',array());
|
||||||
|
foreach($forms as $form){
|
||||||
|
$tmpl->append('forms',$form);
|
||||||
|
}
|
||||||
|
$tmpl->printPage();
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?php /**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/?>
|
||||||
|
|
||||||
|
<?php foreach($_['forms'] as $form){
|
||||||
|
echo $form;
|
||||||
|
};?>
|
|
@ -1,3 +1,9 @@
|
||||||
|
<?php /**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/?>
|
||||||
|
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<a class="button" target="_blank" href="http://apps.owncloud.com/"><?php echo $l->t('Add your application');?></a>
|
<a class="button" target="_blank" href="http://apps.owncloud.com/"><?php echo $l->t('Add your application');?></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
<?php /**
|
||||||
|
* Copyright (c) 2011, Frank Karlitschek karlitschek@kde.org
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/?>
|
||||||
|
|
||||||
<div id="controls">
|
<div id="controls">
|
||||||
<a class="button newquestion" href="http://apps.owncloud.com/knowledgebase/editquestion.php?action=new" target="_blank"><?php echo $l->t( 'Ask a question' ); ?></a>
|
<a class="button newquestion" href="http://apps.owncloud.com/knowledgebase/editquestion.php?action=new" target="_blank"><?php echo $l->t( 'Ask a question' ); ?></a>
|
||||||
<?php
|
<?php
|
||||||
|
|
|
@ -1,3 +1,9 @@
|
||||||
|
<?php /**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/?>
|
||||||
|
|
||||||
<div id="quota" class="personalblock"><div style="width:<?php echo $_['usage_relative'];?>%;">
|
<div id="quota" class="personalblock"><div style="width:<?php echo $_['usage_relative'];?>%;">
|
||||||
<p><?php echo $l->t('You use');?> <strong><?php echo $_['usage'];?></strong> <?php echo $l->t('of the available');?> <strong><?php echo $_['total_space'];?></strong></p>
|
<p><?php echo $l->t('You use');?> <strong><?php echo $_['usage'];?></strong> <?php echo $l->t('of the available');?> <strong><?php echo $_['total_space'];?></strong></p>
|
||||||
</div></div>
|
</div></div>
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
<?php /**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/?>
|
||||||
|
|
||||||
|
<?php foreach($_['forms'] as $form){
|
||||||
|
echo $form;
|
||||||
|
};?>
|
|
@ -1,4 +1,9 @@
|
||||||
<?php
|
<?php /**
|
||||||
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
|
* See the COPYING-README file.
|
||||||
|
*/
|
||||||
|
|
||||||
$allGroups=array();
|
$allGroups=array();
|
||||||
foreach($_["groups"] as $group) {
|
foreach($_["groups"] as $group) {
|
||||||
$allGroups[]=$group['name'];
|
$allGroups[]=$group['name'];
|
||||||
|
|
|
@ -1,25 +1,9 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ownCloud
|
* Copyright (c) 2011, Robin Appelman <icewind1991@gmail.com>
|
||||||
*
|
* This file is licensed under the Affero General Public License version 3 or later.
|
||||||
* @author Frank Karlitschek
|
* See the COPYING-README file.
|
||||||
* @copyright 2010 Frank Karlitschek karlitschek@kde.org
|
*/
|
||||||
*
|
|
||||||
* This library is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
|
|
||||||
* License as published by the Free Software Foundation; either
|
|
||||||
* version 3 of the License, or any later version.
|
|
||||||
*
|
|
||||||
* This library is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public
|
|
||||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
require_once('../lib/base.php');
|
require_once('../lib/base.php');
|
||||||
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
|
if( !OC_User::isLoggedIn() || !OC_Group::inGroup( OC_User::getUser(), 'admin' )){
|
||||||
|
|
Loading…
Reference in New Issue