Backing up laptop, committing all unsaved changes

This commit is contained in:
2008-03-09 17:02:16 +00:00
parent 66ca16f8b0
commit 8447c7a41a
6 changed files with 104 additions and 62 deletions

View File

@@ -1,7 +1,7 @@
<IfModule mod_rewrite.c>
# Magic Quotes are the Root-of-all-Evil and must be burned at the stake.
php_flag magic_quotes_gpc off
# Magic Quotes are the Root-of-all-Evil and must be burned at the stake.
php_flag magic_quotes_gpc off
<IfModule mod_rewrite.c>
# Enable mod_rewrite for pretty urls
RewriteEngine on

View File

@@ -1,60 +1,60 @@
<?php
/*
* IAuthenticator
* Interface for authentication classes
*/
/*
* IAuthenticator
* Interface for authentication classes
*/
interface IAuthenticator {
interface IAuthenticator {
// Do any module-specific initialisation
public function initialise();
// Shutdown the module cleanly when finished
public function uninitialise();
// Do any module-specific initialisation
public function initialise();
// Shutdown the module cleanly when finished
public function uninitialise();
// Identifies whether a user with a given name exists
public function user_exists( $username );
// Checks a given username and password
public function authenticate( $username, $password );
// Identifies whether a user with a given name exists
public function user_exists( $username );
// Checks a given username and password
public function authenticate( $username, $password );
// Does translation between a username and full name
public function username2fullname( $username );
// And vice versa
public function fullname2username( $fullname );
// Does translation between a username and full name
public function username2fullname( $username );
// And vice versa
public function fullname2username( $fullname );
};
};
/*
* IAuthenticatorFactory
* Creates an instance of an Authenticator module, given its name
*/
class IAuthenticatorFactory {
/*
* IAuthenticatorFactory
* Creates an instance of an Authenticator module, given its name
*/
class IAuthenticatorFactory {
// Prevent any instances of this class being constructed
private function __construct() {
// Prevent any instances of this class being constructed
private function __construct() {
}
}
public static function get( $module ) {
global $_meta;
public static function get( $module ) {
global $_meta;
// Get the filename and classnames for this module
$filename = "{$_meta['script-dir']}/code/auth_{$module}.php";
$classname = "Authenticator_{$module}";
// Get the filename and classnames for this module
$filename = "{$_meta['script-dir']}/code/auth_{$module}.php";
$classname = "Authenticator_{$module}";
// Check to make sure this module exists
if( !file_exists($filename) ) throw new ConfigException("Authentication module could not be found: '{$filename}.'", 500);
// Check to make sure this module exists
if( !file_exists($filename) ) throw new ConfigException("Authentication module could not be found: '{$filename}.'", 500);
// Import the auth modules code
require_once( $filename );
// Import the auth modules code
require_once( $filename );
// Ensure the class has been defined
if( !class_exists( $classname ) ) throw new ConfigException("Authentication module is invalid: '{$classname}'.", 500);
// Ensure the class has been defined
if( !class_exists( $classname ) ) throw new ConfigException("Authentication module is invalid: '{$classname}'.", 500);
// Create an instance of the module, and return it
return new $classname();
// Create an instance of the module, and return it
return new $classname();
}
};
}
};
?>

View File

@@ -8,3 +8,16 @@
$_template['title'] = 'Home';
?>
<div>
<img class="bio" src="<?php echo $_meta['base-dir']; ?>/resources/bios_scott.jpg" alt="Me?" />
<p>
I am a third year student at ECS in Southampton, studying for a Masters degree in Computer Science (with Networks and Distributed Systems).
</p>
<p>
Here you can find a copy of my <a href="<?php echo $_req->construct('page','cv'); ?>" title="Curriculum Vitae">CV</a>,
or you can contact me via bar105<img class="at" src="<?php echo $_meta['base-dir']; ?>/resources/at.png" alt="@" />ecs.soton.ac.uk.
</p>
</div>

View File

@@ -24,7 +24,7 @@ div.sidebar {
div.page {
margin: 1em;
margin-left: 9em;
margin-left: 15em;
}
div.footer {
@@ -79,6 +79,10 @@ div.quote blockquote {
background-color: lightyellow;
}
img.at {
height: 1em;
width: 1em;
}
/*
Dialog boxes
@@ -131,3 +135,17 @@ p.loginform label {
p.loginform input {
float: right;
}
/*
Homepage
*/
img.bio {
display: block;
margin-left: auto;
margin-right: auto;
border: 1px solid grey;
padding: 0.2em;
}

View File

@@ -13,6 +13,7 @@
<head>
<title><?php echo $_template['title']; ?></title>
<link rel="stylesheet" type="text/css" href="<?php echo $_meta['base-dir']; ?>/resources/normal.css" />
<script language="javascript" type="text/javascript" src="<?php echo $_meta['base-dir']; ?>/resources/email.js" />
<?php
// If we have a redirection, implement a meta refresh here
if( $_template['redirect-to'] ) {
@@ -36,7 +37,7 @@
<strong>Navigation</strong>
<ul>
<li><a href="<?php echo $_req->construct('page','home'); ?>" title="Homepage">Home</a></li>
<li><a href="<?php echo $_req->construct('page','cv'); ?>" title="Curriculum Vitae">CV</a></li>
<li><a href="<?php echo $_req->construct('page','cv'); ?>" title="Curriculum Vitae">Curriculum Vitae</a></li>
<?php if( $_session->is_logged_in() ) { ?>
<li><a href="<?php echo $_req->construct('page','logout'); ?>" title="Logout">Logout</a></li>
<?php } ?>

View File

@@ -36,4 +36,14 @@
echo '</pre>';
}
if (isset($_GET['validate'])) {
require_once('code/validation/ivalidator.php');
try {
Validator::check('Value', $_GET['value'], IValidatorFactory::get('Range',5,32));
} catch (ValidationException $e) {
echo $e->getMessage();
}
}
?>