Backing up laptop, committing all unsaved changes
This commit is contained in:
@@ -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.
|
<IfModule mod_rewrite.c>
|
||||||
php_flag magic_quotes_gpc off
|
|
||||||
|
|
||||||
# Enable mod_rewrite for pretty urls
|
# Enable mod_rewrite for pretty urls
|
||||||
RewriteEngine on
|
RewriteEngine on
|
||||||
|
|||||||
@@ -1,60 +1,60 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* IAuthenticator
|
* IAuthenticator
|
||||||
* Interface for authentication classes
|
* Interface for authentication classes
|
||||||
*/
|
*/
|
||||||
|
|
||||||
interface IAuthenticator {
|
interface IAuthenticator {
|
||||||
|
|
||||||
// Do any module-specific initialisation
|
// Do any module-specific initialisation
|
||||||
public function initialise();
|
public function initialise();
|
||||||
// Shutdown the module cleanly when finished
|
// Shutdown the module cleanly when finished
|
||||||
public function uninitialise();
|
public function uninitialise();
|
||||||
|
|
||||||
// Identifies whether a user with a given name exists
|
// Identifies whether a user with a given name exists
|
||||||
public function user_exists( $username );
|
public function user_exists( $username );
|
||||||
// Checks a given username and password
|
// Checks a given username and password
|
||||||
public function authenticate( $username, $password );
|
public function authenticate( $username, $password );
|
||||||
|
|
||||||
// Does translation between a username and full name
|
// Does translation between a username and full name
|
||||||
public function username2fullname( $username );
|
public function username2fullname( $username );
|
||||||
// And vice versa
|
// And vice versa
|
||||||
public function fullname2username( $fullname );
|
public function fullname2username( $fullname );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* IAuthenticatorFactory
|
* IAuthenticatorFactory
|
||||||
* Creates an instance of an Authenticator module, given its name
|
* Creates an instance of an Authenticator module, given its name
|
||||||
*/
|
*/
|
||||||
class IAuthenticatorFactory {
|
class IAuthenticatorFactory {
|
||||||
|
|
||||||
// Prevent any instances of this class being constructed
|
// Prevent any instances of this class being constructed
|
||||||
private function __construct() {
|
private function __construct() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function get( $module ) {
|
public static function get( $module ) {
|
||||||
global $_meta;
|
global $_meta;
|
||||||
|
|
||||||
// Get the filename and classnames for this module
|
// Get the filename and classnames for this module
|
||||||
$filename = "{$_meta['script-dir']}/code/auth_{$module}.php";
|
$filename = "{$_meta['script-dir']}/code/auth_{$module}.php";
|
||||||
$classname = "Authenticator_{$module}";
|
$classname = "Authenticator_{$module}";
|
||||||
|
|
||||||
// Check to make sure this module exists
|
// Check to make sure this module exists
|
||||||
if( !file_exists($filename) ) throw new ConfigException("Authentication module could not be found: '{$filename}.'", 500);
|
if( !file_exists($filename) ) throw new ConfigException("Authentication module could not be found: '{$filename}.'", 500);
|
||||||
|
|
||||||
// Import the auth modules code
|
// Import the auth modules code
|
||||||
require_once( $filename );
|
require_once( $filename );
|
||||||
|
|
||||||
// Ensure the class has been defined
|
// Ensure the class has been defined
|
||||||
if( !class_exists( $classname ) ) throw new ConfigException("Authentication module is invalid: '{$classname}'.", 500);
|
if( !class_exists( $classname ) ) throw new ConfigException("Authentication module is invalid: '{$classname}'.", 500);
|
||||||
|
|
||||||
// Create an instance of the module, and return it
|
// Create an instance of the module, and return it
|
||||||
return new $classname();
|
return new $classname();
|
||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@@ -8,3 +8,16 @@
|
|||||||
$_template['title'] = 'Home';
|
$_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>
|
||||||
@@ -24,7 +24,7 @@ div.sidebar {
|
|||||||
|
|
||||||
div.page {
|
div.page {
|
||||||
margin: 1em;
|
margin: 1em;
|
||||||
margin-left: 9em;
|
margin-left: 15em;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.footer {
|
div.footer {
|
||||||
@@ -79,6 +79,10 @@ div.quote blockquote {
|
|||||||
background-color: lightyellow;
|
background-color: lightyellow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
img.at {
|
||||||
|
height: 1em;
|
||||||
|
width: 1em;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Dialog boxes
|
Dialog boxes
|
||||||
@@ -131,3 +135,17 @@ p.loginform label {
|
|||||||
p.loginform input {
|
p.loginform input {
|
||||||
float: right;
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
Homepage
|
||||||
|
*/
|
||||||
|
|
||||||
|
img.bio {
|
||||||
|
display: block;
|
||||||
|
margin-left: auto;
|
||||||
|
margin-right: auto;
|
||||||
|
|
||||||
|
border: 1px solid grey;
|
||||||
|
padding: 0.2em;
|
||||||
|
}
|
||||||
@@ -13,6 +13,7 @@
|
|||||||
<head>
|
<head>
|
||||||
<title><?php echo $_template['title']; ?></title>
|
<title><?php echo $_template['title']; ?></title>
|
||||||
<link rel="stylesheet" type="text/css" href="<?php echo $_meta['base-dir']; ?>/resources/normal.css" />
|
<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
|
<?php
|
||||||
// If we have a redirection, implement a meta refresh here
|
// If we have a redirection, implement a meta refresh here
|
||||||
if( $_template['redirect-to'] ) {
|
if( $_template['redirect-to'] ) {
|
||||||
@@ -36,7 +37,7 @@
|
|||||||
<strong>Navigation</strong>
|
<strong>Navigation</strong>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="<?php echo $_req->construct('page','home'); ?>" title="Homepage">Home</a></li>
|
<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() ) { ?>
|
<?php if( $_session->is_logged_in() ) { ?>
|
||||||
<li><a href="<?php echo $_req->construct('page','logout'); ?>" title="Logout">Logout</a></li>
|
<li><a href="<?php echo $_req->construct('page','logout'); ?>" title="Logout">Logout</a></li>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|||||||
10
test.php
10
test.php
@@ -36,4 +36,14 @@
|
|||||||
echo '</pre>';
|
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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user