summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-02 13:28:56 +0200
committerFrank Karlitschek <frank@owncloud.org>2012-05-02 13:28:56 +0200
commit8e99475886fa3fc23dd576cce7eaefd532c3fe5c (patch)
tree206c1923ac04eea8702805c1e02088b729ff1b9b /apps
parent8c7f8546716ac77cdeaa134caf9fae22232ce213 (diff)
downloadnextcloud-server-8e99475886fa3fc23dd576cce7eaefd532c3fe5c.tar.gz
nextcloud-server-8e99475886fa3fc23dd576cce7eaefd532c3fe5c.zip
first part of the config stuff
Diffstat (limited to 'apps')
-rwxr-xr-x[-rw-r--r--]apps/bookmarks/ajax/editBookmark.php2
-rwxr-xr-xapps/bookmarks/bookmarksHelper.php2
-rwxr-xr-xapps/bookmarks/lib/bookmarks.php2
-rwxr-xr-xapps/files/admin.php8
-rwxr-xr-xapps/files/index.php2
-rwxr-xr-x[-rw-r--r--]apps/files_versions/ajax/togglesettings.php6
-rwxr-xr-x[-rw-r--r--]apps/files_versions/templates/settings.php2
-rwxr-xr-xapps/files_versions/versions.php38
-rwxr-xr-x[-rw-r--r--]apps/gallery/ajax/sharing.php4
-rwxr-xr-xapps/gallery/index.php4
-rwxr-xr-xapps/gallery/lib/photo.php2
-rwxr-xr-xapps/gallery/lib/scanner.php2
-rwxr-xr-xapps/user_migrate/admin.php2
-rwxr-xr-xapps/user_openid/phpmyid.php8
14 files changed, 42 insertions, 42 deletions
diff --git a/apps/bookmarks/ajax/editBookmark.php b/apps/bookmarks/ajax/editBookmark.php
index a834cd216e6..5bed9d08448 100644..100755
--- a/apps/bookmarks/ajax/editBookmark.php
+++ b/apps/bookmarks/ajax/editBookmark.php
@@ -30,7 +30,7 @@ $RUNTIME_NOSETUPFS=true;
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('bookmarks');
-$CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
+$CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" );
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
$_ut = "strftime('%s','now')";
} elseif($CONFIG_DBTYPE == 'pgsql') {
diff --git a/apps/bookmarks/bookmarksHelper.php b/apps/bookmarks/bookmarksHelper.php
index 25c9b4cc7f2..e299f9ee19b 100755
--- a/apps/bookmarks/bookmarksHelper.php
+++ b/apps/bookmarks/bookmarksHelper.php
@@ -72,7 +72,7 @@ function getURLMetadata($url) {
}
function addBookmark($url, $title, $tags='') {
- $CONFIG_DBTYPE = OC_Config::getValue( "dbtype", "sqlite" );
+ $CONFIG_DBTYPE = OCP\Config::getSystemValue( "dbtype", "sqlite" );
if( $CONFIG_DBTYPE == 'sqlite' or $CONFIG_DBTYPE == 'sqlite3' ){
$_ut = "strftime('%s','now')";
} elseif($CONFIG_DBTYPE == 'pgsql') {
diff --git a/apps/bookmarks/lib/bookmarks.php b/apps/bookmarks/lib/bookmarks.php
index 3f27af09557..cbc50fdb81c 100755
--- a/apps/bookmarks/lib/bookmarks.php
+++ b/apps/bookmarks/lib/bookmarks.php
@@ -35,7 +35,7 @@ class OC_Bookmarks_Bookmarks{
*/
public static function findBookmarks($offset, $sqlSortColumn, $filter, $filterTagOnly){
//OCP\Util::writeLog('bookmarks', 'findBookmarks ' .$offset. ' '.$sqlSortColumn.' '. $filter.' '. $filterTagOnly ,OCP\Util::DEBUG);
- $CONFIG_DBTYPE = OC_Config::getValue( 'dbtype', 'sqlite' );
+ $CONFIG_DBTYPE = OCP\Config::getSystemValue( 'dbtype', 'sqlite' );
$params=array(OCP\USER::getUser());
diff --git a/apps/files/admin.php b/apps/files/admin.php
index c14a97568f0..a59a73f0a5b 100755
--- a/apps/files/admin.php
+++ b/apps/files/admin.php
@@ -40,14 +40,14 @@ if($_POST) {
}
if(isset($_POST['maxZipInputSize'])) {
$maxZipInputSize=$_POST['maxZipInputSize'];
- OC_Config::setValue('maxZipInputSize', OCP\Util::computerFileSize($maxZipInputSize));
+ OCP\Config::setSystemValue('maxZipInputSize', OCP\Util::computerFileSize($maxZipInputSize));
}
if(isset($_POST['submitFilesAdminSettings'])) {
- OC_Config::setValue('allowZipDownload', isset($_POST['allowZipDownload']));
+ OCP\Config::setSystemValue('allowZipDownload', isset($_POST['allowZipDownload']));
}
}
-$maxZipInputSize = OCP\Util::humanFileSize(OC_Config::getValue('maxZipInputSize', OCP\Util::computerFileSize('800 MB')));
-$allowZipDownload = intval(OC_Config::getValue('allowZipDownload', true));
+$maxZipInputSize = OCP\Util::humanFileSize(OCP\Config::getSystemValue('maxZipInputSize', OCP\Util::computerFileSize('800 MB')));
+$allowZipDownload = intval(OCP\Config::getSystemValue('allowZipDownload', true));
OCP\App::setActiveNavigationEntry( "files_administration" );
diff --git a/apps/files/index.php b/apps/files/index.php
index 86b877115ca..e2a0eb80a03 100755
--- a/apps/files/index.php
+++ b/apps/files/index.php
@@ -96,7 +96,7 @@ $tmpl->assign( 'readonly', !OC_Filesystem::is_writable($dir));
$tmpl->assign( "files", $files );
$tmpl->assign( 'uploadMaxFilesize', $maxUploadFilesize);
$tmpl->assign( 'uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
-$tmpl->assign( 'allowZipDownload', intval(OC_Config::getValue('allowZipDownload', true)));
+$tmpl->assign( 'allowZipDownload', intval(OCP\Config::getSystemValue('allowZipDownload', true)));
$tmpl->printPage();
?>
diff --git a/apps/files_versions/ajax/togglesettings.php b/apps/files_versions/ajax/togglesettings.php
index 8cb5057672d..49e314f86aa 100644..100755
--- a/apps/files_versions/ajax/togglesettings.php
+++ b/apps/files_versions/ajax/togglesettings.php
@@ -2,10 +2,10 @@
OC_JSON::checkAppEnabled('files_versions');
OC_JSON::checkAdminUser();
-if (OC_Config::getValue('versions', 'true')=='true') {
- OC_Config::setValue('versions', 'false');
+if (OCP\Config::getSystemValue('versions', 'true')=='true') {
+ OCP\Config::setSystemValue('versions', 'false');
} else {
- OC_Config::setValue('versions', 'true');
+ OCP\Config::setSystemValue('versions', 'true');
}
?>
diff --git a/apps/files_versions/templates/settings.php b/apps/files_versions/templates/settings.php
index 74882473168..c3a856bc196 100644..100755
--- a/apps/files_versions/templates/settings.php
+++ b/apps/files_versions/templates/settings.php
@@ -1,5 +1,5 @@
<form id="versions">
<fieldset class="personalblock">
- <input type="checkbox" name="versions" id="versions" value="1" <?php if (OC_Config::getValue('versions', 'true')=='true') echo ' checked="checked"'; ?> /> <label for="versions"><?php echo $l->t('Enable Files Versioning'); ?></label> <br/>
+ <input type="checkbox" name="versions" id="versions" value="1" <?php if (OCP\Config::getSystemValue('versions', 'true')=='true') echo ' checked="checked"'; ?> /> <label for="versions"><?php echo $l->t('Enable Files Versioning'); ?></label> <br/>
</fieldset>
</form>
diff --git a/apps/files_versions/versions.php b/apps/files_versions/versions.php
index 5f8767fd768..082dfbf7fd0 100755
--- a/apps/files_versions/versions.php
+++ b/apps/files_versions/versions.php
@@ -42,9 +42,9 @@ class Storage {
* init the versioning and create the versions folder.
*/
public static function init() {
- if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
// create versions folder
- $foldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+ $foldername=\OCP\Config::getSystemValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OCP\Config::getSystemValue('files_versionsfolder', Storage::DEFAULTFOLDER);
if(!is_dir($foldername)){
mkdir($foldername);
}
@@ -56,7 +56,7 @@ class Storage {
* listen to write event.
*/
public static function write_hook($params) {
- if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
$path = $params[\OC_Filesystem::signal_param_path];
if($path<>'') Storage::store($path);
}
@@ -68,9 +68,9 @@ class Storage {
* store a new version of a file.
*/
public static function store($filename) {
- if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
- $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
- $filesfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/files';
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ $versionsfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OCP\Config::getSystemValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+ $filesfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. \OCP\USER::getUser() .'/files';
Storage::init();
// check if filename is a directory
@@ -79,7 +79,7 @@ class Storage {
}
// check filetype blacklist
- $blacklist=explode(' ',\OC_Config::getValue('files_versionsblacklist', Storage::DEFAULTBLACKLIST));
+ $blacklist=explode(' ',\OCP\Config::getSystemValue('files_versionsblacklist', Storage::DEFAULTBLACKLIST));
foreach($blacklist as $bl) {
$parts=explode('.', $filename);
$ext=end($parts);
@@ -89,7 +89,7 @@ class Storage {
}
// check filesize
- if(filesize($filesfoldername.$filename)>\OC_Config::getValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)){
+ if(filesize($filesfoldername.$filename)>\OCP\Config::getSystemValue('files_versionsmaxfilesize', Storage::DEFAULTMAXFILESIZE)){
return false;
}
@@ -122,11 +122,11 @@ class Storage {
*/
public static function rollback($filename,$revision) {
- if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
- $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+ $versionsfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OCP\Config::getSystemValue('files_versionsfolder', Storage::DEFAULTFOLDER);
- $filesfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/files';
+ $filesfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. \OCP\USER::getUser() .'/files';
// rollback
if ( @copy($versionsfoldername.$filename.'.v'.$revision,$filesfoldername.$filename) ) {
@@ -147,8 +147,8 @@ class Storage {
* check if old versions of a file exist.
*/
public static function isversioned($filename) {
- if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
- $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ $versionsfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OCP\Config::getSystemValue('files_versionsfolder', Storage::DEFAULTFOLDER);
// check for old versions
$matches=glob($versionsfoldername.$filename.'.v*');
@@ -168,8 +168,8 @@ class Storage {
* get a list of old versions of a file.
*/
public static function getversions($filename,$count=0) {
- if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
- $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ $versionsfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OCP\Config::getSystemValue('files_versionsfolder', Storage::DEFAULTFOLDER);
$versions=array();
// fetch for old versions
@@ -199,14 +199,14 @@ class Storage {
* expire old versions of a file.
*/
public static function expire($filename) {
- if(\OC_Config::getValue('files_versions', Storage::DEFAULTENABLED)=='true') {
+ if(\OCP\Config::getSystemValue('files_versions', Storage::DEFAULTENABLED)=='true') {
- $versionsfoldername=\OC_Config::getValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OC_Config::getValue('files_versionsfolder', Storage::DEFAULTFOLDER);
+ $versionsfoldername=\OCP\Config::getSystemValue('datadirectory').'/'. \OCP\USER::getUser() .'/'.\OCP\Config::getSystemValue('files_versionsfolder', Storage::DEFAULTFOLDER);
// check for old versions
$matches=glob($versionsfoldername.$filename.'.v*');
- if(count($matches)>\OC_Config::getValue('files_versionmaxversions', Storage::DEFAULTMAXVERSIONS)){
- $numbertodelete=count($matches-\OC_Config::getValue('files_versionmaxversions', Storage::DEFAULTMAXVERSIONS));
+ if(count($matches)>\OCP\Config::getSystemValue('files_versionmaxversions', Storage::DEFAULTMAXVERSIONS)){
+ $numbertodelete=count($matches-\OCP\Config::getSystemValue('files_versionmaxversions', Storage::DEFAULTMAXVERSIONS));
// delete old versions of a file
$deleteitems=array_slice($matches,0,$numbertodelete);
diff --git a/apps/gallery/ajax/sharing.php b/apps/gallery/ajax/sharing.php
index ce56d652c60..04de57eb177 100644..100755
--- a/apps/gallery/ajax/sharing.php
+++ b/apps/gallery/ajax/sharing.php
@@ -80,7 +80,7 @@ function handleGetThumbnail($token, $imgpath) {
function handleGetAlbumThumbnail($token, $albumname)
{
$owner = OC_Gallery_Sharing::getTokenOwner($token);
- $file = OC_Config::getValue("datadirectory").'/'. $owner .'/gallery/'.$albumname.'.png';
+ $file = OCP\Config::getSystemValue("datadirectory").'/'. $owner .'/gallery/'.$albumname.'.png';
$image = new OC_Image($file);
if ($image->valid()) {
$image->centerCrop();
@@ -93,7 +93,7 @@ function handleGetAlbumThumbnail($token, $albumname)
function handleGetPhoto($token, $photo) {
$owner = OC_Gallery_Sharing::getTokenOwner($token);
- $file = OC_Config::getValue( "datadirectory", OC::$SERVERROOT."/data" ).'/'.$owner.'/files'.urldecode($photo);
+ $file = OCP\Config::getSystemValue( "datadirectory", OC::$SERVERROOT."/data" ).'/'.$owner.'/files'.urldecode($photo);
header('Content-Type: '.OC_Image::getMimeTypeForFile($file));
OC_Response::sendFile($file);
}
diff --git a/apps/gallery/index.php b/apps/gallery/index.php
index 0ae6b15d763..4d49e3212e2 100755
--- a/apps/gallery/index.php
+++ b/apps/gallery/index.php
@@ -27,8 +27,8 @@ OCP\User::checkLoggedIn();
OC_Util::checkAppEnabled('gallery');
OCP\App::setActiveNavigationEntry( 'gallery_index' );
-if (!file_exists(OC_Config::getValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery')) {
- mkdir(OC_Config::getValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery');
+if (!file_exists(OCP\Config::getSystemValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery')) {
+ mkdir(OCP\Config::getSystemValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery');
}
if (!isset($_GET['view'])) {
diff --git a/apps/gallery/lib/photo.php b/apps/gallery/lib/photo.php
index 455ac5036d9..7885ce2bf56 100755
--- a/apps/gallery/lib/photo.php
+++ b/apps/gallery/lib/photo.php
@@ -68,7 +68,7 @@ class OC_Gallery_Photo {
public static function getThumbnail($image_name, $owner = null) {
if (!$owner) $owner = OCP\USER::getUser();
- $save_dir = OC_Config::getValue("datadirectory").'/'. $owner .'/gallery/';
+ $save_dir = OCP\Config::getSystemValue("datadirectory").'/'. $owner .'/gallery/';
$save_dir .= dirname($image_name). '/';
$image_path = $image_name;
$thumb_file = $save_dir . basename($image_name);
diff --git a/apps/gallery/lib/scanner.php b/apps/gallery/lib/scanner.php
index 9cf8c113d1f..11c7541a75f 100755
--- a/apps/gallery/lib/scanner.php
+++ b/apps/gallery/lib/scanner.php
@@ -81,7 +81,7 @@ class OC_Gallery_Scanner {
$image->destroy();
}
}
- imagepng($thumbnail, OC_Config::getValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery/' . $albumName.'.png');
+ imagepng($thumbnail, OCP\Config::getSystemValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery/' . $albumName.'.png');
imagedestroy($thumbnail);
}
diff --git a/apps/user_migrate/admin.php b/apps/user_migrate/admin.php
index 028433939c5..518e4f43f61 100755
--- a/apps/user_migrate/admin.php
+++ b/apps/user_migrate/admin.php
@@ -30,7 +30,7 @@ if (isset($_POST['user_import'])) {
$importname = "owncloud_import_" . date("y-m-d_H-i-s");
// Save data dir for later
- $datadir = OC_Config::getValue( 'datadirectory' );
+ $datadir = OCP\Config::getSystemValue( 'datadirectory' );
// Copy the uploaded file
$from = $_FILES['owncloud_import']['tmp_name'];
diff --git a/apps/user_openid/phpmyid.php b/apps/user_openid/phpmyid.php
index a86e8070fc8..21d1c0a4545 100755
--- a/apps/user_openid/phpmyid.php
+++ b/apps/user_openid/phpmyid.php
@@ -1067,7 +1067,7 @@ function destroy_assoc_handle ( $id ) {
session_write_close();
session_id($id);
- if (OC_Config::getValue( "forcessl", false )) {
+ if (OCP\Config::getSystemValue( "forcessl", false )) {
ini_set("session.cookie_secure", "on");
}
session_start();
@@ -1195,7 +1195,7 @@ function new_assoc ( $expiration ) {
session_write_close();
}
- if (OC_Config::getValue( "forcessl", false )) {
+ if (OCP\Config::getSystemValue( "forcessl", false )) {
ini_set("session.cookie_secure", "on");
}
session_start();
@@ -1269,7 +1269,7 @@ function secret ( $handle ) {
}
session_id($handle);
- if (OC_Config::getValue( "forcessl", false )) {
+ if (OCP\Config::getSystemValue( "forcessl", false )) {
ini_set("session.cookie_secure", "on");
}
session_start();
@@ -1447,7 +1447,7 @@ function user_session () {
global $proto, $profile;
session_name('phpMyID_Server');
- if (OC_Config::getValue( "forcessl", false )) {
+ if (OCP\Config::getSystemValue( "forcessl", false )) {
ini_set("session.cookie_secure", "on");
}
@session_start();