Added Initial Basic Auth Module

This commit is contained in:
jvelilla
2014-10-02 15:32:30 -03:00
parent 5525134148
commit a0cb7c0ecc
15 changed files with 372 additions and 11 deletions

View File

@@ -174,6 +174,12 @@ feature -- Filters
f.set_next (l_filter)
l_filter := f
-- Authentication
create {AUTHENTICATION_FILTER} f.make (roc_config)
f.set_next (l_filter)
l_filter := f
-- Logger Filter
create {LOGGER_FILTER} f.make (roc_config)
f.set_next (l_filter)
@@ -184,10 +190,6 @@ feature -- Filters
f.set_next (l_filter)
l_filter := f
-- Authentication
create {AUTHENTICATION_FILTER} f.make (roc_config)
f.set_next (l_filter)
l_filter := f
filter := l_filter
end

View File

@@ -52,6 +52,7 @@ feature -- HTTP Methods
if attached req.query_parameter ("prompt") as l_prompt then
(create {ROC_RESPONSE}.make(req,"")).new_response_unauthorized (req, res)
else
req.unset_execution_variable ("user")
(create {ROC_RESPONSE}.make(req,"master2/logoff.tpl")).new_response_denied (req, res)
end
end

View File

@@ -12,10 +12,10 @@
{if isset="$user"}
<li><a>{$user/}</a></li>
<li><a title="Node" href="{$host/}/node" rel="node">New Node</a></li>
<li><a title="Logoff" href="{$host/}/logoff" rel="logoff">Logoff</a></li>
<li><a title="Logoff" href="{$host/}/basic_auth/logoff" rel="logoff">Logoff</a></li>
{/if}
{unless isset="$user"}
<li><a title="Login" href="{$host/}/login" rel="login">Login</a></li>
<li><a title="Login" href="{$host/}/basic_auth/login" rel="login">Login</a></li>
<li><a title="Register" href="{$host/}/user" rel="register">Register</a></li>
{/unless}
</ul>