Skip to content
Snippets Groups Projects
Commit 4d85e9a6 authored by Olav Morken's avatar Olav Morken
Browse files

Auth_Simple: Add login()-function.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@1998 44740490-163a-0410-bde0-09ae8108e29a
parent 9a6ff53b
No related branches found
No related tags found
No related merge requests found
...@@ -54,11 +54,7 @@ class SimpleSAML_Auth_Simple { ...@@ -54,11 +54,7 @@ class SimpleSAML_Auth_Simple {
* current page. * current page.
* *
* This function accepts an array $params, which controls some parts of * This function accepts an array $params, which controls some parts of
* the authentication. The accepted parameters depends on the authentication * the authentication. See the login()-function for a description.
* source being used. Some parameters are generic:
* - 'KeepPost': If the current request is a POST request, keep the POST
* data until after the authentication.
* - 'ReturnTo': The URL the user should be returned to after authentication.
* *
* @param array $params Various options to the authentication request. * @param array $params Various options to the authentication request.
*/ */
...@@ -71,6 +67,26 @@ class SimpleSAML_Auth_Simple { ...@@ -71,6 +67,26 @@ class SimpleSAML_Auth_Simple {
return; return;
} }
$this->login($params);
}
/**
* Start an authentication process.
*
* This function never returns.
*
* This function accepts an array $params, which controls some parts of
* the authentication. The accepted parameters depends on the authentication
* source being used. Some parameters are generic:
* - 'KeepPost': If the current request is a POST request, keep the POST
* data until after the authentication.
* - 'ReturnTo': The URL the user should be returned to after authentication.
*
* @param array $params Various options to the authentication request.
*/
public function login(array $params = array()) {
if (array_key_exists('KeepPost', $params)) { if (array_key_exists('KeepPost', $params)) {
$keepPost = (bool)$params['KeepPost']; $keepPost = (bool)$params['KeepPost'];
} else { } else {
...@@ -96,6 +112,7 @@ class SimpleSAML_Auth_Simple { ...@@ -96,6 +112,7 @@ class SimpleSAML_Auth_Simple {
$params[SimpleSAML_Auth_State::RESTART] = $restartURL; $params[SimpleSAML_Auth_State::RESTART] = $restartURL;
SimpleSAML_Auth_Default::initLogin($this->authSource, $returnTo, NULL, $params); SimpleSAML_Auth_Default::initLogin($this->authSource, $returnTo, NULL, $params);
assert('FALSE');
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment