Changeset View
Changeset View
Standalone View
Standalone View
src/app/Http/Controllers/API/V4/NGINXController.php
Show First 20 Lines • Show All 185 Lines • ▼ Show 20 Lines | public function authenticate(Request $request) | ||||
); | ); | ||||
} catch (\Exception $e) { | } catch (\Exception $e) { | ||||
return $this->byebye($request, $e->getMessage()); | return $this->byebye($request, $e->getMessage()); | ||||
} | } | ||||
// All checks passed | // All checks passed | ||||
switch ($request->headers->get('Auth-Protocol')) { | switch ($request->headers->get('Auth-Protocol')) { | ||||
case "imap": | case "imap": | ||||
return $this->authenticateIMAP($request, $user->getSetting('guam_enabled', false), $password); | return $this->authenticateIMAP($request, (bool) $user->getSetting('guam_enabled'), $password); | ||||
case "smtp": | case "smtp": | ||||
return $this->authenticateSMTP($request, $password); | return $this->authenticateSMTP($request, $password); | ||||
default: | default: | ||||
return $this->byebye($request, "unknown protocol in request"); | return $this->byebye($request, "unknown protocol in request"); | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
▲ Show 20 Lines • Show All 71 Lines • Show Last 20 Lines |