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:
2014-09-16 11:40:27 +00:00
parent 3cd475a0d9
commit 6d8a210beb

View File

@@ -11,22 +11,24 @@ class auth
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="")
public function pageHTML ($baseURL, $message="", $url="")
{
$res = "";
$res .= "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"";
$res .= " \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
$res .= "<html>\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 .= " />\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 type='text/javascript' src='public/js/bootstrap.js'>";
$res .= "<script type='text/javascript' src='$baseURL".
"/public/js/bootstrap.js'>";
$res .= "</script>\n";
$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 .= "body { padding-top: 40px; padding-bottom: 40px;";
$res .= " background-color: #eee; }\n";
@@ -49,7 +51,12 @@ class auth
$res .= " <body>\n";
$res .= "<div class='container'>\n";
$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",
"Please sign in");
$res .= "</h2>\n";
@@ -117,4 +124,10 @@ class auth
throw new exception (dgettext("domframework",
"No List User available"), 405);
}
public function logout ()
{
throw new exception (dgettext("domframework",
"No logout method available"), 405);
}
}