Skip to content

Commit

Permalink
Initial commit for form-based login and authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
jimi-c committed Mar 26, 2011
1 parent be4fc80 commit 07b5da0
Show file tree
Hide file tree
Showing 6 changed files with 194 additions and 154 deletions.
35 changes: 35 additions & 0 deletions web/cobbler_web/templates/login.tmpl
@@ -0,0 +1,35 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xml:lang="en" lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>{% block title %}Cobbler Web Interface{% endblock %}</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script src="/cobbler_webui_content/cobbler.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" media="all" href="/cobbler_webui_content/style.css" />
</head>
<body>
<div>
<a href="/cobbler_web/"><img alt="Cobbler Logo" width="185" src="/cobbler_webui_content/logo-cobbler.png"/></a>
</div>
<div id="login">
{% if form.errors %}
<p class="error">Sorry, that's not a valid username or password</p>
{% endif %}
<form action="/cobbler_web/do_login" method="post">
<fieldset>
{% if next %}<input type="hidden" name="next" value="{{ next|escape }}" />{% endif %}
<div id="username">
<label for="username">Username: </label>
<input type="text" name="username" value="" id="username">
</div>
<div id="password">
<label for="password">Password: </label>
<input type="password" name="password" value="" id="password">
</div>
<div id="button">
<input type="submit" value="login" />
</div>
</fieldset>
</form>
</div>
</body>
</html>
3 changes: 2 additions & 1 deletion web/cobbler_web/templates/master.tmpl
Expand Up @@ -68,7 +68,8 @@ $(document).ready(function()
<li><a href="/cobbler_web/hardlink">Hardlink</a> ☼ </li>
<!-- <li><a href="/cobbler_web/replicate">Replicate</a> ☼ </li> -->
<li><a href="/cobbler_web/buildiso">Build ISO</a> ☼ </li>
<li><a href="http://webchat.freenode.net?channels=#cobbler">Online Help Chat</A>
<li><a href="http://webchat.freenode.net?channels=#cobbler">Online Help Chat</a>
<li><a href="/cobbler_web/logout">Logout</a>
</ul>
</fieldset>
{% include "paginate.tmpl" %}
Expand Down
4 changes: 4 additions & 0 deletions web/cobbler_web/urls.py
Expand Up @@ -44,4 +44,8 @@
(r'^import/run$', import_run),
(r'^buildiso$', buildiso),
(r'^check$', check),

(r'^login$', login),
(r'^do_login$', do_login),
(r'^logout$', do_logout),
)

0 comments on commit 07b5da0

Please sign in to comment.