*/
/** User authentication (abstract class) */
class auth
{
/** Display the authentication page
The message is displayed to the user in case of error
The url is the caller url to go back if authentication is correct
@param string|null $message Message to display to the user
@param string|null $url URL to go back after successful authentication */
public function pageHTML ($message="", $url="")
{
$res = "";
$res .= "\n";
$res .= "\n";
$res .= "
\n";
$res .= "Title \n";
$res .= " \n";
$res .= " \n";
$res .= " ";
$res .= " "._("Remember me");
$res .= " \n";
$res .= " \n";
if ($message !== "")
$res .= "$message
";
$res .= " \n";
$res .= "\n";
$res .= "\n";
$res .= "\n";
return $res;
}
/** Establish the connection to authentication server */
public function connect ()
{
throw new Exception (_("No connect to authentication available"), 405);
}
/** Check if the email and password are correct
Return TRUE if the authentication is correct
Return an exception if there is a problem
@param string $email Email to authenticate
@param string $password Password to authenticate */
public function authentication ($email, $password)
{
throw new exception (_("No authentication available"), 405);
}
/** Return all the parameters recorded for the authenticate user */
public function getdetails ()
{
throw new exception (_("No getdetails available"), 405);
}
/** Method to change the password
@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 (_("No password change available"), 405);
}
/** List all the users available in the database
Return firstname, lastname, mail, with mail is an array */
public function listusers ()
{
throw new exception (_("No List User available"), 405);
}
}