80 : bool
81 {
83
84 $cached = $this->file_cache->isAuthenticated($a_username, $a_password);
85 if ($cached !== null) {
86 $this->
logger->info(
'WEBDAV: User authenticated through cache. UserID = ' . $cached);
87 $DIC->user()->setId($cached);
89 return true;
90 }
92 if ($this->session->isAuthenticated()
93 && $this->user->getId() !== 0
95 $this->
logger->debug(
'User authenticated through session. UserID = ' . $this->
user->getId());
96 return true;
97 }
98 } else {
100 }
101
103 $credentials->setUsername($a_username);
104 $credentials->setPassword($a_password);
105
107 $providers = $provider_factory->getProviders($credentials);
108
110
113 $frontend = $frontend_factory->getFrontend(
114 $this->session,
115 $status,
116 $credentials,
117 $providers
118 );
119
120 $frontend->authenticate();
121
122 switch ($status->getStatus()) {
125 'User authenticated through basic authentication. UserId = ' . $this->
user->getId()
126 );
127
128 $this->file_cache->setAuthenticated($a_username, $a_password, (
int)
$DIC->user()->getId());
129 return true;
130
132 $this->
logger->info(
'Basic authentication failed; Account migration required.');
133 return false;
134
136 $this->
logger->info(
'Basic authentication failed; Wrong login, password.');
137 return false;
138 }
139
140 return false;
141 }
isUserAgentSessionAware(string $user_agent)
const int STATUS_AUTHENTICATION_FAILED
const int STATUS_ACCOUNT_MIGRATION_REQUIRED
const int STATUS_AUTHENTICATED
static getInstance()
Get status instance.
static enableWebAccessWithoutSession(bool $enable_web_access_without_session)