Migrate Google Drive storage app to v1.0.0 of the client library
files_external/3rdparty: update google-api-php-client to 1.0.2-beta
fix a bug in google-api-php-client: generates an auth url that doesn't work

Submitted upstream as https://github.com/google/google-api-php-client/issues/76
Google's php lib has a function to generate a URL for OAuth2 authentication.
It uses http_build_query() to generate the query part of the URL, and in PHP
5.3 or later, this uses an encoded ampersand - &amp; - as the query separator,
not a raw one. However, Google's OAuth server apparently can't handle encoded
ampersands as separators and so it fails.

This patch explicitly sets a raw ampersand as the separator. If Google decides
to fix their OAuth server instead of merging this patch into google-api-php-
client, we can drop this patch as soon as that happens.
google drive: set access type to 'offline' when requesting token

We need to do this in order to be able to refresh the access token without
prompting the user for their credentials every hour. This was the default
in 0.6 of the Google library, but needs to be explicitly specified in 1.0.
bump google lib to c6949531d2 (post 1.0.3-beta, including query separator fix)

This is the upstream commit that merged my query separator fix. It's slightly
after the 1.0.3-beta tag. I eyeballed the other post 1.0.3-beta changes and
none of them looks like any kind of problem, so we may as well just use this
upstream state.
scrutinizer fix: correct @return for getDriveFile()
scrutinizer fix: explicitly declare Google class property $client
update google-api-php-client to 1.0.6-beta

Latest version with various bugfixes, also implements support
for using curl instead of its own io class when available; this
avoids the bug that causes severe excess bandwidth use due to
some kind of zlib issue.
google: disable compression when curl is not available

This is a slightly hacky workaround for
https://github.com/google/google-api-php-client/issues/59 .
There's a bug in the Google library which makes it go nuts on
file uploads and transfer *way* too much data if compression is
enabled and it's using its own IO handler (not curl). Upstream
'fixed' this (by disabling compression) for one upload
mechanism, but not for the one we use. The bug doesn't seem to
happen if the google lib detects that curl is available and
decides to use it instead of its own handler. So, let's disable
compression, but only if it looks like the Google lib's check
for curl is going to fail.
Deprecate older API wrappers and calls

Those old classes have now non-static pendants and can be deprecated IMHO.
Show warning when invalid user was passed

Sometimes there are bugs that cause setupFS() to be called for
non-existing users. Instead of failing hard and breaking the instance,
this fix simply logs a warning.
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.
Warn for password reset when files_encryption is enabled

This patch wil warn the user of the consequences when resetting the password and requires checking a checkbox (as we had in the past) to reset a password.

Furthermore I updated the code to use our new classes and added some unit tests for it :dancers:

Fixes https://github.com/owncloud/core/issues/11438
Fix scrutinizer issues
Remove uneeded import
Use correct route instead

THX @schiesbn
(I should setup a mail server on my local system...)
Add "postPasswordReset" hook
add password as parameter to the signal so that the encryption can create a new key-pair
listen to the post_passwordReset hook, backup the old keys and create a new key pair for the user
Hide submit button after password change

Creating a new key pair can take 1-2 seconds. So it could happen that the user click the "Reset password" button again which can lead to many nasty things, e.g. we could create two new key pairs in parallel.