Commit Graph

786 Commits

Author SHA1 Message Date
Morris Jobke 0d4f0ab871 reduce OC_Preferences, OC_Config and \OCP\Config usage
* files_encryption
* files_versions
* files_trashbin
* tests
* status.php
* core
* server container
2014-12-08 22:42:37 +01:00
Morris Jobke f164161f69 fix base.php for not installed systems 2014-12-08 22:29:43 +01:00
Lukas Reschke bd520d2e53 Create config if it does not exists
The codepath that is executed when executing ownCloud via CLI is different than via browser. Specifically, the config is created by the user session already in `OC_Util::getInstanceId()` by a call to `setValue`. That said, this seems to be quite a bad side-effect, but for the sake of "not breaking whatever might break if we touch this" let's keep it that way for now.

When executing the autoconfig via `php -f index.php` the said session was not setup and thus no `config/config.php` file was created resulting in an installation error.

To reproduce this try to setup ownCloud via `php -f index.php` with and without that patch. (ensure to delete all existing configs before and don't access ownCloud with a browser in the meantime)

Fixes itself.
2014-12-06 14:00:14 +01:00
Lukas Reschke ddcf2b84ec Remove checks for safe mode and magic quotes
Both are removed from 5.4.0

Safe Mode: http://php.net/manual/en/features.safe-mode.php
> This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.

Magic Quotes: http://php.net/manual/en/security.magicquotes.php
> This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 5.4.0.
2014-12-05 19:14:47 +01:00
Thomas Müller 0769556989 Merge pull request #12419 from owncloud/read-only-config
Allow read-only configuration
2014-12-01 16:37:29 +01:00
Lukas Reschke e35feadac2 Pass \OC::$WEBROOT to the ctr 2014-11-27 14:50:14 +01:00
Thomas Müller 5097d4dc05 remove deprecated \OC:$session 2014-11-26 15:32:47 +01:00
Lukas Reschke fc116f563f Allow read-only configuration
Workaround required for IIS setups running ownCloud to prevent dataloss.

Long-term solution would be to move some configuration settings to the database
2014-11-25 16:26:47 +01:00
Morris Jobke 604bf61e10 Merge pull request #12299 from owncloud/clean-lib-base-config
replace all static calls to OC_Config and OC_Preferences to calls to OCP...
2014-11-20 16:24:37 +01:00
Thomas Müller cbb9caf030 Merge pull request #12226 from owncloud/remove-phpass
Remove phpass and migrate to new Hasher interface
2014-11-20 14:59:59 +01:00
Morris Jobke 980dd4d22a replace double quotes with single quotes 2014-11-19 13:15:04 +01:00
Morris Jobke fef9d4218c replace all static calls to OC_Config and OC_Preferences to calls to OCP\IConfig 2014-11-19 13:06:22 +01:00
Lukas Reschke d0a30b0e55 Ignore port for trusted domains
This lead to a lot of confusion in the past and did not really offer any value. Let's remove the port check therefore. (it's anyways not really a part of the domain)

Fixes https://github.com/owncloud/core/issues/12150 and https://github.com/owncloud/core/issues/12123 and also a problem reported by @DeepDiver1975.

Conflicts:
	lib/private/request.php
2014-11-18 12:36:03 +01:00
Lukas Reschke 8595b76df2 Remove phpass and migrate to new Hasher interface
This PR removes phpass and migrates to the new Hasher interface.

Please notice that due to https://github.com/owncloud/core/issues/10671 old hashes are not updated but the hashes are backwards compatible so this shouldn't hurt.
Once the sharing classes have a possibility to update the passwords of single shares those methods should be used within the newHash if block.
2014-11-17 13:39:13 +01:00
Thomas Müller 4c1244f50c Merge pull request #11917 from owncloud/fix-11909
Add checkbox to enforce SSL for subdomains
2014-11-11 20:37:50 +01:00
Lukas Reschke 5b8a6b66b5 Load PHPAss via autoloader 2014-11-06 16:32:53 +01:00
Lukas Reschke 5f2a083686 Merge pull request #11883 from owncloud/clear-session-for-setup
Clear session before setup
2014-11-06 14:39:51 +01:00
Morris Jobke 73569b29bc md5 now handled via bower 2014-11-06 13:22:16 +01:00
Morris Jobke e49b9022a1 bower snapjs 2014-11-06 12:03:57 +01:00
Morris Jobke 957dee5af1 bower underscore 2014-11-05 23:23:03 +01:00
Morris Jobke 74d375d8ea migrate jQuery to bower 2014-11-04 14:28:29 +01:00
Morris Jobke 1a405e56f5 replace moment.js with bower version
* fix JS unit tests
2014-11-03 20:54:50 +01:00
Thomas Müller 994768d99f Update Pimple to V3.0 2014-11-03 16:57:16 +01:00
Lukas Reschke e73ccbd4ca Migrate "setsecurity.php" to the AppFramework
Add switch to enforce SSL for subdomains

Add unit tests

Add test for boolean values

Camel-case

Fix ugly JS
2014-11-03 16:53:03 +01:00
Thomas Müller a4f0483f56 Update Symfony/Console to 2.5 & Update Symfony/Routing to 2.5 2014-11-03 13:52:47 +01:00
Lukas Reschke d30fd23544 Clear session before setup
Fixes https://github.com/owncloud/core/issues/11861
2014-10-31 11:21:00 +01:00
Thomas Müller 105940b9dc Merge pull request #11638 from owncloud/oc8-translations
[OC8] Load javascript translations using standard web technologies
2014-10-29 13:09:02 +01:00
Vincent Petry d71cd680dd Include core translations
Moved search result type translations to search.js

Load JS translations earlier

Translations need to be loaded earlier to make sure that some JS files
like search.js get access to translations at this time.

This requires the template initialization to be moved to after session
initialization, because only after the session we have access to the
current language.
2014-10-29 10:09:12 +01:00
Vincent Petry ec1a73fab9 Added OC.L10N namespace with translation functions
Added addTranslations and fixed de.js file

Fixed de.js to use OC.L10N.register() and use to correct expected
format.

Added JS unit tests for OC.L10N class

Include translations JS script for all apps
2014-10-29 10:09:12 +01:00
Thomas Müller 46c2909c78 Update doctrine/dbal to 2.5 2014-10-28 15:39:37 +01:00
Thomas Müller c93ddf77b9 Use composer autoloader to load Patchwork 2014-10-28 13:42:28 +01:00
Adam Williamson 0e3f2055d2 use Composer autoloader not OC for non-Composer 3rdparty (#9643)
Composer's autoloader is rather better than the OwnCloud autoloader's
handling of non-OC classes. Plus we can rely on upstream Composer to
maintain it and not worry about it ourselves.

With this change, we drop the bits of OwnCloud's autoloader that
handled non-OC classes, and register the classes that were being
handled by that code with Composer's autoloader instead. As these
dependencies are converted to actually being managed by Composer,
the explicit registrations can be dropped as they won't be needed
any more.

Since OwnCloud's autoloader isn't going to handle non-OC classes any
more, we no longer need to test to make sure it does it right.

drop unneeded registerPrefix() and registerClass() from autoloader

Now we're not handling anything but OC's own classes, these are
unnecessary.

error out if composer autoloader is not found (thanks bantu)

We're never going to be able to work without the autoloader, if it's not
there we should just throw our hands up and surrender.
2014-10-28 11:32:20 +01:00
Lukas Reschke d6380a5395 Merge pull request #11786 from owncloud/MakeSupportedDBsConfigurable
Make supported DBs configurable within config.php
2014-10-27 22:24:16 +01:00
Lukas Reschke 233c49f4b9 Make supported DBs configurable within config.php
This commit will make the supported DBs for installation configurable within config.php. By default the following databases are tested: "sqlite", "mysql", "pgsql". The reason behind this is that there might be instances where we want to prevent SQLite to be used by mistake.

To test this play around with the new configuration parameter "supportedDatabases".
2014-10-27 21:39:34 +01:00
Robin Appelman 0b96297783 Use the TempManager to handle temporary files 2014-10-24 12:18:49 +02:00
Morris Jobke e2ff180521 Merge pull request #11416 from owncloud/eventlogger
Allow apps to gather performance diagnistics
2014-10-22 11:18:26 +02:00
Thomas Müller 2814a294c8 call initPaths() right before the server is instantiated 2014-10-21 14:10:57 +02:00
Thomas Müller d9907b6fa3 move some deprecated usage of OC_Config and OC_AppConfig to \OC::server 2014-10-20 14:44:44 +02:00
Robin Appelman 9fd234f63f Log some additional events 2014-10-20 13:38:38 +02:00
Robin Appelman 1e69f5e7ac Log some basic events 2014-10-20 13:38:38 +02:00
Vincent Petry 9fc23e1967 Merge pull request #10934 from owncloud/datadir-write-setup
Don't complain about non-writable datadirs before we're installed
2014-09-25 14:32:32 +02:00
Lukas Reschke 4893d2c0ed Show login again instead of JSON if CSRF check fails
Previously a JSON error page was shown to the user in-case the CSRF token was not valid. This was confusing and prevented people from login.

With this at least the login page is shown again and not a JSON error message. I consider this as sufficient since adding a new error page just for this sake would uneededly make lib/base.php even more cluttered and this is a edge-case which optimally should anyways not happen that often.

This can be tested by opening the login page, then clearing the cookies, and trying to login.
2014-09-23 14:55:08 +02:00
Thomas Müller bb18fe1384 send browsers timezone back tp the server on login 2014-09-22 14:01:45 +02:00
Thomas Müller b1d0a0f3bf Merge pull request #10939 from owncloud/add-port-to-trusted-domain-wizard
Append port to trusted domain in case it's not 80 or 443
2014-09-22 10:04:02 +02:00
Lukas Reschke d0d3b7457b Move BasicAuth check to "isLoggedIn()"
Ensures that Basic Auth works properly for APIs and removes the need for some even uglier lines of code.
2014-09-18 16:14:07 +02:00
Robin Appelman 6fa3280c2a Inject config into checkserver and cleanup tests 2014-09-18 13:33:13 +02:00
Lukas Reschke c19bc1917b Move basic auth check
At the previous point not all apps were initialized. Now the basic auth check happens together at the same location as all others.

Fixes https://github.com/owncloud/core/issues/11129
2014-09-17 16:04:12 +02:00
Lukas Reschke 07b14bcd4f Merge pull request #10960 from owncloud/use-intl-module-master
use intl's native normalizer_normalize() in case the module is available
2014-09-15 14:13:30 +02:00
Thomas Müller 59209e0f2b use intl's native normalizer_normalize() in case the module is available 2014-09-11 10:24:31 +02:00
kondou 69f2c0544e Refresh if maintenance mode is over
Using status.php for this.
I modified status.php to also show, whether we're in maintenance.

Checks every 20 seconds if maintenance is over, if yes: reload.
2014-09-09 17:26:11 +02:00
Lukas Reschke 2590a4dc85 Append port to trusted domain in case it's not 80 or 443
Ref https://github.com/owncloud/core/pull/10584#issuecomment-54677059
2014-09-08 16:15:31 +02:00
Vincent Petry d6bfd90bf8 Do not load extra user backends when an upgrade is due
Whenever an upgrade is due, do not load extra user backends
2014-09-08 12:30:04 +02:00
Lukas Reschke c9afa60f62 Move trusted domain check to init()
handleRequest() is not called from remote.php or public.php which made these files party available but all included apps in there produced errors.

As the expected behaviour is anyways that a trusted domain warning is shown I moved this to init()

Fixes https://github.com/owncloud/core/issues/10064
2014-09-05 14:10:35 +02:00
Lukas Reschke 63a90a129b Use proper RNG generator
OC_Util::generateRandomBytes() only returns lowercase alphanumeric values.
We should use the new RNG which has a broader characterset.
2014-09-03 17:46:48 +02:00
Robin Appelman 3c618a0252 Also setup the filesystem when matching routes 2014-09-02 16:15:42 +02:00
Robin Appelman a9a37b5363 Don't automatically setup the filesystem the moment we load OC\Files\FileSystem 2014-09-02 16:15:42 +02:00
Robin Appelman d0266c0bf8 Use public api for getting l10n 2014-08-31 10:08:22 +02:00
Jörn Friedrich Dreyer f687794a4a be correct in deprecation documentation 2014-08-29 10:22:21 +02:00
Jörn Friedrich Dreyer f551917a3c kill OC::$session
maintain deprecated \OC::$session when getting or setting the session via the server container or UserSession

restore order os OC::$session and OC::$CLI

remove unneded initialization of dummy session

write back session when $useCustomSession is true

log warning when deprecated app is used
2014-08-29 10:22:21 +02:00
Georg Ehrke f82b788ba5 add moment.js 2014-08-26 17:39:15 +02:00
Lukas Reschke 97b536e3df Add a trusted domain wizard
Adds a little button to the trusted domain warning, if an admin clicks on the warning he will be redirected to ownCloud and asked whether he want to trust this domain.

By far not the cleanest code, or clean at all, but does the job and I don't see a reason to make a lot of changes for this little improvement.
2014-08-21 22:22:35 +02:00
blizzz 52d5429768 Merge pull request #10522 from owncloud/removeLoadAppScript
Remove loadAppScriptFile
2014-08-21 19:59:31 +02:00
Lukas Reschke ea2a45f19d Remove loadAppScriptFile 2014-08-19 15:16:49 +02:00
Lukas Reschke fdb203ff1e Merge pull request #10409 from owncloud/iShallNotCopyStuffWithoutThinking
Add a copied_sample_config switch
2014-08-19 11:03:57 +02:00
Lukas Reschke c33d1cacd4 Add a copied_sample_config switch
Hopefully this will stop people from copying the sample config. I'm so annoyed by all those wrong bug reports...

Add some explanation about this switch

Move check to init
2014-08-19 09:57:03 +02:00
Lukas Reschke a822a31ce3 Merge pull request #10442 from owncloud/move-failed-logins
Move authentication failed logging to checkPassword
2014-08-15 16:50:28 +02:00
Lukas Reschke 5bb4772858 Move authentication failed logging to checkPassword
Fixes https://github.com/owncloud/core/issues/10366
2014-08-15 12:13:00 +02:00
Lukas Reschke a4a897d26d Remove ability to trigger DEBUG mode via cookie
Users should not be able to enable debug mode on their own by setting a cookie. Using debug mode might leak too much information about the environment or have other unexpected behaviour.

We should backport this.
2014-08-15 11:21:56 +02:00
Jörn Friedrich Dreyer fd798fd982 update deprecation docs 2014-08-14 12:22:34 +02:00
blizzz 54491e8c68 Merge pull request #10323 from gekmihesg/master
Load authentication backends before tryBasicAuth
2014-08-13 16:08:48 +02:00
gekmihesg 578a57f0fb Load authentication backends before tryBasicAuth 2014-08-10 13:29:32 +02:00
marc0s f2e20757f6 Fix checking of NULL or empty OC::$THIRDPARTYROOT/OC::$THIRDPARTYWEBROOT
Fixes #10065
2014-07-30 23:24:55 +02:00
Morris Jobke 521934ee0d Merge pull request #10029 from owncloud/fix-thirdparty
Fix silent crash if 3rdparty dir is not available
2014-07-30 18:34:55 +02:00
Victor Dubiniuk eb9bd200fa Replace exit with return 2014-07-30 14:03:31 +02:00
Victor Dubiniuk 31e7fdb9bf Fix silent crash if 3rdparty dir is not available 2014-07-30 14:03:31 +02:00
Andreas Fischer a8fbc709ce Add registerAutoloaderCache(). 2014-07-29 11:18:40 +02:00
Andreas Fischer 9be8ac5867 Memcache\Factory: Remove static, use globalPrefix. 2014-07-29 11:14:36 +02:00
Andreas Fischer da391b8932 InstanceId is properly injected into factory. Remove comment. 2014-07-29 11:03:10 +02:00
Thomas Müller a3411e3719 Merge pull request #9641 from owncloud/localuser-addressbook
ownCloud users are exported as address book
2014-07-28 12:18:56 +02:00
Jörn Friedrich Dreyer ec7a10f882 reorder if statements to remove negation, indentation correction 2014-07-25 19:39:29 +02:00
Thomas Müller 176ecbd311 ownCloud users are exported as address book 2014-07-24 17:35:02 +02:00
Thomas Müller 2594fb80aa don't silently exit in cli-mode in case ownCloud in not yet installed 2014-07-24 13:45:06 +02:00
Lukas Reschke 1c16d012ab Remove uneeded `strip_tags`
This `strip_tags` seems to be completely unneeded and will cause problems with passwords containing stripped characters. (e.g. `<` or `>`)

Needs https://github.com/owncloud/core/pull/9735 to be merged first.
2014-07-19 10:17:24 +02:00
Andreas Fischer bfd59bddf4 Extract Auth Header logic into new function handleAuthHeaders(). 2014-07-19 02:21:18 +02:00
Andreas Fischer fafed17c60 Deduplicate user/password extraction from alternative HTTP headers. 2014-07-19 02:06:37 +02:00
Joas Schilling 5d3e1bc023 Only calculate the WEBROOT from scriptName if it contains $SUBURI
If not we are most likely in CLI mode. However to be able to still
generate valid URLs, we need to use the overwrite webroot instead.

Fix #9490
2014-07-07 15:08:46 +02:00
Bjoern Schiessle 3c45925e74 fix hook names 2014-07-03 13:52:58 +02:00
Volkan Gezer ae68a773c0 more strings to translate in utils also some fixes in defaults 2014-06-28 13:29:24 +02:00
Vincent Petry a120d6e9a3 Bring back loadApps() in base.php
loadApps() had been deleted by mistake in
799205488c
2014-06-24 17:37:58 +02:00
Vincent Petry 799205488c Prevent loadApps on upgrade
Moved OC::needUpgrade() to OCP\Util::needUpgrade() to make it accessible
form the router.
Moved maintenance + upgrade check to the router.
2014-06-18 11:10:07 +02:00
Lukas Reschke d4bdcb7a9b Merge pull request #9047 from owncloud/fix_preload_fundamental_apps
Load fundamental apps, before any possible customizing app may follow
2014-06-18 07:29:04 +02:00
Lukas Reschke f2fc214ce0 Add deprecation notice to load* functions
This functions are deprecated and/or removed since ownCloud 7. Additionally a issubdirectory check has been added here to prevent developers to use this function in a potentially insecure way.

Port of https://github.com/owncloud/core/pull/9033
2014-06-16 20:33:04 +02:00
Arthur Schiwon 7b704eeb5e Load fundamental apps, before any possible customizing app may follow 2014-06-16 13:12:21 +02:00
Morris Jobke 63c5c7bd21 set logger before registrate to an error handler 2014-06-09 10:02:23 +02:00
Thomas Müller 289accc31b Merge pull request #8159 from owncloud/mobile-sidebar-swipe
Mobile sidebar swipe
2014-06-06 11:27:04 +02:00
Jan-Christoph Borchardt 9e56acbdc9 add snap.js script 2014-06-05 11:52:17 +02:00
Lukas Reschke 7c4abce373 Move authentication to it's own call 2014-06-05 11:45:45 +02:00
Lukas Reschke ac7fb1b23e Remove legacy routing code
The getfile routing code was absolutely legacy and not needed anymore. Additionally \OC::$REQUESTEDAPP was never set to the actually accessed application.

This commit removes the legacy routing code and ensures that $REQUESTEDAPP is always set so that other applications (e.g. the firewall or a two-factor authentication) can intercept the currently accessed app.

Testplan:
[x] Installation works
[x] Login with DB works
[x] Logout works
[x] Login with alternate backend works (tested with user_webdavauth)
[x] Other apps are accessible
[x] Redirect on login works (e.g. index.php?redirect_url=%2Fcore%2Findex.php%2Fsettings%2Fapps%3Finstalled)
[x] Personal settings are accessible
[x] Admin settings are accessible
[x] Sharing files works
[x] DAV works
[x] OC::$REQUESTEDAPP contains the requested application and can be intercepted by other applications
2014-06-05 11:45:45 +02:00
Thomas Müller 1c20c72efe Merge pull request #8620 from owncloud/design-navigation-two
Toggle app navigation not only on mobile, but on desktop as well
2014-06-05 10:53:22 +02:00
Vincent Petry 95fda3c17c Do not load apps when upgrade is needed
This prevents routes like "core/js/oc.js" to automatically load apps and
trigger their update prematurely.
2014-06-04 18:52:52 +02:00