Fix detection of the new iOS app
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
397feb9e8d
commit
33fb86f68b
|
@ -32,7 +32,6 @@
|
||||||
namespace OCA\DAV\Connector\Sabre;
|
namespace OCA\DAV\Connector\Sabre;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
use OC\AppFramework\Http\Request;
|
|
||||||
use OC\Authentication\Exceptions\PasswordLoginForbiddenException;
|
use OC\Authentication\Exceptions\PasswordLoginForbiddenException;
|
||||||
use OC\Authentication\TwoFactorAuth\Manager;
|
use OC\Authentication\TwoFactorAuth\Manager;
|
||||||
use OC\Security\Bruteforce\Throttler;
|
use OC\Security\Bruteforce\Throttler;
|
||||||
|
@ -177,9 +176,9 @@ class Auth extends AbstractBasic {
|
||||||
|
|
||||||
// Official ownCloud clients require no checks
|
// Official ownCloud clients require no checks
|
||||||
if($this->request->isUserAgent([
|
if($this->request->isUserAgent([
|
||||||
Request::USER_AGENT_OWNCLOUD_DESKTOP,
|
IRequest::USER_AGENT_CLIENT_DESKTOP,
|
||||||
Request::USER_AGENT_OWNCLOUD_ANDROID,
|
IRequest::USER_AGENT_CLIENT_ANDROID,
|
||||||
Request::USER_AGENT_OWNCLOUD_IOS,
|
IRequest::USER_AGENT_CLIENT_IOS,
|
||||||
])) {
|
])) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -302,7 +302,7 @@ class AuthTest extends TestCase {
|
||||||
->with([
|
->with([
|
||||||
'/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/',
|
'/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/',
|
||||||
'/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/',
|
'/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/',
|
||||||
'/^Mozilla\/5\.0 \(iOS\) ownCloud\-iOS.*$/',
|
'/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/',
|
||||||
])
|
])
|
||||||
->willReturn(false);
|
->willReturn(false);
|
||||||
$this->session
|
$this->session
|
||||||
|
@ -352,7 +352,7 @@ class AuthTest extends TestCase {
|
||||||
->with([
|
->with([
|
||||||
'/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/',
|
'/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/',
|
||||||
'/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/',
|
'/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/',
|
||||||
'/^Mozilla\/5\.0 \(iOS\) ownCloud\-iOS.*$/',
|
'/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/',
|
||||||
])
|
])
|
||||||
->willReturn(false);
|
->willReturn(false);
|
||||||
$this->session
|
$this->session
|
||||||
|
@ -406,7 +406,7 @@ class AuthTest extends TestCase {
|
||||||
->with([
|
->with([
|
||||||
'/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/',
|
'/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/',
|
||||||
'/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/',
|
'/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/',
|
||||||
'/^Mozilla\/5\.0 \(iOS\) ownCloud\-iOS.*$/',
|
'/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/',
|
||||||
])
|
])
|
||||||
->willReturn(false);
|
->willReturn(false);
|
||||||
$this->session
|
$this->session
|
||||||
|
@ -452,7 +452,7 @@ class AuthTest extends TestCase {
|
||||||
->with([
|
->with([
|
||||||
'/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/',
|
'/^Mozilla\/5\.0 \([A-Za-z ]+\) (mirall|csyncoC)\/.*$/',
|
||||||
'/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/',
|
'/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/',
|
||||||
'/^Mozilla\/5\.0 \(iOS\) ownCloud\-iOS.*$/',
|
'/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/',
|
||||||
])
|
])
|
||||||
->willReturn(true);
|
->willReturn(true);
|
||||||
$this->session
|
$this->session
|
||||||
|
|
|
@ -72,7 +72,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
||||||
/**
|
/**
|
||||||
* @deprecated use \OCP\IRequest::USER_AGENT_CLIENT_IOS instead
|
* @deprecated use \OCP\IRequest::USER_AGENT_CLIENT_IOS instead
|
||||||
*/
|
*/
|
||||||
const USER_AGENT_OWNCLOUD_IOS = '/^Mozilla\/5\.0 \(iOS\) ownCloud\-iOS.*$/';
|
const USER_AGENT_OWNCLOUD_IOS = '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/';
|
||||||
/**
|
/**
|
||||||
* @deprecated use \OCP\IRequest::USER_AGENT_CLIENT_ANDROID instead
|
* @deprecated use \OCP\IRequest::USER_AGENT_CLIENT_ANDROID instead
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -76,7 +76,7 @@ interface IRequest {
|
||||||
/**
|
/**
|
||||||
* @since 9.1.0
|
* @since 9.1.0
|
||||||
*/
|
*/
|
||||||
const USER_AGENT_CLIENT_IOS = '/^Mozilla\/5\.0 \(iOS\) ownCloud\-iOS.*$/';
|
const USER_AGENT_CLIENT_IOS = '/^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $name
|
* @param string $name
|
||||||
|
|
|
@ -131,7 +131,7 @@
|
||||||
androidChrome: /Android.*(?:; (.*) Build\/).*Chrome\/(\d+)[0-9.]+/,
|
androidChrome: /Android.*(?:; (.*) Build\/).*Chrome\/(\d+)[0-9.]+/,
|
||||||
iphone: / *CPU +iPhone +OS +([0-9]+)_(?:[0-9_])+ +like +Mac +OS +X */,
|
iphone: / *CPU +iPhone +OS +([0-9]+)_(?:[0-9_])+ +like +Mac +OS +X */,
|
||||||
ipad: /\(iPad\; *CPU +OS +([0-9]+)_(?:[0-9_])+ +like +Mac +OS +X */,
|
ipad: /\(iPad\; *CPU +OS +([0-9]+)_(?:[0-9_])+ +like +Mac +OS +X */,
|
||||||
iosClient: /^Mozilla\/5\.0 \(iOS\) ownCloud\-iOS.*$/,
|
iosClient: /^Mozilla\/5\.0 \(iOS\) (ownCloud|Nextcloud)\-iOS.*$/,
|
||||||
androidClient:/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/,
|
androidClient:/^Mozilla\/5\.0 \(Android\) ownCloud\-android.*$/,
|
||||||
// DAVdroid/1.2 (2016/07/03; dav4android; okhttp3) Android/6.0.1
|
// DAVdroid/1.2 (2016/07/03; dav4android; okhttp3) Android/6.0.1
|
||||||
davDroid: /DAVdroid\/([0-9.]+)/,
|
davDroid: /DAVdroid\/([0-9.]+)/,
|
||||||
|
|
Loading…
Reference in New Issue