diff options
| author | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-17 02:19:27 +0200 |
|---|---|---|
| committer | George Halkiadakis <gchalkiadakis@sklavenitis.co.gr> | 2023-03-17 02:19:27 +0200 |
| commit | 26229c110fb92646b36c7b2f48ac7518fd3810a5 (patch) | |
| tree | 72b2f2e0e0c789853ceb815fd5b513ad31672cac /core/classes/Request.php | |
| parent | 1e438654005bd408447dc19c8a96099d228bb1aa (diff) | |
| download | classroom-26229c110fb92646b36c7b2f48ac7518fd3810a5.tar.gz classroom-26229c110fb92646b36c7b2f48ac7518fd3810a5.tar.bz2 classroom-26229c110fb92646b36c7b2f48ac7518fd3810a5.zip | |
set algorithns for user authentication and authorization
Diffstat (limited to 'core/classes/Request.php')
| -rw-r--r-- | core/classes/Request.php | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/core/classes/Request.php b/core/classes/Request.php index 20b82c7..6b82dc5 100644 --- a/core/classes/Request.php +++ b/core/classes/Request.php @@ -89,6 +89,59 @@ class Request // if SCRF-token is not valideted, serve 403 return $array; } + + + + + public function isAjax(): bool + { + // check headers 'XMLHttpRequest' == $this->headers->get('X-Requested-With'); + } + + + public function isSecure(): bool + { + // chech if HTTPS + } + + + public function hasSession(): bool + { + // chech if Session exist + } + + + /** + * Get the user making the request. + * + * @param string|null $guard + * @return mixed + */ + public function user($guard = null) + { + // return call_user_func($this->getUserResolver(), $guard); + } + + public function getUserResolver() + { + // return $this->userResolver ?: function () { + // + // }; + } + + /** + * Set the user resolver callback. + * + * @param \Closure $callback + * @return $this + */ + public function setUserResolver(Closure $callback) + { + // $this->userResolver = $callback; + // return $this; + } + + } |
