Initial version, with no update possibility

This commit is contained in:
Gergely Polonkai (W00d5t0ck)
2010-12-17 15:41:45 +01:00
commit 7c6ed627cc
27 changed files with 1318 additions and 0 deletions

54
templates/cpw.tpl Normal file
View File

@@ -0,0 +1,54 @@
{include file="head.tpl" title="Change Password"}
{if $errno == 1}
<div class="error">
The new passwords you typed in does not match.
</div>
{elseif $errno == 2}
<div class="error">
The old password you typed in is incorrect.
</div>
{elseif $errno == 3}
<div class="error">
The new password you typed in is too weak. It must contain small and capital letters, and numbers.
</div>
{elseif $errno == 4}
<div class="error">
No such username. How can this be???
</div>
{elseif $errno == 5}
<div class="error">
You did not provide a new password!
</div>
{elseif $errno == 254}
<div class="error">
Something weird happened on server side.
</div>
{elseif $errno == 255}
<div class="error">
The new password could not be saved due to a database error.
</div>
{elseif $errno == 0}
<div class="info">
Password successfully changed.
</div>
{/if}
<form method="post">
<table>
<tr>
<td>Old password:</td>
<td><input type="password" name="oldpw" /></td>
</tr>
<tr>
<td>New password:</td>
<td><input type="password" name="newpw1" /></td>
</tr>
<tr>
<td>Retype new password:</td>
<td><input type="password" name="newpw2" /></td>
</tr>
<tr>
<td colspan="2"><input type="submit" value="Save" /></td>
</tr>
</table>
</form>
{include file="foot.tpl"}

3
templates/foot.tpl Normal file
View File

@@ -0,0 +1,3 @@
</body>
</html>

25
templates/head.tpl Normal file
View File

@@ -0,0 +1,25 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Password Store - {$title}</title>
{if ($needjquery == 1)}
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/jquery.tooltip.min.js"></script>
<script type="text/javascript" src="js/search.js"></script>
<script type="text/javascript" src="js/pws.js"></script>
<link rel="stylesheet" type="text/css" href="style/tooltip.css" media="screen" />
{/if}
{if $login}
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/login.js"></script>
{/if}
<link rel="stylesheet" type="text/css" href="style/pws.css" media="screen" />
</head>
<body>
<div id="flashbox"></div>
<h1>Password Store - {$title}</h1>
{if !$login}
<p style="text-align: right;">Logged in as{if $isadmin} administrator{/if} <span id="username">[{$username}]</span>. [<a href="index.php">Search</a>] [<a href="cpw.php">Change password</a>] [<a href="logout.php">Logout</a>]</p>
{/if}

21
templates/login.tpl Normal file
View File

@@ -0,0 +1,21 @@
{include file="head.tpl" title="Login" login=1}
{if ($loginerror == true)}
<div class="error">
Bad username or password. Please try again. Please also note, that this try was logged.
</div>
{/if}
<div id="content">
<form method="post" action="{$self}">
<input type="hidden" name="redirect" value="{$redirect}" />
<p>
<label class="formlabel" for="username">Username:</label><br />
<input type="text" name="username" id="username" value="{$user}" /><br />
</p>
<p>
<label class="formlabel" for="password">Password:</label><br />
<input type="password" name="password" id="password" value="" /><br />
</p>
<input type="submit" class="submit" value="Login" />
</form>
</div>
{include file="foot.tpl"}

31
templates/search.tpl Normal file
View File

@@ -0,0 +1,31 @@
{include file="head.tpl" title="Search" needjquery=1}
<h2>Search</h2>
<div id="error"></div>
<input type="text" id="query" name="query" /><input type="button" id="clearsearch" value="" class="submit" />
<div id="results"></div>
<div id="info"></div>
<div id="passwordgroups">
<h2>Accessible password groups</h2>
{foreach $passwordgroups as $passwordgroup=>$permissions}
{if $permissions@first}
<ul>
{/if}
<li>
<span class="pwgname" id="pwgname_{$passwordgroup}">{$passwordgroup}</span>{if ($permissions == 'rw') || ($isadmin)} [Add password]{/if}
</li>
{if $permissions@last}
{if $isadmin}
<li id="addnewgroup">Create new group</li>
{/if}
</ul>
{/if}
{/foreach}
</div>
<div id="passwords">
<h2>Passwords in group <span id="openedgroupname"></span></h2>
<div id="passwordlist">
</div>
<span id="showpasswordgroups" class="button">Back to password groups</span>
</div>
<div id="passwordinfo"></div>
{include file="foot.tpl"}