DomCi : update the parameters definitions
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3280 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -23,33 +23,39 @@ class authentication
|
||||
|
||||
/** Number of authentication maximum by minute */
|
||||
public $ratelimitAuth = 3;
|
||||
|
||||
/** Directory to store the ratelimit files */
|
||||
public $ratelimitDir = "/tmp";
|
||||
|
||||
/** The rest authentication methods. Can be http, session, post.
|
||||
Attention : session case = CSRF ! */
|
||||
* Attention : session case = CSRF !
|
||||
*/
|
||||
public $restMethods = array ("http");
|
||||
|
||||
/** The html authentication methods. Can be http, session, post
|
||||
* The "post" is already used when using verifAuthLoginPage method (usually
|
||||
* only in authentication page)
|
||||
*/
|
||||
public $htmlMethods = array ("session");
|
||||
|
||||
/** The authentication methods. Can be ldap, sympa...*/
|
||||
public $authMethods = array ();
|
||||
|
||||
/** The authentication servers configuration
|
||||
array ("authXXXX"=>array (
|
||||
array ("ldapserver"=>"ldaps://annuaire.grenoble.cnrs.fr",
|
||||
"ldapport"=>636,
|
||||
"ldaptimeout"=>5,
|
||||
"ldapauth"=>"uid=annuaire,ou=people,dc=grenoble,dc=cnrs,dc=fr",
|
||||
"ldappwd"=>";authANNUAIRE2013",
|
||||
"ldapbase"=>"",
|
||||
"ldapfilter"=>"(mail=%s)",
|
||||
"ldapfield"=>"mail",
|
||||
"ldapfiltersearch"=>"(objectClass=inetOrgPerson)"
|
||||
),
|
||||
),
|
||||
);*/
|
||||
* array ("authXXXX"=>array (
|
||||
* array ("ldapserver"=>"ldaps://annuaire.grenoble.cnrs.fr",
|
||||
* "ldapport"=>636,
|
||||
* "ldaptimeout"=>5,
|
||||
* "ldapauth"=>"uid=annuaire,ou=people,dc=grenoble,dc=cnrs,dc=fr",
|
||||
* "ldappwd"=>";authANNUAIRE2013",
|
||||
* "ldapbase"=>"",
|
||||
* "ldapfilter"=>"(mail=%s)",
|
||||
* "ldapfield"=>"mail",
|
||||
* "ldapfiltersearch"=>"(objectClass=inetOrgPerson)"
|
||||
* ),
|
||||
* ),
|
||||
* );
|
||||
*/
|
||||
public $authServers = array ();
|
||||
|
||||
/** The application Name displayed on authentication page */
|
||||
@@ -58,6 +64,9 @@ class authentication
|
||||
/** The class and method to use to log the errors */
|
||||
public $loggingFunc;
|
||||
|
||||
/** The constructor
|
||||
* @param object $route The route object
|
||||
*/
|
||||
public function __construct ($route)
|
||||
{
|
||||
$this->route = $route;
|
||||
@@ -69,7 +78,8 @@ class authentication
|
||||
return $this->email;
|
||||
}*/
|
||||
|
||||
/** Disconnect the user */
|
||||
/** Disconnect the user
|
||||
*/
|
||||
public function logout ()
|
||||
{
|
||||
if ($this->debug) echo "<pre>LOGOUT\n";
|
||||
@@ -88,7 +98,10 @@ class authentication
|
||||
$this->route->redirect ("/authentication", "");
|
||||
}
|
||||
|
||||
/** Display the login page */
|
||||
/** Display the login page
|
||||
* @param string|null $url The url to be redirected after a valid
|
||||
* authentication
|
||||
*/
|
||||
public function pageHTML ($url = "")
|
||||
{
|
||||
// If the user is already connected, redirect to the main page of the site
|
||||
@@ -108,7 +121,10 @@ class authentication
|
||||
$alreadyAuth);
|
||||
}
|
||||
|
||||
/** Check the authentication page */
|
||||
/** Check the authentication page
|
||||
* @param string|null $url The url to be redirected after a valid
|
||||
* authentication
|
||||
*/
|
||||
public function verifAuthLoginPage ($url = "")
|
||||
{
|
||||
// rate-limit the connections
|
||||
@@ -176,7 +192,8 @@ class authentication
|
||||
$this->route->redirect ("/$url", "");
|
||||
}
|
||||
|
||||
/** Check all the REST API */
|
||||
/** Check all the REST API
|
||||
*/
|
||||
public function verifAuthREST ()
|
||||
{
|
||||
if ($this->debug)
|
||||
@@ -201,7 +218,8 @@ class authentication
|
||||
return $res;
|
||||
}
|
||||
|
||||
/** Check all the others pages of the site */
|
||||
/** Check all the others pages of the site
|
||||
*/
|
||||
public function verifAuthHTML ()
|
||||
{
|
||||
if ($this->debug)
|
||||
@@ -234,10 +252,13 @@ class authentication
|
||||
}
|
||||
|
||||
/** Do the real authentication process on all the providers defined in the
|
||||
properties of the class.
|
||||
@return an array containing the user data if the authentication is
|
||||
correct,
|
||||
an exception if noting is found */
|
||||
* properties of the class.
|
||||
* @param string $email The email to check
|
||||
* @param string $password The password to check
|
||||
* @return an array containing the user data if the authentication is
|
||||
* correct,
|
||||
* an exception if noting is found
|
||||
*/
|
||||
private function verifAuth ($email, $password)
|
||||
{
|
||||
if ($this->debug)
|
||||
@@ -350,6 +371,8 @@ class authentication
|
||||
|
||||
/** The default method to display the error messages.
|
||||
* Do not display the debug messages, and write the errors on screen
|
||||
* @param integer $priority The priority of the message
|
||||
* @param string $message The message to log
|
||||
*/
|
||||
private function logging ($priority, $message)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user