Automatic pass to convert with php-cs-fixer
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
<?php
|
||||
|
||||
/** DomFramework
|
||||
* @package domframework
|
||||
* @author Dominique Fournier <dominique@fournier38.fr>
|
||||
* @license BSD
|
||||
*/
|
||||
/**
|
||||
* DomFramework
|
||||
* @package domframework
|
||||
* @author Dominique Fournier <dominique@fournier38.fr>
|
||||
* @license BSD
|
||||
*/
|
||||
|
||||
namespace Domframework;
|
||||
|
||||
/** User authentication against SESSION */
|
||||
/**
|
||||
* User authentication against SESSION
|
||||
*/
|
||||
class Authsession extends Auth
|
||||
{
|
||||
/** Check if there is already a session or the user can not be authenticated
|
||||
/**
|
||||
* Check if there is already a session or the user can not be authenticated
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
@@ -20,16 +24,19 @@ class Authsession extends Auth
|
||||
}
|
||||
}
|
||||
|
||||
/** No connection to session */
|
||||
/**
|
||||
* No connection to session
|
||||
*/
|
||||
public function connect()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/** Try to authenticate the email/password of the user
|
||||
* @param string $email Email to authenticate
|
||||
* @param string $password Password to authenticate
|
||||
*/
|
||||
/**
|
||||
* Try to authenticate the email/password of the user
|
||||
* @param string $email Email to authenticate
|
||||
* @param string $password Password to authenticate
|
||||
*/
|
||||
public function authentication($email, $password)
|
||||
{
|
||||
if (
|
||||
@@ -46,24 +53,27 @@ class Authsession extends Auth
|
||||
}
|
||||
}
|
||||
|
||||
/** Return all the parameters recorded for the authenticate user */
|
||||
/**
|
||||
* Return all the parameters recorded for the authenticate user
|
||||
*/
|
||||
public function getdetails()
|
||||
{
|
||||
if (! isset($_SESSION["domframework"]["auth"]["email"])) {
|
||||
return array("lastname" => "anonymous",
|
||||
return ["lastname" => "anonymous",
|
||||
"firstname" => "",
|
||||
"email" => "anonymous");
|
||||
"email" => "anonymous"];
|
||||
}
|
||||
return array("lastname" => $_SESSION["domframework"]["auth"]["lastname"],
|
||||
return ["lastname" => $_SESSION["domframework"]["auth"]["lastname"],
|
||||
"firstname" => $_SESSION["domframework"]["auth"]["firstname"],
|
||||
"email" => $_SESSION["domframework"]["auth"]["email"]);
|
||||
"email" => $_SESSION["domframework"]["auth"]["email"]];
|
||||
}
|
||||
|
||||
/** Method to change the password : unavailable in SESSION auth
|
||||
* @param string $oldpassword The old password (to check if the user have the
|
||||
* rights to change the password)
|
||||
* @param string $newpassword The new password to be recorded
|
||||
*/
|
||||
/**
|
||||
* Method to change the password : unavailable in SESSION auth
|
||||
* @param string $oldpassword The old password (to check if the user have the
|
||||
* rights to change the password)
|
||||
* @param string $newpassword The new password to be recorded
|
||||
*/
|
||||
public function changepassword($oldpassword, $newpassword)
|
||||
{
|
||||
throw new \Exception(
|
||||
@@ -75,12 +85,13 @@ class Authsession extends Auth
|
||||
);
|
||||
}
|
||||
|
||||
/** Method to overwrite the password (without oldpassword check)
|
||||
* Must be reserved to the administrators. For the users, use changepassword
|
||||
* method
|
||||
* @param string $email the user identifier to select
|
||||
* @param string $newpassword The new password to be recorded
|
||||
*/
|
||||
/**
|
||||
* Method to overwrite the password (without oldpassword check)
|
||||
* Must be reserved to the administrators. For the users, use changepassword
|
||||
* method
|
||||
* @param string $email the user identifier to select
|
||||
* @param string $newpassword The new password to be recorded
|
||||
*/
|
||||
public function overwritepassword($email, $newpassword)
|
||||
{
|
||||
throw new \Exception(
|
||||
@@ -92,23 +103,26 @@ class Authsession extends Auth
|
||||
);
|
||||
}
|
||||
|
||||
/** Save the data in session
|
||||
* @param string $email The email to store in the session
|
||||
* @param string $password The password to store in the session
|
||||
* @param string $lastname The lastname to store in the session
|
||||
* @param string $firstname The firstname to store in the session
|
||||
* @deprecated 0.23 */
|
||||
/**
|
||||
* Save the data in session
|
||||
* @param string $email The email to store in the session
|
||||
* @param string $password The password to store in the session
|
||||
* @param string $lastname The lastname to store in the session
|
||||
* @param string $firstname The firstname to store in the session
|
||||
* @deprecated 0.23
|
||||
*/
|
||||
public function savedatas($email, $password, $lastname, $firstname)
|
||||
{
|
||||
return $this->savedata($email, $password, $lastname, $firstname);
|
||||
}
|
||||
|
||||
/** Save the data in session
|
||||
* @param string $email The email to store in the session
|
||||
* @param string $password The password to store in the session
|
||||
* @param string $lastname The lastname to store in the session
|
||||
* @param string $firstname The firstname to store in the session
|
||||
*/
|
||||
/**
|
||||
* Save the data in session
|
||||
* @param string $email The email to store in the session
|
||||
* @param string $password The password to store in the session
|
||||
* @param string $lastname The lastname to store in the session
|
||||
* @param string $firstname The firstname to store in the session
|
||||
*/
|
||||
public function savedata($email, $password, $lastname, $firstname)
|
||||
{
|
||||
$_SESSION["domframework"]["auth"]["lastname"] = $lastname;
|
||||
@@ -117,7 +131,9 @@ class Authsession extends Auth
|
||||
$_SESSION["domframework"]["auth"]["password"] = $password;
|
||||
}
|
||||
|
||||
/** Remove the information from the session */
|
||||
/**
|
||||
* Remove the information from the session
|
||||
*/
|
||||
public function logout()
|
||||
{
|
||||
if (isset($_SESSION["domframework"]["auth"]["lastname"])) {
|
||||
|
||||
Reference in New Issue
Block a user