Browse Source

filter function added. new layout of header

master v1.1
Rolf Brugger 14 years ago
parent
commit
2ddb933fa4
  1. BIN
      img/go-arr.png
  2. 67
      index.php
  3. 55
      sv.css
  4. 2
      vault/simplevault.txt

BIN
img/go-arr.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

67
index.php

@ -20,28 +20,57 @@
################################################################
// ----------------------------------------------------------------------------------------
// *** Settings
$vaultdir = "vault";
$vaultfile = "simplevault.txt";
$cipher = 'rijndael-256';
// ----------------------------------------------------------------------------------------
$vaultdir = "vault";
$vaultfile = "simplevault.txt";
$cipher = 'rijndael-256';
// date format string as used by php function 'date'
//$dateformat = 'm.d.y G:i'; // "09.19.07 15:44"
//$dateformat = 'M jS Y g:ia'; // "Sep 19th 2007 3:44pm"
$dateformat = 'm-M-Y G:i'; // "09-Sep-2007 15:44"
// ----------------------------------------------------------------------------------------
// *** Constants - Do not change for an already existing vault!
// ----------------------------------------------------------------------------------------
$preamble = "svpwdmanag";
$nbfields = 10;
$nbencfields = 10;
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// *** Initializations
$vlt = explode("\n", file_get_contents("$vaultdir/$vaultfile"));
$cats = categories($vlt);
print "<p><a href='".basename($_SERVER["PHP_SELF"])."'><img src='img/logo.png' border='0'/></a></p>";
print "<p><a href='".basename($_SERVER["PHP_SELF"])."'><b>Home</b></a>";
print " &nbsp; &nbsp; Categories: &nbsp; ";
$myfname = basename($_SERVER["PHP_SELF"]);
print "<p class='logo'><a href='$myfname'><img src='img/logo.png' border='0' align='right'/></a></p>";
print "<br clear='all'/>";
print "<form name='deffilter' action='$myfname' method='post'>";
print "<div class='topbar'><span>";
print "<a href='$myfname'><b>Home</b></a>";
print " &nbsp; &nbsp; ";
print "<a href='$myfname?all=1'>all</a>";
print " &nbsp; &nbsp; ";
print "<input type='text' name='filter' value='".$_POST['filter']."' size ='7' id='inpfield'/>";
print "<input type='image' src='img/go-arr.png' name='image' width='10' height='11' title='run filter'>";
print "</span></div>";
print "<div class='catbar'><span>Categories: &nbsp; ";
foreach ($cats as $cat){print "<a href='?cat=$cat'>$cat</a> &nbsp; ";}
print "</p>";
print "</span></div>";
print "</form>";
@ -76,11 +105,12 @@ if(isset($_POST['entrysave'])){
// ----------------------------------------------------------------------------------------
// *** Show one entry
if ( isset($_POST['entrysave']) ){ $decrmode = "decrypt"; }
if ($_GET['dec'] or isset($_POST['entrydecrypt']) ){ $decrmode = "decrypt"; }
if ($_GET['del'] or isset($_POST['entrydelete'] ) ){ $decrmode = "delete"; }
if ($_GET['edt'] or isset($_POST['entryedit'] ) ){ $decrmode = "edit"; }
if(isset($decrmode) or isset($_POST['entrysave']) ) {
if(isset($decrmode)) {
// decrypt the specified entry
print "<h1>".ucfirst($decrmode)." Entry</h1>";
@ -130,10 +160,7 @@ if(isset($decrmode) or isset($_POST['entrysave']) ) {
}
}
else{
if (isset($decrmode)){
// show form for passphrase
decrypt_form($_REQUEST['cat'], $_REQUEST['t1'], $_REQUEST['t2'], $decrmode);
}
decrypt_form($_REQUEST['cat'], $_REQUEST['t1'], $_REQUEST['t2'], $decrmode);
}
}
@ -148,20 +175,18 @@ elseif(isset($_GET['new'])){
// *** Browse for existing entries
elseif(isset($_GET['cat'])){
elseif(isset($_GET['cat']) or isset($_GET['all']) or isset($_POST['filter'])){
print "<h1>Browse</h1>";
// show entries of this category
print "<table class='entry'>";
foreach ($vlt as $record){
$recfields = explode ("\t", $record, $nbfields);
if ($recfields[0] == $_GET['cat']){
print "<tr><td>".$recfields[0]."</td><td>".$recfields[1]."</td><td>".$recfields[2]."</td><td>".date("m.d.y G:i", $recfields[3])."</td>";
/*
print "<td><a href='?dec=1&cat=".$recfields[0]."&t1=".$recfields[1]."&t2=".$recfields[2]."'>decrypt</a></td>";
print "<td><a href='?edt=1&cat=".$recfields[0]."&t1=".$recfields[1]."&t2=".$recfields[2]."'>edit</a></td>";
print "<td><a href='?del=1&cat=".$recfields[0]."&t1=".$recfields[1]."&t2=".$recfields[2]."'>delete</a></td>";
*/
if ( (isset($_GET['all']))
or (isset($_GET['cat']) and $_GET['cat'] == $recfields[0])
or (isset($_POST['filter']) and strlen($_POST['filter'])>1 and strpos($record, $_POST['filter']) !== false )
){
print "<tr><td>".$recfields[0]."</td><td>".$recfields[1]."</td><td>".$recfields[2]."</td><td>".date($dateformat, $recfields[3])."</td>";
print "<td><a href='?dec=1&cat=".$recfields[0]."&t1=".$recfields[1]."&t2=".$recfields[2]."'><img src='img/decrypt.png' border='0' title='decrypt'></a></td>";
print "<td><a href='?edt=1&cat=".$recfields[0]."&t1=".$recfields[1]."&t2=".$recfields[2]."'><img src='img/edit.png' border='0' title='edit'></a></td>";
print "<td><a href='?del=1&cat=".$recfields[0]."&t1=".$recfields[1]."&t2=".$recfields[2]."'><img src='img/del.png' border='0' title='delete'></a></td>";

55
sv.css

@ -4,7 +4,7 @@ body {
font-size: 0.8em;
line-height: 1.4em;
padding-left : 4px;
padding-top : 10px;
padding-top : 0px;
}
/* Links general */
a {
@ -25,7 +25,53 @@ h1, h2, h3, h4 {
}
small {
font-size: 0.9em;
}
}
/* Logo, Header */
p.logo{
margin: 0px;
}
p.logo img{
border: 0px;
}
div.topbar{
background-color : #faf;
margin: 0px 0px 0px 0px;
padding: 3px 5px 2px 5px;
}
div.catbar{
background-color : #fcf;
margin: 0px 0px 0px 0px;
padding: 3px 5px 2px 5px;
}
div.topbar span{
padding: 4px;
}
div.catbar span{
padding: 4px;
}
div.topbar input{
vertical-align: middle;
padding-left: 4px;
padding-right: 4px;
}
div.topbar input#inpfield{
border: solid 1px silver;
font-family: sans-serif;
font-size: 90%
}
/* Tables */
td.mc{ /* middle centered */
text-align : center;
@ -41,9 +87,6 @@ td.mr{/* top right */
}
/* Tables */
table.raw{
font-size: 1em;
padding : 0px;
@ -98,7 +141,7 @@ span.info{
}
/* Forms */
/* Action-Button */

2
vault/simplevault.txt

@ -1,4 +1,4 @@
BbVista Blackboard devnet 1192897168 %7Dz8%BE4%D4%1E%A4%E1%3AK%C40%91%FBOq%FF%C6%23%C2%F3%2A%CF%915m%0D%28%AA%10S%A2%D65%979%B8%28%0B%05m%25%E1dty8%B3%7F%9E%8Ax%BA%D2s%DD%03%87%24%89%C74U
BbVista Blackboard devnet 1190719875 %C57%BD%DDF%CF%A9%5BK%40%23%F8%ED%1Ct%1C%3F%F6%8C%82%E936%88%9F%B3%9D%A8c%92%FA%5D6%9D%26%9E%5BzY%DD%AE%E9%4098Z6%14%FD%1E%11XT%01SA%1A%86%DEx%0C2%BDh
BbVista calanda host 1190241235 %1C%5B%8A%84%27%8C%AD%FCR%B4%A5%E2%EF%85%60%60%BD%AD%12%B7%81%F3A%3C%BF%0B%5E%F5b%CB%7F%A4
BbVista calanda oracle 1190241401 G%CFH%EE%85%A2%FA%8A%80N%C1%D8M%12%A6Yk%CA%BEc%C8%BF%8E%DB%D1%D3%16%F8o%AD%95%11%10Al%17%8Ei%D4%8E%29%B8%97%D0%7E%F3%88o_h%0C%C8%AA%21%00V%C3%F2%22%5B%1A%2C%18%BF
BbVista falknis host 1190241453 %8A_%EA%F1%81b%E8%82%CE%17%0EN%1F%2C%D2%0B%BAz%DB%E4%14%2B3%D1%B4M6%C2%15M%88%F1f%B8%A2s1%3E4%91fsu%A3%0D%14%C8%85Y%B6%C9%8E%D6e%0E%AC5%DC%CE%94d%13%7E%9C