Location: PHPKode > projects > Philosopher'Stone Personal > pssp/walshow.php
<?php

// Copyright (c) 2010 by Paul M. Foster <hide@address.com>
// Licensed under PostgreSQL License (see LICENSE file)

include('setup.php');

allowed(127, 5);

$record = get_or_post('record', 'OH YEAH, YOU SO SMART! You must select a wallet record first', 'walsel.php');

if (!$session->bfpasswd) {
	emsg('You must supply a password first.');
	redirect('walsel.php');
}

/* ***** FIELDS TO BE VALIDATED ***** */


/* ***** CLASS REGISTRATION ***** */

$sc->register('tmcrypt', array('class' => 'tmcrypt', 'shared' => true));
$sc->register('pwfile', array('class' => 'pwfile', 'shared' => true));

/* ***** INSTANTIATE CLASSES HERE ***** */

$app_navs = $sc->appnavs;
$pwf = $sc->pwfile;

/* ***** VALIDATE USER DATA ***** */

if (isset($_POST['edit']) && $_POST['edit'] == 'Edit') {
	redirect('waledt.php?record=' . $record);
}
elseif (isset($_POST['delete']) && $_POST['delete'] == 'Delete') {
	redirect("waldel.php?record=$record");
}
else {
	$item = $pwf->get_record($record);
}



/* ***** PAGE SETUP ***** */

$meta['app_navs'] = $app_navs->get();
$meta['mod_navs'] = array(
	array('url' => 'waladd.php', 'txt' => 'Add Entry'),
	array('url' => 'walsel.php', 'txt' => 'Select Record'),
	array('url' => 'waldump.php', 'txt' => 'Dump Cleartext'),
	array('url' => 'walencr.php', 'txt' => 'Encrypt File'),
	array('url' => 'walndx.php', 'txt' => 'Master Password')
);
$meta['file_mtime'] = date("d F Y H:i:s", filemtime($_SERVER['SCRIPT_FILENAME']));
$meta['return_url'] = 'walshow.php';
$meta['app_title'] = 'Wallet';
$meta['page_title'] = 'Show Record';
$meta['view_file'] = fullpath('view', 'walshow');

include('generic.php');
Return current item: Philosopher'Stone Personal