Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
die_coolen_jungs
our_own_cloud_project
Commits
49318b4d
Commit
49318b4d
authored
Dec 18, 2014
by
Jörn Friedrich Dreyer
Browse files
Merge pull request #12896 from owncloud/drop-deprecated
first step to drop \OCP\Config:: in favour of IConfig
parents
5327b804
d41082f4
Changes
13
Hide whitespace changes
Inline
Side-by-side
apps/files/appinfo/update.php
deleted
100644 → 0
View file @
5327b804
<?php
// this drops the keys below, because they aren't needed anymore
// core related
if
(
version_compare
(
\
OCP\Config
::
getSystemValue
(
'version'
,
'0.0.0'
),
'7.0.0'
,
'<'
))
{
\
OCP\Config
::
deleteSystemValue
(
'allowZipDownload'
);
\
OCP\Config
::
deleteSystemValue
(
'maxZipInputSize'
);
}
apps/files_encryption/lib/helper.php
View file @
49318b4d
...
...
@@ -427,7 +427,7 @@ class Helper {
*/
public
static
function
getOpenSSLConfig
()
{
$config
=
array
(
'private_key_bits'
=>
4096
);
$config
=
array_merge
(
\
OC
P\
Config
::
getSystemValue
(
'openssl'
,
array
()),
$config
);
$config
=
array_merge
(
\
OC
::
$server
->
get
Config
()
->
getSystemValue
(
'openssl'
,
array
()),
$config
);
return
$config
;
}
...
...
@@ -460,7 +460,7 @@ class Helper {
*/
public
static
function
getCipher
()
{
$cipher
=
\
OC
P\
Config
::
getSystemValue
(
'cipher'
,
Crypt
::
DEFAULT_CIPHER
);
$cipher
=
\
OC
::
$server
->
get
Config
()
->
getSystemValue
(
'cipher'
,
Crypt
::
DEFAULT_CIPHER
);
if
(
$cipher
!==
'AES-256-CFB'
&&
$cipher
!==
'AES-128-CFB'
)
{
\
OCP\Util
::
writeLog
(
'files_encryption'
,
...
...
apps/files_encryption/tests/crypt.php
View file @
49318b4d
...
...
@@ -30,6 +30,9 @@ class Crypt extends TestCase {
public
$genPrivateKey
;
public
$genPublicKey
;
/** @var \OCP\IConfig */
private
$config
;
public
static
function
setUpBeforeClass
()
{
parent
::
setUpBeforeClass
();
...
...
@@ -65,6 +68,8 @@ class Crypt extends TestCase {
// we don't want to tests with app files_trashbin enabled
\
OC_App
::
disable
(
'files_trashbin'
);
$this
->
config
=
\
OC
::
$server
->
getConfig
();
}
protected
function
tearDown
()
{
...
...
@@ -76,7 +81,7 @@ class Crypt extends TestCase {
}
$this
->
assertTrue
(
\
OC_FileProxy
::
$enabled
);
\
OCP\C
onfig
::
deleteSystemValue
(
'cipher'
);
$this
->
c
onfig
->
deleteSystemValue
(
'cipher'
);
parent
::
tearDown
();
}
...
...
@@ -198,14 +203,14 @@ class Crypt extends TestCase {
$filename
=
'tmp-'
.
$this
->
getUniqueID
()
.
'.test'
;
\
OCP\C
onfig
::
setSystemValue
(
'cipher'
,
'AES-128-CFB'
);
$this
->
c
onfig
->
setSystemValue
(
'cipher'
,
'AES-128-CFB'
);
$cryptedFile
=
file_put_contents
(
'crypt:///'
.
$this
->
userId
.
'/files/'
.
$filename
,
$this
->
dataShort
);
// Test that data was successfully written
$this
->
assertTrue
(
is_int
(
$cryptedFile
));
\
OCP\C
onfig
::
deleteSystemValue
(
'cipher'
);
$this
->
c
onfig
->
deleteSystemValue
(
'cipher'
);
// Disable encryption proxy to prevent recursive calls
$proxyStatus
=
\
OC_FileProxy
::
$enabled
;
...
...
@@ -282,7 +287,7 @@ class Crypt extends TestCase {
// Generate a a random filename
$filename
=
'tmp-'
.
$this
->
getUniqueID
()
.
'.test'
;
\
OCP\C
onfig
::
setSystemValue
(
'cipher'
,
'AES-128-CFB'
);
$this
->
c
onfig
->
setSystemValue
(
'cipher'
,
'AES-128-CFB'
);
// Save long data as encrypted file using stream wrapper
$cryptedFile
=
file_put_contents
(
'crypt:///'
.
$this
->
userId
.
'/files/'
.
$filename
,
$this
->
dataLong
.
$this
->
dataLong
);
...
...
@@ -294,7 +299,7 @@ class Crypt extends TestCase {
$proxyStatus
=
\
OC_FileProxy
::
$enabled
;
\
OC_FileProxy
::
$enabled
=
false
;
\
OCP\C
onfig
::
deleteSystemValue
(
'cipher'
);
$this
->
c
onfig
->
deleteSystemValue
(
'cipher'
);
// Get file contents without using any wrapper to get it's actual contents on disk
$retreivedCryptedFile
=
$this
->
view
->
file_get_contents
(
$this
->
userId
.
'/files/'
.
$filename
);
...
...
@@ -326,12 +331,12 @@ class Crypt extends TestCase {
// Generate a a random filename
$filename
=
'tmp-'
.
$this
->
getUniqueID
()
.
'.test'
;
\
OCP\C
onfig
::
setSystemValue
(
'cipher'
,
'AES-128-CFB'
);
$this
->
c
onfig
->
setSystemValue
(
'cipher'
,
'AES-128-CFB'
);
// Save long data as encrypted file using stream wrapper
$cryptedFile
=
file_put_contents
(
'crypt:///'
.
$this
->
userId
.
'/files/'
.
$filename
,
$this
->
dataLong
.
$this
->
dataLong
);
\
OCP\C
onfig
::
deleteSystemValue
(
'cipher'
);
$this
->
c
onfig
->
deleteSystemValue
(
'cipher'
);
// Test that data was successfully written
$this
->
assertTrue
(
is_int
(
$cryptedFile
));
...
...
apps/files_external/lib/config.php
View file @
49318b4d
...
...
@@ -862,7 +862,7 @@ class OC_Mount_Config {
include
(
'Crypt/AES.php'
);
}
$cipher
=
new
Crypt_AES
(
CRYPT_AES_MODE_CBC
);
$cipher
->
setKey
(
\
OC
P\
Config
::
getSystemValue
(
'passwordsalt'
));
$cipher
->
setKey
(
\
OC
::
$server
->
get
Config
()
->
getSystemValue
(
'passwordsalt'
,
null
));
return
$cipher
;
}
...
...
apps/files_external/lib/sftp.php
View file @
49318b4d
...
...
@@ -112,7 +112,7 @@ class SFTP extends \OC\Files\Storage\Common {
try
{
$storage_view
=
\
OCP\Files
::
getStorage
(
'files_external'
);
if
(
$storage_view
)
{
return
\
OC
P\
Config
::
getSystemValue
(
'datadirectory'
)
.
return
\
OC
::
$server
->
get
Config
()
->
getSystemValue
(
'datadirectory'
)
.
$storage_view
->
getAbsolutePath
(
''
)
.
'ssh_hostKeys'
;
}
...
...
apps/files_sharing/lib/helper.php
View file @
49318b4d
...
...
@@ -280,7 +280,7 @@ class Helper {
* @return string
*/
public
static
function
getShareFolder
()
{
$shareFolder
=
\
OC
P\
Config
::
getSystemValue
(
'share_folder'
,
'/'
);
$shareFolder
=
\
OC
::
$server
->
get
Config
()
->
getSystemValue
(
'share_folder'
,
'/'
);
return
\
OC\Files\Filesystem
::
normalizePath
(
$shareFolder
);
}
...
...
@@ -291,7 +291,7 @@ class Helper {
* @param string $shareFolder
*/
public
static
function
setShareFolder
(
$shareFolder
)
{
\
OC
P\
Config
::
setSystemValue
(
'share_folder'
,
$shareFolder
);
\
OC
::
$server
->
get
Config
()
->
setSystemValue
(
'share_folder'
,
$shareFolder
);
}
}
apps/files_sharing/tests/api.php
View file @
49318b4d
...
...
@@ -948,10 +948,11 @@ class Test_Files_Sharing_Api extends TestCase {
function
testUpdateShareExpireDate
()
{
$fileInfo
=
$this
->
view
->
getFileInfo
(
$this
->
folder
);
$config
=
\
OC
::
$server
->
getConfig
();
// enforce expire date, by default 7 days after the file was shared
\
OCP\C
onfig
::
setAppValue
(
'core'
,
'shareapi_default_expire_date'
,
'yes'
);
\
OCP\C
onfig
::
setAppValue
(
'core'
,
'shareapi_enforce_expire_date'
,
'yes'
);
$c
onfig
->
setAppValue
(
'core'
,
'shareapi_default_expire_date'
,
'yes'
);
$c
onfig
->
setAppValue
(
'core'
,
'shareapi_enforce_expire_date'
,
'yes'
);
$dateWithinRange
=
new
\
DateTime
();
$dateWithinRange
->
add
(
new
\
DateInterval
(
'P5D'
));
...
...
@@ -1008,8 +1009,8 @@ class Test_Files_Sharing_Api extends TestCase {
$this
->
assertEquals
(
$dateWithinRange
->
format
(
'Y-m-d'
)
.
' 00:00:00'
,
$updatedLinkShare
[
'expiration'
]);
// cleanup
\
OCP\C
onfig
::
setAppValue
(
'core'
,
'shareapi_default_expire_date'
,
'no'
);
\
OCP\C
onfig
::
setAppValue
(
'core'
,
'shareapi_enforce_expire_date'
,
'no'
);
$c
onfig
->
setAppValue
(
'core'
,
'shareapi_default_expire_date'
,
'no'
);
$c
onfig
->
setAppValue
(
'core'
,
'shareapi_enforce_expire_date'
,
'no'
);
\
OCP\Share
::
unshare
(
'file'
,
$fileInfo
[
'fileid'
],
\
OCP\Share
::
SHARE_TYPE_LINK
,
null
);
}
...
...
apps/files_sharing/tests/helper.php
View file @
49318b4d
...
...
@@ -35,7 +35,7 @@ class Test_Files_Sharing_Helper extends TestCase {
$this
->
assertSame
(
'/Shared'
,
\
OCA\Files_Sharing\Helper
::
getShareFolder
());
// cleanup
\
OC
P\
Config
::
deleteSystemValue
(
'share_folder'
);
\
OC
::
$server
->
get
Config
()
->
deleteSystemValue
(
'share_folder'
);
}
...
...
apps/files_sharing/tests/share.php
View file @
49318b4d
...
...
@@ -243,7 +243,7 @@ class Test_Files_Sharing extends OCA\Files_sharing\Tests\TestCase {
$this
->
assertTrue
(
\
OC\Files\Filesystem
::
file_exists
(
'/Shared/subfolder/'
.
$this
->
folder
));
//cleanup
\
OC
P\
Config
::
deleteSystemValue
(
'share_folder'
);
\
OC
::
$server
->
get
Config
()
->
deleteSystemValue
(
'share_folder'
);
}
/**
...
...
apps/files_trashbin/lib/trashbin.php
View file @
49318b4d
...
...
@@ -874,7 +874,7 @@ class Trashbin {
* @return integer size of the folder
*/
private
static
function
calculateSize
(
$view
)
{
$root
=
\
OC
P\
Config
::
getSystemValue
(
'datadirectory'
)
.
$view
->
getAbsolutePath
(
''
);
$root
=
\
OC
::
$server
->
get
Config
()
->
getSystemValue
(
'datadirectory'
)
.
$view
->
getAbsolutePath
(
''
);
if
(
!
file_exists
(
$root
))
{
return
0
;
}
...
...
apps/user_ldap/appinfo/update.php
View file @
49318b4d
<?php
$configInstance
=
\
OC
::
$server
->
getConfig
();
//detect if we can switch on naming guidelines. We won't do it on conflicts.
//it's a bit spaghetti, but hey.
$state
=
OCP\Config
::
getSystemValue
(
'ldapIgnoreNamingRules'
,
'unset'
);
$state
=
$configInstance
->
getSystemValue
(
'ldapIgnoreNamingRules'
,
'unset'
);
if
(
$state
===
'unset'
)
{
OCP\Config
::
setSystemValue
(
'ldapIgnoreNamingRules'
,
false
);
$configInstance
->
setSystemValue
(
'ldapIgnoreNamingRules'
,
false
);
}
$installedVersion
=
OCP\Config
::
getAppValue
(
'user_ldap'
,
'installed_version'
);
$installedVersion
=
$configInstance
->
getAppValue
(
'user_ldap'
,
'installed_version'
);
$enableRawMode
=
version_compare
(
$installedVersion
,
'0.4.1'
,
'<'
);
$configPrefixes
=
OCA\user_ldap\lib\Helper
::
getServerConfigurationPrefixes
(
true
);
...
...
@@ -15,31 +17,31 @@ $ldap = new OCA\user_ldap\lib\LDAP();
foreach
(
$configPrefixes
as
$config
)
{
$connection
=
new
OCA\user_ldap\lib\Connection
(
$ldap
,
$config
);
$state
=
\
OCP\Config
::
getAppValue
(
$state
=
$configInstance
->
getAppValue
(
'user_ldap'
,
$config
.
'ldap_uuid_user_attribute'
,
'not existing'
);
if
(
$state
===
'non existing'
)
{
$value
=
\
OCP\Config
::
getAppValue
(
$value
=
$configInstance
->
getAppValue
(
'user_ldap'
,
$config
.
'ldap_uuid_attribute'
,
''
);
\
OCP\Config
::
setAppValue
(
$configInstance
->
setAppValue
(
'user_ldap'
,
$config
.
'ldap_uuid_user_attribute'
,
$value
);
\
OCP\Config
::
setAppValue
(
$configInstance
->
setAppValue
(
'user_ldap'
,
$config
.
'ldap_uuid_group_attribute'
,
$value
);
}
$state
=
\
OCP\Config
::
getAppValue
(
$state
=
$configInstance
->
getAppValue
(
'user_ldap'
,
$config
.
'ldap_expert_uuid_user_attr'
,
'not existing'
);
if
(
$state
===
'non existing'
)
{
$value
=
\
OCP\Config
::
getAppValue
(
$value
=
$configInstance
->
getAppValue
(
'user_ldap'
,
$config
.
'ldap_expert_uuid_attr'
,
''
);
\
OCP\Config
::
setAppValue
(
$configInstance
->
setAppValue
(
'user_ldap'
,
$config
.
'ldap_expert_uuid_user_attr'
,
$value
);
\
OCP\Config
::
setAppValue
(
$configInstance
->
setAppValue
(
'user_ldap'
,
$config
.
'ldap_expert_uuid_group_attr'
,
$value
);
}
if
(
$enableRawMode
)
{
\
OCP\Config
::
setAppValue
(
'user_ldap'
,
$config
.
'ldap_user_filter_mode'
,
1
);
\
OCP\Config
::
setAppValue
(
'user_ldap'
,
$config
.
'ldap_login_filter_mode'
,
1
);
\
OCP\Config
::
setAppValue
(
'user_ldap'
,
$config
.
'ldap_group_filter_mode'
,
1
);
$configInstance
->
setAppValue
(
'user_ldap'
,
$config
.
'ldap_user_filter_mode'
,
1
);
$configInstance
->
setAppValue
(
'user_ldap'
,
$config
.
'ldap_login_filter_mode'
,
1
);
$configInstance
->
setAppValue
(
'user_ldap'
,
$config
.
'ldap_group_filter_mode'
,
1
);
}
}
apps/user_ldap/lib/access.php
View file @
49318b4d
...
...
@@ -673,7 +673,7 @@ class Access extends LDAPUtility implements user\IUserTools {
$table
=
$this
->
getMapTable
(
$isUser
);
$sqlAdjustment
=
''
;
$dbType
=
\
OC
P\
Config
::
getSystemValue
(
'dbtype'
);
$dbType
=
\
OC
::
$server
->
get
Config
()
->
getSystemValue
(
'dbtype'
,
null
);
if
(
$dbType
===
'mysql'
||
$dbType
==
'oci'
)
{
$sqlAdjustment
=
'FROM DUAL'
;
}
...
...
apps/user_ldap/user_ldap.php
View file @
49318b4d
...
...
@@ -199,7 +199,7 @@ class USER_LDAP extends BackendUtility implements \OCP\UserInterface {
)
{
$homedir
=
$path
;
}
else
{
$homedir
=
\
OC
P\
Config
::
getSystemValue
(
'datadirectory'
,
$homedir
=
\
OC
::
$server
->
get
Config
()
->
getSystemValue
(
'datadirectory'
,
\
OC
::
$SERVERROOT
.
'/data'
)
.
'/'
.
$homedir
[
0
];
}
$this
->
access
->
connection
->
writeToCache
(
$cacheKey
,
$homedir
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment