BUG : auth : Add the path to the default login window to load the javascript
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@1821 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
25
auth.php
25
auth.php
@@ -11,22 +11,24 @@ class auth
|
|||||||
The url is the caller url to go back if authentication is correct
|
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 $message Message to display to the user
|
||||||
@param string|null $url URL to go back after successful authentication */
|
@param string|null $url URL to go back after successful authentication */
|
||||||
public function pageHTML ($message="", $url="")
|
public function pageHTML ($baseURL, $message="", $url="")
|
||||||
{
|
{
|
||||||
$res = "";
|
$res = "";
|
||||||
$res .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"";
|
$res .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"";
|
||||||
$res .= " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
|
$res .= " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
|
||||||
$res .= "<html>\n";
|
$res .= "<html>\n";
|
||||||
$res .= "<head>\n";
|
$res .= "<head>\n";
|
||||||
$res .= "<title>Title</title>\n";
|
$res .= "<title>".dgettext("domframework", "Sign in")."</title>\n";
|
||||||
$res .= "<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'";
|
$res .= "<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'";
|
||||||
$res .= " />\n";
|
$res .= " />\n";
|
||||||
$res .= "<script src='public/js/jquery.min.js' type='text/javascript'>";
|
$res .= "<script type='text/javascript' src='$baseURL".
|
||||||
|
"/public/js/jquery.min.js'>";
|
||||||
$res .= "</script>\n";
|
$res .= "</script>\n";
|
||||||
$res .= "<script type='text/javascript' src='public/js/bootstrap.js'>";
|
$res .= "<script type='text/javascript' src='$baseURL".
|
||||||
|
"/public/js/bootstrap.js'>";
|
||||||
$res .= "</script>\n";
|
$res .= "</script>\n";
|
||||||
$res .= "<link type='text/css' rel='stylesheet' href='";
|
$res .= "<link type='text/css' rel='stylesheet' href='";
|
||||||
$res .= "public/css/bootstrap.css'/>\n";
|
$res .= "$baseURL/public/css/bootstrap.css'/>\n";
|
||||||
$res .= " <style type='text/css'>\n";
|
$res .= " <style type='text/css'>\n";
|
||||||
$res .= "body { padding-top: 40px; padding-bottom: 40px;";
|
$res .= "body { padding-top: 40px; padding-bottom: 40px;";
|
||||||
$res .= " background-color: #eee; }\n";
|
$res .= " background-color: #eee; }\n";
|
||||||
@@ -49,7 +51,12 @@ class auth
|
|||||||
$res .= " <body>\n";
|
$res .= " <body>\n";
|
||||||
$res .= "<div class='container'>\n";
|
$res .= "<div class='container'>\n";
|
||||||
$res .= " <form class='form-signin' role='form' method='post' ";
|
$res .= " <form class='form-signin' role='form' method='post' ";
|
||||||
$res .= "action='#'>\n";
|
$res .= "action='";
|
||||||
|
if ($url === "")
|
||||||
|
$res .= "#";
|
||||||
|
else
|
||||||
|
$res .= $baseURL."authentication/$url";
|
||||||
|
$res .= "'>\n";
|
||||||
$res .= " <h2 class='form-signin-heading'>".dgettext("domframework",
|
$res .= " <h2 class='form-signin-heading'>".dgettext("domframework",
|
||||||
"Please sign in");
|
"Please sign in");
|
||||||
$res .= "</h2>\n";
|
$res .= "</h2>\n";
|
||||||
@@ -117,4 +124,10 @@ class auth
|
|||||||
throw new exception (dgettext("domframework",
|
throw new exception (dgettext("domframework",
|
||||||
"No List User available"), 405);
|
"No List User available"), 405);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function logout ()
|
||||||
|
{
|
||||||
|
throw new exception (dgettext("domframework",
|
||||||
|
"No logout method available"), 405);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user