diff --git a/simpleid/.devcontainer/devcontainer.json b/simpleid/.devcontainer/devcontainer.json
new file mode 100644
index 0000000..ed14f03
--- /dev/null
+++ b/simpleid/.devcontainer/devcontainer.json
@@ -0,0 +1,24 @@
+// For format details, see https://aka.ms/devcontainer.json. For config options, see the
+// README at: https://github.com/devcontainers/templates/tree/main/src/php
+{
+	"name": "PHP",
+	// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
+	"image": "mcr.microsoft.com/devcontainers/php:7.4",
+
+	// Features to add to the dev container. More info: https://containers.dev/features.
+	// "features": {},
+
+	// Configure tool-specific properties.
+	// "customizations": {},
+
+	// Use 'forwardPorts' to make a list of ports inside the container available locally.
+	//"forwardPorts": [8080]
+
+	// Use 'postCreateCommand' to run commands after the container is created.
+	// "postCreateCommand": "sudo chmod a+x \"$(pwd)\" && sudo rm -rf /var/www/html && sudo ln -s \"$(pwd)\" /var/www/html"
+	"postCreateCommand": "sudo curl -sSLf -o /usr/local/bin/install-php-extensions https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions && sudo chmod +x /usr/local/bin/install-php-extensions && sudo PHP_INI_DIR=/usr/local/etc/php install-php-extensions bcmath"
+
+
+	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
+	// "remoteUser": "root"
+}
diff --git a/simpleid/.gitignore b/simpleid/.gitignore
new file mode 100644
index 0000000..a55cf42
--- /dev/null
+++ b/simpleid/.gitignore
@@ -0,0 +1,5 @@
+composer.lock
+vendor/
+www/vendor/
+dist/
+version.txt
diff --git a/simpleid/CHANGELOG.txt b/simpleid/CHANGELOG.txt
new file mode 100644
index 0000000..815b960
--- /dev/null
+++ b/simpleid/CHANGELOG.txt
@@ -0,0 +1,336 @@
+SimpleID 1.0.5
+--------------
+
+- Bug fixes:
+    * #85 Fix compatibility with PHP 8.2
+
+SimpleID 1.0.4
+--------------
+
+- Bug fixes:
+    * #81 Cache cleanup does not cover subdirectories
+
+
+SimpleID 1.0.3
+--------------
+
+- Security enhancements:
+    * #23 Configuration can now be in a separate conf directory
+- Bug fixes:
+    * #35 Fix undefined index error in discovery.inc.php
+
+SimpleID 1.0.2
+--------------
+
+- Bug fixes:
+    * #158 Incorrect handling of fsock-based HTTP requests
+
+SimpleID 1.0.1
+--------------
+
+- Bug fixes:
+    * #154 Duplicate random_bytes() function as it is now also a native
+      function in PHP7
+    * #155 Infinite loop in cache.inc if a particular cache type has not been
+      created
+
+
+SimpleID 1.0
+------------
+
+- Security enhancements:
+    * #149 Add PBKDF2 to available password hashing algorithms to improve
+      hashing security
+    * #150 Changed hash string comparison function to mitigate against
+      timing attacks
+
+
+SimpleID 0.9.1
+--------------
+
+- Bug fixes:
+    * #147 Incorrect update_access_check warning when upgrading
+    * #148 Identity files with certlogin can now be symlinked from the
+      identities directory
+
+
+SimpleID 0.9
+------------
+
+- Security enhancements:
+    * #9 Changed file extensions from .inc to .php
+    * #69 #71 Require HTTPS for login pages
+    * #100 Restricted path and added http_only flag for session cookies
+    * #101 Implemented HTTP strict transport security header
+    * #130 Added support for TOTP one-time passwords
+- Improvements to identity files:
+    * #21 Allow non-MD5 hash algorithms and salted passwords
+    * #137 Identity files can now be symlinked from the identities
+      directory
+- Improvements to user interface:
+    * #93 #106 Localization support
+    * #103 Enhanced simpleweb error pages
+    * #138 Refactored style sheets for better mobile device support
+- New extension:
+    * #85 certauth extension for authentication using client SSL
+      certificates
+- Improvements to SimpleID internals:
+    * #58 #72 Dropped support for PHP 4 and fixed up PHP syntax
+      warnings
+    * #110 Refactored authentication system to allow for custom authentication
+      extensions
+    * #131 Refactored cache system to improve performance
+    * #132 Refactored "remember me" cookies
+
+SimpleID 0.8.5
+--------------
+
+- Bug fixes:
+    * #129 Fixed bug introduced in 0.8.4 regarding Warning if
+      suhosin.get.max_value_length configuration setting is too low
+    * #134 PHP syntax warnings under PHP 5.3
+
+SimpleID 0.8.4
+--------------
+
+- Bug fixes:
+    * #123 Updated user interface to reflect change in SimpleID web site URL
+    * #125 Fixed line ending (CRLF vs LF) bug introduced when migrating from
+      SVN to Git
+    * #122 Fixed PEAR package not loading PEAR_Config
+    * #133 Fixed bug in bignum.inc where bignum_new() was returning $false
+      instead of false
+- Improvements to SimpleID internals:
+    * #129 Warning if suhosin.get.max_value_length configuration setting
+      is too low
+
+SimpleID 0.8.3
+--------------
+
+- Bug fixes:
+    * #119 Remove XRDS-Simple Type element from template.xtpl for Blogger
+      interoperability
+
+SimpleID 0.8.2
+--------------
+
+- Bug fixes:
+    * #104 Detect missing PHP extensions
+    * #105 Incorrect CSS property in simpleid.css
+    * #108 Incorrect footer links
+    * #109 Incorrect processing of HTTP requests and responses when used with
+      SAPI CGI
+    * #112 Incorrect reference to html/consent.js in page.inc
+- Improvements to user interface:      
+    * #111 Replaced packaged version of jQuery with CDN version
+
+SimpleID 0.8.1
+--------------
+
+- Bug fixes:
+    * #77 Incorrect detection of register_globals PHP configuration variable
+    * #86 PHP syntax warnings in filesystem.store.inc
+    * #88 Updated URL to Simple Registration Extension specification in
+      example.identity.dist
+    * #91 Missing parameters in simpleid_checkid_error()
+    * #92 Corrected path handling in simpleweb
+    * #98 Missing global variable in simpleid_openid_consent()
+- Improvements to user interface:
+    * #94 Switch redirects from form-based to HTTP header-based
+- Improvements to the PAPE extension
+    * #95 Added private personal identifiers
+    
+
+SimpleID 0.8
+------------
+
+- Improved OpenID specification compliance:
+    * Added read-only support for attribute exchange extension
+    * Addes support for provider authentication policy extension 
+- Improvements to user interfaces:
+    * #14 Added support for clean URLs
+    * #18 Improved comformance to HTML specifications in user interface
+    * #19 For OpenID immediate requests, assertion will not fail simply because
+      return_to has not been verified
+    * #23 Optional support for browsers to save SimpleID passwords
+- Improvements to SimpleID internals:
+    * Refactored function names
+    * Refactored function layout in discovery.inc and openid.inc
+    * Opened up identity store code to allow support for non filesystem based
+      identity files
+    * Improved source code documentation
+    
+SimpleID 0.7.6
+--------------
+
+- Fixed directory traversal vulnerability SA-2011-1
+  (http://simpleid.sourceforge.net/advisories/sa-2011-1)
+
+SimpleID 0.7.5
+--------------
+
+- Bug fixes:
+    * #61 PHP safe mode causing curl configuration issues
+    * #64 Issue with URL parsing under Simpleweb framework
+
+
+SimpleID 0.7.4
+--------------
+
+- Fixed incorrect implementation of fix for PHP's handling of HTTP parameters.
+
+
+SimpleID 0.7.3
+--------------
+
+- Bug fixes:
+    * #47 PHP syntax warnings in discovery.inc.
+    * #48 PHP syntax warnings in user.inc.
+    * #50 Fix for PHP's handling of HTTP parameters.
+
+
+SimpleID 0.7.2
+--------------
+
+- Bug fixes:
+    * #40 PHP syntax warnings in simpleweb.inc.
+    * #42 PHP syntax warnings in index.php.
+
+
+SimpleID 0.7.1
+--------------
+
+- Bug fixes:
+    * Incorrect specification for expiry time for auto login.
+    * Fixed verification of credentials under legacy authentication.
+    * Fixed incorrect signing of Simple Registration Extension response.
+    * Fixed Javascript for digest authentication.
+    * Used Javascript instead of forms for page redirection for better HTTPS
+      user experience.
+
+
+SimpleID 0.7
+------------
+
+- Improved OpenID specification compliance:
+    * Added additional return_to verification using discovery.
+    * Fixed support for SHA256.
+    * Fixed indirect message URL encoding.
+    * Fixed filtering of extension-specific parameters.
+    * Fixed XRDS document for SimpleID.
+- Preliminary implementation of the OpenID User Interface extension.
+- Added support for GMP for improved performance for arbitary precision
+  arithmetic operations.
+- Improved user interface:
+    * Separated Dashboard, My Profile and My Sites pages.
+    * Added "log in as different user" functionality.
+    * CSS improvements.
+    * Added framekiller code.
+    * Support for nicer URLs via mod_rewrite.
+- Enhanced detection of SSL/TLS for user login page.
+- Implemented flexible persistent storage system to store user data.
+- Improved extension framework: major refactoring of hooks available to be
+  utilised by extensions.
+- Improved URL routing framework: included simpleweb.inc.
+- Added upgrade script.
+- Enhanced logging of status and errors.
+- Enhanced code documentation.
+
+
+SimpleID 0.6.5
+--------------
+
+- Bug fixes:
+    * Fixed XSS vulnerability in user login page.
+    * Fixed XRDS-Location HTTP header.
+
+
+SimpleID 0.6.4
+--------------
+
+- Fixed user interface bug on trusted sites page (disable Submit button when
+  there are no trusted sites).
+
+
+SimpleID 0.6.3
+--------------
+
+- Fixed session_type verification response when using OpenID 1.1 associations.
+
+
+SimpleID 0.6.2
+--------------
+
+- Fixed session_type verification issue when using OpenID 1.1 associations.
+
+
+SimpleID 0.6.1
+--------------
+  
+- Fixed return_to verification issue when using OpenID 1.1 (legacy handling of
+  nonce parameter).
+
+SimpleID 0.6
+------------
+
+- Bug fixes:
+    * Fixed syntax errors in openid.inc.
+    * Fixed incorrect error authentication response.
+- Implemented digest authentication for user login (security enhancements).
+- Implemented persistent login
+- Enhanced form security:
+    * Added form token verification.
+    * Enhanced encoding of HTML special characters.
+- Improved compliance against OpenID specifications:
+    * Added return_to verification.
+- Changed extension of extensions from .inc to .extension.inc.
+- Enhanced code documentation.
+
+
+SimpleID 0.5.1
+--------------
+
+- Bug fixes:
+    * Removed remnants of maths question (removed in SimpleID 0.5) from user.inc
+- Included Simple Registration Extension by default
+
+
+SimpleID 0.5
+------------
+
+- Bug fixes:
+    * Removed XSS vulnerabilities
+    * Fixed incorrect processing of Simple Registration Extension parameters
+    * Fixed URL for identifier selection.
+- The identifier variable is now optional in identity files.  SimpleID automatically
+  assigns an identifier to all identities where this is not specified.
+- Log in security improvements:
+    * Removed requirement to complete a maths question to log in.
+    * Added nonce check into login page to detect repeat attacks.
+- Improved compliance against OpenID specifications:
+    * Enhanced support for OpenID 2.0.
+    * Enhanced checking of request parameters.
+    * Added support for discovery of SimpleID services via XRDS.
+- Support for SHA256 where this is compiled into PHP.
+- Added default profile page and XRDS document for each user.
+
+
+SimpleID 0.2.1
+--------------
+
+- Bug fixes:
+    * Removed incorrect and legacy handling of nonce parameter in OpenID 1.1
+      authentication responses
+
+
+SimpleID 0.2
+------------
+
+- Bug fixes:
+    * Fixed template compile error in Simple Registration Extension.
+
+
+SimpleID 0.1
+------------
+
+- Initial release
diff --git a/simpleid/COPYING-normalizecss.txt b/simpleid/COPYING-normalizecss.txt
new file mode 100644
index 0000000..c6bcc9b
--- /dev/null
+++ b/simpleid/COPYING-normalizecss.txt
@@ -0,0 +1,19 @@
+Copyright (c) Nicolas Gallagher and Jonathan Neal
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/simpleid/COPYING-xtemplate.txt b/simpleid/COPYING-xtemplate.txt
new file mode 100644
index 0000000..fc2988d
--- /dev/null
+++ b/simpleid/COPYING-xtemplate.txt
@@ -0,0 +1,191 @@
+$HeadURL: https://xtpl.svn.sourceforge.net/svnroot/xtpl/branches/php4/license.txt $
+$Id$
+
+XTemplate is dual licensed using BSD and LGPL.
+
+In plain English, you do not need to distribute your application in source code form, nor do you need to distribute XTemplate source code, provided you follow the rest of terms of the BSD license.
+
+For more info about XTemplate, visit http://www.phpxtemplate.org/
+
+BSD Style-License
+=================
+
+Copyright (c) 2000-2001 Barnab�s Debreceni [cranx@users.sourceforge.net] XTemplate
+Copyright (c) 2002-2007 Jeremy Coates [cocomp@users.sourceforge.net] XTemplate & CachingXTemplate
+
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list
+of conditions and the following disclaimer.
+
+Redistributions in binary form must reproduce the above copyright notice, this list
+of conditions and the following disclaimer in the documentation and/or other materials
+provided with the distribution.
+
+Neither the name of the XTemplate, Barnab�s Debreceni, Jeremy Coates nor the names of its contributors may be used to
+endorse or promote products derived from this software without specific prior written
+permission.
+
+DISCLAIMER:
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
+XTemplate, Barnab�s Debreceni, Jeremy Coates OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+==========================================================
+
+Copyright (c) 2000-2001 Barnab�s Debreceni [cranx@users.sourceforge.net] XTemplate
+Copyright (c) 2002-2007 Jeremy Coates [cocomp@users.sourceforge.net] XTemplate
+
+GNU LESSER GENERAL PUBLIC LICENSE
+Version 2.1, February 1999
+
+Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+
+Preamble
+The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.
+
+This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below.
+
+When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things.
+
+To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it.
+
+For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights.
+
+We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library.
+
+To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others.
+
+Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license.
+
+Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs.
+
+When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library.
+
+We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances.
+
+For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License.
+
+In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system.
+
+Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library.
+
+The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.
+
+
+TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you".
+
+A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables.
+
+The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".)
+
+"Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library.
+
+Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does.
+
+1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library.
+
+You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee.
+
+2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions:
+
+
+a) The modified work must itself be a software library.
+b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change.
+c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License.
+d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful.
+(For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License.
+
+3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices.
+
+Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy.
+
+This option is useful when you wish to copy part of the code of the Library into a program that is not a library.
+
+4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange.
+
+If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code.
+
+5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License.
+
+However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables.
+
+When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law.
+
+If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.)
+
+Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself.
+
+6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications.
+
+You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things:
+
+
+a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.)
+b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with.
+c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution.
+d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place.
+e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy.
+For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable.
+
+It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute.
+
+7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things:
+
+
+a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above.
+b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
+8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance.
+
+9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it.
+
+10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License.
+
+11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice.
+
+This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License.
+
+12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License.
+
+13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation.
+
+14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally.
+
+NO WARRANTY
+
+15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+
+END OF TERMS AND CONDITIONS
\ No newline at end of file
diff --git a/simpleid/COPYING.txt b/simpleid/COPYING.txt
new file mode 100644
index 0000000..5312a46
--- /dev/null
+++ b/simpleid/COPYING.txt
@@ -0,0 +1,342 @@
+// $Id$
+
+        GNU GENERAL PUBLIC LICENSE
+           Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+          Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+        GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+          NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+         END OF TERMS AND CONDITIONS
+
+      How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
diff --git a/simpleid/README.txt b/simpleid/README.txt
new file mode 100644
index 0000000..b693305
--- /dev/null
+++ b/simpleid/README.txt
@@ -0,0 +1,92 @@
+SimpleID
+========
+
+SimpleID is a simple, personal OpenID provider written in PHP.
+
+Latest Version
+--------------
+
+Version 1.0 is the final version of the original series of SimpleID.
+SimpleID 2.0 is almost a complete rewrite of SimpleID and is not
+backwards compatible this version.
+
+The latest version of SimpleID can be found in the SimpleID web page at
+<http://simpleid.org/>
+
+Upgrading
+---------
+
+General upgrade instructions can be found in UPGRADE.txt.
+
+IMPORTANT: SimpleID version 0.9 introduced numerous changes and additional
+system requirements.  A manual upgrading process is required.  If you are
+upgrading from an earlier version of SimpleID, please read UPGRADE.txt for
+upgrade instructions.
+
+IMPORTANT: SimpleID version 0.7 introduced numerous changes.  A manual
+upgrading process is required.  If you are upgrading from an earlier version of
+SimpleID, please read UPGRADE.txt for upgrade instructions.
+
+IMPORTANT: SimpleID version 0.6 introduced a new log in mechanism.  If you
+are upgrading from an earlier version of SimpleID, please read
+UPGRADE.txt for upgrade instructions.
+
+
+Installation
+------------
+
+For installation instructions, please see the SimpleID Getting Started Guide at
+<http://simpleid.org/docs/1/#getting-started>.
+
+Documentation
+-------------
+
+Documentation for SimpleID can be found at
+<http://simpleid.org/docs/1/>.
+
+Licensing
+---------
+
+Licensing information for SimpleID can be found in the file COPYING.txt.
+
+Donate
+------
+
+If you enjoy using SimpleID, please consider making a donation to support the
+ongoing development work.  To find out more on how to donate, visit
+<http://simpleid.org/donate>.
+
+Your donation is very much appreciated.
+
+Acknowledgements
+----------------
+
+SimpleID includes code from the Drupal OpenID module
+<http://drupal.org/project/openid>, written by Rowan Kerr
+<rowan@standardinteractive.com> and James Walker <james@bryght.com>.
+
+SimpleID includes code from php-gettext <https://launchpad.net/php-gettext>,
+written by Danilo Segan <danilo@kvota.net> and Nico Kaiser <nico@siriux.net>.
+
+SimpleID uses the XTemplate PHP templating engine
+<http://www.phpxtemplate.org>, written by Barnabas Debreceni and Jeremy Coates.
+Licensing information for this library can be found in COPYING-xtemplate.txt.
+
+SimpleID uses the famfamfam Silk icon set
+<http://www.famfamfam.com/lab/icons/silk/>, designed by Mark James.  The icon
+set is licensed is licensed under a Creative Commons Attribution 2.5 License
+<http://creativecommons.org/licenses/by/2.5/>.
+
+SimpleID uses the jQuery JavaScript library <http://jquery.com>, by John
+Resig and the jQuery team.  Licensing information for this library can be found
+at <http://docs.jquery.com/Licensing>.
+
+SimpleID uses the jQuery QR code library
+<http://jeromeetienne.github.io/jquery-qrcode/>, by Jerome Etienne.  Licensing
+information for this library can be found at
+<https://github.com/jeromeetienne/jquery-qrcode/blob/master/MIT-LICENSE.txt>.
+
+SimpleID uses normalize.css style sheet
+<http://necolas.github.io/normalize.css/>, by Nicolas Gallagher and Jonathan
+Neal.  Licensing information for this library can be found at
+<https://github.com/necolas/normalize.css/blob/master/LICENSE.md>.
diff --git a/simpleid/RoboFile.php b/simpleid/RoboFile.php
new file mode 100644
index 0000000..df63fab
--- /dev/null
+++ b/simpleid/RoboFile.php
@@ -0,0 +1,115 @@
+<?php
+
+use Gettext\Scanner\PhpScanner;
+use Gettext\Generator\PoGenerator;
+use Gettext\Translations;
+use Symfony\Component\Finder\Finder;
+
+/**
+ * This is project's console commands configuration for Robo task runner.
+ *
+ * @see http://robo.li/
+ */
+class RoboFile extends \Robo\Tasks {
+    public function xgettext() {
+        $domain = 'messages';
+
+        $finder = new Finder();
+        $finder->in('www')->name('*.php');
+
+        $translations[] = Translations::create($domain);
+
+        $scanner = new PhpScanner(...$translations);
+        $scanner->setDefaultDomain($domain);
+
+        $scanner->setFunctions(['t' => 'gettext']);
+
+        foreach ($finder as $file) {
+            $scanner->scanFile($file);
+        }
+
+        $generator = new PoGenerator();
+
+        foreach ($scanner->getTranslations() as $domain => $translations) {
+            $destFile = 'www/locale/messages.pot';
+
+            $translations->getHeaders()->set('Project-Id-Version', 'PACKAGE VERSION');
+            $translations->getHeaders()->set('Report-Msgid-Bugs-To', '');
+            $translations->getHeaders()->set('POT-Creation-Date', date('c'));
+            $translations->getHeaders()->set('PO-Revision-Date', 'YEAR-MO-DA HO:MI+ZONE');
+            $translations->getHeaders()->set('Last-Translator', 'FULL NAME <EMAIL@ADDRESS>');
+            $translations->getHeaders()->set('Language-Team', 'LANGUAGE <LL@li.org>');
+            $translations->getHeaders()->set('MIME-Version', '1.0');
+            $translations->getHeaders()->set('Content-Type', 'text/plain; charset=UTF-8');
+            $translations->getHeaders()->set('Content-Transfer-Encoding', '8bit');
+
+            $generator->generateFile($translations, $destFile);
+        }
+    }
+
+    public function build() {
+        $ref = getenv('GITHUB_REF_NAME');
+        if ($ref === false) {
+            $version = 'master';
+        } else {
+            $version = str_replace('release-', '', $ref);
+        }
+
+        $dist_file = 'simpleid-' . $version . '.tar.gz';
+        
+        // 1. Set up robo collections and create temp directory
+        $main_collection = $this->collectionBuilder();
+        $prepare_collection = $this->collectionBuilder();
+        $temp = $main_collection->tmpDir();
+        $working = $main_collection->workDir("dist");
+
+        // 3. Prepare step
+        // (a) Copy files to temp directory
+        $prepare_collection->taskMirrorDir([
+            '.' => "$temp/simpleid"
+        ]);
+
+        // (b) remove unnecessary directories and files
+        $prepare_collection->taskDeleteDir([
+            "$temp/simpleid/.git",
+            "$temp/simpleid/.github",
+            "$temp/simpleid/.sourceforge",
+            "$temp/simpleid/dist",
+            "$temp/simpleid/vendor",
+            "$temp/simpleid/www/vendor",
+            "$temp/simpleid/www/test",
+            "$temp/simpleid/www/test-suite"
+        ]);
+
+        $prepare_collection->taskFileSystemStack()->remove([
+            "$temp/simpleid/www/.htaccess",
+            "$temp/simpleid/www/config.inc",
+            "$temp/simpleid/www/config.php",
+            "$temp/simpleid/www/composer.lock",
+            "$temp/simpleid/composer.lock"
+        ]);
+
+        // (c) run
+        $result = $prepare_collection->run();
+        if (!$result->wasSuccessful()) {
+            return $result;
+        }
+
+        // 4. Replace variables
+        $finder = new Finder();
+        $finder->in("$temp/simpleid/www")->name('*.php')->name('*.dist');
+        foreach($finder as $file) {
+            $main_collection->taskReplaceInFile($file)
+                ->from(['@@BUILD_VERSION@@', '@@IDENTITIES_DIR@@', '@@CACHE_DIR@@', '@@STORE_DIR@@'])
+                ->to([$version, '../identities', '../cache', '../store']);
+        }
+
+        // 5. Create the release files
+        $main_collection->taskFileSystemStack()->mkdir("$working/$version")->copy('.sourceforge/frs/README.md', "$working/$version/README.md");
+        $main_collection->taskPack("$working/$version/$dist_file")->addDir('simpleid/', "$temp/simpleid");
+        $main_collection->taskWriteToFile('version.txt')->line($version);
+
+        // 6. Run everything
+        return $main_collection->run();
+    }
+}
\ No newline at end of file
diff --git a/simpleid/UPGRADE.txt b/simpleid/UPGRADE.txt
new file mode 100644
index 0000000..16c1856
--- /dev/null
+++ b/simpleid/UPGRADE.txt
@@ -0,0 +1,171 @@
+Upgrading SimpleID
+==================
+
+Introduction
+------------
+
+SimpleID is currently in heavy development, with the software changing rapidly.
+As a result, it is very important to upgrade SimpleID when a new version is
+released.
+
+General information on upgrading can be found at
+<http://simpleid.org/docs/1/upgrading/>.
+
+This document sets out the additional steps which may need to be performed to
+upgrade to a specific version of SimpleID.
+
+Upgrading to SimpleID 0.9
+-------------------------
+
+1. System requirements
+
+The system requirements for SimpleID have changed.  The most important
+changes are:
+
+    (a) PHP
+
+        From version 0.9, the minimum version of PHP is 5.3.0.  PHP 4 is no
+        longer supported.
+
+    (b) HTTPS support
+
+        From version 0.9, HTTPS support is mandatory.  The evolving security
+        environment means that it is no longer safe to accept logins from
+        unencrypted connections.
+
+        If you run your own server, there are now many inexpensive certificate 
+        authorities from which to get certificates.  Self-signed certificates
+        are also acceptable (although not recommended).
+
+        If you are using a shared server from a web hosting provider, check
+        with them regarding SSL capabilities.  Many offer a shared SSL
+        certificate to the server at no extra cost.
+
+For further information on the revised system requirements, see the SimpleID
+web site at <http://simpleid.org/docs/1/system-requirements/>
+
+2. Enhanced password security
+
+Version 0.9 now supports storing passwords with hashing algorithms other than
+MD5 and with a salt.  You may wish to update your identity file to take
+advantage of this new feature.
+
+3. File extensions
+
+SimpleID PHP code files no longer use the .inc file extension.  Instead only
+the .php file extension is used.  This prevents misconfigured web servers to
+return SimpleID source code.
+
+You will need to perform the following manually:
+
+    (a) Rename config.inc to config.php
+
+    (b) Rename any custom extensions in the extensions directory from
+        .extension.inc to .extension.php
+
+    (c) Delete all old .inc files from the SimpleID web directory.
+
+4. upgrade.php
+
+You will need to run the upgrade script to complete the upgrade.  To run the
+script, use your web browser to go to
+
+http://www.exmaple.com/simpleid/upgrade.php
+
+where http://www.exmaple.com/simpleid/ is the URL of your SimpleID server
+(where you have moved the www directory).  You will need to be logged in as
+an administrator to proceed with the script.
+
+Upgrading to SimpleID 0.8
+-------------------------
+
+SimpleID 0.8 does not require any additional steps as part of the upgrade
+process.
+
+However, you will still need to run the upgrade script to complete the
+upgrade.  To run the script, use your web browser to go to
+
+http://www.exmaple.com/simpleid/upgrade.php
+
+where http://www.exmaple.com/simpleid/ is the URL of your SimpleID server
+(where you have moved the www directory).  You will need to be logged in as
+an administrator to proceed with the script.
+
+
+Upgrading to SimpleID 0.7
+-------------------------
+
+1. New storage framework
+
+SimpleID introduced a new storage framework.  The new framework allows SimpleID
+to store additional information about your identity.
+
+As a result, you will need to be aware that there is a new configuration option
+called SIMPLEID_STORE_DIR, which specifies the directory where this information
+will be stored.  This directory must exist and be readable and writable by the
+web server.
+
+If you are upgrading from SimpleID 0.6, this setting will default to the
+directory specified by SIMPLEID_CACHE_DIR in your config.inc.  However, it is
+a good idea to place this in a separate directory.  To do this, add the
+following line to your config.inc:
+
+define('SIMPLEID_STORE_DIR', '<your directory here>');
+
+2. Administrators
+
+SimpleID 0.7 introduced the concept of administrators.  Administrators
+have access to certain functions which regular users cannot.  To make a user
+an administrator, edit the user's identity file to include the following line:
+
+administrator=1
+
+3. User Interface Extension
+
+SimpleID 0.7 introduced support for the draft OpenID User Interface Extension.
+It is enabled by default for new installations of SimpleID, however if you
+are upgrading you may need to enable it manually.  To do so, edit
+your config.inc to change the SIMPLEID_EXTENSIONS configuration option to
+include ui.  For example:
+
+define('SIMPLEID_EXTENSIONS', 'sreg,ui');
+
+4. Upgrade script
+
+SimpleID introduced a new upgrade script.  This means that whenever you
+upgrade you will also need to run the script.  To run the script, use your
+web browser to go to
+
+http://www.exmaple.com/simpleid/upgrade.php
+
+where http://www.exmaple.com/simpleid/ is the URL of your SimpleID server
+(where you have moved the www directory).  You will need to be logged in as
+an administrator to proceed with the script.
+
+
+Upgrading to SimpleID 0.6
+-------------------------
+
+SimpleID version 0.6 introduced a new log in system.  The new system allows
+you to log in to SimpleID without sending your password in plain text.  Your
+password is used to create a cryptographic digest, which is then sent to
+the SimpleID server and verified.
+
+As a result, you need to be aware of two things:
+
+1.  You browser must have JavaScript switched on in order to use the new
+    log in system.  If JavaScript is not switched on, SimpleID reverts to the
+    "legacy" log in system used in previous versions, subject to the important
+    point below.
+    
+2.  By default, SimpleID version 0.6 will not accept logins under the legacy
+    system.  You can override this by putting the following line in your
+    config.inc:
+    
+    define('SIMPLEID_ALLOW_LEGACY_LOGIN', true);
+    
+    It is STRONGLY RECOMMENDED that you DO NOT switch the legacy login system
+    on, as it is substantially less secure than the new login system.  Use this
+    ONLY if your browser does not support JavaScript.
+    
+
diff --git a/simpleid/cache/.gitignore b/simpleid/cache/.gitignore
new file mode 100644
index 0000000..e4012f6
--- /dev/null
+++ b/simpleid/cache/.gitignore
@@ -0,0 +1,5 @@
+# Ignore this directory
+*
+
+# Don't ignore this file
+!.gitignore
\ No newline at end of file
diff --git a/simpleid/composer.json b/simpleid/composer.json
new file mode 100644
index 0000000..4eb9b0f
--- /dev/null
+++ b/simpleid/composer.json
@@ -0,0 +1,33 @@
+{
+    "name": "simpleid/simpleid",
+    "description": "A simple, personal OpenID provider written in PHP",
+    "type": "project",
+    "require": {
+        "php": "^5.3 | ^7.0",
+        "ext-bcmath": "*",
+        "ext-pcre": "*",
+        "ext-session": "*",
+        "ext-xml": "*",
+        "ext-hash": "*"
+    },
+    "suggest": {
+        "ext-gmp": "Better performance"
+    },
+    "require-dev": {
+        "pear/archive_tar": "^1.4",
+        "gettext/gettext": "^5.0",
+        "gettext/php-scanner": "^1.0",
+        "consolidation/robo": "1.0"
+    },
+    "scripts": {
+        "build": [ "@composer install", "robo build" ],
+        "xgettext": [ "@composer install", "robo xgettext" ]
+    },
+    "license": "GPL-2.0+",
+    "authors": [
+        {
+            "name": "Kelvin Mo",
+            "email": "kmo@users.sourceforge.net"
+        }
+    ]
+}
diff --git a/simpleid/extensions/hooks.php b/simpleid/extensions/hooks.php
new file mode 100644
index 0000000..24219ce
--- /dev/null
+++ b/simpleid/extensions/hooks.php
@@ -0,0 +1,337 @@
+<?php
+
+/**
+ * 
+ * This page lists out all the hooks which are available to SimpleID extensions.
+ *
+ * When implementing these hooks in your extensions, you should replace the word
+ * hook with the name of your extension.
+ *
+ * @package extensions
+ */
+
+/**
+ * Returns an array of type URIs to be included in SimpleID's XRDS document.
+ *
+ * For example:
+ *
+ * <code>
+ * <?php
+ * return array('http://specs.openid.net/extensions/ui/1.0/lang-pref', 'http://specs.openid.net/extensions/ui/1.0/mode/popup');
+ * ?>
+ * </code>
+ *
+ * @return array an array of URIs
+ * @since 0.7
+ */
+function hook_xrds_types() {
+}
+
+/**
+ * Processes an authentication request that is <i>not</i> about an identifier.
+ *
+ * The OpenID specifications provides a mechanism for extensions to process
+ * authentication requests that are not about an identifier.  Authentication requests
+ * about identifiers are automatically processed by the {@link simpleid_checkid_identity()}
+ * function and the {@link hook_checkid_identity()} hooks.
+ *
+ * Assertion results are coded within SimpleID as an integer between 127 ({@link CHECKID_OK})
+ * and -127 ({@link CHECKID_PROTOCOL_ERROR}).  Positive values indicate a potential
+ * positive assertion (subject to various types of user approval), while negative
+ * values indicate a irrecoverable negative assertion.
+ *
+ * This hook should return one of these values.  If the extension is unable to
+ * handle this particular type of authentication request, it should return NULL.
+ *
+ * @param array $request the OpenID request
+ * @param bool $immediate true if openid.mode is checkid_immediate
+ * @return int a return value from the list of possible values returned by
+ * {@link simpleid_checkid_identity()} or NULL
+ * @see simpleid_checkid()
+ */
+function hook_checkid($request, $immediate) {
+}
+
+
+/**
+ * Processes an authentication request where the assertion is potentially
+ * positive.
+ *
+ * Assertion results are coded within SimpleID as an integer between 127 ({@link CHECKID_OK})
+ * and -127 ({@link CHECKID_PROTOCOL_ERROR}).  Positive values indicate a potential
+ * positive assertion (subject to various types of user approval), while negative
+ * values indicate a irrecoverable negative assertion.
+ *
+ * Extensions are able to examine the authentication request to modify change
+ * the assertion result from positive to negative.  As SimpleID takes the
+ * minimum from the results returned by this hook, extensions are
+ * not able to change the assertion result from negative to positive.
+ *
+ * If the extension is indifferent to the result of the current authentication
+ * request (e.g. it cannot understand it), it should return NULL.
+ *
+ * This hook is not called at all if SimpleID determines that the assertion
+ * is negative.
+ *
+ * @param array $request the OpenID request
+ * @param string $identity the identity to be checked against
+ * @param bool $immediate true if openid.mode is checkid_immediate
+ * @return int a return value from the list of possible values returned by
+ * {@link simpleid_checkid_identity()} or NULL
+ * @see simpleid_checkid_identity()
+ */
+function hook_checkid_identity($request, $identity, $immediate) {
+}
+
+/**
+ * Gets fields and values to be included in the OpenID response.
+ *
+ * For positive assertions, this hook should assume that all user approvals
+ * have been given and return a response array accordingly.  The extension has
+ * the opportunity to modify the response what the user has actually approved
+ * in the {@link hook_send() send hook}.
+ *
+ * This hook will need to provide any aliases required.
+ *
+ * An example:
+ *
+ * <code>
+ * <?php
+ * $alias = openid_extension_alias($my_uri);
+ * return array(
+ *     'openid.ns.' . $alias => $my_uri,
+ *     'openid.' . $alias . '.field' => 'value'
+ * );
+ * ?>
+ * </code>
+ *
+ * @param bool $assertion true if a positive assertion is made, false otherwise
+ * @param array $request the OpenID request
+ * @return array the fields and values to include
+ */
+function hook_response($assertion, $request) {
+}
+ 
+/**
+ * Gets fields associated with this extension which needs to be signed
+ *
+ * SimpleID automatically handles signing fields required by the OpenID
+ * specification, so only the fields introduced by this extension
+ * needed to be returned by this function.
+ *
+ * The array of fields returned by this function must include any applicable
+ * aliases as required.  For example
+ *
+ * <code>
+ * <?php
+ * $alias = openid_extension_alias($my_uri);
+ * return array($alias . '.field1', $alias . 'field2');
+ * ?>
+ * </code>
+ *
+ * @param array $response the OpenID response to sign
+ * @return array an array of fields to sign
+ */
+function hook_signed_fields($response) {
+}
+
+/**
+ * Determines the format in which assertions are sent, when they are sent via
+ * indirect communication.
+ *
+ * The OpenID specification version 2.0 provides for the sending of assertions
+ * via indirect communication.  The original specifications provide that the
+ * response should be formatted within the query string.
+ *
+ * Some extensions to the OpenID specification allows the assertion to be
+ * formatted in some other way, e.g. via the fragment.  This hook allows
+ * extensions to specify which format the assertion should be sent.
+ *
+ * If the extension is indifferent regarding the format, it should return
+ * null
+ *
+ * @param string $url the URL of the RP to which the response is to be sent
+ * @param array $response the assertion to be sent
+ * @return int one of OPENID_RESPONSE_QUERY or OPENID_RESPONSE_FRAGMENT or NULL
+ */
+function hook_indirect_response($url, $response) {
+}
+
+/**
+ * Provides additional form items when displaying the relying party consent
+ * form
+ * 
+ *
+ * @param array $request the OpenID request
+ * @param array $response the proposed OpenID response
+ * @param array $rp the user's preferences saved with this relying party
+ * @return string HTML code to be inserted into the verification form
+ * @see simpleid_consent_form()
+ * @deprecated Use {@link hook_consent_form()}
+ */
+function hook_rp_form($request, $response, $rp) {
+}
+
+/**
+ * Provides additional form items when displaying the relying party consent
+ * form
+ * 
+ *
+ * @param array $request the OpenID request
+ * @param array $response the proposed OpenID response
+ * @param array $rp the user's preferences saved with this relying party
+ * @return string HTML code to be inserted into the verification form
+ * @see simpleid_consent_form()
+ * @since 0.8
+ */
+function hook_consent_form($request, $response, $rp) {
+}
+
+/**
+ * Processes the relying party consent form.
+ *
+ * This provides the extension with the opportunity to:
+ *
+ * - modify the OpenID response based on the user's preferences by editing
+ *   $response
+ * - save the user's preferences by editing $rp
+ *
+ * <strong>WARNING</strong> Because this function requires parameters to be
+ * passed by reference, this does not work with {@link extension_invoke_all()}.
+ *
+ * @param array $form_request the data submitted by the user in the relying
+ * party verification form
+ * @param array &$response pointer to the proposed OpenID response
+ * @param array &$rp pointer to the user's preferences saved with this relying party
+ * @deprecated Use {@link hook_consent()}
+ *
+ */
+function hook_send($form_request, &$response, &$rp) {
+}
+
+/**
+ * Processes the relying party verification form.
+ *
+ * This provides the extension with the opportunity to:
+ *
+ * - modify the OpenID response based on the user's preferences by editing
+ *   $response
+ * - save the user's preferences by editing $rp
+ *
+ * <strong>WARNING</strong> Because this function requires parameters to be
+ * passed by reference, this does not work with {@link extension_invoke_all()}.
+ *
+ * @param array $form_request the data submitted by the user in the relying
+ * party verification form
+ * @param array &$response pointer to the proposed OpenID response
+ * @param array &$rp pointer to the user's preferences saved with this relying party
+ * @since 0.8
+ *
+ */
+function hook_consent($form_request, &$response, &$rp) {
+}
+
+/**
+ * Return any additional items provided by the extension to be appended to the
+ * Simpleweb route array.
+ *
+ * @see simpleweb.inc.php
+ * @see simpleid_start()
+ * @return array the routes array
+ * @since 0.7
+ */
+function hook_routes() {
+}
+
+/**
+ * Provides additional form items when displaying the login form
+ * 
+ * @param string $destination he SimpleID location to which the user is directed
+ * if login is successful
+ * @param string $state the current SimpleID state, if required by the location
+ * @see user_login_form()
+ */
+function hook_user_login_form($destination, $state) {
+}
+
+/**
+ * Attempts to automatically login using credentials presented by the user agent.
+ *
+ * This hook is called by the {@link user_auto_login()} function.  The hook
+ * should detect any credentials present in the request and return a $user array
+ * (loaded using the {@link user_load()} function) if credentials identifying
+ * the user is present.
+ *
+ * If no credentials are present, or the credentials are invalid, this hook
+ * should return NULL.
+ * 
+ * @return array the user array, or NULL
+ */
+function hook_user_auto_login() {
+}
+
+/**
+ * Verifies a set of credentials for a specified user.
+ *
+ * A set of credentials comprises:
+ *
+ * - A user name
+ * - Some kind of verifying information, such as a plaintext password, a hashed
+ *   password (e.g. digest) or some other kind of identifying information.
+ *
+ * The user name is passed to this function using the $uid parameter.  The user
+ * name may or may not exist.  If the user name does not exist, this function
+ * <strong>must</strong> return false.
+ *
+ * The credentials are supplied as an array using the $credentials parameter.
+ * Typically this array will be a subset of the $_POST superglobal passed to the
+ * {@link user_login()} function.  Thus it will generally contain the keys 'pass' and
+ * 'digest'.
+ *
+ * This hook must check whether the credentials supplied matches the credentials
+ * for the specified user in the store.  If for any reason that credentials
+ * do not match, this function <strong>must</strong> return false.
+ *
+ * @param string $uid the name of the user to verify
+ * @param array $credentials the credentials supplied by the browser
+ * @return bool whether the credentials supplied matches those for the specified
+ * user
+ */
+function hook_user_verify_credentials($uid, $credentials) {
+}
+
+
+
+/**
+ * Returns additional blocks to be displayed in the user's dashboard.
+ *
+ * A block is coded as an array in accordance with the specifications set
+ * out in {@link page.inc}.
+ *
+ * This hook should return an <i>array</i> of blocks, i.e. an array of
+ * arrays.
+ *
+ * @see page_dashboard()
+ * @return array an array of blocks to add to the user's dashboard
+ * @since 0.7
+ */
+function hook_page_dashboard() {
+}
+
+/**
+ * Returns additional blocks to be displayed in the user's profile page.
+ *
+ * A block is coded as an array in accordance with the specifications set
+ * out in {@link page.inc}.
+ *
+ * This hook should return an <i>array</i> of blocks, i.e. an array of
+ * arrays.
+ *
+ * @see page_profile()
+ * @return array an array of blocks to add to the user's profile page
+ * @since 0.7
+ */
+function hook_page_profile() {
+}
+
+?>
diff --git a/simpleid/identities/example.identity.dist b/simpleid/identities/example.identity.dist
new file mode 100644
index 0000000..7223f51
--- /dev/null
+++ b/simpleid/identities/example.identity.dist
@@ -0,0 +1,233 @@
+; :mode=ini:
+; $Id$
+;
+;
+; SimpleID identity file.
+;
+; This file contains all the data associated with an identity.  It should
+; always be named username.identity, where username is the user name to be used
+; when logging into SimpleID.
+;
+; In this file, if a value contains non-numeric characters, you will need to
+; surround it with quotation characters.
+;
+
+;
+; The OpenID Identifier associated with this identity.  This is typically a
+; URL, although the OpenID specifications allow the use of URIs and even XRIs.
+;
+; Relying parties must be able to resolve the identity to obtain the address
+; of this SimpleID installation.
+;
+; WARNING: If you change the OpenID Identifier after you have used it in
+; SimpleID, you will need to delete all files named 'identity-*.cache' in the
+; cache directory.
+;
+; Examples:
+;    http://example.com/
+;    http://example.com:8888/
+;    http://example.com/myopenid
+;    https://example.com:8080/myopenid
+;
+identity="http://example.com/"
+
+;
+; The password associated with this identity.  
+;
+; The password is encoded as follows:
+;
+;     pass="hash:algorithm:other_params"
+;
+; There are three components to the password string.  Only the first component
+; (the hash) is required, the other two are optional.
+;
+; 1. The hash of the password.  For backwards compatibility reasons, the
+;    default algorithm for hashing the password is MD5.
+;
+;    However, you are strongly encouraged to use a much stronger password
+;    hashing algorithm, such as PBKDF2 with a HMAC-SHA256 function and at least
+;    100,000 iterations.
+;
+; 2. The algorithm used to hash the password.  If this is omitted, 'md5' is assumed.
+;
+;    Allowed algorithms are:
+;
+;    - md5
+;    - sha1
+;    - if the hash module is enabled, pbkdf2 and any algorithms available from that
+;      module
+;
+; 3. Other parameters.
+;
+;    For md5 and sha1, this is an optional salt used to hash the password.  If
+;    used, the password is appended by a colon character (:) then the salt before
+;    a hash is calculated, that is:
+;
+;    hash(password:salt)
+;
+;    For pbkdf2, it is the underlying pseudorandom function, the number of
+;    iterations and the salt, separated by colons.
+;
+; Examples (these contain the same password):
+;    1a79a4d60de6718e8e5b326e338ae533                   ; MD5 hash and no salt
+;    c3499c2729730a7f807efb8676a92dcb6f8a3f8f:sha1      ; SHA1 hash and no salt
+;    f5e6ea5714945786623ad3932ccc757d::ideally-a-large-number-of-random-characters-to-use-as-salt                   ; MD5 hash with salt
+;    9bce4e6997c6f2590717686bd62f99e33d5c6e1c:sha1:ideally-a-large-number-of-random-characters-to-use-as-salt       ; SHA1 hash with salt
+;    c6e1aa5914c6e4e55fae69093afbc02e180810dcc7d3da9f863aa54f3d76e2c3:pbkdf2:sha256:100000:ideally-a-large-number-of-random-characters-to-use-as-salt ; PBKDF2
+;
+pass="906ae7ffe4d00616daf099c74dcb51b86057f51531123c8039007b53176ae0e5:pbkdf2:sha256:100000:C2WG7PRM7PICMN5R"
+
+;
+; Whether this user is given administrative privileges in SimpleID.
+;
+; This setting has no effect in the current version of SimpleID.  However,
+; more functionality may be added to SimpleID in future versions which will
+; be restricted to SimpleID administrators.
+;
+; You should grant administrative privileges to at least one user.
+;
+; If you wish this user to be given administrative privileges, uncomment the
+; line below.
+;
+;administrator=1
+
+;
+; Advanced users only: SSL client certificates associated with this identity.
+;
+; You can associate SSL client certificates to this identity, so that you can
+; log in using certificates instead of supplying a user name or password.
+;
+; The SSL certicate is identified using two parameters:
+;
+; - the certificate's serial number
+; - the distinguished name of the certificate's issuer
+;
+; You can find out these two values using OpenSSL by running the following
+; commands (replacing the file name of the certificate as required):
+; 
+;    openssl x509 -noout -serial -in certificate.crt
+;    openssl x509 -noout -issuer -in certificate.crt
+;
+; These two values are then joined together using a semicolon.
+;
+; This option is for advanced users only.  Please see the documentation at
+; http://simpleid.org/docs/1/certauth/
+; for details on how to set this up.
+;
+; Note, you must also enable the certauth extension in SimpleID.  To
+; do this, make sure the SIMPLEID_EXTENSIONS option in config.php contains
+; certauth
+
+; Example:
+;
+;[certauth]
+;cert[]="02A97C;/C=XX/O=Example CA/OU=Example CA Certificate Signing/CN=Example Client CA"
+
+
+;
+; OpenID Connect user information.
+;
+; If you want to provide personal data to OpenID Connect clients, uncomment the
+; section below and fill in your details.
+;
+; Note that you will need to supply your data in this section again even if you
+; have uncommented and filled in the Simple Registration Extension and/or
+; Attribute Exchange Extension information in the sections below.  SimpleID
+; does not pick these up automatically.
+;
+; WARNING: The address fields below are only supported by PHP 5.3 or later.
+; Earlier versions of PHP are not able to read identity files with
+; associative arrays
+;
+;[user_info]
+;name="Example"
+;given_name="Example"
+;family_name="Example"
+;middle_name="Example"
+;nickname="Example"
+;profile="http://example.com/profile/example"
+;picture="http://example.com/profile/example.jpg"
+;website="http://example.com/blog/example"
+;email="example@example.com"
+;gender="male"
+;birthday="12/31/2000"
+;zoneinfo="Australia/Sydney"
+;locale="en-AU"
+;phone_number="+61400000000"
+;address["formatted"]="1 George Street, Sydney NSW 2000, Australia"
+;address["street_address"]="1 George Street"
+;address["locality"]="Sydney"
+;address["region"]="NSW"
+;address["postal_code"]="2000"
+;address["country"]="Australia"
+
+
+;
+; Simple Registration Extension data.
+;
+; If you want to provide registration data to relying parties which support the
+; Simple Registration Extension, uncomment the section below and fill
+; in your details.
+;
+; Further information on the Simple Registration Extension can be found at
+; http://simpleid.org/docs/1/extensions-bundled/#sreg
+;
+; Note, you must also enable the Simple Registration Extension in SimpleID.  To
+; do this, make sure the SIMPLEID_EXTENSIONS option in config.php contains
+; sreg
+;
+;[sreg]
+;nickname="Example"
+;email="example@example.com"
+;fullname="Example"
+;dob="2000-00-00"
+;gender="M"
+;postcode="1234"
+;country="en"
+;language="au"
+;timezone="Australia/Sydney"
+
+
+;
+; Attribute Exchange Extension data.
+;
+; If you want to provide personal identity information data to relying parties
+; which support the Attribute Exchange Extension, uncomment the section below
+; and fill in your details.
+;
+; The format of this section is attribute type URI=attribute value.  Examples
+; are given below.
+;
+; For a full list of attributes, see http://openid.net/specs/openid-attribute-properties-list-1_0-01.html
+;
+; Note if you have already uncommented and filled out the OpenID Connect user
+; information and/or Simple Registration Extension data above, you do not need
+; to fill out the corresponding attributes again in the section below.  SimpleID
+; will pick these up automatically, including:
+;
+;    http://axschema.org/namePerson/friendly
+;    http://axschema.org/contact/email
+;    http://axschema.org/namePerson
+;    http://axschema.org/birthDate
+;    http://axschema.org/person/gender
+;    http://axschema.org/contact/postalCode/home
+;    http://axschema.org/contact/country/home
+;    http://axschema.org/pref/language
+;    http://axschema.org/pref/timezone
+;    http://openid.net/schema/namePerson/friendly
+;    http://openid.net/schema/contact/internet/email
+;    http://openid.net/schema/gender
+;    http://openid.net/schema/contact/postalCode/home
+;    http://openid.net/schema/contact/country/home
+;    http://openid.net/schema/language/pref
+;    http://openid.net/schema/timezone
+;
+; Note, you must also enable the Attribute Exchange Extension in SimpleID.  To
+; do this, make sure the SIMPLEID_EXTENSIONS option in config.php contains
+; ax
+;
+;[ax]
+;http://openid.net/schema/company/name="Example Company Limited"
+;http://openid.net/schema/company/title="Managing Director"
+;http://openid.net/schema/contact/web/blog="http://simpleid.org/"
+
diff --git a/simpleid/store/.gitignore b/simpleid/store/.gitignore
new file mode 100644
index 0000000..e4012f6
--- /dev/null
+++ b/simpleid/store/.gitignore
@@ -0,0 +1,5 @@
+# Ignore this directory
+*
+
+# Don't ignore this file
+!.gitignore
\ No newline at end of file
diff --git a/simpleid/www/.htaccess.dist b/simpleid/www/.htaccess.dist
new file mode 100644
index 0000000..b962c35
--- /dev/null
+++ b/simpleid/www/.htaccess.dist
@@ -0,0 +1,51 @@
+# :mode=htaccess:
+#
+# SimpleID
+#
+# Copyright (C) Kelvin Mo 2009
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public
+# License as published by the Free Software Foundation; either
+# version 2 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public
+# License along with this program; if not, write to the Free
+# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# 
+# $Id$
+
+# Protect files and directories from prying eyes.
+<FilesMatch "(\.(inc|cache|client|identity|xtpl|inc\.php|store\.php|extension\.php)|config\.php|locale)$">
+    Order deny,allow
+    Deny from all
+</FilesMatch>
+
+# Don't show directory listings for URLs which map to a directory.
+Options -Indexes
+
+# Various rewrite rules.
+<IfModule mod_rewrite.c>
+    RewriteEngine on
+
+    # Modify the RewriteBase if you are using SimpleID in a subdirectory and
+    # the rewrite rules are not working properly.
+    #RewriteBase /simpleid
+
+    # Pass Authorization header to PHP
+    RewriteCond %{HTTP:Authorization} ^(.*)
+    RewriteRule ^(.*) - [E=HTTP_AUTHORIZATION:%1]
+
+    # Rewrite URLs
+    RewriteCond %{REQUEST_FILENAME} !-f
+    RewriteCond %{REQUEST_FILENAME} !-d
+    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
+</IfModule>
+
+# Switch register_globals to off
+php_value register_globals 0
diff --git a/simpleid/www/bignum.inc.php b/simpleid/www/bignum.inc.php
new file mode 100644
index 0000000..78fefd7
--- /dev/null
+++ b/simpleid/www/bignum.inc.php
@@ -0,0 +1,286 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2009
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Abstraction library for multiple precision mathematics.  This file uses either
+ * the GNU Multiple Precision Arithmic Libary (GMP) if it is installed, or the
+ * default BCMath library if it is not installed.
+ *
+ * @package simpleid
+ * @filesource
+ */
+
+ 
+if (function_exists('gmp_init')) {
+    /**
+     * Defines whether the GMP library is available.
+     */
+    define('BIGNUM_GMP', true);
+} else {
+    /** @ignore */
+    define('BIGNUM_GMP', false);
+}
+
+/**
+ * Returns whether either the GMP or the BCMath library is installed.  If neither
+ * of these libraries are installed, the functions in this file will not work.
+ *
+ * @return bool true if either GMP or BCMath is installed.
+ */ 
+function bignum_loaded() {
+    return (function_exists('gmp_init') || function_exists('bcadd'));
+}
+
+/**
+ * Creates a bignum.
+ *
+ * @param mixed $str An integer, a string in base 2 to 36, or a byte stream in base 256
+ * @param int $base an integer between 2 and 36, or 256
+ * @return resource a bignum
+ */
+function bignum_new($str, $base = 10) {
+    switch ($base) {
+        case 10:
+            if (BIGNUM_GMP) {
+                return gmp_init($str, 10);
+            } else {
+                return $str;
+            }
+            break;
+        case 256:
+            $bytes = array_merge(unpack('C*', $str));
+
+            $num = bignum_new(0);
+      
+            foreach ($bytes as $byte) {
+                $num = bignum_mul($num, 256);
+                $num = bignum_add($num, bignum_new($byte));
+            }
+            return $num;
+            break;
+        default:
+            if (!is_integer($base) || ($base < 2) || ($base > 36)) return FALSE;
+
+            $num = bignum_new(0);
+
+            for ($i = 0; $i < strlen($str); $i++) {
+                $num = bignum_mul($num, $base);
+                $num = bignum_add($num, bignum_new(base_convert($str[$i], $base, 10)));
+            }
+            return $num;
+    }
+
+    return FALSE;
+}
+
+/**
+ * Converts a bignum into a string representation (base 2 to 36) or a byte stream
+ * (base 256)
+ *
+ * @param resource $num the bignum
+ * @param int $base an integer between 2 and 36, or 256
+ * @return string the converted bignum
+ */
+function bignum_val($num, $base = 10) {
+    switch ($base) {
+        case 10:
+            if (BIGNUM_GMP) {
+                $base10 = gmp_strval($num, 10);
+            } else {
+                $base10 = $num;
+            }
+
+            return $base10;
+            break;
+    
+        case 256:
+            $cmp = bignum_cmp($num, 0);
+            if ($cmp < 0) {
+                return FALSE;
+            }
+    
+            if ($cmp == 0) {
+                return "\x00";
+            }
+    
+            $bytes = array();
+      
+            while (bignum_cmp($num, 0) > 0) {
+                array_unshift($bytes, bignum_mod($num, 256));
+                $num = bignum_div($num, 256);
+            }
+      
+            if ($bytes && ($bytes[0] > 127)) {
+                array_unshift($bytes, 0);
+            }
+      
+            $byte_stream = '';
+            foreach ($bytes as $byte) {
+                $byte_stream .= pack('C', $byte);
+            }
+      
+            return $byte_stream;
+            break;
+        default:
+            if (!is_integer($base) || ($base < 2) || ($base > 36)) return FALSE;
+
+            $cmp = bignum_cmp($num, 0);
+            if ($cmp < 0) {
+                return FALSE;
+            }
+    
+            if ($cmp == 0) {
+                return "0";
+            }
+
+            $str = '';
+            while (bignum_cmp($num, 0) > 0) {
+                $r = intval(bignum_val(bignum_mod($num, $base)));
+                $str = base_convert($r, 10, $base) . $str;
+                $num = bignum_div($num, $base);
+            }
+ 
+            return $str;
+    }
+    
+    return FALSE;
+}
+
+/**
+ * Adds two bignums
+ *
+ * @param resource $a
+ * @param resource $b
+ * @return resource a bignum representing a + b
+ */
+function bignum_add($a, $b) {
+    if (BIGNUM_GMP) {
+        return gmp_add($a, $b);
+    } else {
+        return bcadd($a, $b);
+    }
+}
+
+/**
+ * Multiplies two bignums
+ *
+ * @param resource $a
+ * @param resource $b
+ * @return resource a bignum representing a * b
+ */
+function bignum_mul($a, $b) {
+    if (BIGNUM_GMP) {
+        return gmp_mul($a, $b);
+    } else {
+        return bcmul($a, $b);
+    }
+}
+
+/**
+ * Divides two bignums
+ *
+ * @param resource $a
+ * @param resource $b
+ * @return resource a bignum representing a / b
+ */
+function bignum_div($a, $b) {
+    if (BIGNUM_GMP) {
+        return gmp_div($a, $b);
+    } else {
+        return bcdiv($a, $b);
+    }
+}
+
+/**
+ * Raise base to power exp
+ *
+ * @param resource $base the base
+ * @param mixed $exp the exponent, as an integer or a bignum
+ * @return resource a bignum representing base ^ exp
+ */
+function bignum_pow($base, $exp) {
+    if (BIGNUM_GMP) {
+        if (is_resource($exp) && (get_resource_type($exp) == 'gmp')) $exp = gmp_intval($exp);
+        return gmp_pow($base, $exp);
+    } else {
+        return bcpow($base, $exp);
+    }
+}
+
+/**
+ * Returns n modulo d
+ *
+ * @param resource $n
+ * @param resource $d
+ * @return resource a bignum representing n mod d
+ */
+function bignum_mod($n, $d) {
+    if (BIGNUM_GMP) {
+        return gmp_mod($n, $d);
+    } else {
+        return bcmod($n, $d);
+    }
+}
+
+/**
+ * Raise a number into power with modulo
+ *
+ * @param resource $base the base
+ * @param resource $exp the exponent
+ * @param resource $mod the modulo
+ * @return resource a bignum representing base ^ exp mod mod
+ */
+function bignum_powmod($base, $exp, $mod) {
+    if (BIGNUM_GMP) {
+        return gmp_powm($base, $exp, $mod);
+    } elseif (function_exists('bcpowmod')) {
+        return bcpowmod($base, $exp, $mod);
+    } else {
+        $square = bignum_mod($base, $mod);
+        $result = 1;
+        while (bignum_cmp($exp, 0) > 0) {
+            if (bignum_mod($exp, 2)) {
+                $result = bignum_mod(bignum_mul($result, $square), $mod);
+            }
+            $square = bignum_mod(bignum_mul($square, $square), $mod);
+            $exp = bignum_div($exp, 2);
+        }
+        return $result;
+    }
+}
+
+/**
+ * Compares two bignum
+ *
+ * @param resource $a
+ * @param resource $b
+ * @return int positive value if a > b, zero if a = b and a negative value if a < b
+ */
+function bignum_cmp($a, $b) {
+    if (BIGNUM_GMP) {
+        return gmp_cmp($a, $b);
+    } else {
+        return bccomp($a, $b);
+    }
+}
+?>
diff --git a/simpleid/www/cache.inc.php b/simpleid/www/cache.inc.php
new file mode 100644
index 0000000..d555e73
--- /dev/null
+++ b/simpleid/www/cache.inc.php
@@ -0,0 +1,232 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-9
+ *
+ * Includes code Drupal OpenID module (http://drupal.org/project/openid)
+ * Rowan Kerr <rowan@standardinteractive.com>
+ * James Walker <james@bryght.com>
+ *
+ * Copyright (C) Rowan Kerr and James Walker
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Functions for caching and persistence.
+ *
+ * @package simpleid
+ * @filesource
+ */
+ 
+/**
+ *  Stores data into the cache.
+ *
+ * @param string $type the type of data in the cache
+ * @param string $key an identifier
+ * @param mixed $data the data to store
+ * @param int $time if present, sets the modification time of the cache file to this
+ * time
+ */ 
+function cache_set($type, $key, $data, $time = NULL) {
+    $filename = _cache_get_name($type, $key);
+    if (!file_exists(dirname($filename))) mkdir(dirname($filename), 0775, true);
+    $file = fopen($filename, 'w');
+    fwrite($file, serialize($data));
+    fclose($file);
+    
+    if ($time != NULL) {
+        touch($filename, $time);
+    }
+}
+
+/**
+ * Obtains data from the cache.
+ *
+ * @param string $type the type of data in the cache
+ * @param string $key an identifier
+ * @return mixed the data associated with the type and key, or NULL if the cache
+ * does not contain the requested data.
+ */
+function cache_get($type, $key) {
+    $filename = _cache_get_name($type, $key);
+    
+    if (!file_exists($filename)) return NULL;
+    
+    return unserialize(file_get_contents($filename));
+}
+
+/**
+ * Obtains all data of a particular type from the cache.
+ *
+ * @param string $type the type of data in the cache
+ * @return mixed an array of data associated with the type, or NULL if the cache
+ * does not contain the requested data.
+ */
+function cache_get_all($type) {
+    $r = array();
+    
+    if (!is_dir(CACHE_DIR . '/' . $type)) return $r;
+    $dir = opendir(CACHE_DIR . '/' . $type);
+    
+    while (($file = readdir($dir)) !== false) {
+        $filename = CACHE_DIR . '/' . $type . '/' . $file;
+        
+        if (filetype($filename) != "file") continue;
+        
+        $r[] = unserialize(file_get_contents($filename));
+    }
+    
+    closedir($dir);
+    
+    return $r;
+}
+
+/**
+ * Deletes data from the cache.
+ *
+ * @param string $type the type of data in the cache
+ * @param string $key an identifier
+ */
+function cache_delete($type, $key) {
+    $filename = _cache_get_name($type, $key);
+    if (file_exists($filename)) unlink($filename);
+}
+
+/**
+ * Garbage collects data stored the cache.  Data is deleted if it was stored
+ * for longer than the specified expiry.
+ *
+ * This function is deprecated, use {@link cache_expire()}.
+ *
+ * @param int $expiry the expiry time, in seconds, after which data will be deleted
+ * @param string $type the type of data in the cache
+ * @deprecated
+ */
+function cache_gc($expiry, $type = NULL) {
+    if ($type == NULL) {
+        $dir = opendir(CACHE_DIR);
+
+        while (($file = readdir($dir)) !== false) {
+            $filename = CACHE_DIR . '/' . $file;
+            if (in_array(filetype($filename), array('dir', 'link')))
+                cache_gc($expiry, $file);
+        }
+    } else {
+        if (!is_dir(CACHE_DIR . '/' . $type)) return;
+        $dir = opendir(CACHE_DIR . '/' . $type);
+        while (($file = readdir($dir)) !== false) {
+            $filename = CACHE_DIR . '/' . $type . '/' . $file;
+        
+            if ((filetype($filename) == "file") && (filectime($filename) < time() - $expiry))
+                unlink($filename);
+        }
+    }
+    
+    closedir($dir);
+}
+
+/**
+ * Garbage collects data stored the cache.  Data is deleted if it was stored
+ * for longer than the specified expiry.
+ *
+ * The parameter to this function takes either an integer or an array.  If the
+ * parameter is an integer, everything in the cache older than the specified
+ * time (in seconds) will be deleted.  If the parameter is an array, 
+ * cache items of the type specified in the key to the array, older than the
+ * corresponding value will be deleted.
+ *
+ * This function is deprecated, use {@link cache_expire()}.
+ *
+ * @param int|array $params the expiry time, in seconds, after which data will be deleted,
+ * or an array specifiying the expiry time for each type
+ */
+function cache_expire($params) {
+
+    $dirs = array();
+    array_push($dirs, CACHE_DIR);
+    while (sizeof($dirs)) {
+        $dirname = array_pop($dirs);
+        if (($dir = opendir($dirname)) === false) {
+            continue;
+        }
+
+        while (($file = readdir($dir)) !== false) {
+            $expiry = NULL;
+            if ($file == '.' || $file == '..') {
+                continue;
+            }
+            $filename = $dirname . '/' . $file;
+
+            if (is_dir($filename)) {
+                array_push($dirs, $filename);
+                continue;
+            }
+
+            if (is_int($params)) {
+                $expiry = $params;
+            } elseif (is_array($params)) {
+                foreach ($params as $type => $param) {
+                    if (strpos($filename, $type) !== false) {
+                        $expiry = $param;
+                        break;
+                    }
+                }
+            }
+
+            if (!is_null($expiry) && (filetype($filename) == "file") && (filectime($filename) < time() - $expiry)) {
+                unlink($filename);
+            }
+        }
+
+        closedir($dir);
+    }
+}
+
+/**
+ * Returns the time remaining, in seconds, before the data associated with the
+ * type and key become subject to garbage collection by {@link cache_gc()}.
+ *
+ * @param string $type the type of data in the cache
+ * @param string $key an identifier
+ * @param int $expiry the expiry time, in seconds, which would be passed onto the
+ * {@link cache_gc()} function
+ * @return int the time remaining before expiry, rounded downwards,
+ * or zero if the cache does not contain the requested data
+ * @since 0.8
+ */
+function cache_ttl($type, $key, $expiry) {
+    $filename = _cache_get_name($type, $key);
+    
+    if (!file_exists($filename)) return 0;
+    
+    return filectime($filename) - (time() - $expiry) - 1;
+}
+
+/**
+ * Returns the name of the cache data file, given a type and an identifier.
+ *
+ * @param string $type the type of data in the cache
+ * @param string $key an identifier
+ * @return string a file name
+ */
+function _cache_get_name($type, $key) {
+    return CACHE_DIR . '/' . $type . '/' . md5($key) . '.cache';
+}
+
+?>
diff --git a/simpleid/www/common.inc.php b/simpleid/www/common.inc.php
new file mode 100644
index 0000000..b0f3fd6
--- /dev/null
+++ b/simpleid/www/common.inc.php
@@ -0,0 +1,664 @@
+<?php 
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-8
+ *
+ * Includes code Drupal OpenID module (http://drupal.org/project/openid)
+ * Rowan Kerr <rowan@standardinteractive.com>
+ * James Walker <james@bryght.com>
+ *
+ * Copyright (C) Rowan Kerr and James Walker
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Common functions used by SimpleID, and the implementation of extensions.
+ *
+ * @package simpleid
+ * @filesource
+ */
+ 
+/**
+ * Sets a message to display to the user on the rendered SimpleID page.
+ *
+ * @param string $msg the message to set
+ */
+function set_message($msg) {
+    global $xtpl;
+    
+    $xtpl->assign('message', $msg);
+    $xtpl->parse('main.message');
+}
+
+/**
+ * Displays a fatal error message and exits.
+ *
+ * @param string $error the message to set
+ */
+function indirect_fatal_error($error) {
+    global $xtpl;
+    
+    set_message($error);
+    
+    $xtpl->parse('main');
+    $xtpl->out('main');
+    exit;
+}
+
+/**
+ * Send a HTTP response code to the user agent.
+ *
+ * The format of the HTTP response code depends on the way PHP is run.
+ * When run as an Apache module, a properly formatted HTTP response
+ * string is sent.  When run via CGI, the response code is sent via the
+ * Status response header.
+ *
+ * @param string $code the response code along
+ */
+function header_response_code($code) {
+    if (substr(PHP_SAPI, 0,3) === 'cgi') {
+        header('Status: ' . $code);
+    } else {
+        header($_SERVER['SERVER_PROTOCOL'] . ' ' . $code);
+    }
+}
+
+/**
+ * Determines whether the current connection with the user agent is via
+ * HTTPS.
+ *
+ * HTTPS is detected if one of the following occurs:
+ *
+ * - $_SERVER['HTTPS'] is set to 'on' (Apache installations)
+ * - $_SERVER['HTTP_X_FORWARDED_PROTO'] is set to 'https' (reverse proxies)
+ * - $_SERVER['HTTP_FRONT_END_HTTPS'] is set to 'on'
+ *
+ * @return bool true if the connection is via HTTPS
+ */
+function is_https() {
+    return (isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on'))
+        || (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && (strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https'))
+        || (isset($_SERVER['HTTP_FRONT_END_HTTPS']) && ($_SERVER['HTTP_FRONT_END_HTTPS'] == 'on'));
+}
+
+
+/**
+ * Ensure the current connection with the user agent is secure with HTTPS.
+ *
+ * This function uses {@link is_https()} to determine whether the connection
+ * is via HTTPS.  If it is, this function will return successfully.
+ *
+ * If it is not, what happens next is determined by the following steps.
+ *
+ * 1. If $allow_override is true and {@link SIMPLEID_ALLOW_PLAINTEXT} is also true,
+ * then the function will return successfully
+ * 2. Otherwise, then it will either redirect (if $action is
+ * redirect) or return an error (if $action is error)
+ *
+ * @param string $action what to do if connection is not secure - either
+ * 'redirect' or 'error'
+ * @param boolean $allow_override whether SIMPLEID_ALLOW_PLAINTEXT is checked
+ * to see if an unencrypted connection is allowed
+ * @param string $redirect_url if $action is redirect, what URL to redirect to.
+ * If null, this will redirect to the same page (albeit with an HTTPS connection)
+ * @param boolean $strict whether HTTP Strict Transport Security is active
+ * @see SIMPLEID_ALLOW_PLAINTEXT
+ */
+function check_https($action = 'redirect', $allow_override = false, $redirect_url = null, $strict = true) {
+    if (is_https()) {
+        if ($strict) header('Strict-Transport-Security: max-age=3600');
+        return;
+    }
+    
+    if ($allow_override && SIMPLEID_ALLOW_PLAINTEXT) return;
+    
+    if ($action == 'error') {
+        if (substr(PHP_SAPI, 0,3) === 'cgi') {
+            header('Status: 426 Upgrade Required');
+        } else {
+            header($_SERVER['SERVER_PROTOCOL'] . ' 426 Upgrade Required');
+        }
+
+        header('Upgrade: TLS/1.2, HTTP/1.1');
+        header('Connection: Upgrade');
+        indirect_fatal_error(t('An encrypted connection (HTTPS) is required for this page.'));
+        return;
+    }
+    
+    if ($redirect_url == null) $redirect_url = simpleid_url('', $_SERVER['QUERY_STRING'], false, 'https');
+    
+    if (substr(PHP_SAPI, 0,3) === 'cgi') {
+        header('Status: 301 Moved Permanently');
+    } else {
+        header($_SERVER['SERVER_PROTOCOL'] . ' 301 Moved Permanently');
+    }
+        
+    header('Location: ' . $redirect_url);
+}
+
+/**
+ * Fix PHP's handling of request data.  PHP changes dots in all request parameters
+ * to underscores when creating the $_GET, $_POST and $_REQUEST arrays.
+ *
+ * This function scans the original query string and POST parameters and fixes
+ * them.
+ */
+function fix_http_request() {
+    // Fix GET parameters
+    if (isset($_SERVER['QUERY_STRING'])) {
+        $get = parse_http_query($_SERVER['QUERY_STRING']);
+        
+        foreach ($get as $key => $value) {
+            // We strip out array-like identifiers - PHP uses special processing for these
+            if ((strpos($key, '[') !== FALSE) && (strpos($key, ']') !== FALSE)) $key = substr($key, 0, strpos($key, '['));
+            
+            // Replace special characters with underscore as per PHP processing
+            $php_key = preg_replace('/[ .[\x80-\x9F]/', '_', $key);
+            
+            // See if the PHP key is present; if so, copy and delete
+            if (($key != $php_key) && isset($_GET[$php_key])) {
+                $_GET[$key] = $_GET[$php_key];
+                $_REQUEST[$key] = $_REQUEST[$php_key];
+                unset($_GET[$php_key]);
+                unset($_REQUEST[$php_key]);
+            }
+        }
+    }
+    
+    // Fix POST parameters
+    $input = file_get_contents('php://input');
+    if ($input !== FALSE) {
+        $post = parse_http_query($input);
+        
+        foreach ($post as $key => $value) {
+            // We strip out array-like identifiers - PHP uses special processing for these
+            if ((strpos($key, '[') !== FALSE) && (strpos($key, ']') !== FALSE)) $key = substr($key, 0, strpos($key, '['));
+            
+            // Replace special characters with underscore as per PHP processing
+            $php_key = preg_replace('/[ .[\x80-\x9F]/', '_', $key);
+            
+            // See if the PHP key is present; if so, copy and delete
+            if (($key != $php_key) && isset($_POST[$php_key])) {
+                $_POST[$key] = $_POST[$php_key];
+                $_REQUEST[$key] = $_REQUEST[$php_key];
+                unset($_POST[$php_key]);
+                unset($_REQUEST[$php_key]);
+            }
+        }
+    }
+}
+
+/**
+ * Parses a query string.
+ *
+ * @param string $query the query string to parse
+ * @return array an array containing the parsed key-value pairs
+ *
+ * @since 0.7
+ */
+function parse_http_query($query) {
+    $data = array();
+    
+    if ($query === NULL) return array();
+    if ($query === '') return array();
+    
+    $pairs = explode('&', $query);
+    
+    foreach ($pairs as $pair) {
+        list ($key, $value) = explode('=', $pair, 2);
+        $data[$key] = urldecode($value);
+    }
+
+    return $data;
+}
+
+/**
+ * Assigns and returns a unique ID for the user agent (UAID).
+ *
+ * A UAID uniquely identifies the user agent (e.g. browser) used to
+ * make the HTTP request.  The UAID is stored in a long-dated
+ * cookie.  Therefore, the UAID may be useful for security purposes.
+ *
+ * This function will look for a cookie sent by the user agent with
+ * the name returned by {@link simpleid_cookie_name()} with a suffix
+ * of uaid.  If the cookie does not exist, it will generate a
+ * random UAID and return it to the user agent with a Set-Cookie
+ * response header.
+ *
+ * @return string the UAID
+ */
+function get_user_agent_id() {
+    if (isset($_COOKIE[simpleid_cookie_name('uaid')])) return $_COOKIE[simpleid_cookie_name('uaid')];
+
+    $uaid = bin2hex(pack('LLLL', mt_rand(), mt_rand(), mt_rand(), mt_rand()));
+    setcookie(simpleid_cookie_name('uaid'), $uaid, time() + 315360000, get_base_path(), '', false, true);
+    return $uaid;
+}
+
+/**
+ * Content type negotiation using the Accept Header.
+ *
+ * Under HTTP, the user agent is able to negoatiate the content type returned with
+ * the server using HTTP Accept header.  This header contains a comma-delimited
+ * list of items (e.g. content types) which the user agent is able to
+ * accept, ranked by a quality parameter.
+ *
+ * This function takes the header from the user agent, compares it against the
+ * content types which the server can provide, then returns the item which the highest
+ * quality which the server can provide.
+ *
+ * @param array $content_types an array of content types which the server can
+ * provide
+ * @param string $accept_header the header string provided by the user agent.
+ * If NULL, this defaults to $_SERVER['HTTP_ACCEPT'] if available
+ * @return string the negotiated content type, FALSE if $accept_header is NULL and
+ * the user agent did not provide an Accept header, or NULL if the negotiation is
+ * unsuccessful
+ *
+ * @since 0.8
+ *
+ */
+function negotiate_content_type($content_types, $accept_header = NULL) {
+    $content_types = array_map("strtolower", $content_types);
+    if (($accept_header == NULL) && isset($_SERVER['HTTP_ACCEPT'])) $accept_header = $_SERVER['HTTP_ACCEPT'];
+    
+    if ($accept_header) {
+        $acceptible = preg_split('/\s*,\s*/', strtolower(trim($accept_header)));
+        for ($i = 0; $i < count($acceptible); $i++) {
+            $split = preg_split('/\s*;\s*q\s*=\s*/', $acceptible[$i], 2);
+            $item = strtolower($split[0]);
+            
+            if (count($split) == 1) {
+                $q = 1.0;
+            } else {
+                $q = doubleval($split[1]);
+            }
+            
+            if ($q > 0.0) {
+                if (in_array($item, $content_types)) {
+                    if ($q == 1.0) {
+                        return $item;
+                    }
+                    $candidates[$item] = $q;
+                } else {
+                    $item = preg_quote($item, '/');
+                    $item = strtr($item, array('\*' => '[^\\x00-\\x20\\x22\\x28\\x29\\x2c\\x2e\\x3a-\\x3c\\x3e\\x40\\x5b-\\x5d\\x7f-\\xff]+'));
+                    
+                    foreach ($content_types as $value) {
+                        if (preg_match("/^$item$/", $value)) {
+                            if ($q == 1.0) {
+                                return $value;
+                            }
+                            $candidates[$value] = $q;
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+        if (isset($candidates)) {
+            arsort($candidates);
+            reset($candidates);
+            return key($candidates);
+        }
+        return NULL;
+    } else {
+        // No headers
+        return FALSE;
+    }
+}
+
+/**
+ * Serialises a variable for inclusion as a URL parameter.
+ *
+ * @param mixed $data the data to serialise
+ * @return string serialised data
+ * @see unpickle()
+ */
+function pickle($data) {
+    return base64_encode(gzcompress(serialize($data)));
+}
+
+/**
+ * Deserialises data specified in a URL parameter as a variable.
+ *
+ * @param string $pickle the serialised data
+ * @return mixed the deserialised data
+ * @see pickle()
+ */
+function unpickle($pickle) {
+    return unserialize(gzuncompress(base64_decode($pickle)));
+}
+
+/**
+ * Compares two strings using the same time whether they're equal or not.
+ * This function should be used to mitigate timing attacks when, for
+ * example, comparing password hashes
+ *
+ * @param string $str1
+ * @param string $str2
+ * @return bool true if the two strings are equal
+ */
+function secure_compare($str1, $str2) {
+    if (function_exists('hash_equals')) return hash_equals($str1, $str2);
+
+    $xor = $str1 ^ $str2;
+    $result = strlen($str1) ^ strlen($str2); //not the same length, then fail ($result != 0)
+    for ($i = strlen($xor) - 1; $i >= 0; $i--) $result += ord($xor[$i]);
+    return !$result;
+}
+
+/**
+ * Obtains the URI of the current request, given a base URI.
+ *
+ * @param string $base the base URI
+ * @return string the request URI
+ */
+function get_request_uri($base) {
+    $i = strpos($base, '//');
+    $i = strpos($base, '/', $i + 2);
+    
+    if ($i === false) {
+        return $base . $_SERVER['REQUEST_URI'];
+    } else {
+        return substr($base, 0, $i) . $_SERVER['REQUEST_URI'];
+    }
+}
+
+/**
+ * Returns the base URL path, relative to the current host, of the SimpleID
+ * installation.
+ *
+ * This is worked out from {@link SIMPLEID_BASE_URL}.  It will always contain
+ * a trailing slash.
+ *
+ * @return string the base URL path
+ * @since 0.8
+ * @see SIMPLEID_BASE_URL
+ */
+function get_base_path() {
+    static $base_path;
+    
+    if (!$base_path) {
+        if ((substr(SIMPLEID_BASE_URL, -1) == '/') || (substr(SIMPLEID_BASE_URL, -9) == 'index.php')) {
+            $url = SIMPLEID_BASE_URL;
+        } else {
+            $url = SIMPLEID_BASE_URL . '/';
+        }
+        
+        $parts = parse_url($url);
+        $base_path = $parts['path'];
+    }
+    
+    return $base_path;
+}
+
+/**
+ * Determines whether the {@link SIMPLEID_BASE_URL} configuration option is a
+ * HTTPS URL.
+ *
+ * @return true if SIMPLEID_BASE_URL is a HTTPS URL
+ */
+function is_base_https() {
+    return (stripos(SIMPLEID_BASE_URL, 'https:') === 0);
+}
+
+/**
+ * Obtains a SimpleID URL.  URLs produced by SimpleID should use this function.
+ *
+ * @param string $q the q parameter
+ * @param string $params a properly encoded query string
+ * @param bool $relative whether a relative URL should be returned
+ * @param string $secure if $relative is false, either 'https' to force an HTTPS connection, 'http' to force
+ * an unencrypted HTTP connection, 'detect' to base on the current connection, or NULL to vary based on SIMPLEID_BASE_URL
+ * @return string the url
+ *
+ * @since 0.7
+ */
+function simpleid_url($q = '', $params = '', $relative = false, $secure = null) {
+    if ($relative) {
+        $url = get_base_path();
+    } else {
+        // Make sure that the base has a trailing slash
+        if ((substr(SIMPLEID_BASE_URL, -1) == '/') || (substr(SIMPLEID_BASE_URL, -9) == 'index.php')) {
+            $url = SIMPLEID_BASE_URL;
+        } else {
+            $url = SIMPLEID_BASE_URL . '/';
+        }
+        
+        if (($secure == 'https') && (stripos($url, 'http:') === 0)) {
+            $url = 'https:' . substr($url, 5);
+        }
+        if (($secure == 'http') && (stripos($url, 'https:') === 0)) {
+            $url = 'http:' . substr($url, 6);
+        }
+        if (($secure == 'detect') && (is_https()) && (stripos($url, 'http:') === 0)) {
+            $url = 'https:' . substr($url, 5);
+        }
+        if (($secure == 'detect') && (!is_https()) && (stripos($url, 'https:') === 0)) {
+            $url = 'http:' . substr($url, 6);
+        }
+    }
+    
+    if (SIMPLEID_CLEAN_URL) {
+        $url .= $q . (($params == '') ? '' : '?' . $params);
+    } elseif (($q == '') && ($params == '')) {
+        $url .= '';
+    } elseif ($q == '') {
+        $url .= 'index.php?' . $params;
+    } else {
+        $url .= 'index.php?q=' . $q . (($params == '') ? '' : '&' . $params);
+    }
+    return $url;
+}
+
+/**
+ * Obtains the URL of the host of the SimpleID's installation.  The host is worked
+ * out based on SIMPLEID_BASE_URL
+ *
+ * @param string $secure if $relative is false, either 'https' to force an HTTPS connection, 'http' to force
+ * an unencrypted HTTP connection, or NULL to vary based on SIMPLEID_BASE_URL
+ * @return string the url
+ */
+function simpleid_host_url($secure = null) {
+    $parts = parse_url(SIMPLEID_BASE_URL);
+    
+    if ($secure == 'https') {
+        $scheme = 'https';
+    } elseif ($secure == 'http') {
+        $scheme = 'http';
+    } else {
+        $scheme = $parts['scheme'];
+    }
+    
+    $url = $scheme . '://';
+    if (isset($parts['user'])) {
+        $url .= $parts['user'];
+        if (isset($parts['pass'])) $url .= ':' . $parts['pass'];
+        $url .= '@';
+    }
+    $url .= $parts['host'];
+    if (isset($parts['port'])) $url .= ':' . $parts['port'];
+
+    return $url;
+}
+
+/**
+ * Returns a relatively unique cookie name based on a specified suffix and
+ * SIMPLEID_BASE_URL.
+ *
+ * @param string $suffix the cookie name suffix
+ * @return string the cookie name
+ */
+function simpleid_cookie_name($suffix) {
+    static $prefix = NULL;
+
+    if ($prefix == NULL) {
+        $prefix = substr(get_form_token('cookie', FALSE), 0, 7) . '_';
+    }
+    return $prefix . $suffix;
+}
+
+/**
+ * Obtains a form token given a form ID.
+ *
+ * Form tokens are used in SimpleID forms to guard against cross-site forgery
+ * attacks.
+ *
+ * @param string $id the form ID
+ * @param bool $bind_session whether to bind the form token to the current session
+ * @return string a form token
+ */
+function get_form_token($id, $bind_session = TRUE) {
+    global $user;
+
+    if (store_get('site-token') == NULL) {
+        $site_token = pack('LLLL', mt_rand(), mt_rand(), mt_rand(), mt_rand());
+        store_set('site-token', $site_token);
+    } else {
+        $site_token = store_get('site-token');
+    }
+    
+    return _get_form_token($site_token, $id, $bind_session);
+}
+
+/**
+ * Checks whether a form token is valid
+ *
+ * @param string $token the token returned by the user agent
+ * @param string $id the form ID
+ * @param bool $bind_session whether the token has been bound to the current session
+ * @return bool true if the form token is valid
+ */
+function validate_form_token($token, $id, $bind_session = TRUE) {
+    global $user;
+    
+    $site_token = store_get('site-token');
+    
+    return ($token == _get_form_token($site_token, $id, $bind_session));
+}
+
+function _get_form_token($site_token, $id, $bind_session = TRUE) {
+    global $user;
+
+    if (($user == NULL) || (!$bind_session)) {
+        $key = $site_token;
+    } else {
+        $key = session_id() . $site_token;
+    }
+
+    if (function_exists('hash_hmac') && function_exists('hash_algos') && (in_array('sha1', hash_algos()))) {
+        return hash_hmac('sha1', $id, $key);
+    } else {
+        if (strlen($site_token) > 64) {
+            $site_token = sha1($site_token, TRUE);
+        }
+    
+        $site_token = str_pad($site_token, 64, chr(0x00));
+        $ipad = str_repeat(chr(0x36), 64);
+        $opad = str_repeat(chr(0x5c), 64);
+        return bin2hex(sha1(($key ^ $opad) . sha1(($key ^ $ipad) . $text, TRUE), TRUE));
+    }
+}
+
+/* ------- SimpleID extension support ---------------------------------------- */
+
+
+/**
+ * This variable holds an array of extensions specified by the user
+ *
+ * @global array $simpleid_extensions
+ * @see SIMPLEID_EXTENSIONS
+ */
+$simpleid_extensions = array();
+
+/**
+ * Initialises the extension mechanism.  This function looks up the extensions
+ * to load in the {@link SIMPLEID_EXTENSIONS} constants, loads them, then
+ * calls the ns hook.
+ */
+function extension_init() {
+    global $simpleid_extensions;
+    
+    $simpleid_extensions = preg_split('/,\s*/', SIMPLEID_EXTENSIONS);
+    
+    foreach ($simpleid_extensions as $extension) {
+        include_once 'extensions/' . $extension . '/' . $extension . '.extension.php';
+    }
+}
+
+/**
+ * Invokes a hook in all the loaded extensions.
+ *
+ * @param string $function the name of the hook to call
+ * @param mixed $args the arguments to the hook
+ * @return array the return values from the hook
+ */
+function extension_invoke_all() {
+    global $simpleid_extensions;
+    
+    $args = func_get_args();
+    $function = array_shift($args);
+    $return = array();
+    
+    foreach ($simpleid_extensions as $extension) {
+        if (function_exists($extension . '_' . $function)) {
+            log_debug('extension_invoke_all: ' . $extension . '_' . $function);
+            $result = call_user_func_array($extension . '_' . $function, $args);
+            if (isset($result) && is_array($result)) {
+                $return = array_merge($return, $result);
+            } elseif (isset($result)) {
+                $return[] = $result;
+            } 
+        }
+    }
+    
+    return $return;
+}
+
+/**
+ * Invokes a hook in a specified extension.
+ *
+ * @param string $extension the extension to call
+ * @param string $function the name of the hook to call
+ * @param mixed $args the arguments to the hook
+ * @return mixed the return value from the hook
+ */
+function extension_invoke() {
+    $args = func_get_args();
+    $extension = array_shift($args);
+    $function = array_shift($args);
+    
+    if (function_exists($extension . '_' . $function)) {
+        log_debug('extension_invoke: ' . $extension . '_' . $function);
+        return call_user_func_array($extension . '_' . $function, $args);
+    }
+}
+
+/**
+ * Returns an array of currently loaded extensions.
+ *
+ * @return array a list of the names of the currently loaded extensions.
+ */
+function get_extensions() {
+    global $simpleid_extensions;
+    
+    return $simpleid_extensions;
+}
+?>
diff --git a/simpleid/www/config.default.php b/simpleid/www/config.default.php
new file mode 100644
index 0000000..a64e832
--- /dev/null
+++ b/simpleid/www/config.default.php
@@ -0,0 +1,61 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-8
+ *
+ * Includes code Drupal OpenID module (http://drupal.org/project/openid)
+ * Rowan Kerr <rowan@standardinteractive.com>
+ * James Walker <james@bryght.com>
+ *
+ * Copyright (C) Rowan Kerr and James Walker
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+/**
+ * Default configuration settings
+ *
+ * @package simpleid
+ * @filesource
+ */
+
+/**
+ * Define a constant if it has not been defined already.
+ *
+ * @param $name string the name of the constant
+ * @param $value mixed the value of the constant - only scalar and null values
+ * are allowed
+ */
+function define_default($name, $value) {
+    if (!defined($name)) {
+        define($name, $value);
+    }
+}
+
+define_default('SIMPLEID_CLEAN_URL', false);
+define_default('SIMPLEID_ALLOW_PLAINTEXT', false);
+define_default('SIMPLEID_ALLOW_AUTOCOMPLETE', false);
+define_default('SIMPLEID_EXTENSIONS', 'sreg');
+define_default('SIMPLEID_VERIFY_RETURN_URL_USING_REALM', true);
+define_default('SIMPLEID_STORE', 'filesystem');
+define_default('SIMPLEID_STORE_DIR', SIMPLEID_CACHE_DIR);
+define_default('SIMPLEID_LOCALE', 'en');
+define_default('SIMPLEID_LOGFILE', '');
+define_default('SIMPLEID_LOGLEVEL', 4);
+
+if (function_exists('date_default_timezone_set')) date_default_timezone_set(@date_default_timezone_get());
+?>
diff --git a/simpleid/www/config.pear.php b/simpleid/www/config.pear.php
new file mode 100644
index 0000000..0d797a8
--- /dev/null
+++ b/simpleid/www/config.pear.php
@@ -0,0 +1,34 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2012
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Proxy for {@link config.php} for PEAR installations.
+ *
+ * @package pear
+ */
+ 
+include_once 'PEAR/Config.php';
+ 
+$pear_cfg_dir = PEAR_Config::singleton()->get('cfg_dir');
+include_once $pear_cfg_dir . '/simpleid/config.php';
+?>
diff --git a/simpleid/www/config.php.dist b/simpleid/www/config.php.dist
new file mode 100644
index 0000000..4601ae8
--- /dev/null
+++ b/simpleid/www/config.php.dist
@@ -0,0 +1,220 @@
+<?php
+/**
+ * SimpleID configuration file.
+ *
+ * @package simpleid
+ *
+ */
+/*
+ * $Id$
+ *
+ */
+
+
+/**
+ * Base URL.
+ *
+ * This is the URL of the location you want to place your SimpleID
+ * distribution.  It becomes the URL of the SimpleID server.
+ *
+ * It is not allowed to have a trailing slash; SimpleID will add it
+ * for you.
+ *
+ * Examples:
+ * <code>
+ *   define('SIMPLEID_BASE_URL', 'http://www.example.com');
+ *   define('SIMPLEID_BASE_URL', 'http://www.example.com:8888');
+ *   define('SIMPLEID_BASE_URL', 'http://www.example.com/simpleid');
+ *   define('SIMPLEID_BASE_URL', 'https://www.example.com:8888/simpleid');
+ * </code>
+ *
+ */
+define('SIMPLEID_BASE_URL', 'http://www.example.com');
+
+/**
+ * Allow clean URLs.
+ *
+ * URLs used in SimpleID are normally in the form
+ * http://www.example.com/index.php?q=foo.  Enabling clean URLs will allow for
+ * SimpleID URLs to be in the form http://www.example.com/foo
+ *
+ * In order to support clean URLs, you must be using Apache with mod_rewrite
+ * enabled.  You will need to rename .htaccess.dist in the SimpleID web directory
+ * to .htaccess
+ *
+ * @since 0.8
+ *
+ */
+define('SIMPLEID_CLEAN_URL', false);
+
+/**
+ * Directory to store identity information.
+ *
+ * This directory must exist and be readable by the web server.
+ *
+ * For maximum security, it is highly recommended to place this
+ * directory outside your web browser's document root directory, so
+ * that it is not visible to user agents.
+ *
+ */
+define('SIMPLEID_IDENTITIES_DIR', '../identities');
+
+/**
+ * Directory to store cache data.
+ *
+ * This directory must exist and be readable and writable by the
+ * web server.
+ *
+ * For maximum security, it is highly recommended to place this
+ * directory outside your web browser's document root directory, so
+ * that it is not visible to user agents.
+ *
+ */
+define('SIMPLEID_CACHE_DIR', '../cache');
+
+/**
+ * Persistent data storage mechanism.
+ *
+ * SimpleID provides flexible methods to store and retrieve persistent data.
+ * By default, SimpleID uses the file system to store this data, implemented
+ * in filesystem.store.inc.  Users can implement other methods by creating
+ * a file with extension .store.inc and specifying the file through this
+ * setting.
+ * 
+ * Generally you do not need to change this setting.
+ *
+ */
+define('SIMPLEID_STORE', 'filesystem');
+
+/**
+ * Directory to store persistent data.
+ *
+ * This directory must exist and be readable and writable by the
+ * web server.
+ *
+ * For maximum security, it is highly recommended to place this
+ * directory outside your web browser's document root directory, so
+ * that it is not visible to user agents.
+ *
+ */
+define('SIMPLEID_STORE_DIR', '../store');
+
+/**
+ * Allows use of unencrypted connections.
+ *
+ * Between versions 0.6 and 0.8 (inclusive), SimpleID uses either HTTPS or 
+ * a form of digest authentication for its login system.  This allows passwords
+ * and other secure information not to be sent to the server as plaintext.
+ *
+ * From version 0.9, SimpleID mandates the use of HTTPS for all connections
+ * (other than direct connections between SimpleID and an OpenID relying
+ * party).  However, for debug purposes, it may be necessary to allow
+ * unencrypted connections to SimpleID.
+ *
+ * It is strongly recommended that this is set to false.  Setting this to true
+ * will allow passwords to be sent as plaintext.  You should not change this
+ * value unless it is absolutely necessary.
+ *
+ * @since 0.9
+ */
+define('SIMPLEID_ALLOW_PLAINTEXT', false);
+
+/**
+ * Allows web browsers to save passwords.
+ *
+ * SimpleID prevents web browsers from saving user passwords entered in a user
+ * logs into SimpleID.  Setting this value to true will allow browsers to
+ * ask the user whether the password should be saved in the browser's password
+ * store.
+ *
+ * The default is set to false for security reasons.  You should not change
+ * this value unless you are certain regarding the security of your browser's
+ * password store.
+ *
+ * @since 0.8
+ */
+define('SIMPLEID_ALLOW_AUTOCOMPLETE', false);
+
+/**
+ * Performs additional verification of relying party return URLs.
+ *
+ * When authenticating using OpenID version 2, SimpleID version 0.7 or later
+ * can perform additional verification of the relying party's return URLs under
+ * section 9.2.1 of the OpenID specification.
+ *
+ * The default is set to true for security reasons.  However, if your web server
+ * is blocked by your web hosting provider's firewall from accessing outside
+ * servers, then set this to false.
+ *
+ * @since 0.7
+ *
+ */
+define('SIMPLEID_VERIFY_RETURN_URL_USING_REALM', true);
+
+
+/**
+ * The locale for the SimpleID user interface.
+ *
+ * @since 0.9
+ */
+define('SIMPLEID_LOCALE', 'en');
+
+/**
+ * Date and time format.
+ *
+ * The date and time format specified using the strftime() syntax.
+ *
+ * See http://www.php.net/strftime for details.
+ * 
+ */
+define('SIMPLEID_DATE_TIME_FORMAT', '%Y-%m-%d %H:%M:%S %Z');
+
+/**
+ * The number of seconds before associations expire.  This is an advanced
+ * option, for which the default setting should work fine.
+ *
+ * Note that for ICAM compliance, this number must be less than 86400.
+ */
+define('SIMPLEID_ASSOC_EXPIRES_IN', 3600);
+
+/**
+ * SimpleID extensions.
+ *
+ * The SimpleID extensions you wish to load.  You should separate the
+ * extensions you wish to load with a comma.
+ *
+ */
+define('SIMPLEID_EXTENSIONS', 'sreg,ui');
+
+/**
+ * Log file.
+ *
+ * You can specify a file into which SimpleID will log various diagnostic
+ * messages.
+ *
+ * The log file's directory must exist and must be writable by the web server.
+ *
+ * To disable logging, set this as an empty string.
+ *
+ * @since 0.7
+ *
+ */
+define('SIMPLEID_LOGFILE', '');
+
+/**
+ * The level of detail for log messages.
+ *
+ * You can determine which messages are captured in the log file by specifying
+ * a number between 0 and 5. The higher the number, the more messages are
+ * logged.
+ *
+ * WARNING: Setting the log level to 5 will result in security sensitive
+ * information also being logged.
+ *
+ * This has effect only if logging is enabled.
+ *
+ * @since 0.7
+ *
+ */
+define('SIMPLEID_LOGLEVEL', 4);
+?>
diff --git a/simpleid/www/discovery.inc.php b/simpleid/www/discovery.inc.php
new file mode 100644
index 0000000..30c50e6
--- /dev/null
+++ b/simpleid/www/discovery.inc.php
@@ -0,0 +1,649 @@
+<?php 
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-9
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Support for XRDS based discovery.
+ *
+ * The functions for this file supports HTTP-based identifiers.  For XRIs, the
+ * resolution service xri.net is used to resolve to HTTP-based URLs.
+ *
+ * @package simpleid
+ * @since 0.7
+ * @filesource
+ */
+ 
+include_once "http.inc.php";
+
+/**
+ * The namespace identifier for an XRDS document.
+ */
+define('XRDS_NS', 'xri://$xrds');
+
+/**
+ * The namespace identifier for XRDS version 2.
+ */
+define('XRD2_NS', 'xri://$xrd*($v*2.0)');
+
+/**
+ * The namespace identifier for XRDS Simple.
+ */
+define('XRDS_SIMPLE_NS', 'http://xrds-simple.net/core/1.0');
+
+/**
+ * The type identifier for XRDS Simple.
+ */
+define('XRDS_SIMPLE_TYPE', 'xri://$xrds*simple');
+
+/**
+ * The namespace identifier for OpenID services.
+ */
+define('XRD_OPENID_NS', 'http://openid.net/xmlns/1.0');
+
+/**
+ * Obtains the services for particular identifier.
+ *
+ * This function attempts to discover and obtain the XRDS document associated
+ * with the identifier, parses the XRDS document and returns an array of
+ * services.
+ *
+ * If an XRDS document is not found, and $openid is set to true, this function
+ * will also attempt to discover OpenID services by looking for link elements
+ * with rel of openid.server or openid2.provider in the discovered HTML document.
+ *
+ * @param string $identifier the identifier
+ * @param bool $openid if true, performs additional discovery of OpenID services
+ * by looking for link elements within the discovered document
+ * @return array an array of discovered services, or an empty array if no services
+ * are found
+ */
+function discovery_xrds_discover($identifier, $openid = FALSE) {
+    $identifier = discovery_xrds_normalize($identifier);
+    $url = discovery_xrds_url($identifier);
+    
+    $xrds = discovery_xrds_get($url);
+
+    if ($xrds) {
+        return discovery_xrds_parse($xrds);
+    } else {
+        if ($openid) return discovery_html_get_services($url);
+        return array();
+    }
+}
+
+/**
+ * Given an array of discovered services, obtains information on services of
+ * a particular type.
+ *
+ * @param array $services the discovered services
+ * @param string $type the URI of the type of service to obtain
+ * @return array an array of matching services, or an empty array of no services
+ * match
+ */
+function discovery_xrds_services_by_type($services, $type) {
+    $matches = array();
+    
+    foreach ($services as $service) {
+        foreach ($service['type'] as $service_type) {
+            if ($service_type == $type) $matches[] = $service;
+        }
+    }
+    return $matches;
+}
+
+/**
+ * Given an array of discovered services, obtains information on the service of
+ * a specified ID.
+ *
+ * @param array $services the discovered services
+ * @param string $id the XML ID of the service in the XRDS document
+ * @return array the matching service, or NULL of no services
+ * are found
+ */
+function discovery_xrds_service_by_id($services, $id) {
+    foreach ($services as $service) {
+        if ($service['#id'] == $id) return $service;
+    }
+    return NULL;
+}
+
+/**
+ * Obtains a XRDS document at a particular URL.  Performs Yadis discovery if
+ * the URL does not produce a XRDS document.
+ *
+ * @param string $url the URL
+ * @param bool $check whether to check the content type of the response is
+ * application/xrds+xml
+ * @param int $retries the number of tries to make
+ * @return string the contents of the XRDS document
+ */
+function discovery_xrds_get($url, $check = TRUE, $retries = 5) {
+    if ($retries == 0) return NULL;
+    
+    $response = http_make_request($url, array('Accept' => 'application/xrds+xml'));
+
+    if (isset($response['http-error'])) return NULL;
+    if (($response['content-type'] == 'application/xrds+xml') || ($check == FALSE)) {
+        return $response['data'];
+    } elseif (isset($response['headers']['x-xrds-location'])) {
+        return discovery_xrds_get($response['headers']['x-xrds-location'], false, $retries - 1);
+    } elseif (isset($response['data'])) {
+        $location = _discovery_meta_httpequiv('X-XRDS-Location', $response['data']);
+        if ($location) {
+            return discovery_xrds_get($location, false, $retries - 1);
+        }
+        return NULL;
+    } else {
+        return NULL;
+    }
+}
+
+/**
+ * Normalises an identifier for discovery.
+ *
+ * If the identifier begins with xri://, acct: or mailto:, this is stripped out.  If the identifier
+ * does not begin with a valid URI scheme, http:// is assumed and added to the
+ * identifier.
+ *
+ * @param string $identifier the identifier to normalise
+ * @return string the normalised identifier
+ */
+function discovery_xrds_normalize($identifier) {
+    $normalized = $identifier;
+    
+    if (discovery_is_xri($identifier)) {
+        if (stristr($identifier, 'xri://') !== false) $normalized = substr($identifier, 6);
+    } elseif (discovery_is_email($identifier)) {
+        if (stristr($identifier, 'acct:') !== false) $normalized = substr($identifier, 5);
+        if (stristr($identifier, 'mailto:') !== false) $normalized = substr($identifier, 7);
+    } else {
+        if (stristr($identifier, '://') === false) $normalized = 'http://'. $identifier;
+        if (substr_count($normalized, '/') < 3) $normalized .= '/';
+    }
+    
+    return $normalized;
+}
+
+/**
+ * Obtains a URL for an identifier.  If the identifier is a XRI, the XRI resolution
+ * service is used to convert the identifier to a URL.
+ *
+ * @param string $identifier the identifier
+ * @return string the URL
+ */
+function discovery_xrds_url($identifier) {
+    if (discovery_is_xri($identifier)) {
+        return 'http://xri.net/' . $identifier;
+    } elseif (discovery_is_email($identifier)) {
+        //list($user, $host) = explode('@', $identifier, 2);
+        //$host_meta = 'http://' . $host . '/.well-known/host-meta';
+    } else {
+        return $identifier;
+    }
+
+}
+
+/**
+ * Determines whether an identifier is an XRI.
+ *
+ * XRI identifiers either start with xri:// or with @, =, +, $ or !.
+ *
+ * @param string $identifier the parameter to test
+ * @return bool true if the identifier is an XRI
+ */
+function discovery_is_xri($identifier) {
+    $firstchar = substr($identifier, 0, 1);
+    if ($firstchar == "@" || $firstchar == "=" || $firstchar == "+" || $firstchar == "\$" || $firstchar == "!") return true;
+    if (stristr($identifier, 'xri://') !== FALSE) return true;
+    return false;
+}
+
+/**
+ * Determines whether an identifier is an e-mail address.
+ *
+ * An identifier is an e-mail address if it:
+ *
+ * - has a single @ character
+ * - does not have a slash character
+ *
+ * @param string $identifier the parameter to test
+ * @return bool true if the identifier is an e-mail address
+ */
+function discovery_is_email($identifier) {
+    // If it begins with acct: or mailto:, strip it out
+    if (stristr($identifier, 'acct:') !== false) $identifier = substr($identifier, 5);
+    if (stristr($identifier, 'mailto:') !== false) $identifier = substr($identifier, 7);
+    
+    // If it contains a slash, it is not an e-mail address
+    if (strpos($identifier, "/") !== false) return false;
+    
+    $at = strpos($identifier, "@");
+    
+    // If it does not contain a @, it is not an e-mail address
+    if ($at === false) return false;
+    
+    // If it contains more than one @, it is not an e-mail
+    if (strrpos($identifier, "@") != $at) return false;
+    
+    return true;
+}
+
+
+/**
+ * Callback function to sort service and URI elements based on priorities
+ * specified in the XRDS document.
+ *
+ * The XRDS specification allows multiple instances of certain elements, such
+ * as Service and URI.  The specification allows an attribute called priority
+ * so that the document creator can specify the order the elements should be used.
+ *
+ * @param array $a
+ * @param array $b
+ * @return int
+ */
+function discovery_xrds_priority_sort($a, $b) {
+    if (!isset($a['#priority']) && !isset($b['#priority'])) return 0;
+    
+    // if #priority is missing, #priority is assumed to be infinity
+    if (!isset($a['#priority'])) return 1;
+    if (!isset($b['#priority'])) return -1;
+    
+    if ($a['#priority'] == $b['#priority']) return 0;
+    return ($a['#priority'] < $b['#priority']) ? -1 : 1;
+}
+
+/**
+ * Parses an XRDS document to return services available.
+ *
+ * @param string $xrds the XRDS document
+ * @return array the parsed structure
+ *
+ * @see XRDSParser
+ */
+function discovery_xrds_parse($xrds) {
+    $parser = new XRDSParser();
+    $parser->parse($xrds);
+    $parser->free();
+    $services = $parser->services();
+    uasort($services, 'discovery_xrds_priority_sort');
+
+    return $services;
+}
+
+/**
+ * Obtains the OpenID services for particular identifier by scanning for link
+ * elements in the returned document.
+ *
+ * Note that this function does not use the YADIS protocol to scan for services.
+ * To use the YADIS protocol, use {@link discovery_get_services()}.
+ *
+ * @param string $url the URL
+ * @return array an array of discovered services, or an empty array if no services
+ * are found
+ */
+function discovery_html_get_services($url) {
+    $services = array();
+        
+    $response = http_make_request($url);
+    $html = $response['data'];
+        
+    $uri = _discovery_link_rel('openid2.provider', $html);
+    $delegate = _discovery_link_rel('openid2.local_id', $html);
+    
+    if ($uri) {
+        $service = array(
+            'type' => 'http://specs.openid.net/auth/2.0/signon',
+            'uri' => $uri
+            );
+        if ($delegate) $service['localid'] = $delegate;
+        $services[] = $service;
+    }
+
+    $uri = _discovery_link_rel('openid.server', $html);
+    $delegate = _discovery_link_rel('openid.delegate', $html);
+        
+    if ($uri) {
+        $service = array(
+            'type' => 'http://openid.net/signon/1.0',
+            'uri' => $uri
+            );
+        if ($delegate) $service['localid'] = $delegate;
+        $services[] = $service;
+    }
+    
+    return $services;
+}
+
+/**
+ * Searches through an HTML document to obtain the value of a meta
+ * element with a specified http-equiv attribute.
+ *
+ * @param string $equiv the http-equiv attribute for which to search
+ * @param string $html the HTML document to search
+ * @return mixed the value of the meta element, or FALSE if the element is not
+ * found
+ */
+function _discovery_meta_httpequiv($equiv, $html) {
+    $html = preg_replace('/<!(?:--(?:[^-]*|-[^-]+)*--\s*)>/', '', $html); // Strip html comments
+    
+    $equiv = preg_quote($equiv);
+    preg_match('|<meta\s+http-equiv=["\']'. $equiv .'["\'](.*)/?>|iUs', $html, $matches);
+    if (isset($matches[1])) {
+        preg_match('|content=["\']([^"]+)["\']|iUs', $matches[1], $content);
+        if (isset($content[1])) {
+            return $content[1];
+        }
+    }
+    return FALSE;
+}
+
+/**
+ * Searches through an HTML document to obtain the value of a link
+ * element with a specified rel attribute.
+ *
+ * @param string $rel the rel attribute for which to search
+ * @param string $html the HTML document to search
+ * @return mixed the href of the link element, or FALSE if the element is not
+ * found
+ */
+function _discovery_link_rel($rel, $html) {
+    $html = preg_replace('/<!(?:--(?:[^-]*|-[^-]+)*--\s*)>/s', '', $html); // Strip html comments
+    
+    $rel = preg_quote($rel);
+    preg_match('|<link\s+rel=["\'](.*)'. $rel .'(.*)["\'](.*)/?>|iUs', $html, $matches);
+    if (isset($matches[3])) {
+        preg_match('|href=["\']([^"]+)["\']|iU', $matches[3], $href);
+        return trim($href[1]);
+    }
+    return FALSE;
+}
+
+/**
+ * A simple XRDS parser.
+ *
+ * This parser uses the classic expat functions available in PHP to parse the
+ * XRDS Simple XML document.
+ *
+ * The result is an array of discovered services.
+ *
+ * @link http://xrds-simple.net/
+ */
+class XRDSParser {
+    /**
+     * XML parser
+     * @var resource
+     * @access private
+     */
+    var $parser;
+    
+    /**
+     * Discovered services
+     * @var array
+     * @access private
+     */
+    var $services = array();
+    
+    /**
+     * State: are we parsing a service element?
+     * @var bool
+     * @access private
+     */
+    var $in_service = FALSE;
+    
+    /**
+     * CDATA buffer
+     * @var string
+     * @access private
+     */
+    var $_buffer;
+    /**
+     * Attributes buffer
+     * @var array
+     * @access private
+     */
+    var $_attribs = array();
+    
+    /**
+     * priority attribute buffer
+     * @var string
+     * @access private
+     */
+    var $priority = NULL;
+    
+    /**
+     * Currently parsed service buffer
+     * @var array
+     * @access private
+     */
+    var $service = array();
+    
+    /**
+     * Creates an instance of the XRDS parser.
+     *
+     * This constructor also initialises the underlying XML parser.
+     */
+    function XRDSParser() {
+        $this->parser = xml_parser_create_ns();
+        xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING,0);
+        xml_set_object($this->parser, $this);
+        xml_set_element_handler($this->parser, 'element_start', 'element_end');
+        xml_set_character_data_handler($this->parser, 'cdata');
+    }
+    
+    /**
+     * Frees memory associated with the underlying XML parser.
+     *
+     * Note that only the memory associated with the underlying XML parser is
+     * freed.  Memory associated with the class itself is not freed.
+     *
+     * @access public
+     */
+    function free() {
+        xml_parser_free($this->parser);
+    }
+    
+    /**
+     * Parses an XRDS document.
+     *
+     * Once the parsing is complete, use {@link XRDSParser::services()} to obtain
+     * the services extracted from the document.
+     *
+     * @param string $xml the XML document to parse
+     * @access public
+     */
+    function parse($xml) {
+        xml_parse($this->parser, $xml);
+    }
+    
+    /**
+     * Gets an array of discovered services.
+     *
+     * @return array an array of discovered services, or an empty array
+     * @access public
+     * @see XRDSParser::parse()
+     */
+    function services() {
+        return $this->services;
+    }
+    
+    /**
+     * XML parser callback
+     *
+     * @access private
+     */
+    function element_start(&$parser, $qualified, $attribs) {
+        list($ns, $name) = $this->parse_namespace($qualified);
+
+        // Strictly speaking, XML namespace URIs are semi-case sensitive
+        // (i.e. the scheme and host are not case sensitive, but other elements
+        // are).  However, the XRDS-Simple specifications defines a
+        // namespace URI for XRD (xri://$XRD*($v*2.0) rather than xri://$xrd*($v*2.0))
+        // with an unusual case.
+        if ((strtolower($ns) == strtolower(XRD2_NS)) && ($name == 'Service')) {
+            $this->in_service = TRUE;
+            $this->service = array();
+            
+            if (in_array('priority', $attribs)) {
+                $this->service['#priority'] = $attribs['priority'];
+            }
+            if (in_array('id', $attribs)) {
+                $this->service['#id'] = $attribs['id'];
+            }
+        }
+        
+        if ((strtolower($ns) == strtolower(XRD2_NS)) && ($this->in_service)) {
+            switch ($name) {
+                case 'Type':
+                case 'LocalID':
+                case 'URI':
+                    if (in_array('priority', $attribs)) {
+                        $this->priority = $attribs['priority'];
+                    } else {
+                        $this->priority = NULL;
+                    }
+            }
+        }
+        
+        $this->_buffer = '';
+        $this->_attribs = $attribs;
+    }
+
+    /**
+     * XML parser callback
+     *
+     * @access private
+     */
+    function element_end(&$parser, $qualified) {
+        list($ns, $name) = $this->parse_namespace($qualified);
+        
+        if ((strtolower($ns) == strtolower(XRD2_NS)) && ($this->in_service)) {
+            switch ($name) {
+                case 'Service':
+                    foreach (array('type', 'localid', 'uri') as $key) {
+                        if (!isset($this->service[$key])) continue;
+                        $this->service[$key] = $this->flatten_uris($this->service[$key]);
+                    }
+                
+                    $this->services[] = $this->service;
+                    $this->in_service = FALSE;
+                    break;
+
+                case 'Type':
+                case 'LocalID':
+                case 'URI':
+                    $key = strtolower($name);
+                    if (!isset($this->service[$key])) {
+                        $this->service[$key] = array();
+                    }
+                    if ($this->priority != NULL) {
+                        $this->service[$key][] = array('#uri' => trim($this->_buffer), '#priority' => $this->priority);
+                    } else {
+                        $this->service[$key][] = array('#uri' => trim($this->_buffer));
+                    }
+                    $this->priority = NULL;
+                    break;
+            }
+        }
+        
+        if ((strtolower($ns) == strtolower(XRD_OPENID_NS)) && ($this->in_service)) {
+            switch ($name) {
+                case 'Delegate':
+                    $this->service['delegate'] = trim($this->_buffer);
+            }
+        }
+
+        $this->_attribs = array();
+    }
+
+    /**
+     * XML parser callback
+     *
+     * @access private
+     */
+    function cdata(&$parser, $data) {
+        $this->_buffer .= $data;
+    }
+    
+    /**
+     * Parses a namespace-qualified element name.
+     *
+     * @param string $qualified the qualified name
+     * @return array an array with two elements - the first element contains
+     * the namespace qualifier (or an empty string), the second element contains
+     * the element name
+     * @access protected
+     */
+    function parse_namespace($qualified) {
+        $pos = strrpos($qualified, ':');
+        if ($pos !== FALSE) return array(substr($qualified, 0, $pos), substr($qualified, $pos + 1, strlen($qualified)));
+        return array('', $qualified);
+    }
+    
+    /**
+     * Flattens the service array.
+     *
+     * In an XRDS document, child elements of the service element often contains
+     * a list of URIs, with the priority specified in the priority attribute.
+     *
+     * When the document is parsed in this class, the URI and the priority are first
+     * extracted into the #uri and the #priority keys respectively.  This function
+     * takes this array, sorts the elements using the #priority keys (if $sort is
+     * true), then collapses the array using the value associated with the #uri key.
+     *
+     * @param array $array the service array, with URIs and priorities
+     * @param bool $sort whether to sort the service array using the #priority
+     * keys
+     * @return array the services array with URIs sorted by priority
+     * @access protected
+     */
+    function flatten_uris($array, $sort = TRUE) {
+        $result = array();
+        
+        if ($sort) uasort($array, 'discovery_xrds_priority_sort');
+        
+        for ($i = 0; $i < count($array); $i++) {
+            $result[] = $array[$i]['#uri'];
+        }
+        
+        return $result;
+    }
+}
+
+if (!function_exists('rfc3986_urlencode')) {
+    /**
+     * Encodes a URL using RFC 3986.
+     *
+     * PHP's rawurlencode function encodes a URL using RFC 1738.  RFC 1738 has been
+     * updated by RFC 3986, which change the list of characters which needs to be
+     * encoded.
+     *
+     * Strictly correct encoding is required for various purposes, such as OAuth
+     * signature base strings.
+     *
+     * @param string $s the URL to encode
+     * @return string the encoded URL
+     */
+    function rfc3986_urlencode($s) {
+        return str_replace('%7E', '~', rawurlencode($s));
+    }
+}
+?>
diff --git a/simpleid/www/extensions/ax/ax.extension.php b/simpleid/www/extensions/ax/ax.extension.php
new file mode 100644
index 0000000..1286c52
--- /dev/null
+++ b/simpleid/www/extensions/ax/ax.extension.php
@@ -0,0 +1,327 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2009
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Implements the Attribute Exchange extension.
+ * 
+ *
+ * @package simpleid
+ * @subpackage extensions
+ * @filesource
+ */
+
+/** Namespace for the AX extension */
+define('OPENID_NS_AX', 'http://openid.net/srv/ax/1.0');
+
+/** @ignore */
+global $ax_sreg_map;
+
+/**
+ * A mapping between Type URIs defined for Attribute Exchange and the corresponding
+ * property for the Simple Registration Extension
+ *
+ * @link http://www.axschema.org/types/#sreg
+ * @global array
+ */
+$ax_sreg_map = array(
+    'http://axschema.org/namePerson/friendly' => 'nickname',
+    'http://axschema.org/contact/email' => 'email',
+    'http://axschema.org/namePerson' => 'fullname',
+    'http://axschema.org/birthDate' => 'dob',
+    'http://axschema.org/person/gender' => 'gender',
+    'http://axschema.org/contact/postalCode/home' => 'postcode',
+    'http://axschema.org/contact/country/home' => 'country',
+    'http://axschema.org/pref/language' => 'language',
+    'http://axschema.org/pref/timezone' => 'timezone',
+    'http://openid.net/schema/namePerson/friendly' => 'nickname',
+    'http://openid.net/schema/contact/internet/email' => 'email',
+    'http://openid.net/schema/gender' => 'gender',
+    'http://openid.net/schema/contact/postalCode/home' => 'postcode',
+    'http://openid.net/schema/contact/country/home' => 'country',
+    'http://openid.net/schema/language/pref' => 'language',
+    'http://openid.net/schema/timezone' => 'timezone'
+);
+
+/**
+ * Returns the support for AX in SimpleID XRDS document
+ *
+ * @return array
+ * @see hook_xrds_types()
+ */
+function ax_xrds_types() {
+    return array(OPENID_NS_AX);
+}
+
+/**
+ * @see hook_response()
+ */
+function ax_response($assertion, $request) {
+    global $user;
+    global $version;
+    global $ax_sreg_map;
+    
+    // We only deal with positive assertions
+    if (!$assertion) return array();
+    
+    // We only respond if the extension is requested
+    if (!openid_extension_requested(OPENID_NS_AX, $request)) return array();
+    
+    $request = openid_extension_filter_request(OPENID_NS_AX, $request);
+    if (!isset($request['mode'])) return array();
+    $mode = $request['mode'];
+    
+    $response = array();
+    $alias = openid_extension_alias(OPENID_NS_AX);
+    $response['openid.ns.' . $alias] = OPENID_NS_AX;
+    
+    if ($mode == 'fetch_request') {
+        $response['openid.' . $alias . '.mode'] = 'fetch_response';
+        
+        $required = (isset($request['required'])) ? explode(',', $request['required']) : array();
+        $optional = (isset($request['if_available'])) ? explode(',', $request['if_available']) : array();
+        $fields = array_merge($required, $optional);
+        
+        foreach ($fields as $field) {
+            $type = $request['type.' . $field];
+            $response['openid.' . $alias . '.type.' . $field] = $type;
+            $value = _ax_get_value($type);
+            
+            if ($value == NULL) {
+                $response['openid.' . $alias . '.count.' .  $field] = 0;
+            } elseif (is_array($value)) {
+                $response['openid.' . $alias . '.count.' .  $field] = count($value);
+                for ($i = 0; $i < count($value); $i++) {
+                    $response['openid.' . $alias . '.value.' .  $field . '.' . ($i + 1)] = $value[$i];
+                }
+            } else {
+                $response['openid.' . $alias . '.value.' .  $field] = $value;
+            }
+        }
+    } elseif ($mode == 'store_request') {
+        // Sadly, we don't support storage at this stage
+        $response['openid.' . $alias . '.mode'] = 'store_response_failure';
+        $response['openid.' . $alias . '.error'] = 'OpenID provider does not support storage of attributes';
+    }
+    
+    return $response;
+}
+
+/**
+ * Returns an array of fields that need signing.
+ *
+ * @see hook_signed_fields()
+ */
+function ax_signed_fields($response) {
+    // We only respond if the extension is requested
+    if (!openid_extension_requested(OPENID_NS_AX, $response)) return array();
+    
+    $fields = array_keys(openid_extension_filter_request(OPENID_NS_AX, $response));
+    $alias = openid_extension_alias(OPENID_NS_AX);
+    $signed_fields = array();
+
+    if (isset($response['openid.ns.' . $alias])) $signed_fields[] = 'ns.' . $alias;
+    foreach ($fields as $field) {
+        if (isset($response['openid.' . $alias . '.' . $field])) $signed_fields[] = $alias . '.' . $field;
+    }
+    
+    return $signed_fields;
+}
+
+/**
+ * @see hook_consent_form()
+ */
+function ax_consent_form($request, $response, $rp) {
+    global $user;
+    
+    // We only respond if the extension is requested
+    if (!openid_extension_requested(OPENID_NS_AX, $request)) return '';
+    
+    $request = openid_extension_filter_request(OPENID_NS_AX, $request);
+    if (!isset($request['mode'])) return '';
+    $mode = $request['mode'];
+    
+    $xtpl2 = new XTemplate('extensions/ax/ax.xtpl');
+    
+    if ($mode == 'fetch_request') {
+        $xtpl2->assign('alias', openid_extension_alias(OPENID_NS_AX));
+        
+        $required = (isset($request['required'])) ? explode(',', $request['required']) : array();
+        $optional = (isset($request['if_available'])) ? explode(',', $request['if_available']) : array();
+        $fields = array_merge($required, $optional);
+        $i = 1;
+        
+        foreach ($fields as $field) {
+            $type = $request['type.' . $field];
+            $value = _ax_get_value($type);
+            
+            $xtpl2->assign('name', htmlspecialchars($type, ENT_QUOTES, 'UTF-8'));
+            $xtpl2->assign('id', $i);
+            
+            if (is_array($value)) {
+                $xtpl2->assign('value', htmlspecialchars(implode(',', $value), ENT_QUOTES, 'UTF-8'));
+            } elseif ($value != NULL) {
+                $xtpl2->assign('value', htmlspecialchars($value, ENT_QUOTES, 'UTF-8'));
+            }
+            
+            $xtpl2->assign('checked', (in_array($field, $required) || !isset($rp['ax_consents']) || in_array($field, $rp['ax_consents'])) ? 'checked="checked"' : '');
+            $xtpl2->assign('disabled', (in_array($field, $required)) ? 'disabled="disabled"' : '');
+            if (in_array($field, $required)) $xtpl2->parse('fetch_request.ax.required');
+            
+            $xtpl2->parse('fetch_request.ax');
+            
+            $i++;
+        }
+
+        $xtpl2->assign('ax_data', t('SimpleID will also be sending the following information to the site.'));
+        $xtpl2->assign('name_label', t('Type URL'));
+        $xtpl2->assign('value_label', t('Value'));
+        
+        $xtpl2->parse('fetch_request');
+        return $xtpl2->text('fetch_request');
+    } elseif ($mode == 'store_request') {
+        // Sadly, we don't support storage at this stage
+        $xtpl2->assign('store_request_message', t('This web site requested to store information about you on SimpleID. Sadly, SimpleID does not support this feature.'));
+        $xtpl2->parse('store_request');
+        return $xtpl2->text('store_request');
+    }
+}
+
+/**
+ * @see hook_consent()
+ */
+function ax_consent($form_request, &$response, &$rp) {
+    // We only respond if the extension is requested
+    if (!openid_extension_requested(OPENID_NS_AX, $response)) return array();
+    
+    $fields = array_keys(openid_extension_filter_request(OPENID_NS_AX, $response));
+    $alias = openid_extension_alias(OPENID_NS_AX);
+    
+    foreach ($fields as $field) {
+        if ((strpos($field, 'value.') !== 0) && (strpos($field, 'count.') !== 0)) continue;
+        
+        $type_alias = (strpos($field, '.', 6) === FALSE) ? substr($field, 6) : substr($field, strpos($field, '.', 6) - 6);
+        $type = $response['openid.' . $alias . '.type.' . $type_alias];
+        
+        if (isset($response['openid.' . $alias . '.' . $field])) {
+            if (!in_array($type, $form_request['ax_consents'])) {
+                unset($response['openid.' . $alias . '.' . $field]);
+            }
+        }
+    }
+    foreach ($fields as $field) {
+        if (strpos($field, 'type.') !== 0) continue;
+        $type = $response['openid.' . $alias . '.' . $field];
+        
+        if (isset($response['openid.' . $alias . '.' . $field])) {
+            if (!in_array($type, $form_request['ax_consents'])) {
+                unset($response['openid.' . $alias . '.' . $field]);
+            }
+        }
+    }
+    
+    if (count(array_keys(openid_extension_filter_request(OPENID_NS_AX, $response))) == 0) {
+        // We have removed all the responses, so we remove the namespace as well
+        unset($response['openid.ns.' . $alias]);
+    }
+    
+    $rp['ax_consents'] = $form_request['ax_consents'];
+}
+
+/**
+ * @see hook_page_profile()
+ */
+function ax_page_profile() {
+    global $user;
+    $xtpl2 = new XTemplate('extensions/ax/ax.xtpl');
+    
+    if (isset($user['ax'])) {
+        foreach ($user['ax'] as $name => $value) {
+            $xtpl2->assign('name', htmlspecialchars($name, ENT_QUOTES, 'UTF-8'));
+            $xtpl2->assign('value', htmlspecialchars($value, ENT_QUOTES, 'UTF-8'));
+            $xtpl2->parse('user_page.ax');
+        }
+    }
+    
+    $xtpl2->assign('ax_data', t('SimpleID will send the following information to sites which supports the Attribute Exchange Extension.  If you have also supplied OpenID Connect user information in your identity, or have the Simple Registration Extension installed, these may also be sent as part of this Extension.'));
+    $xtpl2->assign('edit_identity_file', t('To change these, <a href="!url">edit your identity file</a>.', array('!url' => 'http://simpleid.org/docs/1/identity-files/')));
+    $xtpl2->assign('name_label', t('Type URL'));
+    $xtpl2->assign('value_label', t('Value'));
+    
+    $xtpl2->parse('user_page');
+    
+    return array(array(
+        'id' => 'ax',
+        'title' => t('Attribute Exchange Extension'),
+        'content' => $xtpl2->text('user_page')
+    ));
+}
+
+/**
+ * Looks up the value of a specified Attribute Exchange Extension type URI.
+ *
+ * This function looks up the ax section of the user's identity file.  If the
+ * specified type cannot be found, it looks up the corresponding field in the
+ * OpenID Connect user information (user_info section) and the Simple Registration
+ * Extension (sreg section).
+ *
+ * @param string $type the type URI to look up
+ * @return string the value or NULL if not found
+ */
+function _ax_get_value($type) {
+    global $user;
+    global $ax_sreg_map;
+    
+    if (isset($user['ax'][$type])) {
+        return $user['ax'][$type];
+    } else {
+        // Look up OpenID Connect
+        switch ($type) {
+            case 'http://axschema.org/namePerson/friendly':
+                if (isset($user['user_info']['nickname'])) return $user['user_info']['nickname'];
+                break;
+            case 'http://axschema.org/contact/email':
+                if (isset($user['user_info']['email'])) return $user['user_info']['email'];
+                break;
+            case 'http://axschema.org/namePerson':
+                if (isset($user['user_info']['name'])) return $user['user_info']['name'];
+                break;
+            case 'http://axschema.org/pref/timezone':
+                if (isset($user['user_info']['zoneinfo'])) return $user['user_info']['zoneinfo'];
+                break;
+            case 'http://axschema.org/person/gender':
+                if (isset($user['user_info']['gender'])) return strtoupper(substr($user['user_info']['gender'], 0, 1));
+                break;
+            case 'http://axschema.org/contact/postalCode/home':
+                if (isset($user['user_info']['address']['postal_code'])) return $user['user_info']['address']['postcal_code'];
+                break;
+        } 
+        
+        // Look up sreg
+        if (isset($ax_sreg_map[$type]) && isset($user['sreg'][$ax_sreg_map[$type]])) {
+            return $user['sreg'][$ax_sreg_map[$type]];
+        } else {
+            return NULL;
+        }
+    }
+}
+?>
diff --git a/simpleid/www/extensions/ax/ax.xtpl b/simpleid/www/extensions/ax/ax.xtpl
new file mode 100644
index 0000000..bf9edbe
--- /dev/null
+++ b/simpleid/www/extensions/ax/ax.xtpl
@@ -0,0 +1,44 @@
+<!-- BEGIN: user_page -->
+<!-- :mode=html: $Id$ -->
+    <p>{ax_data}</p>
+    
+    <p>{edit_identity_file}</p>
+    
+    <table>
+        <tr>
+            <th>{name_label}</th>
+            <th>{value_label}</th>
+        </tr>
+        <!-- BEGIN: ax -->
+        <tr>
+            <td>{name}</td>
+            <td>{value}</td>
+        </tr>
+        <!-- END: ax -->
+    </table>
+<!-- END: user_page -->
+            
+<!-- BEGIN: fetch_request -->
+    <p>{ax_data}</p>
+    
+    <table>
+        <tr>
+            <th></th>
+            <th>{name_label}</th>
+            <th>{value_label}</th>
+        </tr>
+        <!-- BEGIN: ax -->
+        <tr>
+            <td><input name="ax_consents[]" type="checkbox" value="{name}" id="ax-consents-{id}" {checked} {disabled} /><!-- BEGIN: required --><input name="ax_consents[]" type="hidden" value="{name}" /><!-- END: required --></td>
+            <td><label for="ax-consents-{id}">{name}</label></td>
+            <td>{value}</td>
+        </tr>
+        <!-- END: ax -->
+    </table>
+<!-- END: fetch_request -->
+
+<!-- BEGIN: store_request -->
+<div class="message">
+    <p>{store_request_message}</p>
+</div>
+<!-- END: store_request -->
diff --git a/simpleid/www/extensions/certauth/certauth.extension.php b/simpleid/www/extensions/certauth/certauth.extension.php
new file mode 100644
index 0000000..b442d93
--- /dev/null
+++ b/simpleid/www/extensions/certauth/certauth.extension.php
@@ -0,0 +1,88 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2012
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Authentication using a SSL client certificate.
+ *
+ * @package simpleid
+ * @subpackage extensions
+ * @filesource
+ */
+ 
+
+/**
+ * Attempt to login using a SSL client certificate.
+ *
+ * Note that the web server must be set up to request a SSL client certificate
+ * and pass the certificate's details to PHP.
+ */
+function certauth_user_auto_login() {
+    if (!_certauth_has_client_cert()) return NULL;
+    
+    $cert = trim($_SERVER['SSL_CLIENT_M_SERIAL']) . ';' . trim($_SERVER['SSL_CLIENT_I_DN']);
+    log_debug('Client SSL certificate: ' . $cert);
+
+    $uid = store_get_uid_from_cert($cert);
+    if ($uid != NULL) {
+        log_debug('Client SSL certificate accepted for ' . $uid);
+        return user_load($uid);
+    } else {
+        log_warn('Client SSL certificate presented, but no user with that certificate exists.');
+        return NULL;
+    }
+}
+
+/**
+ * Determines whether the user agent supplied valid a certificate identifying the
+ * user.
+ *
+ * A valid certificate is supplied if all of the following occurs:
+ *
+ * - the connection is done using HTTPS (i.e. {@link is_https()} is true)
+ * - the web server has been set up to request a certificate from the user agent
+ * - the web server has been set up to pass the certificate details to PHP
+ * - the certificate has not been revoked
+ * - the certificate contains a serial number and a valid issuer
+ *
+ * @return true if the user agent has supplied a valid SSL certificate
+ */
+function _certauth_has_client_cert() {
+    // False if we are not in HTTP
+    if (!is_https()) return false;
+    
+    // False if certificate is not valid
+    if (!isset($_SERVER['SSL_CLIENT_VERIFY']) || ($_SERVER['SSL_CLIENT_VERIFY'] !== 'SUCCESS')) return false;
+    
+    // False if certificate is expired or has no expiry date
+    if (!isset($_SERVER['SSL_CLIENT_V_REMAIN']) || ($_SERVER['SSL_CLIENT_V_REMAIN'] < 0)) return false;
+    if (!isset($_SERVER['SSL_CLIENT_V_END'])) return false;
+    
+    // False if no serial number
+    if (!isset($_SERVER['SSL_CLIENT_M_SERIAL'])) return false;
+    
+    // False if no issuer
+    if (!isset($_SERVER['SSL_CLIENT_I_DN'])) return false;
+    
+    return true;
+}
+?>
diff --git a/simpleid/www/extensions/pape/pape.extension.php b/simpleid/www/extensions/pape/pape.extension.php
new file mode 100644
index 0000000..e189f2e
--- /dev/null
+++ b/simpleid/www/extensions/pape/pape.extension.php
@@ -0,0 +1,200 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2009
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Implements the Provider Authentication Policy Extension extension.
+ * 
+ *
+ * @package simpleid
+ * @subpackage extensions
+ * @filesource
+ */
+
+/** Namespace for the PAPE extension */
+define('OPENID_NS_PAPE', 'http://specs.openid.net/extensions/pape/1.0');
+
+/** Namespaces for PAPE policies */
+define('PAPE_POLICY_NONE', 'http://schemas.openid.net/pape/policies/2007/06/none');
+define('PAPE_POLICY_PPID', 'http://schemas.xmlsoap.org/ws/2005/05/identity/claims/privatepersonalidentifier');
+
+/** Namespaces for PAPE levels */
+define('PAPE_LEVEL_NIST800_63', 'http://csrc.nist.gov/publications/nistpubs/800-63/SP800-63V1_0_2.pdf');
+
+/**
+ * Returns the support for PAPE in SimpleID XRDS document
+ *
+ * @return array
+ * @see hook_xrds_types()
+ */
+function pape_xrds_types() {
+    return array(
+        OPENID_NS_PAPE,
+        PAPE_POLICY_PPID,
+        PAPE_LEVEL_NIST800_63
+    );
+}
+
+/**
+ * @see hook_checkid_identity()
+ */
+function pape_checkid_identity($request, $identity, $immediate) {
+    global $user;
+    
+    // We only respond if the extension is requested
+    if (!openid_extension_requested(OPENID_NS_PAPE, $request)) return null;
+    
+    // See if we are choosing an identity and save for later
+    // This may be used by pape_response() to produce a private identifier
+    if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) _pape_identifier_select(true);
+    
+    $pape_request = openid_extension_filter_request(OPENID_NS_PAPE, $request);
+    
+    // If the relying party provides a max_auth_age
+    if (isset($pape_request['max_auth_age'])) {
+        // If we are not logged in then we don't need to do anything
+        if ($user == NULL) return NULL;
+        
+        // If the last time we logged on actively (i.e. using a password) is greater than
+        // max_auth_age, we then require the user to log in again
+        if ((!isset($user['auth_active']) || !$user['auth_active']) 
+            && ((time() - $user['auth_time']) > $pape_request['max_auth_age'])) {
+            set_message(t('This web site\'s policy requires you to log in again to confirm your identity.'));
+            
+            _user_logout();
+            return CHECKID_LOGIN_REQUIRED;
+        }
+    }
+}
+
+/**
+ * @see hook_response()
+ */
+function pape_response($assertion, $request) {
+    global $user, $version;
+    
+    // We only deal with positive assertions
+    if (!$assertion) return array();
+    
+    // We only respond if we are using OpenID 2 or later
+    if ($version < OPENID_VERSION_2) return array();
+    
+    // Get what is requested
+    $pape_request = openid_extension_filter_request(OPENID_NS_PAPE, $request);
+        
+    // If the extension is requested, we use the same alias, otherwise, we
+    // make one up
+    $alias = openid_extension_alias(OPENID_NS_PAPE, 'pape');
+    $response = array();
+    
+    // The PAPE specification recommends us to respond even when the extension
+    // is not present in the request.
+    $response['openid.ns.' . $alias] = OPENID_NS_PAPE;
+    
+    // We return the last time the user logged in using the login form
+    $response['openid.' . $alias . '.auth_time'] = gmstrftime('%Y-%m-%dT%H:%M:%SZ', $user['auth_time']);
+    
+    // We don't comply with NIST_SP800-63
+    $response['openid.' . $alias . '.auth_level.ns.nist'] = PAPE_LEVEL_NIST800_63;
+    $response['openid.' . $alias . '.auth_level.nist'] = 0;
+    
+    // The default is that we don't apply any authentication policies. This can be changed later in the
+    // function
+    $response['openid.' . $alias . '.auth_policies'] = PAPE_POLICY_NONE;
+
+    // Now we go through the authentication policies
+    if (isset($pape_request['preferred_auth_policies'])) {
+        $policies = preg_split('/\s+/', $pape_request['preferred_auth_policies']);
+        
+        if (in_array(PAPE_POLICY_PPID, $policies)) {
+            // We want a ppid.  Check that the authentication request is correct
+            if (_pape_identifier_select()) {
+                $realm = openid_get_realm($request, $version);
+                $identity = $request['openid.identity'];
+                
+                $ppid = _pape_ppid($identity, $realm);                
+                $response['openid.claimed_id'] = $ppid;
+                $response['openid.identity'] = $ppid;
+            }
+        }
+    }
+    
+    return $response;
+}
+
+/**
+ * Returns an array of fields that need signing.
+ *
+ * @see hook_signed_fields()
+ */
+function pape_signed_fields($response) {
+    $fields = array_keys(openid_extension_filter_request(OPENID_NS_PAPE, $response));
+    $alias = openid_extension_alias(OPENID_NS_PAPE);
+    $signed_fields = array();
+
+    if (isset($response['openid.ns.' . $alias])) $signed_fields[] = 'ns.' . $alias;
+    foreach ($fields as $field) {
+        if (isset($response['openid.' . $alias . '.' . $field])) $signed_fields[] = $alias . '.' . $field;
+    }
+    
+    return $signed_fields;
+}
+
+/**
+ * Sets and returns whether the current OpenID request is requesting an identity.
+ *
+ * @param bool $identifier_select
+ * @return bool whether the current OpenID request is requesting an identity
+ */
+function _pape_identifier_select($identifier_select = NULL) {
+    static $static_identifier_select = false;
+    
+    if (!is_null($identifier_select)) $static_identifier_select = $identifier_select;
+    
+    return $static_identifier_select;
+}
+
+/**
+ * Generates a private personal identifier (PPID).  The PPID is an opaque identifier
+ * for a particular user-RP pair
+ *
+ * @param string $identity the identity of the user
+ * @param string $realm the URL of the relying party
+ * @return string the PPID
+ */
+function _pape_ppid($identity, $realm) {
+    // We are reusing the site-token from get_form_token() in common.inc
+    if (store_get('site-token') == NULL) {
+        $site_token = mt_rand();
+        store_set('site-token', $site_token);
+    } else {
+        $site_token = store_get('site-token');
+    }
+    
+    $parts = parse_url($realm);
+    $host = $parts['host'];
+    if (strstr($host, 'www.') === 0) $host = substr($host, 4);
+    
+    return simpleid_url('ppid/' . md5($site_token . $identity . $host));
+}
+
+?>
diff --git a/simpleid/www/extensions/sreg/sreg.extension.php b/simpleid/www/extensions/sreg/sreg.extension.php
new file mode 100644
index 0000000..955d6f6
--- /dev/null
+++ b/simpleid/www/extensions/sreg/sreg.extension.php
@@ -0,0 +1,240 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-8
+ *
+ * Includes code Drupal OpenID module (http://drupal.org/project/openid)
+ * Rowan Kerr <rowan@standardinteractive.com>
+ * James Walker <james@bryght.com>
+ *
+ * Copyright (C) Rowan Kerr and James Walker
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Implements the Simple Registration extension.
+ * 
+ *
+ * @package simpleid
+ * @subpackage extensions
+ * @filesource
+ */
+ 
+/** Namespace for the Simple Registration extension */
+define('OPENID_NS_SREG', 'http://openid.net/extensions/sreg/1.1');
+
+/**
+ * @see hook_response()
+ */
+function sreg_response($assertion, $request) {
+    global $user;
+    global $version;
+    
+    // We only deal with positive assertions
+    if (!$assertion) return array();
+    
+    // We only respond if the extension is requested
+    if (!openid_extension_requested(OPENID_NS_SREG, $request)) return array();
+    
+    $request = openid_extension_filter_request(OPENID_NS_SREG, $request);
+    $required = (isset($request['required'])) ? explode(',', $request['required']) : array();
+    $optional = (isset($request['optional'])) ? explode(',', $request['optional']) : array();
+    $fields = array_merge($required, $optional);
+    $alias = openid_extension_alias(OPENID_NS_SREG);
+    $response = array();
+    
+    if ($version == OPENID_VERSION_2) $response['openid.ns.' . $alias] = OPENID_NS_SREG;
+    
+    foreach ($fields as $field) {
+        $value = _sreg_get_value($field);
+        
+        if ($value != NULL) $response['openid.' . $alias . '.' .  $field] = $value;
+    }
+    
+    return $response;
+}
+
+/**
+ * Returns an array of fields that need signing.
+ *
+ * @see hook_signed_fields()
+ */
+function sreg_signed_fields($response) {
+    // We only respond if the extension is requested
+    if (!openid_extension_requested(OPENID_NS_SREG, $response)) return array();
+    
+    $fields = array_keys(openid_extension_filter_request(OPENID_NS_SREG, $response));
+    $alias = openid_extension_alias(OPENID_NS_SREG);
+    $signed_fields = array();
+
+    if (isset($response['openid.ns.' . $alias])) $signed_fields[] = 'ns.' . $alias;
+    foreach ($fields as $field) {
+        if (isset($response['openid.' . $alias . '.' . $field])) $signed_fields[] = $alias . '.' . $field;
+    }
+    
+    return $signed_fields;
+}
+
+/**
+ * @see hook_consent_form()
+ */
+function sreg_consent_form($request, $response, $rp) {
+    global $user;
+    
+    // We only respond if the extension is requested
+    if (!openid_extension_requested(OPENID_NS_SREG, $request)) return '';
+    
+    $request = openid_extension_filter_request(OPENID_NS_SREG, $request);
+    $required = (isset($request['required'])) ? explode(',', $request['required']) : array();
+    $optional = (isset($request['optional'])) ? explode(',', $request['optional']) : array();
+    $fields = array_merge($required, $optional);
+    
+    if ((count($request)) && isset($user['sreg'])) {
+        $xtpl2 = new XTemplate('extensions/sreg/sreg.xtpl');
+        
+        $xtpl2->assign('alias', openid_extension_alias(OPENID_NS_SREG));
+        
+        if (isset($request['policy_url'])) {            
+            $xtpl2->assign('policy', t('You can view the site\'s policy in relation to the use of this information at this URL: <a href="@url">@url</a>.', array('@url' => $request['policy_url'])));            
+        }
+        
+        foreach ($fields as $field) {
+            $value = _sreg_get_value($field);
+        
+            if ($value != NULL) {
+                $xtpl2->assign('name', htmlspecialchars($field, ENT_QUOTES, 'UTF-8'));
+                $xtpl2->assign('value', htmlspecialchars($value, ENT_QUOTES, 'UTF-8'));
+                
+                $xtpl2->assign('checked', (in_array($field, $required) || !isset($rp['sreg_consents']) || in_array($field, $rp['sreg_consents'])) ? 'checked="checked"' : '');
+                $xtpl2->assign('disabled', (in_array($field, $required)) ? 'disabled="disabled"' : '');
+                if (in_array($field, $required)) $xtpl2->parse('form.sreg.required');
+                
+                $xtpl2->parse('form.sreg');
+            }
+        }
+        
+        $xtpl2->assign('sreg_data', t('SimpleID will also be sending the following registration information to the site.'));
+        $xtpl2->assign('name_label', t('Name'));
+        $xtpl2->assign('value_label', t('Value'));
+        
+        $xtpl2->parse('form');
+        return $xtpl2->text('form');
+    }
+}
+
+/**
+ * @see hook_consent()
+ */
+function sreg_consent($form_request, &$response, &$rp) {
+    // We only respond if the extension is requested
+    if (!openid_extension_requested(OPENID_NS_SREG, $response)) return;
+    
+    $fields = array_keys(openid_extension_filter_request(OPENID_NS_SREG, $response));
+    $alias = openid_extension_alias(OPENID_NS_SREG);
+    
+    foreach ($fields as $field) {
+        if (isset($response['openid.' . $alias . '.' . $field])) {
+            if (!in_array($field, $form_request['sreg_consents'])) {
+                unset($response['openid.' . $alias . '.' . $field]);
+            }
+        }
+    }
+    
+    if (count(array_keys(openid_extension_filter_request(OPENID_NS_SREG, $response))) == 0) {
+        // We have removed all the responses, so we remove the namespace as well
+        unset($response['openid.ns.' . $alias]);
+    }
+    
+    $rp['sreg_consents'] = $form_request['sreg_consents'];
+}
+
+/**
+ * @see hook_page_profile()
+ */
+function sreg_page_profile() {
+    global $user;
+    $xtpl2 = new XTemplate('extensions/sreg/sreg.xtpl');
+    
+    if (isset($user['sreg'])) {
+        foreach ($user['sreg'] as $name => $value) {
+            $xtpl2->assign('name', htmlspecialchars($name, ENT_QUOTES, 'UTF-8'));
+            $xtpl2->assign('value', htmlspecialchars($value, ENT_QUOTES, 'UTF-8'));
+            $xtpl2->parse('user_page.sreg');
+        }
+    }
+    
+    $xtpl2->assign('sreg_data', t('SimpleID will send the following information to sites which supports the Simple Registration Extension.'));
+    $xtpl2->assign('connect_data', t('If you have also supplied OpenID Connect user information in your identity file, these may also be sent as part of this Extension.'));
+    $xtpl2->assign('edit_identity_file', t('To change these, <a href="!url">edit your identity file</a>.', array('!url' => 'http://simpleid.org/docs/1/identity-files/')));
+    $xtpl2->assign('name_label', t('Name'));
+    $xtpl2->assign('value_label', t('Value'));
+    
+    $xtpl2->parse('user_page');
+    
+    return array(array(
+        'id' => 'sreg',
+        'title' => t('Simple Registration Extension'),
+        'content' => $xtpl2->text('user_page')
+    ));
+}
+
+
+/**
+ * Looks up the value of a specified Simple Registration Extension field.
+ *
+ * This function looks up the sreg section of the user's identity file.  If the
+ * specified field cannot be found, it looks up the corresponding field in the
+ * OpenID Connect user information (user_info section).
+ *
+ * @param string $field the field to look up
+ * @return string the value or NULL if not found
+ */
+function _sreg_get_value($field) {
+    global $user;
+    
+    if (isset($user['sreg'][$field])) {
+        return $user['sreg'][$field];
+    } else {
+        switch ($field) {
+            case 'nickname':
+            case 'email':
+                if (isset($user['user_info'][$field])) return $user['user_info'][$field];
+                break;
+            case 'fullname':
+                if (isset($user['user_info']['name'])) return $user['user_info']['name'];
+                break;
+            case 'timezone':
+                if (isset($user['user_info']['zoneinfo'])) return $user['user_info']['zoneinfo'];
+                break;
+            case 'gender':
+                if (isset($user['user_info']['gender'])) return strtoupper(substr($user['user_info']['gender'], 0, 1));
+                break;
+            case 'postcode':
+                if (isset($user['user_info']['address']['postal_code'])) return $user['user_info']['address']['postcal_code'];
+                break;
+            default:
+                return NULL;
+        } 
+        return NULL;
+    }
+}
+
+
+
+?>
diff --git a/simpleid/www/extensions/sreg/sreg.xtpl b/simpleid/www/extensions/sreg/sreg.xtpl
new file mode 100644
index 0000000..07550bb
--- /dev/null
+++ b/simpleid/www/extensions/sreg/sreg.xtpl
@@ -0,0 +1,40 @@
+<!-- BEGIN: user_page -->
+<!-- :mode=html: $Id$ -->
+    <p>{sreg_data}</p>
+    
+    <p>{connect_data}</p>
+    
+    <p>{edit_identity_file}</p>
+    
+    <table>
+        <tr>
+            <th>{name_label}</th>
+            <th>{value_label}</th>
+        </tr>
+        <!-- BEGIN: sreg -->
+        <tr>
+            <td>{name}</td>
+            <td>{value}</td>
+        </tr>
+        <!-- END: sreg -->
+    </table>
+<!-- END: user_page -->
+            
+<!-- BEGIN: form -->
+    <p>{sreg_data} {policy}</p>
+    
+    <table>
+        <tr>
+            <th></th>
+            <th>{name_label}</th>
+            <th>{value_label}</th>
+        </tr>
+        <!-- BEGIN: sreg -->
+        <tr>
+            <td><input name="sreg_consents[]" type="checkbox" value="{name}" id="sreg-consents-{name}" {checked} {disabled} /><!-- BEGIN: required --><input name="sreg_consents[]" type="hidden" value="{name}" /><!-- END: required --></td>
+            <td><input type="hidden" name="openid.{alias}.{name}" value="{value}" /><label for="sreg-consents-{name}">{name}</label></td>
+            <td>{value}</td>
+        </tr>
+        <!-- END: sreg -->
+    </table>
+<!-- END: form -->
diff --git a/simpleid/www/extensions/ui/ui.css b/simpleid/www/extensions/ui/ui.css
new file mode 100644
index 0000000..a6b9cfd
--- /dev/null
+++ b/simpleid/www/extensions/ui/ui.css
@@ -0,0 +1,31 @@
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2009
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+.dialog-page {
+    background: #FFFFFF;
+}
+
+.dialog-page #content {
+    margin: 10px auto;
+    padding: 0;
+    border: 0;
+}
diff --git a/simpleid/www/extensions/ui/ui.extension.php b/simpleid/www/extensions/ui/ui.extension.php
new file mode 100644
index 0000000..3982be0
--- /dev/null
+++ b/simpleid/www/extensions/ui/ui.extension.php
@@ -0,0 +1,260 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2009
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Implements the popup and icon modes from the User Interface extension
+ *
+ * @package simpleid
+ * @subpackage extensions
+ * @filesource
+ */
+
+/** Namespace for the User Interface extension */
+define('OPENID_NS_UI', 'http://specs.openid.net/extensions/ui/1.0');
+
+/**
+ * Returns the popup mode in SimpleID XRDS document
+ *
+ * @return array
+ * @see hook_xrds_types()
+ */
+function ui_xrds_types() {
+    return array(
+        'http://specs.openid.net/extensions/ui/1.0/mode/popup',
+        'http://specs.openid.net/extensions/ui/1.0/icon'
+    );
+}
+
+/**
+ * Detects the openid.ui.x-has-session parameter and processes it accordingly.
+ *
+ * @return array
+ * @see hook_response()
+ */
+function ui_response($assertion, $request) {
+    global $user;
+    global $version;
+    
+    // We only deal with negative assertions
+    if ($assertion) return array();
+    
+    // We only respond if the extension is requested
+    if (!openid_extension_requested(OPENID_NS_UI, $request)) return array();
+    
+    // We only deal with openid.ui.x-has-session requests
+    $filtered_request = openid_extension_filter_request(OPENID_NS_UI, $request);
+    if (!isset($filtered_request['mode']) || ($filtered_request['mode'] != 'x-has-session')) return array();
+    
+    // If user is null, there is no active session
+    if ($user == NULL) return array();
+    
+    // There is an active session
+    $alias = openid_extension_alias(OPENID_NS_UI);
+    $response = array();
+    
+    $response['openid.ns.' . $alias] = OPENID_NS_UI;
+    $response['openid.' . $alias . '.mode'] = 'x-has-session';
+    
+    return $response;
+}
+
+/**
+ * Returns an array of fields that need signing.
+ *
+ * @see hook_signed_fields()
+ */
+function ui_signed_fields($response) {
+    // We only respond if the extension is requested
+    if (!openid_extension_requested(OPENID_NS_UI, $response)) return array();
+    
+    $fields = array_keys(openid_extension_filter_request(OPENID_NS_UI, $response));
+    $alias = openid_extension_alias(OPENID_NS_UI);
+    $signed_fields = array();
+
+    if (isset($response['openid.ns.' . $alias])) $signed_fields[] = 'ns.' . $alias;
+    foreach ($fields as $field) {
+        if (isset($response['openid.' . $alias . '.' . $field])) $signed_fields[] = $alias . '.' . $field;
+    }
+    
+    return $signed_fields;
+}
+
+/**
+ * Detects the presence of the UI extension and modifies the login form
+ * accordingly.
+ *
+ * @param string $destination
+ * @param string $state
+ * @see hook_user_login_form()
+ */
+function ui_user_login_form($destination, $state) {
+    if (($destination != 'continue') || (!$state)) return;
+    
+    $request = unpickle($state);
+    openid_parse_request($request);
+    
+    // Skip if popup does not exist
+    if (!openid_extension_requested(OPENID_NS_UI, $request)) return;
+    
+    $filtered_request = openid_extension_filter_request(OPENID_NS_UI, $request);
+    
+    if (isset($filtered_request['mode']) && ($filtered_request['mode'] == 'popup')) _ui_insert_css_js();
+    
+    return;
+}
+
+/**
+ * Detects the presence of the UI extension and modifies the relying party
+ * verification form accordingly.
+ *
+ * @param array $request
+ * @param array $response
+ * @param array $rp
+ * @return string
+ * @see hook_consent_form()
+ */
+function ui_consent_form($request, $response, $rp) {
+    // Skip if popup does not exist
+    if (!openid_extension_requested(OPENID_NS_UI, $request)) return '';
+    
+    $filtered_request = openid_extension_filter_request(OPENID_NS_UI, $request);
+    
+    if (isset($filtered_request['mode']) && ($filtered_request['mode'] == 'popup')) _ui_insert_css_js();
+    
+    if (isset($filtered_request['icon']) && ($filtered_request['icon'] == 'true')) {
+        global $xtpl;
+        
+        $realm = $request['openid.realm'];
+        $icon_url = simpleid_url('ui/icon', 'realm=' . rawurlencode($realm) . '&tk=' . _ui_icon_token($realm));
+        
+        $xtpl->assign('icon_url', htmlspecialchars($icon_url, ENT_QUOTES, 'UTF-8'));
+        $xtpl->parse('main.openid_consent.icon');
+    }
+    
+    return '';
+}
+
+/**
+ * Specifies that the OpenID response should be sent via the fragment
+ *
+ */
+function ui_indirect_response($url, $response) {
+    global $openid_ns_to_alias;
+    if (!array_key_exists(OPENID_NS_UI, $openid_ns_to_alias)) return NULL;
+    
+    // Cheat - if we run this, then the redirect page will also be themed!
+    _ui_insert_css_js();
+    
+    if (strstr($url, '#')) {
+        return OPENID_RESPONSE_FRAGMENT;
+    } else {
+        return NULL;
+    }
+}
+
+/**
+ * Adds an extra route to the SimpleWeb framework.
+ */
+function ui_routes() {
+    return array('ui/icon' => 'ui_icon');
+}
+
+/**
+ * Returns an icon.
+ */
+function ui_icon() {
+    if (!isset($_GET['realm']) || !isset($_GET['tk']) || ($_GET['tk'] != _ui_icon_token($_GET['realm']))) {
+        header_response_code('404 Not Found');
+        indirect_fatal_error(t('Invalid UI icon parameters.'));
+    }
+    
+    $realm = $_GET['realm'];
+    $icon_res = _ui_get_icon($realm);
+    
+    if ($icon_res === NULL) {
+        header_response_code('404 Not Found');
+        indirect_fatal_error(t('Unable to get icon.'));
+    }
+    
+    header('Via: ' . $icon_res['protocol'] . ' simpleid-ui-icon-' . md5($realm));
+    header('Cache-Control: max-age=86400');
+    header('Content-Type: ' . $icon_res['headers']['content-type']);
+    if (isset($icon_res['headers']['content-encoding'])) header('Content-Encoding: ' . $icon_res['headers']['content-encoding']);
+    print $icon_res['data'];
+}
+
+/**
+ * Inserts the necessary CSS and JavaScript code to implement the popup mode
+ * from the User Interface extension.
+ */
+function _ui_insert_css_js() {
+    global $xtpl;
+    
+    $css = (isset($xtpl->vars['css'])) ? $xtpl->vars['css'] : '';
+    $js = (isset($xtpl->vars['javascript'])) ? $xtpl->vars['javascript'] : '';
+    
+    $xtpl->assign('css', $css . '@import url(' . get_base_path() . 'extensions/ui/ui.css);');
+    $xtpl->assign('javascript', $js . '<script src="' . get_base_path() . 'extensions/ui/ui.js" type="text/javascript"></script>');
+}
+
+/**
+ * Attempts to obtain an icon from a RP
+ *
+ * @param string $realm the openid.realm parameter
+ * @return array the response from {@link http_make_request()} with the discovered URL of the
+ * RP's icon
+ */
+function _ui_get_icon($realm) {
+    $rp_info = simpleid_get_rp_info($realm);
+    
+    if (isset($rp_info['ui_icon'])) return $rp_info['ui_icon'];
+    
+    $services = discovery_xrds_services_by_type($rp_info['services'], 'http://specs.openid.net/extensions/ui/icon');
+        
+    if ($services) {
+        $icon_url = $services[0]['uri'];
+        
+        $icon_res = http_make_request($icon_url);
+        if (isset($icon_res['http-error'])) {
+            return NULL;
+        }
+        
+        $rp_info['ui_icon'] = $icon_res;
+        simpleid_set_rp_info($realm, $rp_info);
+    } else {
+        return NULL;
+    }
+}
+
+/**
+ * Returns a token to be used when requesting the icon.
+ *
+ * The token is used to prevent flooding SimpleID with external requests.
+ *
+ * @param string $realm the openid.realm parameter
+ * @return string the token
+ */
+function _ui_icon_token($realm) {
+    return get_form_token('q=ui/icon&realm=' . rawurlencode($realm));
+}
+?>
diff --git a/simpleid/www/extensions/ui/ui.js b/simpleid/www/extensions/ui/ui.js
new file mode 100644
index 0000000..1711d13
--- /dev/null
+++ b/simpleid/www/extensions/ui/ui.js
@@ -0,0 +1,22 @@
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2009
+ *
+ * This program is licensed under the GPL.
+ * 
+ * $Id$
+ */
+
+$(document).ready(function() {
+    $('input#edit-cancel').click(function() {
+        window.close();
+        return false;
+    });
+    $(document).keydown(function(e) {
+        if (e.which == 27) { // Close the window if user presses Esc
+            window.close();
+            return false;
+        }
+    });
+});
diff --git a/simpleid/www/filesystem.store.php b/simpleid/www/filesystem.store.php
new file mode 100644
index 0000000..7d99a8d
--- /dev/null
+++ b/simpleid/www/filesystem.store.php
@@ -0,0 +1,334 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-9
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Functions for persistent storage via the file system.
+ *
+ * In general, there are three different sets of data which SimpleID needs
+ * to store:
+ *
+ * - transient data (e.g. OpenID associations, sessions, auto-login)
+ * - application data (e.g. salt for form tokens)
+ * - user data (e.g. user names, passwords and settings)
+ *
+ * Prior to version 0.7, both transient data and application data are stored
+ * using {@link cache.inc}.  From version 0.7, application data are now
+ * stored separately from the cache.
+ *
+ * Prior to version 0.7, user data is only stored in the identity file, to which
+ * SimpleID cannot write.  This means that if the user wishes to change a setting,
+ * he or she will need to edit the identity file manually.  Other user settings
+ * (e.g. RP preferences) are stored using {@link cache.inc}
+ *
+ * From version 0.7, user data is stored in two files, one is the identity
+ * file, the other is the user store file, which SimpleID can write.
+ *
+ * @package simpleid
+ * @filesource
+ */
+
+/**
+ * This variable is a cache of SimpleID's application settings.  It is populated
+ * progressively as {@link store_get()} is called.
+ *
+ * @global array $simpleid_settings
+ */
+$simpleid_settings = array();
+
+/**
+ * Returns whether the user name exists in the user store.
+ *
+ * @param string $uid the name of the user to check
+ * @return bool whether the user name exists
+ */
+function store_user_exists($uid) {
+    if (_store_is_valid_name($uid)) {
+        $identity_file = SIMPLEID_IDENTITIES_DIR . "/$uid.identity";
+        return (file_exists($identity_file));
+    } else {
+        return false;
+    }
+}
+
+/**
+ * Loads user data for a specified user name.
+ *
+ * The user name must exist.  You should check whether the user name exists with
+ * the {@link store_user_exists()} function
+ *
+ * @param string $uid the name of the user to load
+ * @return mixed data for the specified user
+ */
+function store_user_load($uid) {
+    if (!_store_is_valid_name($uid)) return array();
+    $store_file = SIMPLEID_STORE_DIR . "/$uid.usrstore";
+    
+    if (file_exists($store_file)) {
+        $data = unserialize(file_get_contents($store_file));
+    } else {
+        $data = array();
+    }
+    
+    $identity_file = SIMPLEID_IDENTITIES_DIR . "/$uid.identity";
+    $data = array_merge($data, parse_ini_file($identity_file, TRUE));
+    
+    return $data;
+}
+
+/**
+ * Returns the time which a user's data has been updated.
+ *
+ * The user name must exist.  You should check whether the user name exists with
+ * the {@link store_user_exists()} function.
+ *
+ * The time returned can be based on the identity file,
+ * the user store file, or the latter of the two.
+ *
+ * @param string $uid the name of the user to obtain the update time
+ * @param string $type one of: 'identity' (identity file), 'usrstore' (user store
+ * file) or NULL (latter of the two)
+ * @return int the updated time
+ */ 
+function store_user_updated_time($uid, $type = NULL) {
+    if (!_store_is_valid_name($uid)) return NULL;
+    
+    $identity_file = SIMPLEID_IDENTITIES_DIR . "/$uid.identity";
+    $identity_time = filemtime($identity_file);
+    
+    $store_file = SIMPLEID_STORE_DIR . "/$uid.usrstore";
+    if (file_exists($store_file)) {
+        $store_time = filemtime($store_file);
+    } else {
+        $store_time = NULL;
+    }
+    
+    if ($type == 'identity') {
+        return $identity_time;
+    } elseif ($type == 'usrstore') {
+        return $store_time;
+    } elseif ($type == NULL) {
+        return ($identity_time > $store_time) ? $identity_time : $store_time;
+    } else {
+        return NULL;
+    }
+}
+
+
+/**
+ * Finds the user name from a specified OpenID Identity URI.
+ *
+ * @param string $identity the Identity URI of the user to load
+ * @return string the user name for the Identity URI, or NULL if no user has
+ * the specified Identity URI
+ */
+function store_get_uid($identity) {
+    $uid = cache_get('identity', $identity);
+    if ($uid !== NULL) return $uid;
+    
+    $r = NULL;
+    
+    $dir = opendir(SIMPLEID_IDENTITIES_DIR);
+    
+    while (($file = readdir($dir)) !== false) {
+        $filename = SIMPLEID_IDENTITIES_DIR . '/' . $file;
+        
+        if (is_link($filename)) $filename = readlink($filename);
+        if ((filetype($filename) != "file") || (!preg_match('/^(.+)\.identity$/', $file, $matches))) continue;
+        
+        $uid = $matches[1];
+        $test_user = store_user_load($uid);
+        
+        cache_set('identity', $test_user['identity'], $uid);
+    
+        if ($test_user['identity'] == $identity) {
+            $r = $uid;
+        }
+    }
+        
+    closedir($dir);
+    
+    return $r;
+}
+
+/**
+ * Finds the user name from a specified client SSL certificate string.
+ *
+ * The client SSL certificate string comprises the certificate's serial number
+ * (in capitals hex notation) and the distinguished name of the certificate's issuer
+ * (with components joined using slashes), joined using a semi-colon.
+ *
+ *
+ * @param string $cert the client SSL certificate string of the user to load
+ * @return string the user name matching the client SSL certificate string, or NULL if no user has
+ * client SSL certificate string
+ */
+function store_get_uid_from_cert($cert) {
+    $uid = cache_get('cert', $cert);
+    if ($uid !== NULL) return $uid;
+    
+    $r = NULL;
+    
+    $dir = opendir(SIMPLEID_IDENTITIES_DIR);
+    
+    while (($file = readdir($dir)) !== false) {
+        $filename = SIMPLEID_IDENTITIES_DIR . '/' . $file;
+        
+        if (is_link($filename)) $filename = readlink($filename);
+        if ((filetype($filename) != "file") || (!preg_match('/^(.+)\.identity$/', $file, $matches))) continue;
+        
+        $uid = $matches[1];
+        $test_user = store_user_load($uid);
+        
+        if (isset($test_user['certauth']['cert'])) {
+            if (is_array($test_user['certauth']['cert'])) {
+                foreach ($test_user['certauth']['cert'] as $test_cert) {
+                    if (trim($test_cert) != '') cache_set('cert', $test_cert, $uid);
+                }
+                foreach ($test_user['certauth']['cert'] as $test_cert) {
+                    if ((trim($test_cert) != '') && ($test_cert == $cert))  $r = $uid;
+                }
+            } else {
+                if (trim($test_cert) != '') {
+                    cache_set('cert', $test_user['certauth']['cert'], $uid);
+                    if ($test_user['certauth']['cert'] == $cert) $r = $uid;
+                }
+            }
+        }
+    }
+        
+    closedir($dir);
+    
+    return $r;
+}
+
+/**
+ * Saves user data for a specific user name.
+ *
+ * This data is stored in the user store file.
+ *
+ * @param string $uid the name of the user
+ * @param array $data the data to save
+ * @param array $exclude an array of keys to exclude from the user store file.
+ * These are generally keys which are stored in the identity file.
+ *
+ * @since 0.7
+ */
+function store_user_save($uid, $data, $exclude = array()) {
+    foreach ($exclude as $key) {
+        if (isset($data[$key])) unset($data[$key]);
+    }
+    
+    if (!_store_is_valid_name($uid)) {
+        trigger_error("Invalid user name for filesystem store", E_USER_ERROR);
+        return;
+    }
+    
+    $store_file = SIMPLEID_STORE_DIR . "/$uid.usrstore";
+    $file = fopen($store_file, 'w');
+    fwrite($file, serialize($data));
+    fclose($file);
+}
+
+/**
+ * Loads an application setting.
+ *
+ * @param string $name the name of the setting to return
+ * @param mixed $default the default value to use if this variable has never been set
+ * @return mixed the value of the setting
+ *
+ */
+function store_get($name, $default = NULL) {
+    global $simpleid_settings;
+    
+    if (!_store_is_valid_name($name)) return $default;
+    
+    if (!isset($simpleid_settings[$name])) {
+        $setting_file = SIMPLEID_STORE_DIR . "/$name.setting";
+        
+        if (file_exists($setting_file)) {
+            $simpleid_settings[$name] = unserialize(file_get_contents($setting_file));
+        } else {
+            return $default;
+        }
+    }
+    
+    return $simpleid_settings[$name];
+}
+
+/**
+ * Saves an application setting.
+ *
+ * @param string $name the name of the setting to save
+ * @param mixed $value the value of the setting
+ *
+ */
+function store_set($name, $value) {
+    global $simpleid_settings;
+    
+    if (!_store_is_valid_name($name)) {
+        trigger_error("Invalid setting name for filesystem store", E_USER_ERROR);
+        return;
+    }
+    
+    $simpleid_settings[$name] = $value;
+    
+    $setting_file = SIMPLEID_STORE_DIR . "/$name.setting";
+    $file = fopen($setting_file, 'w');
+    fwrite($file, serialize($value));
+    fclose($file);
+}
+
+/**
+ * Deletes an application setting.
+ *
+ * @param string $name the name of the setting to delete
+ *
+ */
+function store_del($name) {
+    global $simpleid_settings;
+    
+    if (!_store_is_valid_name($name)) {
+        trigger_error("Invalid setting name for filesystem store", E_USER_ERROR);
+        return;
+    }
+    
+    if (isset($simpleid_settings[$name])) unset($simpleid_settings[$name]);
+    
+    $setting_file = SIMPLEID_STORE_DIR . "/$name.setting";
+    if (file_exists($setting_file)) unlink($setting_file);
+}
+
+/**
+ * Determines whether a name is a valid name for use with this store.
+ *
+ * For file system storage, a name is not valid if it contains either a
+ * directory separator (i.e. / or \).
+ *
+ * @param string $name the name to check
+ * @return boolean whether the name is valid for use with this store 
+ *
+ */
+function _store_is_valid_name($name) {
+    return preg_match('!\A[^/\\\\]*\z!', $name);
+}
+?>
diff --git a/simpleid/www/html/application.png b/simpleid/www/html/application.png
new file mode 100644
index 0000000..1dee9e3
--- /dev/null
+++ b/simpleid/www/html/application.png
Binary files differ
diff --git a/simpleid/www/html/block.xtpl b/simpleid/www/html/block.xtpl
new file mode 100644
index 0000000..c70ff41
--- /dev/null
+++ b/simpleid/www/html/block.xtpl
@@ -0,0 +1,16 @@
+<!-- :mode=html: $Id$ -->
+<!-- BEGIN: block -->
+<div class="block" id="{id}">
+    <div class="block-header">
+        <!-- BEGIN: links -->
+        <div class="block-header-links">
+            {links}
+        </div>
+        <!-- END: links -->
+        <h2>{title}</h2>
+    </div>
+    <div class="block-content">
+    {content}
+    </div>
+</div>
+<!-- END: block -->
diff --git a/simpleid/www/html/drive.png b/simpleid/www/html/drive.png
new file mode 100644
index 0000000..37b7c9b
--- /dev/null
+++ b/simpleid/www/html/drive.png
Binary files differ
diff --git a/simpleid/www/html/jquery.js b/simpleid/www/html/jquery.js
new file mode 100644
index 0000000..da41706
--- /dev/null
+++ b/simpleid/www/html/jquery.js
@@ -0,0 +1,6 @@
+/*! jQuery v1.10.2 | (c) 2005, 2013 jQuery Foundation, Inc. | jquery.org/license
+//@ sourceMappingURL=jquery-1.10.2.min.map
+*/
+(function(e,t){var n,r,i=typeof t,o=e.location,a=e.document,s=a.documentElement,l=e.jQuery,u=e.$,c={},p=[],f="1.10.2",d=p.concat,h=p.push,g=p.slice,m=p.indexOf,y=c.toString,v=c.hasOwnProperty,b=f.trim,x=function(e,t){return new x.fn.init(e,t,r)},w=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,T=/\S+/g,C=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,N=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,k=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,E=/^[\],:{}\s]*$/,S=/(?:^|:|,)(?:\s*\[)+/g,A=/\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,j=/"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,D=/^-ms-/,L=/-([\da-z])/gi,H=function(e,t){return t.toUpperCase()},q=function(e){(a.addEventListener||"load"===e.type||"complete"===a.readyState)&&(_(),x.ready())},_=function(){a.addEventListener?(a.removeEventListener("DOMContentLoaded",q,!1),e.removeEventListener("load",q,!1)):(a.detachEvent("onreadystatechange",q),e.detachEvent("onload",q))};x.fn=x.prototype={jquery:f,constructor:x,init:function(e,n,r){var i,o;if(!e)return this;if("string"==typeof e){if(i="<"===e.charAt(0)&&">"===e.charAt(e.length-1)&&e.length>=3?[null,e,null]:N.exec(e),!i||!i[1]&&n)return!n||n.jquery?(n||r).find(e):this.constructor(n).find(e);if(i[1]){if(n=n instanceof x?n[0]:n,x.merge(this,x.parseHTML(i[1],n&&n.nodeType?n.ownerDocument||n:a,!0)),k.test(i[1])&&x.isPlainObject(n))for(i in n)x.isFunction(this[i])?this[i](n[i]):this.attr(i,n[i]);return this}if(o=a.getElementById(i[2]),o&&o.parentNode){if(o.id!==i[2])return r.find(e);this.length=1,this[0]=o}return this.context=a,this.selector=e,this}return e.nodeType?(this.context=this[0]=e,this.length=1,this):x.isFunction(e)?r.ready(e):(e.selector!==t&&(this.selector=e.selector,this.context=e.context),x.makeArray(e,this))},selector:"",length:0,toArray:function(){return g.call(this)},get:function(e){return null==e?this.toArray():0>e?this[this.length+e]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t.context=this.context,t},each:function(e,t){return x.each(this,e,t)},ready:function(e){return x.ready.promise().done(e),this},slice:function(){return this.pushStack(g.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(e){var t=this.length,n=+e+(0>e?t:0);return this.pushStack(n>=0&&t>n?[this[n]]:[])},map:function(e){return this.pushStack(x.map(this,function(t,n){return e.call(t,n,t)}))},end:function(){return this.prevObject||this.constructor(null)},push:h,sort:[].sort,splice:[].splice},x.fn.init.prototype=x.fn,x.extend=x.fn.extend=function(){var e,n,r,i,o,a,s=arguments[0]||{},l=1,u=arguments.length,c=!1;for("boolean"==typeof s&&(c=s,s=arguments[1]||{},l=2),"object"==typeof s||x.isFunction(s)||(s={}),u===l&&(s=this,--l);u>l;l++)if(null!=(o=arguments[l]))for(i in o)e=s[i],r=o[i],s!==r&&(c&&r&&(x.isPlainObject(r)||(n=x.isArray(r)))?(n?(n=!1,a=e&&x.isArray(e)?e:[]):a=e&&x.isPlainObject(e)?e:{},s[i]=x.extend(c,a,r)):r!==t&&(s[i]=r));return s},x.extend({expando:"jQuery"+(f+Math.random()).replace(/\D/g,""),noConflict:function(t){return e.$===x&&(e.$=u),t&&e.jQuery===x&&(e.jQuery=l),x},isReady:!1,readyWait:1,holdReady:function(e){e?x.readyWait++:x.ready(!0)},ready:function(e){if(e===!0?!--x.readyWait:!x.isReady){if(!a.body)return setTimeout(x.ready);x.isReady=!0,e!==!0&&--x.readyWait>0||(n.resolveWith(a,[x]),x.fn.trigger&&x(a).trigger("ready").off("ready"))}},isFunction:function(e){return"function"===x.type(e)},isArray:Array.isArray||function(e){return"array"===x.type(e)},isWindow:function(e){return null!=e&&e==e.window},isNumeric:function(e){return!isNaN(parseFloat(e))&&isFinite(e)},type:function(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?c[y.call(e)]||"object":typeof e},isPlainObject:function(e){var n;if(!e||"object"!==x.type(e)||e.nodeType||x.isWindow(e))return!1;try{if(e.constructor&&!v.call(e,"constructor")&&!v.call(e.constructor.prototype,"isPrototypeOf"))return!1}catch(r){return!1}if(x.support.ownLast)for(n in e)return v.call(e,n);for(n in e);return n===t||v.call(e,n)},isEmptyObject:function(e){var t;for(t in e)return!1;return!0},error:function(e){throw Error(e)},parseHTML:function(e,t,n){if(!e||"string"!=typeof e)return null;"boolean"==typeof t&&(n=t,t=!1),t=t||a;var r=k.exec(e),i=!n&&[];return r?[t.createElement(r[1])]:(r=x.buildFragment([e],t,i),i&&x(i).remove(),x.merge([],r.childNodes))},parseJSON:function(n){return e.JSON&&e.JSON.parse?e.JSON.parse(n):null===n?n:"string"==typeof n&&(n=x.trim(n),n&&E.test(n.replace(A,"@").replace(j,"]").replace(S,"")))?Function("return "+n)():(x.error("Invalid JSON: "+n),t)},parseXML:function(n){var r,i;if(!n||"string"!=typeof n)return null;try{e.DOMParser?(i=new DOMParser,r=i.parseFromString(n,"text/xml")):(r=new ActiveXObject("Microsoft.XMLDOM"),r.async="false",r.loadXML(n))}catch(o){r=t}return r&&r.documentElement&&!r.getElementsByTagName("parsererror").length||x.error("Invalid XML: "+n),r},noop:function(){},globalEval:function(t){t&&x.trim(t)&&(e.execScript||function(t){e.eval.call(e,t)})(t)},camelCase:function(e){return e.replace(D,"ms-").replace(L,H)},nodeName:function(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()},each:function(e,t,n){var r,i=0,o=e.length,a=M(e);if(n){if(a){for(;o>i;i++)if(r=t.apply(e[i],n),r===!1)break}else for(i in e)if(r=t.apply(e[i],n),r===!1)break}else if(a){for(;o>i;i++)if(r=t.call(e[i],i,e[i]),r===!1)break}else for(i in e)if(r=t.call(e[i],i,e[i]),r===!1)break;return e},trim:b&&!b.call("\ufeff\u00a0")?function(e){return null==e?"":b.call(e)}:function(e){return null==e?"":(e+"").replace(C,"")},makeArray:function(e,t){var n=t||[];return null!=e&&(M(Object(e))?x.merge(n,"string"==typeof e?[e]:e):h.call(n,e)),n},inArray:function(e,t,n){var r;if(t){if(m)return m.call(t,e,n);for(r=t.length,n=n?0>n?Math.max(0,r+n):n:0;r>n;n++)if(n in t&&t[n]===e)return n}return-1},merge:function(e,n){var r=n.length,i=e.length,o=0;if("number"==typeof r)for(;r>o;o++)e[i++]=n[o];else while(n[o]!==t)e[i++]=n[o++];return e.length=i,e},grep:function(e,t,n){var r,i=[],o=0,a=e.length;for(n=!!n;a>o;o++)r=!!t(e[o],o),n!==r&&i.push(e[o]);return i},map:function(e,t,n){var r,i=0,o=e.length,a=M(e),s=[];if(a)for(;o>i;i++)r=t(e[i],i,n),null!=r&&(s[s.length]=r);else for(i in e)r=t(e[i],i,n),null!=r&&(s[s.length]=r);return d.apply([],s)},guid:1,proxy:function(e,n){var r,i,o;return"string"==typeof n&&(o=e[n],n=e,e=o),x.isFunction(e)?(r=g.call(arguments,2),i=function(){return e.apply(n||this,r.concat(g.call(arguments)))},i.guid=e.guid=e.guid||x.guid++,i):t},access:function(e,n,r,i,o,a,s){var l=0,u=e.length,c=null==r;if("object"===x.type(r)){o=!0;for(l in r)x.access(e,n,l,r[l],!0,a,s)}else if(i!==t&&(o=!0,x.isFunction(i)||(s=!0),c&&(s?(n.call(e,i),n=null):(c=n,n=function(e,t,n){return c.call(x(e),n)})),n))for(;u>l;l++)n(e[l],r,s?i:i.call(e[l],l,n(e[l],r)));return o?e:c?n.call(e):u?n(e[0],r):a},now:function(){return(new Date).getTime()},swap:function(e,t,n,r){var i,o,a={};for(o in t)a[o]=e.style[o],e.style[o]=t[o];i=n.apply(e,r||[]);for(o in t)e.style[o]=a[o];return i}}),x.ready.promise=function(t){if(!n)if(n=x.Deferred(),"complete"===a.readyState)setTimeout(x.ready);else if(a.addEventListener)a.addEventListener("DOMContentLoaded",q,!1),e.addEventListener("load",q,!1);else{a.attachEvent("onreadystatechange",q),e.attachEvent("onload",q);var r=!1;try{r=null==e.frameElement&&a.documentElement}catch(i){}r&&r.doScroll&&function o(){if(!x.isReady){try{r.doScroll("left")}catch(e){return setTimeout(o,50)}_(),x.ready()}}()}return n.promise(t)},x.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(e,t){c["[object "+t+"]"]=t.toLowerCase()});function M(e){var t=e.length,n=x.type(e);return x.isWindow(e)?!1:1===e.nodeType&&t?!0:"array"===n||"function"!==n&&(0===t||"number"==typeof t&&t>0&&t-1 in e)}r=x(a),function(e,t){var n,r,i,o,a,s,l,u,c,p,f,d,h,g,m,y,v,b="sizzle"+-new Date,w=e.document,T=0,C=0,N=st(),k=st(),E=st(),S=!1,A=function(e,t){return e===t?(S=!0,0):0},j=typeof t,D=1<<31,L={}.hasOwnProperty,H=[],q=H.pop,_=H.push,M=H.push,O=H.slice,F=H.indexOf||function(e){var t=0,n=this.length;for(;n>t;t++)if(this[t]===e)return t;return-1},B="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",P="[\\x20\\t\\r\\n\\f]",R="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",W=R.replace("w","w#"),$="\\["+P+"*("+R+")"+P+"*(?:([*^$|!~]?=)"+P+"*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|("+W+")|)|)"+P+"*\\]",I=":("+R+")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|"+$.replace(3,8)+")*)|.*)\\)|)",z=RegExp("^"+P+"+|((?:^|[^\\\\])(?:\\\\.)*)"+P+"+$","g"),X=RegExp("^"+P+"*,"+P+"*"),U=RegExp("^"+P+"*([>+~]|"+P+")"+P+"*"),V=RegExp(P+"*[+~]"),Y=RegExp("="+P+"*([^\\]'\"]*)"+P+"*\\]","g"),J=RegExp(I),G=RegExp("^"+W+"$"),Q={ID:RegExp("^#("+R+")"),CLASS:RegExp("^\\.("+R+")"),TAG:RegExp("^("+R.replace("w","w*")+")"),ATTR:RegExp("^"+$),PSEUDO:RegExp("^"+I),CHILD:RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+P+"*(even|odd|(([+-]|)(\\d*)n|)"+P+"*(?:([+-]|)"+P+"*(\\d+)|))"+P+"*\\)|)","i"),bool:RegExp("^(?:"+B+")$","i"),needsContext:RegExp("^"+P+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+P+"*((?:-\\d)?\\d*)"+P+"*\\)|)(?=[^-]|$)","i")},K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,et=/^(?:input|select|textarea|button)$/i,tt=/^h\d$/i,nt=/'|\\/g,rt=RegExp("\\\\([\\da-f]{1,6}"+P+"?|("+P+")|.)","ig"),it=function(e,t,n){var r="0x"+t-65536;return r!==r||n?t:0>r?String.fromCharCode(r+65536):String.fromCharCode(55296|r>>10,56320|1023&r)};try{M.apply(H=O.call(w.childNodes),w.childNodes),H[w.childNodes.length].nodeType}catch(ot){M={apply:H.length?function(e,t){_.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function at(e,t,n,i){var o,a,s,l,u,c,d,m,y,x;if((t?t.ownerDocument||t:w)!==f&&p(t),t=t||f,n=n||[],!e||"string"!=typeof e)return n;if(1!==(l=t.nodeType)&&9!==l)return[];if(h&&!i){if(o=Z.exec(e))if(s=o[1]){if(9===l){if(a=t.getElementById(s),!a||!a.parentNode)return n;if(a.id===s)return n.push(a),n}else if(t.ownerDocument&&(a=t.ownerDocument.getElementById(s))&&v(t,a)&&a.id===s)return n.push(a),n}else{if(o[2])return M.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&r.getElementsByClassName&&t.getElementsByClassName)return M.apply(n,t.getElementsByClassName(s)),n}if(r.qsa&&(!g||!g.test(e))){if(m=d=b,y=t,x=9===l&&e,1===l&&"object"!==t.nodeName.toLowerCase()){c=mt(e),(d=t.getAttribute("id"))?m=d.replace(nt,"\\$&"):t.setAttribute("id",m),m="[id='"+m+"'] ",u=c.length;while(u--)c[u]=m+yt(c[u]);y=V.test(e)&&t.parentNode||t,x=c.join(",")}if(x)try{return M.apply(n,y.querySelectorAll(x)),n}catch(T){}finally{d||t.removeAttribute("id")}}}return kt(e.replace(z,"$1"),t,n,i)}function st(){var e=[];function t(n,r){return e.push(n+=" ")>o.cacheLength&&delete t[e.shift()],t[n]=r}return t}function lt(e){return e[b]=!0,e}function ut(e){var t=f.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function ct(e,t){var n=e.split("|"),r=e.length;while(r--)o.attrHandle[n[r]]=t}function pt(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&(~t.sourceIndex||D)-(~e.sourceIndex||D);if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function ft(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function dt(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function ht(e){return lt(function(t){return t=+t,lt(function(n,r){var i,o=e([],n.length,t),a=o.length;while(a--)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))})})}s=at.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return t?"HTML"!==t.nodeName:!1},r=at.support={},p=at.setDocument=function(e){var n=e?e.ownerDocument||e:w,i=n.defaultView;return n!==f&&9===n.nodeType&&n.documentElement?(f=n,d=n.documentElement,h=!s(n),i&&i.attachEvent&&i!==i.top&&i.attachEvent("onbeforeunload",function(){p()}),r.attributes=ut(function(e){return e.className="i",!e.getAttribute("className")}),r.getElementsByTagName=ut(function(e){return e.appendChild(n.createComment("")),!e.getElementsByTagName("*").length}),r.getElementsByClassName=ut(function(e){return e.innerHTML="<div class='a'></div><div class='a i'></div>",e.firstChild.className="i",2===e.getElementsByClassName("i").length}),r.getById=ut(function(e){return d.appendChild(e).id=b,!n.getElementsByName||!n.getElementsByName(b).length}),r.getById?(o.find.ID=function(e,t){if(typeof t.getElementById!==j&&h){var n=t.getElementById(e);return n&&n.parentNode?[n]:[]}},o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){return e.getAttribute("id")===t}}):(delete o.find.ID,o.filter.ID=function(e){var t=e.replace(rt,it);return function(e){var n=typeof e.getAttributeNode!==j&&e.getAttributeNode("id");return n&&n.value===t}}),o.find.TAG=r.getElementsByTagName?function(e,n){return typeof n.getElementsByTagName!==j?n.getElementsByTagName(e):t}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},o.find.CLASS=r.getElementsByClassName&&function(e,n){return typeof n.getElementsByClassName!==j&&h?n.getElementsByClassName(e):t},m=[],g=[],(r.qsa=K.test(n.querySelectorAll))&&(ut(function(e){e.innerHTML="<select><option selected=''></option></select>",e.querySelectorAll("[selected]").length||g.push("\\["+P+"*(?:value|"+B+")"),e.querySelectorAll(":checked").length||g.push(":checked")}),ut(function(e){var t=n.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("t",""),e.querySelectorAll("[t^='']").length&&g.push("[*^$]="+P+"*(?:''|\"\")"),e.querySelectorAll(":enabled").length||g.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),g.push(",.*:")})),(r.matchesSelector=K.test(y=d.webkitMatchesSelector||d.mozMatchesSelector||d.oMatchesSelector||d.msMatchesSelector))&&ut(function(e){r.disconnectedMatch=y.call(e,"div"),y.call(e,"[s!='']:x"),m.push("!=",I)}),g=g.length&&RegExp(g.join("|")),m=m.length&&RegExp(m.join("|")),v=K.test(d.contains)||d.compareDocumentPosition?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},A=d.compareDocumentPosition?function(e,t){if(e===t)return S=!0,0;var i=t.compareDocumentPosition&&e.compareDocumentPosition&&e.compareDocumentPosition(t);return i?1&i||!r.sortDetached&&t.compareDocumentPosition(e)===i?e===n||v(w,e)?-1:t===n||v(w,t)?1:c?F.call(c,e)-F.call(c,t):0:4&i?-1:1:e.compareDocumentPosition?-1:1}:function(e,t){var r,i=0,o=e.parentNode,a=t.parentNode,s=[e],l=[t];if(e===t)return S=!0,0;if(!o||!a)return e===n?-1:t===n?1:o?-1:a?1:c?F.call(c,e)-F.call(c,t):0;if(o===a)return pt(e,t);r=e;while(r=r.parentNode)s.unshift(r);r=t;while(r=r.parentNode)l.unshift(r);while(s[i]===l[i])i++;return i?pt(s[i],l[i]):s[i]===w?-1:l[i]===w?1:0},n):f},at.matches=function(e,t){return at(e,null,null,t)},at.matchesSelector=function(e,t){if((e.ownerDocument||e)!==f&&p(e),t=t.replace(Y,"='$1']"),!(!r.matchesSelector||!h||m&&m.test(t)||g&&g.test(t)))try{var n=y.call(e,t);if(n||r.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(i){}return at(t,f,null,[e]).length>0},at.contains=function(e,t){return(e.ownerDocument||e)!==f&&p(e),v(e,t)},at.attr=function(e,n){(e.ownerDocument||e)!==f&&p(e);var i=o.attrHandle[n.toLowerCase()],a=i&&L.call(o.attrHandle,n.toLowerCase())?i(e,n,!h):t;return a===t?r.attributes||!h?e.getAttribute(n):(a=e.getAttributeNode(n))&&a.specified?a.value:null:a},at.error=function(e){throw Error("Syntax error, unrecognized expression: "+e)},at.uniqueSort=function(e){var t,n=[],i=0,o=0;if(S=!r.detectDuplicates,c=!r.sortStable&&e.slice(0),e.sort(A),S){while(t=e[o++])t===e[o]&&(i=n.push(o));while(i--)e.splice(n[i],1)}return e},a=at.getText=function(e){var t,n="",r=0,i=e.nodeType;if(i){if(1===i||9===i||11===i){if("string"==typeof e.textContent)return e.textContent;for(e=e.firstChild;e;e=e.nextSibling)n+=a(e)}else if(3===i||4===i)return e.nodeValue}else for(;t=e[r];r++)n+=a(t);return n},o=at.selectors={cacheLength:50,createPseudo:lt,match:Q,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(rt,it),e[3]=(e[4]||e[5]||"").replace(rt,it),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||at.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&at.error(e[0]),e},PSEUDO:function(e){var n,r=!e[5]&&e[2];return Q.CHILD.test(e[0])?null:(e[3]&&e[4]!==t?e[2]=e[4]:r&&J.test(r)&&(n=mt(r,!0))&&(n=r.indexOf(")",r.length-n)-r.length)&&(e[0]=e[0].slice(0,n),e[2]=r.slice(0,n)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(rt,it).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=N[e+" "];return t||(t=RegExp("(^|"+P+")"+e+"("+P+"|$)"))&&N(e,function(e){return t.test("string"==typeof e.className&&e.className||typeof e.getAttribute!==j&&e.getAttribute("class")||"")})},ATTR:function(e,t,n){return function(r){var i=at.attr(r,e);return null==i?"!="===t:t?(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i+" ").indexOf(n)>-1:"|="===t?i===n||i.slice(0,n.length+1)===n+"-":!1):!0}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var u,c,p,f,d,h,g=o!==a?"nextSibling":"previousSibling",m=t.parentNode,y=s&&t.nodeName.toLowerCase(),v=!l&&!s;if(m){if(o){while(g){p=t;while(p=p[g])if(s?p.nodeName.toLowerCase()===y:1===p.nodeType)return!1;h=g="only"===e&&!h&&"nextSibling"}return!0}if(h=[a?m.firstChild:m.lastChild],a&&v){c=m[b]||(m[b]={}),u=c[e]||[],d=u[0]===T&&u[1],f=u[0]===T&&u[2],p=d&&m.childNodes[d];while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if(1===p.nodeType&&++f&&p===t){c[e]=[T,d,f];break}}else if(v&&(u=(t[b]||(t[b]={}))[e])&&u[0]===T)f=u[1];else while(p=++d&&p&&p[g]||(f=d=0)||h.pop())if((s?p.nodeName.toLowerCase()===y:1===p.nodeType)&&++f&&(v&&((p[b]||(p[b]={}))[e]=[T,f]),p===t))break;return f-=i,f===r||0===f%r&&f/r>=0}}},PSEUDO:function(e,t){var n,r=o.pseudos[e]||o.setFilters[e.toLowerCase()]||at.error("unsupported pseudo: "+e);return r[b]?r(t):r.length>1?(n=[e,e,"",t],o.setFilters.hasOwnProperty(e.toLowerCase())?lt(function(e,n){var i,o=r(e,t),a=o.length;while(a--)i=F.call(e,o[a]),e[i]=!(n[i]=o[a])}):function(e){return r(e,0,n)}):r}},pseudos:{not:lt(function(e){var t=[],n=[],r=l(e.replace(z,"$1"));return r[b]?lt(function(e,t,n,i){var o,a=r(e,null,i,[]),s=e.length;while(s--)(o=a[s])&&(e[s]=!(t[s]=o))}):function(e,i,o){return t[0]=e,r(t,null,o,n),!n.pop()}}),has:lt(function(e){return function(t){return at(e,t).length>0}}),contains:lt(function(e){return function(t){return(t.textContent||t.innerText||a(t)).indexOf(e)>-1}}),lang:lt(function(e){return G.test(e||"")||at.error("unsupported lang: "+e),e=e.replace(rt,it).toLowerCase(),function(t){var n;do if(n=h?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return n=n.toLowerCase(),n===e||0===n.indexOf(e+"-");while((t=t.parentNode)&&1===t.nodeType);return!1}}),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===d},focus:function(e){return e===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(e.type||e.href||~e.tabIndex)},enabled:function(e){return e.disabled===!1},disabled:function(e){return e.disabled===!0},checked:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&!!e.checked||"option"===t&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,e.selected===!0},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeName>"@"||3===e.nodeType||4===e.nodeType)return!1;return!0},parent:function(e){return!o.pseudos.empty(e)},header:function(e){return tt.test(e.nodeName)},input:function(e){return et.test(e.nodeName)},button:function(e){var t=e.nodeName.toLowerCase();return"input"===t&&"button"===e.type||"button"===t},text:function(e){var t;return"input"===e.nodeName.toLowerCase()&&"text"===e.type&&(null==(t=e.getAttribute("type"))||t.toLowerCase()===e.type)},first:ht(function(){return[0]}),last:ht(function(e,t){return[t-1]}),eq:ht(function(e,t,n){return[0>n?n+t:n]}),even:ht(function(e,t){var n=0;for(;t>n;n+=2)e.push(n);return e}),odd:ht(function(e,t){var n=1;for(;t>n;n+=2)e.push(n);return e}),lt:ht(function(e,t,n){var r=0>n?n+t:n;for(;--r>=0;)e.push(r);return e}),gt:ht(function(e,t,n){var r=0>n?n+t:n;for(;t>++r;)e.push(r);return e})}},o.pseudos.nth=o.pseudos.eq;for(n in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})o.pseudos[n]=ft(n);for(n in{submit:!0,reset:!0})o.pseudos[n]=dt(n);function gt(){}gt.prototype=o.filters=o.pseudos,o.setFilters=new gt;function mt(e,t){var n,r,i,a,s,l,u,c=k[e+" "];if(c)return t?0:c.slice(0);s=e,l=[],u=o.preFilter;while(s){(!n||(r=X.exec(s)))&&(r&&(s=s.slice(r[0].length)||s),l.push(i=[])),n=!1,(r=U.exec(s))&&(n=r.shift(),i.push({value:n,type:r[0].replace(z," ")}),s=s.slice(n.length));for(a in o.filter)!(r=Q[a].exec(s))||u[a]&&!(r=u[a](r))||(n=r.shift(),i.push({value:n,type:a,matches:r}),s=s.slice(n.length));if(!n)break}return t?s.length:s?at.error(e):k(e,l).slice(0)}function yt(e){var t=0,n=e.length,r="";for(;n>t;t++)r+=e[t].value;return r}function vt(e,t,n){var r=t.dir,o=n&&"parentNode"===r,a=C++;return t.first?function(t,n,i){while(t=t[r])if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var l,u,c,p=T+" "+a;if(s){while(t=t[r])if((1===t.nodeType||o)&&e(t,n,s))return!0}else while(t=t[r])if(1===t.nodeType||o)if(c=t[b]||(t[b]={}),(u=c[r])&&u[0]===p){if((l=u[1])===!0||l===i)return l===!0}else if(u=c[r]=[p],u[1]=e(t,n,s)||i,u[1]===!0)return!0}}function bt(e){return e.length>1?function(t,n,r){var i=e.length;while(i--)if(!e[i](t,n,r))return!1;return!0}:e[0]}function xt(e,t,n,r,i){var o,a=[],s=0,l=e.length,u=null!=t;for(;l>s;s++)(o=e[s])&&(!n||n(o,r,i))&&(a.push(o),u&&t.push(s));return a}function wt(e,t,n,r,i,o){return r&&!r[b]&&(r=wt(r)),i&&!i[b]&&(i=wt(i,o)),lt(function(o,a,s,l){var u,c,p,f=[],d=[],h=a.length,g=o||Nt(t||"*",s.nodeType?[s]:s,[]),m=!e||!o&&t?g:xt(g,f,e,s,l),y=n?i||(o?e:h||r)?[]:a:m;if(n&&n(m,y,s,l),r){u=xt(y,d),r(u,[],s,l),c=u.length;while(c--)(p=u[c])&&(y[d[c]]=!(m[d[c]]=p))}if(o){if(i||e){if(i){u=[],c=y.length;while(c--)(p=y[c])&&u.push(m[c]=p);i(null,y=[],u,l)}c=y.length;while(c--)(p=y[c])&&(u=i?F.call(o,p):f[c])>-1&&(o[u]=!(a[u]=p))}}else y=xt(y===a?y.splice(h,y.length):y),i?i(null,a,y,l):M.apply(a,y)})}function Tt(e){var t,n,r,i=e.length,a=o.relative[e[0].type],s=a||o.relative[" "],l=a?1:0,c=vt(function(e){return e===t},s,!0),p=vt(function(e){return F.call(t,e)>-1},s,!0),f=[function(e,n,r){return!a&&(r||n!==u)||((t=n).nodeType?c(e,n,r):p(e,n,r))}];for(;i>l;l++)if(n=o.relative[e[l].type])f=[vt(bt(f),n)];else{if(n=o.filter[e[l].type].apply(null,e[l].matches),n[b]){for(r=++l;i>r;r++)if(o.relative[e[r].type])break;return wt(l>1&&bt(f),l>1&&yt(e.slice(0,l-1).concat({value:" "===e[l-2].type?"*":""})).replace(z,"$1"),n,r>l&&Tt(e.slice(l,r)),i>r&&Tt(e=e.slice(r)),i>r&&yt(e))}f.push(n)}return bt(f)}function Ct(e,t){var n=0,r=t.length>0,a=e.length>0,s=function(s,l,c,p,d){var h,g,m,y=[],v=0,b="0",x=s&&[],w=null!=d,C=u,N=s||a&&o.find.TAG("*",d&&l.parentNode||l),k=T+=null==C?1:Math.random()||.1;for(w&&(u=l!==f&&l,i=n);null!=(h=N[b]);b++){if(a&&h){g=0;while(m=e[g++])if(m(h,l,c)){p.push(h);break}w&&(T=k,i=++n)}r&&((h=!m&&h)&&v--,s&&x.push(h))}if(v+=b,r&&b!==v){g=0;while(m=t[g++])m(x,y,l,c);if(s){if(v>0)while(b--)x[b]||y[b]||(y[b]=q.call(p));y=xt(y)}M.apply(p,y),w&&!s&&y.length>0&&v+t.length>1&&at.uniqueSort(p)}return w&&(T=k,u=C),x};return r?lt(s):s}l=at.compile=function(e,t){var n,r=[],i=[],o=E[e+" "];if(!o){t||(t=mt(e)),n=t.length;while(n--)o=Tt(t[n]),o[b]?r.push(o):i.push(o);o=E(e,Ct(i,r))}return o};function Nt(e,t,n){var r=0,i=t.length;for(;i>r;r++)at(e,t[r],n);return n}function kt(e,t,n,i){var a,s,u,c,p,f=mt(e);if(!i&&1===f.length){if(s=f[0]=f[0].slice(0),s.length>2&&"ID"===(u=s[0]).type&&r.getById&&9===t.nodeType&&h&&o.relative[s[1].type]){if(t=(o.find.ID(u.matches[0].replace(rt,it),t)||[])[0],!t)return n;e=e.slice(s.shift().value.length)}a=Q.needsContext.test(e)?0:s.length;while(a--){if(u=s[a],o.relative[c=u.type])break;if((p=o.find[c])&&(i=p(u.matches[0].replace(rt,it),V.test(s[0].type)&&t.parentNode||t))){if(s.splice(a,1),e=i.length&&yt(s),!e)return M.apply(n,i),n;break}}}return l(e,f)(i,t,!h,n,V.test(e)),n}r.sortStable=b.split("").sort(A).join("")===b,r.detectDuplicates=S,p(),r.sortDetached=ut(function(e){return 1&e.compareDocumentPosition(f.createElement("div"))}),ut(function(e){return e.innerHTML="<a href='#'></a>","#"===e.firstChild.getAttribute("href")})||ct("type|href|height|width",function(e,n,r){return r?t:e.getAttribute(n,"type"===n.toLowerCase()?1:2)}),r.attributes&&ut(function(e){return e.innerHTML="<input/>",e.firstChild.setAttribute("value",""),""===e.firstChild.getAttribute("value")})||ct("value",function(e,n,r){return r||"input"!==e.nodeName.toLowerCase()?t:e.defaultValue}),ut(function(e){return null==e.getAttribute("disabled")})||ct(B,function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&i.specified?i.value:e[n]===!0?n.toLowerCase():null}),x.find=at,x.expr=at.selectors,x.expr[":"]=x.expr.pseudos,x.unique=at.uniqueSort,x.text=at.getText,x.isXMLDoc=at.isXML,x.contains=at.contains}(e);var O={};function F(e){var t=O[e]={};return x.each(e.match(T)||[],function(e,n){t[n]=!0}),t}x.Callbacks=function(e){e="string"==typeof e?O[e]||F(e):x.extend({},e);var n,r,i,o,a,s,l=[],u=!e.once&&[],c=function(t){for(r=e.memory&&t,i=!0,a=s||0,s=0,o=l.length,n=!0;l&&o>a;a++)if(l[a].apply(t[0],t[1])===!1&&e.stopOnFalse){r=!1;break}n=!1,l&&(u?u.length&&c(u.shift()):r?l=[]:p.disable())},p={add:function(){if(l){var t=l.length;(function i(t){x.each(t,function(t,n){var r=x.type(n);"function"===r?e.unique&&p.has(n)||l.push(n):n&&n.length&&"string"!==r&&i(n)})})(arguments),n?o=l.length:r&&(s=t,c(r))}return this},remove:function(){return l&&x.each(arguments,function(e,t){var r;while((r=x.inArray(t,l,r))>-1)l.splice(r,1),n&&(o>=r&&o--,a>=r&&a--)}),this},has:function(e){return e?x.inArray(e,l)>-1:!(!l||!l.length)},empty:function(){return l=[],o=0,this},disable:function(){return l=u=r=t,this},disabled:function(){return!l},lock:function(){return u=t,r||p.disable(),this},locked:function(){return!u},fireWith:function(e,t){return!l||i&&!u||(t=t||[],t=[e,t.slice?t.slice():t],n?u.push(t):c(t)),this},fire:function(){return p.fireWith(this,arguments),this},fired:function(){return!!i}};return p},x.extend({Deferred:function(e){var t=[["resolve","done",x.Callbacks("once memory"),"resolved"],["reject","fail",x.Callbacks("once memory"),"rejected"],["notify","progress",x.Callbacks("memory")]],n="pending",r={state:function(){return n},always:function(){return i.done(arguments).fail(arguments),this},then:function(){var e=arguments;return x.Deferred(function(n){x.each(t,function(t,o){var a=o[0],s=x.isFunction(e[t])&&e[t];i[o[1]](function(){var e=s&&s.apply(this,arguments);e&&x.isFunction(e.promise)?e.promise().done(n.resolve).fail(n.reject).progress(n.notify):n[a+"With"](this===r?n.promise():this,s?[e]:arguments)})}),e=null}).promise()},promise:function(e){return null!=e?x.extend(e,r):r}},i={};return r.pipe=r.then,x.each(t,function(e,o){var a=o[2],s=o[3];r[o[1]]=a.add,s&&a.add(function(){n=s},t[1^e][2].disable,t[2][2].lock),i[o[0]]=function(){return i[o[0]+"With"](this===i?r:this,arguments),this},i[o[0]+"With"]=a.fireWith}),r.promise(i),e&&e.call(i,i),i},when:function(e){var t=0,n=g.call(arguments),r=n.length,i=1!==r||e&&x.isFunction(e.promise)?r:0,o=1===i?e:x.Deferred(),a=function(e,t,n){return function(r){t[e]=this,n[e]=arguments.length>1?g.call(arguments):r,n===s?o.notifyWith(t,n):--i||o.resolveWith(t,n)}},s,l,u;if(r>1)for(s=Array(r),l=Array(r),u=Array(r);r>t;t++)n[t]&&x.isFunction(n[t].promise)?n[t].promise().done(a(t,u,n)).fail(o.reject).progress(a(t,l,s)):--i;return i||o.resolveWith(u,n),o.promise()}}),x.support=function(t){var n,r,o,s,l,u,c,p,f,d=a.createElement("div");if(d.setAttribute("className","t"),d.innerHTML="  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>",n=d.getElementsByTagName("*")||[],r=d.getElementsByTagName("a")[0],!r||!r.style||!n.length)return t;s=a.createElement("select"),u=s.appendChild(a.createElement("option")),o=d.getElementsByTagName("input")[0],r.style.cssText="top:1px;float:left;opacity:.5",t.getSetAttribute="t"!==d.className,t.leadingWhitespace=3===d.firstChild.nodeType,t.tbody=!d.getElementsByTagName("tbody").length,t.htmlSerialize=!!d.getElementsByTagName("link").length,t.style=/top/.test(r.getAttribute("style")),t.hrefNormalized="/a"===r.getAttribute("href"),t.opacity=/^0.5/.test(r.style.opacity),t.cssFloat=!!r.style.cssFloat,t.checkOn=!!o.value,t.optSelected=u.selected,t.enctype=!!a.createElement("form").enctype,t.html5Clone="<:nav></:nav>"!==a.createElement("nav").cloneNode(!0).outerHTML,t.inlineBlockNeedsLayout=!1,t.shrinkWrapBlocks=!1,t.pixelPosition=!1,t.deleteExpando=!0,t.noCloneEvent=!0,t.reliableMarginRight=!0,t.boxSizingReliable=!0,o.checked=!0,t.noCloneChecked=o.cloneNode(!0).checked,s.disabled=!0,t.optDisabled=!u.disabled;try{delete d.test}catch(h){t.deleteExpando=!1}o=a.createElement("input"),o.setAttribute("value",""),t.input=""===o.getAttribute("value"),o.value="t",o.setAttribute("type","radio"),t.radioValue="t"===o.value,o.setAttribute("checked","t"),o.setAttribute("name","t"),l=a.createDocumentFragment(),l.appendChild(o),t.appendChecked=o.checked,t.checkClone=l.cloneNode(!0).cloneNode(!0).lastChild.checked,d.attachEvent&&(d.attachEvent("onclick",function(){t.noCloneEvent=!1}),d.cloneNode(!0).click());for(f in{submit:!0,change:!0,focusin:!0})d.setAttribute(c="on"+f,"t"),t[f+"Bubbles"]=c in e||d.attributes[c].expando===!1;d.style.backgroundClip="content-box",d.cloneNode(!0).style.backgroundClip="",t.clearCloneStyle="content-box"===d.style.backgroundClip;for(f in x(t))break;return t.ownLast="0"!==f,x(function(){var n,r,o,s="padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",l=a.getElementsByTagName("body")[0];l&&(n=a.createElement("div"),n.style.cssText="border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px",l.appendChild(n).appendChild(d),d.innerHTML="<table><tr><td></td><td>t</td></tr></table>",o=d.getElementsByTagName("td"),o[0].style.cssText="padding:0;margin:0;border:0;display:none",p=0===o[0].offsetHeight,o[0].style.display="",o[1].style.display="none",t.reliableHiddenOffsets=p&&0===o[0].offsetHeight,d.innerHTML="",d.style.cssText="box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;",x.swap(l,null!=l.style.zoom?{zoom:1}:{},function(){t.boxSizing=4===d.offsetWidth}),e.getComputedStyle&&(t.pixelPosition="1%"!==(e.getComputedStyle(d,null)||{}).top,t.boxSizingReliable="4px"===(e.getComputedStyle(d,null)||{width:"4px"}).width,r=d.appendChild(a.createElement("div")),r.style.cssText=d.style.cssText=s,r.style.marginRight=r.style.width="0",d.style.width="1px",t.reliableMarginRight=!parseFloat((e.getComputedStyle(r,null)||{}).marginRight)),typeof d.style.zoom!==i&&(d.innerHTML="",d.style.cssText=s+"width:1px;padding:1px;display:inline;zoom:1",t.inlineBlockNeedsLayout=3===d.offsetWidth,d.style.display="block",d.innerHTML="<div></div>",d.firstChild.style.width="5px",t.shrinkWrapBlocks=3!==d.offsetWidth,t.inlineBlockNeedsLayout&&(l.style.zoom=1)),l.removeChild(n),n=d=o=r=null)}),n=s=l=u=r=o=null,t
+}({});var B=/(?:\{[\s\S]*\}|\[[\s\S]*\])$/,P=/([A-Z])/g;function R(e,n,r,i){if(x.acceptData(e)){var o,a,s=x.expando,l=e.nodeType,u=l?x.cache:e,c=l?e[s]:e[s]&&s;if(c&&u[c]&&(i||u[c].data)||r!==t||"string"!=typeof n)return c||(c=l?e[s]=p.pop()||x.guid++:s),u[c]||(u[c]=l?{}:{toJSON:x.noop}),("object"==typeof n||"function"==typeof n)&&(i?u[c]=x.extend(u[c],n):u[c].data=x.extend(u[c].data,n)),a=u[c],i||(a.data||(a.data={}),a=a.data),r!==t&&(a[x.camelCase(n)]=r),"string"==typeof n?(o=a[n],null==o&&(o=a[x.camelCase(n)])):o=a,o}}function W(e,t,n){if(x.acceptData(e)){var r,i,o=e.nodeType,a=o?x.cache:e,s=o?e[x.expando]:x.expando;if(a[s]){if(t&&(r=n?a[s]:a[s].data)){x.isArray(t)?t=t.concat(x.map(t,x.camelCase)):t in r?t=[t]:(t=x.camelCase(t),t=t in r?[t]:t.split(" ")),i=t.length;while(i--)delete r[t[i]];if(n?!I(r):!x.isEmptyObject(r))return}(n||(delete a[s].data,I(a[s])))&&(o?x.cleanData([e],!0):x.support.deleteExpando||a!=a.window?delete a[s]:a[s]=null)}}}x.extend({cache:{},noData:{applet:!0,embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"},hasData:function(e){return e=e.nodeType?x.cache[e[x.expando]]:e[x.expando],!!e&&!I(e)},data:function(e,t,n){return R(e,t,n)},removeData:function(e,t){return W(e,t)},_data:function(e,t,n){return R(e,t,n,!0)},_removeData:function(e,t){return W(e,t,!0)},acceptData:function(e){if(e.nodeType&&1!==e.nodeType&&9!==e.nodeType)return!1;var t=e.nodeName&&x.noData[e.nodeName.toLowerCase()];return!t||t!==!0&&e.getAttribute("classid")===t}}),x.fn.extend({data:function(e,n){var r,i,o=null,a=0,s=this[0];if(e===t){if(this.length&&(o=x.data(s),1===s.nodeType&&!x._data(s,"parsedAttrs"))){for(r=s.attributes;r.length>a;a++)i=r[a].name,0===i.indexOf("data-")&&(i=x.camelCase(i.slice(5)),$(s,i,o[i]));x._data(s,"parsedAttrs",!0)}return o}return"object"==typeof e?this.each(function(){x.data(this,e)}):arguments.length>1?this.each(function(){x.data(this,e,n)}):s?$(s,e,x.data(s,e)):null},removeData:function(e){return this.each(function(){x.removeData(this,e)})}});function $(e,n,r){if(r===t&&1===e.nodeType){var i="data-"+n.replace(P,"-$1").toLowerCase();if(r=e.getAttribute(i),"string"==typeof r){try{r="true"===r?!0:"false"===r?!1:"null"===r?null:+r+""===r?+r:B.test(r)?x.parseJSON(r):r}catch(o){}x.data(e,n,r)}else r=t}return r}function I(e){var t;for(t in e)if(("data"!==t||!x.isEmptyObject(e[t]))&&"toJSON"!==t)return!1;return!0}x.extend({queue:function(e,n,r){var i;return e?(n=(n||"fx")+"queue",i=x._data(e,n),r&&(!i||x.isArray(r)?i=x._data(e,n,x.makeArray(r)):i.push(r)),i||[]):t},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t),a=function(){x.dequeue(e,t)};"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,a,o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return x._data(e,n)||x._data(e,n,{empty:x.Callbacks("once memory").add(function(){x._removeData(e,t+"queue"),x._removeData(e,n)})})}}),x.fn.extend({queue:function(e,n){var r=2;return"string"!=typeof e&&(n=e,e="fx",r--),r>arguments.length?x.queue(this[0],e):n===t?this:this.each(function(){var t=x.queue(this,e,n);x._queueHooks(this,e),"fx"===e&&"inprogress"!==t[0]&&x.dequeue(this,e)})},dequeue:function(e){return this.each(function(){x.dequeue(this,e)})},delay:function(e,t){return e=x.fx?x.fx.speeds[e]||e:e,t=t||"fx",this.queue(t,function(t,n){var r=setTimeout(t,e);n.stop=function(){clearTimeout(r)}})},clearQueue:function(e){return this.queue(e||"fx",[])},promise:function(e,n){var r,i=1,o=x.Deferred(),a=this,s=this.length,l=function(){--i||o.resolveWith(a,[a])};"string"!=typeof e&&(n=e,e=t),e=e||"fx";while(s--)r=x._data(a[s],e+"queueHooks"),r&&r.empty&&(i++,r.empty.add(l));return l(),o.promise(n)}});var z,X,U=/[\t\r\n\f]/g,V=/\r/g,Y=/^(?:input|select|textarea|button|object)$/i,J=/^(?:a|area)$/i,G=/^(?:checked|selected)$/i,Q=x.support.getSetAttribute,K=x.support.input;x.fn.extend({attr:function(e,t){return x.access(this,x.attr,e,t,arguments.length>1)},removeAttr:function(e){return this.each(function(){x.removeAttr(this,e)})},prop:function(e,t){return x.access(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return e=x.propFix[e]||e,this.each(function(){try{this[e]=t,delete this[e]}catch(n){}})},addClass:function(e){var t,n,r,i,o,a=0,s=this.length,l="string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).addClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):" ")){o=0;while(i=t[o++])0>r.indexOf(" "+i+" ")&&(r+=i+" ");n.className=x.trim(r)}return this},removeClass:function(e){var t,n,r,i,o,a=0,s=this.length,l=0===arguments.length||"string"==typeof e&&e;if(x.isFunction(e))return this.each(function(t){x(this).removeClass(e.call(this,t,this.className))});if(l)for(t=(e||"").match(T)||[];s>a;a++)if(n=this[a],r=1===n.nodeType&&(n.className?(" "+n.className+" ").replace(U," "):"")){o=0;while(i=t[o++])while(r.indexOf(" "+i+" ")>=0)r=r.replace(" "+i+" "," ");n.className=e?x.trim(r):""}return this},toggleClass:function(e,t){var n=typeof e;return"boolean"==typeof t&&"string"===n?t?this.addClass(e):this.removeClass(e):x.isFunction(e)?this.each(function(n){x(this).toggleClass(e.call(this,n,this.className,t),t)}):this.each(function(){if("string"===n){var t,r=0,o=x(this),a=e.match(T)||[];while(t=a[r++])o.hasClass(t)?o.removeClass(t):o.addClass(t)}else(n===i||"boolean"===n)&&(this.className&&x._data(this,"__className__",this.className),this.className=this.className||e===!1?"":x._data(this,"__className__")||"")})},hasClass:function(e){var t=" "+e+" ",n=0,r=this.length;for(;r>n;n++)if(1===this[n].nodeType&&(" "+this[n].className+" ").replace(U," ").indexOf(t)>=0)return!0;return!1},val:function(e){var n,r,i,o=this[0];{if(arguments.length)return i=x.isFunction(e),this.each(function(n){var o;1===this.nodeType&&(o=i?e.call(this,n,x(this).val()):e,null==o?o="":"number"==typeof o?o+="":x.isArray(o)&&(o=x.map(o,function(e){return null==e?"":e+""})),r=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()],r&&"set"in r&&r.set(this,o,"value")!==t||(this.value=o))});if(o)return r=x.valHooks[o.type]||x.valHooks[o.nodeName.toLowerCase()],r&&"get"in r&&(n=r.get(o,"value"))!==t?n:(n=o.value,"string"==typeof n?n.replace(V,""):null==n?"":n)}}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:e.text}},select:{get:function(e){var t,n,r=e.options,i=e.selectedIndex,o="select-one"===e.type||0>i,a=o?null:[],s=o?i+1:r.length,l=0>i?s:o?i:0;for(;s>l;l++)if(n=r[l],!(!n.selected&&l!==i||(x.support.optDisabled?n.disabled:null!==n.getAttribute("disabled"))||n.parentNode.disabled&&x.nodeName(n.parentNode,"optgroup"))){if(t=x(n).val(),o)return t;a.push(t)}return a},set:function(e,t){var n,r,i=e.options,o=x.makeArray(t),a=i.length;while(a--)r=i[a],(r.selected=x.inArray(x(r).val(),o)>=0)&&(n=!0);return n||(e.selectedIndex=-1),o}}},attr:function(e,n,r){var o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return typeof e.getAttribute===i?x.prop(e,n,r):(1===s&&x.isXMLDoc(e)||(n=n.toLowerCase(),o=x.attrHooks[n]||(x.expr.match.bool.test(n)?X:z)),r===t?o&&"get"in o&&null!==(a=o.get(e,n))?a:(a=x.find.attr(e,n),null==a?t:a):null!==r?o&&"set"in o&&(a=o.set(e,r,n))!==t?a:(e.setAttribute(n,r+""),r):(x.removeAttr(e,n),t))},removeAttr:function(e,t){var n,r,i=0,o=t&&t.match(T);if(o&&1===e.nodeType)while(n=o[i++])r=x.propFix[n]||n,x.expr.match.bool.test(n)?K&&Q||!G.test(n)?e[r]=!1:e[x.camelCase("default-"+n)]=e[r]=!1:x.attr(e,n,""),e.removeAttribute(Q?n:r)},attrHooks:{type:{set:function(e,t){if(!x.support.radioValue&&"radio"===t&&x.nodeName(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},propFix:{"for":"htmlFor","class":"className"},prop:function(e,n,r){var i,o,a,s=e.nodeType;if(e&&3!==s&&8!==s&&2!==s)return a=1!==s||!x.isXMLDoc(e),a&&(n=x.propFix[n]||n,o=x.propHooks[n]),r!==t?o&&"set"in o&&(i=o.set(e,r,n))!==t?i:e[n]=r:o&&"get"in o&&null!==(i=o.get(e,n))?i:e[n]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):Y.test(e.nodeName)||J.test(e.nodeName)&&e.href?0:-1}}}}),X={set:function(e,t,n){return t===!1?x.removeAttr(e,n):K&&Q||!G.test(n)?e.setAttribute(!Q&&x.propFix[n]||n,n):e[x.camelCase("default-"+n)]=e[n]=!0,n}},x.each(x.expr.match.bool.source.match(/\w+/g),function(e,n){var r=x.expr.attrHandle[n]||x.find.attr;x.expr.attrHandle[n]=K&&Q||!G.test(n)?function(e,n,i){var o=x.expr.attrHandle[n],a=i?t:(x.expr.attrHandle[n]=t)!=r(e,n,i)?n.toLowerCase():null;return x.expr.attrHandle[n]=o,a}:function(e,n,r){return r?t:e[x.camelCase("default-"+n)]?n.toLowerCase():null}}),K&&Q||(x.attrHooks.value={set:function(e,n,r){return x.nodeName(e,"input")?(e.defaultValue=n,t):z&&z.set(e,n,r)}}),Q||(z={set:function(e,n,r){var i=e.getAttributeNode(r);return i||e.setAttributeNode(i=e.ownerDocument.createAttribute(r)),i.value=n+="","value"===r||n===e.getAttribute(r)?n:t}},x.expr.attrHandle.id=x.expr.attrHandle.name=x.expr.attrHandle.coords=function(e,n,r){var i;return r?t:(i=e.getAttributeNode(n))&&""!==i.value?i.value:null},x.valHooks.button={get:function(e,n){var r=e.getAttributeNode(n);return r&&r.specified?r.value:t},set:z.set},x.attrHooks.contenteditable={set:function(e,t,n){z.set(e,""===t?!1:t,n)}},x.each(["width","height"],function(e,n){x.attrHooks[n]={set:function(e,r){return""===r?(e.setAttribute(n,"auto"),r):t}}})),x.support.hrefNormalized||x.each(["href","src"],function(e,t){x.propHooks[t]={get:function(e){return e.getAttribute(t,4)}}}),x.support.style||(x.attrHooks.style={get:function(e){return e.style.cssText||t},set:function(e,t){return e.style.cssText=t+""}}),x.support.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex),null}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){x.propFix[this.toLowerCase()]=this}),x.support.enctype||(x.propFix.enctype="encoding"),x.each(["radio","checkbox"],function(){x.valHooks[this]={set:function(e,n){return x.isArray(n)?e.checked=x.inArray(x(e).val(),n)>=0:t}},x.support.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})});var Z=/^(?:input|select|textarea)$/i,et=/^key/,tt=/^(?:mouse|contextmenu)|click/,nt=/^(?:focusinfocus|focusoutblur)$/,rt=/^([^.]*)(?:\.(.+)|)$/;function it(){return!0}function ot(){return!1}function at(){try{return a.activeElement}catch(e){}}x.event={global:{},add:function(e,n,r,o,a){var s,l,u,c,p,f,d,h,g,m,y,v=x._data(e);if(v){r.handler&&(c=r,r=c.handler,a=c.selector),r.guid||(r.guid=x.guid++),(l=v.events)||(l=v.events={}),(f=v.handle)||(f=v.handle=function(e){return typeof x===i||e&&x.event.triggered===e.type?t:x.event.dispatch.apply(f.elem,arguments)},f.elem=e),n=(n||"").match(T)||[""],u=n.length;while(u--)s=rt.exec(n[u])||[],g=y=s[1],m=(s[2]||"").split(".").sort(),g&&(p=x.event.special[g]||{},g=(a?p.delegateType:p.bindType)||g,p=x.event.special[g]||{},d=x.extend({type:g,origType:y,data:o,handler:r,guid:r.guid,selector:a,needsContext:a&&x.expr.match.needsContext.test(a),namespace:m.join(".")},c),(h=l[g])||(h=l[g]=[],h.delegateCount=0,p.setup&&p.setup.call(e,o,m,f)!==!1||(e.addEventListener?e.addEventListener(g,f,!1):e.attachEvent&&e.attachEvent("on"+g,f))),p.add&&(p.add.call(e,d),d.handler.guid||(d.handler.guid=r.guid)),a?h.splice(h.delegateCount++,0,d):h.push(d),x.event.global[g]=!0);e=null}},remove:function(e,t,n,r,i){var o,a,s,l,u,c,p,f,d,h,g,m=x.hasData(e)&&x._data(e);if(m&&(c=m.events)){t=(t||"").match(T)||[""],u=t.length;while(u--)if(s=rt.exec(t[u])||[],d=g=s[1],h=(s[2]||"").split(".").sort(),d){p=x.event.special[d]||{},d=(r?p.delegateType:p.bindType)||d,f=c[d]||[],s=s[2]&&RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),l=o=f.length;while(o--)a=f[o],!i&&g!==a.origType||n&&n.guid!==a.guid||s&&!s.test(a.namespace)||r&&r!==a.selector&&("**"!==r||!a.selector)||(f.splice(o,1),a.selector&&f.delegateCount--,p.remove&&p.remove.call(e,a));l&&!f.length&&(p.teardown&&p.teardown.call(e,h,m.handle)!==!1||x.removeEvent(e,d,m.handle),delete c[d])}else for(d in c)x.event.remove(e,d+t[u],n,r,!0);x.isEmptyObject(c)&&(delete m.handle,x._removeData(e,"events"))}},trigger:function(n,r,i,o){var s,l,u,c,p,f,d,h=[i||a],g=v.call(n,"type")?n.type:n,m=v.call(n,"namespace")?n.namespace.split("."):[];if(u=f=i=i||a,3!==i.nodeType&&8!==i.nodeType&&!nt.test(g+x.event.triggered)&&(g.indexOf(".")>=0&&(m=g.split("."),g=m.shift(),m.sort()),l=0>g.indexOf(":")&&"on"+g,n=n[x.expando]?n:new x.Event(g,"object"==typeof n&&n),n.isTrigger=o?2:3,n.namespace=m.join("."),n.namespace_re=n.namespace?RegExp("(^|\\.)"+m.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,n.result=t,n.target||(n.target=i),r=null==r?[n]:x.makeArray(r,[n]),p=x.event.special[g]||{},o||!p.trigger||p.trigger.apply(i,r)!==!1)){if(!o&&!p.noBubble&&!x.isWindow(i)){for(c=p.delegateType||g,nt.test(c+g)||(u=u.parentNode);u;u=u.parentNode)h.push(u),f=u;f===(i.ownerDocument||a)&&h.push(f.defaultView||f.parentWindow||e)}d=0;while((u=h[d++])&&!n.isPropagationStopped())n.type=d>1?c:p.bindType||g,s=(x._data(u,"events")||{})[n.type]&&x._data(u,"handle"),s&&s.apply(u,r),s=l&&u[l],s&&x.acceptData(u)&&s.apply&&s.apply(u,r)===!1&&n.preventDefault();if(n.type=g,!o&&!n.isDefaultPrevented()&&(!p._default||p._default.apply(h.pop(),r)===!1)&&x.acceptData(i)&&l&&i[g]&&!x.isWindow(i)){f=i[l],f&&(i[l]=null),x.event.triggered=g;try{i[g]()}catch(y){}x.event.triggered=t,f&&(i[l]=f)}return n.result}},dispatch:function(e){e=x.event.fix(e);var n,r,i,o,a,s=[],l=g.call(arguments),u=(x._data(this,"events")||{})[e.type]||[],c=x.event.special[e.type]||{};if(l[0]=e,e.delegateTarget=this,!c.preDispatch||c.preDispatch.call(this,e)!==!1){s=x.event.handlers.call(this,e,u),n=0;while((o=s[n++])&&!e.isPropagationStopped()){e.currentTarget=o.elem,a=0;while((i=o.handlers[a++])&&!e.isImmediatePropagationStopped())(!e.namespace_re||e.namespace_re.test(i.namespace))&&(e.handleObj=i,e.data=i.data,r=((x.event.special[i.origType]||{}).handle||i.handler).apply(o.elem,l),r!==t&&(e.result=r)===!1&&(e.preventDefault(),e.stopPropagation()))}return c.postDispatch&&c.postDispatch.call(this,e),e.result}},handlers:function(e,n){var r,i,o,a,s=[],l=n.delegateCount,u=e.target;if(l&&u.nodeType&&(!e.button||"click"!==e.type))for(;u!=this;u=u.parentNode||this)if(1===u.nodeType&&(u.disabled!==!0||"click"!==e.type)){for(o=[],a=0;l>a;a++)i=n[a],r=i.selector+" ",o[r]===t&&(o[r]=i.needsContext?x(r,this).index(u)>=0:x.find(r,this,null,[u]).length),o[r]&&o.push(i);o.length&&s.push({elem:u,handlers:o})}return n.length>l&&s.push({elem:this,handlers:n.slice(l)}),s},fix:function(e){if(e[x.expando])return e;var t,n,r,i=e.type,o=e,s=this.fixHooks[i];s||(this.fixHooks[i]=s=tt.test(i)?this.mouseHooks:et.test(i)?this.keyHooks:{}),r=s.props?this.props.concat(s.props):this.props,e=new x.Event(o),t=r.length;while(t--)n=r[t],e[n]=o[n];return e.target||(e.target=o.srcElement||a),3===e.target.nodeType&&(e.target=e.target.parentNode),e.metaKey=!!e.metaKey,s.filter?s.filter(e,o):e},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(e,t){return null==e.which&&(e.which=null!=t.charCode?t.charCode:t.keyCode),e}},mouseHooks:{props:"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(e,n){var r,i,o,s=n.button,l=n.fromElement;return null==e.pageX&&null!=n.clientX&&(i=e.target.ownerDocument||a,o=i.documentElement,r=i.body,e.pageX=n.clientX+(o&&o.scrollLeft||r&&r.scrollLeft||0)-(o&&o.clientLeft||r&&r.clientLeft||0),e.pageY=n.clientY+(o&&o.scrollTop||r&&r.scrollTop||0)-(o&&o.clientTop||r&&r.clientTop||0)),!e.relatedTarget&&l&&(e.relatedTarget=l===e.target?n.toElement:l),e.which||s===t||(e.which=1&s?1:2&s?3:4&s?2:0),e}},special:{load:{noBubble:!0},focus:{trigger:function(){if(this!==at()&&this.focus)try{return this.focus(),!1}catch(e){}},delegateType:"focusin"},blur:{trigger:function(){return this===at()&&this.blur?(this.blur(),!1):t},delegateType:"focusout"},click:{trigger:function(){return x.nodeName(this,"input")&&"checkbox"===this.type&&this.click?(this.click(),!1):t},_default:function(e){return x.nodeName(e.target,"a")}},beforeunload:{postDispatch:function(e){e.result!==t&&(e.originalEvent.returnValue=e.result)}}},simulate:function(e,t,n,r){var i=x.extend(new x.Event,n,{type:e,isSimulated:!0,originalEvent:{}});r?x.event.trigger(i,null,t):x.event.dispatch.call(t,i),i.isDefaultPrevented()&&n.preventDefault()}},x.removeEvent=a.removeEventListener?function(e,t,n){e.removeEventListener&&e.removeEventListener(t,n,!1)}:function(e,t,n){var r="on"+t;e.detachEvent&&(typeof e[r]===i&&(e[r]=null),e.detachEvent(r,n))},x.Event=function(e,n){return this instanceof x.Event?(e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||e.returnValue===!1||e.getPreventDefault&&e.getPreventDefault()?it:ot):this.type=e,n&&x.extend(this,n),this.timeStamp=e&&e.timeStamp||x.now(),this[x.expando]=!0,t):new x.Event(e,n)},x.Event.prototype={isDefaultPrevented:ot,isPropagationStopped:ot,isImmediatePropagationStopped:ot,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=it,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=it,e&&(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0)},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=it,this.stopPropagation()}},x.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(e,t){x.event.special[e]={delegateType:t,bindType:t,handle:function(e){var n,r=this,i=e.relatedTarget,o=e.handleObj;return(!i||i!==r&&!x.contains(r,i))&&(e.type=o.origType,n=o.handler.apply(this,arguments),e.type=t),n}}}),x.support.submitBubbles||(x.event.special.submit={setup:function(){return x.nodeName(this,"form")?!1:(x.event.add(this,"click._submit keypress._submit",function(e){var n=e.target,r=x.nodeName(n,"input")||x.nodeName(n,"button")?n.form:t;r&&!x._data(r,"submitBubbles")&&(x.event.add(r,"submit._submit",function(e){e._submit_bubble=!0}),x._data(r,"submitBubbles",!0))}),t)},postDispatch:function(e){e._submit_bubble&&(delete e._submit_bubble,this.parentNode&&!e.isTrigger&&x.event.simulate("submit",this.parentNode,e,!0))},teardown:function(){return x.nodeName(this,"form")?!1:(x.event.remove(this,"._submit"),t)}}),x.support.changeBubbles||(x.event.special.change={setup:function(){return Z.test(this.nodeName)?(("checkbox"===this.type||"radio"===this.type)&&(x.event.add(this,"propertychange._change",function(e){"checked"===e.originalEvent.propertyName&&(this._just_changed=!0)}),x.event.add(this,"click._change",function(e){this._just_changed&&!e.isTrigger&&(this._just_changed=!1),x.event.simulate("change",this,e,!0)})),!1):(x.event.add(this,"beforeactivate._change",function(e){var t=e.target;Z.test(t.nodeName)&&!x._data(t,"changeBubbles")&&(x.event.add(t,"change._change",function(e){!this.parentNode||e.isSimulated||e.isTrigger||x.event.simulate("change",this.parentNode,e,!0)}),x._data(t,"changeBubbles",!0))}),t)},handle:function(e){var n=e.target;return this!==n||e.isSimulated||e.isTrigger||"radio"!==n.type&&"checkbox"!==n.type?e.handleObj.handler.apply(this,arguments):t},teardown:function(){return x.event.remove(this,"._change"),!Z.test(this.nodeName)}}),x.support.focusinBubbles||x.each({focus:"focusin",blur:"focusout"},function(e,t){var n=0,r=function(e){x.event.simulate(t,e.target,x.event.fix(e),!0)};x.event.special[t]={setup:function(){0===n++&&a.addEventListener(e,r,!0)},teardown:function(){0===--n&&a.removeEventListener(e,r,!0)}}}),x.fn.extend({on:function(e,n,r,i,o){var a,s;if("object"==typeof e){"string"!=typeof n&&(r=r||n,n=t);for(a in e)this.on(a,n,r,e[a],o);return this}if(null==r&&null==i?(i=n,r=n=t):null==i&&("string"==typeof n?(i=r,r=t):(i=r,r=n,n=t)),i===!1)i=ot;else if(!i)return this;return 1===o&&(s=i,i=function(e){return x().off(e),s.apply(this,arguments)},i.guid=s.guid||(s.guid=x.guid++)),this.each(function(){x.event.add(this,e,i,r,n)})},one:function(e,t,n,r){return this.on(e,t,n,r,1)},off:function(e,n,r){var i,o;if(e&&e.preventDefault&&e.handleObj)return i=e.handleObj,x(e.delegateTarget).off(i.namespace?i.origType+"."+i.namespace:i.origType,i.selector,i.handler),this;if("object"==typeof e){for(o in e)this.off(o,n,e[o]);return this}return(n===!1||"function"==typeof n)&&(r=n,n=t),r===!1&&(r=ot),this.each(function(){x.event.remove(this,e,r,n)})},trigger:function(e,t){return this.each(function(){x.event.trigger(e,t,this)})},triggerHandler:function(e,n){var r=this[0];return r?x.event.trigger(e,n,r,!0):t}});var st=/^.[^:#\[\.,]*$/,lt=/^(?:parents|prev(?:Until|All))/,ut=x.expr.match.needsContext,ct={children:!0,contents:!0,next:!0,prev:!0};x.fn.extend({find:function(e){var t,n=[],r=this,i=r.length;if("string"!=typeof e)return this.pushStack(x(e).filter(function(){for(t=0;i>t;t++)if(x.contains(r[t],this))return!0}));for(t=0;i>t;t++)x.find(e,r[t],n);return n=this.pushStack(i>1?x.unique(n):n),n.selector=this.selector?this.selector+" "+e:e,n},has:function(e){var t,n=x(e,this),r=n.length;return this.filter(function(){for(t=0;r>t;t++)if(x.contains(this,n[t]))return!0})},not:function(e){return this.pushStack(ft(this,e||[],!0))},filter:function(e){return this.pushStack(ft(this,e||[],!1))},is:function(e){return!!ft(this,"string"==typeof e&&ut.test(e)?x(e):e||[],!1).length},closest:function(e,t){var n,r=0,i=this.length,o=[],a=ut.test(e)||"string"!=typeof e?x(e,t||this.context):0;for(;i>r;r++)for(n=this[r];n&&n!==t;n=n.parentNode)if(11>n.nodeType&&(a?a.index(n)>-1:1===n.nodeType&&x.find.matchesSelector(n,e))){n=o.push(n);break}return this.pushStack(o.length>1?x.unique(o):o)},index:function(e){return e?"string"==typeof e?x.inArray(this[0],x(e)):x.inArray(e.jquery?e[0]:e,this):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){var n="string"==typeof e?x(e,t):x.makeArray(e&&e.nodeType?[e]:e),r=x.merge(this.get(),n);return this.pushStack(x.unique(r))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}});function pt(e,t){do e=e[t];while(e&&1!==e.nodeType);return e}x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return x.dir(e,"parentNode")},parentsUntil:function(e,t,n){return x.dir(e,"parentNode",n)},next:function(e){return pt(e,"nextSibling")},prev:function(e){return pt(e,"previousSibling")},nextAll:function(e){return x.dir(e,"nextSibling")},prevAll:function(e){return x.dir(e,"previousSibling")},nextUntil:function(e,t,n){return x.dir(e,"nextSibling",n)},prevUntil:function(e,t,n){return x.dir(e,"previousSibling",n)},siblings:function(e){return x.sibling((e.parentNode||{}).firstChild,e)},children:function(e){return x.sibling(e.firstChild)},contents:function(e){return x.nodeName(e,"iframe")?e.contentDocument||e.contentWindow.document:x.merge([],e.childNodes)}},function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(ct[e]||(i=x.unique(i)),lt.test(e)&&(i=i.reverse())),this.pushStack(i)}}),x.extend({filter:function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,function(e){return 1===e.nodeType}))},dir:function(e,n,r){var i=[],o=e[n];while(o&&9!==o.nodeType&&(r===t||1!==o.nodeType||!x(o).is(r)))1===o.nodeType&&i.push(o),o=o[n];return i},sibling:function(e,t){var n=[];for(;e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n}});function ft(e,t,n){if(x.isFunction(t))return x.grep(e,function(e,r){return!!t.call(e,r,e)!==n});if(t.nodeType)return x.grep(e,function(e){return e===t!==n});if("string"==typeof t){if(st.test(t))return x.filter(t,e,n);t=x.filter(t,e)}return x.grep(e,function(e){return x.inArray(e,t)>=0!==n})}function dt(e){var t=ht.split("|"),n=e.createDocumentFragment();if(n.createElement)while(t.length)n.createElement(t.pop());return n}var ht="abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",gt=/ jQuery\d+="(?:null|\d+)"/g,mt=RegExp("<(?:"+ht+")[\\s/>]","i"),yt=/^\s+/,vt=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bt=/<([\w:]+)/,xt=/<tbody/i,wt=/<|&#?\w+;/,Tt=/<(?:script|style|link)/i,Ct=/^(?:checkbox|radio)$/i,Nt=/checked\s*(?:[^=]|=\s*.checked.)/i,kt=/^$|\/(?:java|ecma)script/i,Et=/^true\/(.*)/,St=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,At={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],area:[1,"<map>","</map>"],param:[1,"<object>","</object>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:x.support.htmlSerialize?[0,"",""]:[1,"X<div>","</div>"]},jt=dt(a),Dt=jt.appendChild(a.createElement("div"));At.optgroup=At.option,At.tbody=At.tfoot=At.colgroup=At.caption=At.thead,At.th=At.td,x.fn.extend({text:function(e){return x.access(this,function(e){return e===t?x.text(this):this.empty().append((this[0]&&this[0].ownerDocument||a).createTextNode(e))},null,e,arguments.length)},append:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.appendChild(e)}})},prepend:function(){return this.domManip(arguments,function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Lt(this,e);t.insertBefore(e,t.firstChild)}})},before:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this)})},after:function(){return this.domManip(arguments,function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)})},remove:function(e,t){var n,r=e?x.filter(e,this):this,i=0;for(;null!=(n=r[i]);i++)t||1!==n.nodeType||x.cleanData(Ft(n)),n.parentNode&&(t&&x.contains(n.ownerDocument,n)&&_t(Ft(n,"script")),n.parentNode.removeChild(n));return this},empty:function(){var e,t=0;for(;null!=(e=this[t]);t++){1===e.nodeType&&x.cleanData(Ft(e,!1));while(e.firstChild)e.removeChild(e.firstChild);e.options&&x.nodeName(e,"select")&&(e.options.length=0)}return this},clone:function(e,t){return e=null==e?!1:e,t=null==t?e:t,this.map(function(){return x.clone(this,e,t)})},html:function(e){return x.access(this,function(e){var n=this[0]||{},r=0,i=this.length;if(e===t)return 1===n.nodeType?n.innerHTML.replace(gt,""):t;if(!("string"!=typeof e||Tt.test(e)||!x.support.htmlSerialize&&mt.test(e)||!x.support.leadingWhitespace&&yt.test(e)||At[(bt.exec(e)||["",""])[1].toLowerCase()])){e=e.replace(vt,"<$1></$2>");try{for(;i>r;r++)n=this[r]||{},1===n.nodeType&&(x.cleanData(Ft(n,!1)),n.innerHTML=e);n=0}catch(o){}}n&&this.empty().append(e)},null,e,arguments.length)},replaceWith:function(){var e=x.map(this,function(e){return[e.nextSibling,e.parentNode]}),t=0;return this.domManip(arguments,function(n){var r=e[t++],i=e[t++];i&&(r&&r.parentNode!==i&&(r=this.nextSibling),x(this).remove(),i.insertBefore(n,r))},!0),t?this:this.remove()},detach:function(e){return this.remove(e,!0)},domManip:function(e,t,n){e=d.apply([],e);var r,i,o,a,s,l,u=0,c=this.length,p=this,f=c-1,h=e[0],g=x.isFunction(h);if(g||!(1>=c||"string"!=typeof h||x.support.checkClone)&&Nt.test(h))return this.each(function(r){var i=p.eq(r);g&&(e[0]=h.call(this,r,i.html())),i.domManip(e,t,n)});if(c&&(l=x.buildFragment(e,this[0].ownerDocument,!1,!n&&this),r=l.firstChild,1===l.childNodes.length&&(l=r),r)){for(a=x.map(Ft(l,"script"),Ht),o=a.length;c>u;u++)i=l,u!==f&&(i=x.clone(i,!0,!0),o&&x.merge(a,Ft(i,"script"))),t.call(this[u],i,u);if(o)for(s=a[a.length-1].ownerDocument,x.map(a,qt),u=0;o>u;u++)i=a[u],kt.test(i.type||"")&&!x._data(i,"globalEval")&&x.contains(s,i)&&(i.src?x._evalUrl(i.src):x.globalEval((i.text||i.textContent||i.innerHTML||"").replace(St,"")));l=r=null}return this}});function Lt(e,t){return x.nodeName(e,"table")&&x.nodeName(1===t.nodeType?t:t.firstChild,"tr")?e.getElementsByTagName("tbody")[0]||e.appendChild(e.ownerDocument.createElement("tbody")):e}function Ht(e){return e.type=(null!==x.find.attr(e,"type"))+"/"+e.type,e}function qt(e){var t=Et.exec(e.type);return t?e.type=t[1]:e.removeAttribute("type"),e}function _t(e,t){var n,r=0;for(;null!=(n=e[r]);r++)x._data(n,"globalEval",!t||x._data(t[r],"globalEval"))}function Mt(e,t){if(1===t.nodeType&&x.hasData(e)){var n,r,i,o=x._data(e),a=x._data(t,o),s=o.events;if(s){delete a.handle,a.events={};for(n in s)for(r=0,i=s[n].length;i>r;r++)x.event.add(t,n,s[n][r])}a.data&&(a.data=x.extend({},a.data))}}function Ot(e,t){var n,r,i;if(1===t.nodeType){if(n=t.nodeName.toLowerCase(),!x.support.noCloneEvent&&t[x.expando]){i=x._data(t);for(r in i.events)x.removeEvent(t,r,i.handle);t.removeAttribute(x.expando)}"script"===n&&t.text!==e.text?(Ht(t).text=e.text,qt(t)):"object"===n?(t.parentNode&&(t.outerHTML=e.outerHTML),x.support.html5Clone&&e.innerHTML&&!x.trim(t.innerHTML)&&(t.innerHTML=e.innerHTML)):"input"===n&&Ct.test(e.type)?(t.defaultChecked=t.checked=e.checked,t.value!==e.value&&(t.value=e.value)):"option"===n?t.defaultSelected=t.selected=e.defaultSelected:("input"===n||"textarea"===n)&&(t.defaultValue=e.defaultValue)}}x.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(e,t){x.fn[e]=function(e){var n,r=0,i=[],o=x(e),a=o.length-1;for(;a>=r;r++)n=r===a?this:this.clone(!0),x(o[r])[t](n),h.apply(i,n.get());return this.pushStack(i)}});function Ft(e,n){var r,o,a=0,s=typeof e.getElementsByTagName!==i?e.getElementsByTagName(n||"*"):typeof e.querySelectorAll!==i?e.querySelectorAll(n||"*"):t;if(!s)for(s=[],r=e.childNodes||e;null!=(o=r[a]);a++)!n||x.nodeName(o,n)?s.push(o):x.merge(s,Ft(o,n));return n===t||n&&x.nodeName(e,n)?x.merge([e],s):s}function Bt(e){Ct.test(e.type)&&(e.defaultChecked=e.checked)}x.extend({clone:function(e,t,n){var r,i,o,a,s,l=x.contains(e.ownerDocument,e);if(x.support.html5Clone||x.isXMLDoc(e)||!mt.test("<"+e.nodeName+">")?o=e.cloneNode(!0):(Dt.innerHTML=e.outerHTML,Dt.removeChild(o=Dt.firstChild)),!(x.support.noCloneEvent&&x.support.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||x.isXMLDoc(e)))for(r=Ft(o),s=Ft(e),a=0;null!=(i=s[a]);++a)r[a]&&Ot(i,r[a]);if(t)if(n)for(s=s||Ft(e),r=r||Ft(o),a=0;null!=(i=s[a]);a++)Mt(i,r[a]);else Mt(e,o);return r=Ft(o,"script"),r.length>0&&_t(r,!l&&Ft(e,"script")),r=s=i=null,o},buildFragment:function(e,t,n,r){var i,o,a,s,l,u,c,p=e.length,f=dt(t),d=[],h=0;for(;p>h;h++)if(o=e[h],o||0===o)if("object"===x.type(o))x.merge(d,o.nodeType?[o]:o);else if(wt.test(o)){s=s||f.appendChild(t.createElement("div")),l=(bt.exec(o)||["",""])[1].toLowerCase(),c=At[l]||At._default,s.innerHTML=c[1]+o.replace(vt,"<$1></$2>")+c[2],i=c[0];while(i--)s=s.lastChild;if(!x.support.leadingWhitespace&&yt.test(o)&&d.push(t.createTextNode(yt.exec(o)[0])),!x.support.tbody){o="table"!==l||xt.test(o)?"<table>"!==c[1]||xt.test(o)?0:s:s.firstChild,i=o&&o.childNodes.length;while(i--)x.nodeName(u=o.childNodes[i],"tbody")&&!u.childNodes.length&&o.removeChild(u)}x.merge(d,s.childNodes),s.textContent="";while(s.firstChild)s.removeChild(s.firstChild);s=f.lastChild}else d.push(t.createTextNode(o));s&&f.removeChild(s),x.support.appendChecked||x.grep(Ft(d,"input"),Bt),h=0;while(o=d[h++])if((!r||-1===x.inArray(o,r))&&(a=x.contains(o.ownerDocument,o),s=Ft(f.appendChild(o),"script"),a&&_t(s),n)){i=0;while(o=s[i++])kt.test(o.type||"")&&n.push(o)}return s=null,f},cleanData:function(e,t){var n,r,o,a,s=0,l=x.expando,u=x.cache,c=x.support.deleteExpando,f=x.event.special;for(;null!=(n=e[s]);s++)if((t||x.acceptData(n))&&(o=n[l],a=o&&u[o])){if(a.events)for(r in a.events)f[r]?x.event.remove(n,r):x.removeEvent(n,r,a.handle);
+u[o]&&(delete u[o],c?delete n[l]:typeof n.removeAttribute!==i?n.removeAttribute(l):n[l]=null,p.push(o))}},_evalUrl:function(e){return x.ajax({url:e,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})}}),x.fn.extend({wrapAll:function(e){if(x.isFunction(e))return this.each(function(t){x(this).wrapAll(e.call(this,t))});if(this[0]){var t=x(e,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&t.insertBefore(this[0]),t.map(function(){var e=this;while(e.firstChild&&1===e.firstChild.nodeType)e=e.firstChild;return e}).append(this)}return this},wrapInner:function(e){return x.isFunction(e)?this.each(function(t){x(this).wrapInner(e.call(this,t))}):this.each(function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)})},wrap:function(e){var t=x.isFunction(e);return this.each(function(n){x(this).wrapAll(t?e.call(this,n):e)})},unwrap:function(){return this.parent().each(function(){x.nodeName(this,"body")||x(this).replaceWith(this.childNodes)}).end()}});var Pt,Rt,Wt,$t=/alpha\([^)]*\)/i,It=/opacity\s*=\s*([^)]*)/,zt=/^(top|right|bottom|left)$/,Xt=/^(none|table(?!-c[ea]).+)/,Ut=/^margin/,Vt=RegExp("^("+w+")(.*)$","i"),Yt=RegExp("^("+w+")(?!px)[a-z%]+$","i"),Jt=RegExp("^([+-])=("+w+")","i"),Gt={BODY:"block"},Qt={position:"absolute",visibility:"hidden",display:"block"},Kt={letterSpacing:0,fontWeight:400},Zt=["Top","Right","Bottom","Left"],en=["Webkit","O","Moz","ms"];function tn(e,t){if(t in e)return t;var n=t.charAt(0).toUpperCase()+t.slice(1),r=t,i=en.length;while(i--)if(t=en[i]+n,t in e)return t;return r}function nn(e,t){return e=t||e,"none"===x.css(e,"display")||!x.contains(e.ownerDocument,e)}function rn(e,t){var n,r,i,o=[],a=0,s=e.length;for(;s>a;a++)r=e[a],r.style&&(o[a]=x._data(r,"olddisplay"),n=r.style.display,t?(o[a]||"none"!==n||(r.style.display=""),""===r.style.display&&nn(r)&&(o[a]=x._data(r,"olddisplay",ln(r.nodeName)))):o[a]||(i=nn(r),(n&&"none"!==n||!i)&&x._data(r,"olddisplay",i?n:x.css(r,"display"))));for(a=0;s>a;a++)r=e[a],r.style&&(t&&"none"!==r.style.display&&""!==r.style.display||(r.style.display=t?o[a]||"":"none"));return e}x.fn.extend({css:function(e,n){return x.access(this,function(e,n,r){var i,o,a={},s=0;if(x.isArray(n)){for(o=Rt(e),i=n.length;i>s;s++)a[n[s]]=x.css(e,n[s],!1,o);return a}return r!==t?x.style(e,n,r):x.css(e,n)},e,n,arguments.length>1)},show:function(){return rn(this,!0)},hide:function(){return rn(this)},toggle:function(e){return"boolean"==typeof e?e?this.show():this.hide():this.each(function(){nn(this)?x(this).show():x(this).hide()})}}),x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Wt(e,"opacity");return""===n?"1":n}}}},cssNumber:{columnCount:!0,fillOpacity:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":x.support.cssFloat?"cssFloat":"styleFloat"},style:function(e,n,r,i){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var o,a,s,l=x.camelCase(n),u=e.style;if(n=x.cssProps[l]||(x.cssProps[l]=tn(u,l)),s=x.cssHooks[n]||x.cssHooks[l],r===t)return s&&"get"in s&&(o=s.get(e,!1,i))!==t?o:u[n];if(a=typeof r,"string"===a&&(o=Jt.exec(r))&&(r=(o[1]+1)*o[2]+parseFloat(x.css(e,n)),a="number"),!(null==r||"number"===a&&isNaN(r)||("number"!==a||x.cssNumber[l]||(r+="px"),x.support.clearCloneStyle||""!==r||0!==n.indexOf("background")||(u[n]="inherit"),s&&"set"in s&&(r=s.set(e,r,i))===t)))try{u[n]=r}catch(c){}}},css:function(e,n,r,i){var o,a,s,l=x.camelCase(n);return n=x.cssProps[l]||(x.cssProps[l]=tn(e.style,l)),s=x.cssHooks[n]||x.cssHooks[l],s&&"get"in s&&(a=s.get(e,!0,r)),a===t&&(a=Wt(e,n,i)),"normal"===a&&n in Kt&&(a=Kt[n]),""===r||r?(o=parseFloat(a),r===!0||x.isNumeric(o)?o||0:a):a}}),e.getComputedStyle?(Rt=function(t){return e.getComputedStyle(t,null)},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s.getPropertyValue(n)||s[n]:t,u=e.style;return s&&(""!==l||x.contains(e.ownerDocument,e)||(l=x.style(e,n)),Yt.test(l)&&Ut.test(n)&&(i=u.width,o=u.minWidth,a=u.maxWidth,u.minWidth=u.maxWidth=u.width=l,l=s.width,u.width=i,u.minWidth=o,u.maxWidth=a)),l}):a.documentElement.currentStyle&&(Rt=function(e){return e.currentStyle},Wt=function(e,n,r){var i,o,a,s=r||Rt(e),l=s?s[n]:t,u=e.style;return null==l&&u&&u[n]&&(l=u[n]),Yt.test(l)&&!zt.test(n)&&(i=u.left,o=e.runtimeStyle,a=o&&o.left,a&&(o.left=e.currentStyle.left),u.left="fontSize"===n?"1em":l,l=u.pixelLeft+"px",u.left=i,a&&(o.left=a)),""===l?"auto":l});function on(e,t,n){var r=Vt.exec(t);return r?Math.max(0,r[1]-(n||0))+(r[2]||"px"):t}function an(e,t,n,r,i){var o=n===(r?"border":"content")?4:"width"===t?1:0,a=0;for(;4>o;o+=2)"margin"===n&&(a+=x.css(e,n+Zt[o],!0,i)),r?("content"===n&&(a-=x.css(e,"padding"+Zt[o],!0,i)),"margin"!==n&&(a-=x.css(e,"border"+Zt[o]+"Width",!0,i))):(a+=x.css(e,"padding"+Zt[o],!0,i),"padding"!==n&&(a+=x.css(e,"border"+Zt[o]+"Width",!0,i)));return a}function sn(e,t,n){var r=!0,i="width"===t?e.offsetWidth:e.offsetHeight,o=Rt(e),a=x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,o);if(0>=i||null==i){if(i=Wt(e,t,o),(0>i||null==i)&&(i=e.style[t]),Yt.test(i))return i;r=a&&(x.support.boxSizingReliable||i===e.style[t]),i=parseFloat(i)||0}return i+an(e,t,n||(a?"border":"content"),r,o)+"px"}function ln(e){var t=a,n=Gt[e];return n||(n=un(e,t),"none"!==n&&n||(Pt=(Pt||x("<iframe frameborder='0' width='0' height='0'/>").css("cssText","display:block !important")).appendTo(t.documentElement),t=(Pt[0].contentWindow||Pt[0].contentDocument).document,t.write("<!doctype html><html><body>"),t.close(),n=un(e,t),Pt.detach()),Gt[e]=n),n}function un(e,t){var n=x(t.createElement(e)).appendTo(t.body),r=x.css(n[0],"display");return n.remove(),r}x.each(["height","width"],function(e,n){x.cssHooks[n]={get:function(e,r,i){return r?0===e.offsetWidth&&Xt.test(x.css(e,"display"))?x.swap(e,Qt,function(){return sn(e,n,i)}):sn(e,n,i):t},set:function(e,t,r){var i=r&&Rt(e);return on(e,t,r?an(e,n,r,x.support.boxSizing&&"border-box"===x.css(e,"boxSizing",!1,i),i):0)}}}),x.support.opacity||(x.cssHooks.opacity={get:function(e,t){return It.test((t&&e.currentStyle?e.currentStyle.filter:e.style.filter)||"")?.01*parseFloat(RegExp.$1)+"":t?"1":""},set:function(e,t){var n=e.style,r=e.currentStyle,i=x.isNumeric(t)?"alpha(opacity="+100*t+")":"",o=r&&r.filter||n.filter||"";n.zoom=1,(t>=1||""===t)&&""===x.trim(o.replace($t,""))&&n.removeAttribute&&(n.removeAttribute("filter"),""===t||r&&!r.filter)||(n.filter=$t.test(o)?o.replace($t,i):o+" "+i)}}),x(function(){x.support.reliableMarginRight||(x.cssHooks.marginRight={get:function(e,n){return n?x.swap(e,{display:"inline-block"},Wt,[e,"marginRight"]):t}}),!x.support.pixelPosition&&x.fn.position&&x.each(["top","left"],function(e,n){x.cssHooks[n]={get:function(e,r){return r?(r=Wt(e,n),Yt.test(r)?x(e).position()[n]+"px":r):t}}})}),x.expr&&x.expr.filters&&(x.expr.filters.hidden=function(e){return 0>=e.offsetWidth&&0>=e.offsetHeight||!x.support.reliableHiddenOffsets&&"none"===(e.style&&e.style.display||x.css(e,"display"))},x.expr.filters.visible=function(e){return!x.expr.filters.hidden(e)}),x.each({margin:"",padding:"",border:"Width"},function(e,t){x.cssHooks[e+t]={expand:function(n){var r=0,i={},o="string"==typeof n?n.split(" "):[n];for(;4>r;r++)i[e+Zt[r]+t]=o[r]||o[r-2]||o[0];return i}},Ut.test(e)||(x.cssHooks[e+t].set=on)});var cn=/%20/g,pn=/\[\]$/,fn=/\r?\n/g,dn=/^(?:submit|button|image|reset|file)$/i,hn=/^(?:input|select|textarea|keygen)/i;x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this}).filter(function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&hn.test(this.nodeName)&&!dn.test(e)&&(this.checked||!Ct.test(e))}).map(function(e,t){var n=x(this).val();return null==n?null:x.isArray(n)?x.map(n,function(e){return{name:t.name,value:e.replace(fn,"\r\n")}}):{name:t.name,value:n.replace(fn,"\r\n")}}).get()}}),x.param=function(e,n){var r,i=[],o=function(e,t){t=x.isFunction(t)?t():null==t?"":t,i[i.length]=encodeURIComponent(e)+"="+encodeURIComponent(t)};if(n===t&&(n=x.ajaxSettings&&x.ajaxSettings.traditional),x.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,function(){o(this.name,this.value)});else for(r in e)gn(r,e[r],n,o);return i.join("&").replace(cn,"+")};function gn(e,t,n,r){var i;if(x.isArray(t))x.each(t,function(t,i){n||pn.test(e)?r(e,i):gn(e+"["+("object"==typeof i?t:"")+"]",i,n,r)});else if(n||"object"!==x.type(t))r(e,t);else for(i in t)gn(e+"["+i+"]",t[i],n,r)}x.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(e,t){x.fn[t]=function(e,n){return arguments.length>0?this.on(t,null,e,n):this.trigger(t)}}),x.fn.extend({hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)},bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)}});var mn,yn,vn=x.now(),bn=/\?/,xn=/#.*$/,wn=/([?&])_=[^&]*/,Tn=/^(.*?):[ \t]*([^\r\n]*)\r?$/gm,Cn=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Nn=/^(?:GET|HEAD)$/,kn=/^\/\//,En=/^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,Sn=x.fn.load,An={},jn={},Dn="*/".concat("*");try{yn=o.href}catch(Ln){yn=a.createElement("a"),yn.href="",yn=yn.href}mn=En.exec(yn.toLowerCase())||[];function Hn(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(T)||[];if(x.isFunction(n))while(r=o[i++])"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function qn(e,n,r,i){var o={},a=e===jn;function s(l){var u;return o[l]=!0,x.each(e[l]||[],function(e,l){var c=l(n,r,i);return"string"!=typeof c||a||o[c]?a?!(u=c):t:(n.dataTypes.unshift(c),s(c),!1)}),u}return s(n.dataTypes[0])||!o["*"]&&s("*")}function _n(e,n){var r,i,o=x.ajaxSettings.flatOptions||{};for(i in n)n[i]!==t&&((o[i]?e:r||(r={}))[i]=n[i]);return r&&x.extend(!0,e,r),e}x.fn.load=function(e,n,r){if("string"!=typeof e&&Sn)return Sn.apply(this,arguments);var i,o,a,s=this,l=e.indexOf(" ");return l>=0&&(i=e.slice(l,e.length),e=e.slice(0,l)),x.isFunction(n)?(r=n,n=t):n&&"object"==typeof n&&(a="POST"),s.length>0&&x.ajax({url:e,type:a,dataType:"html",data:n}).done(function(e){o=arguments,s.html(i?x("<div>").append(x.parseHTML(e)).find(i):e)}).complete(r&&function(e,t){s.each(r,o||[e.responseText,t,e])}),this},x.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){x.fn[t]=function(e){return this.on(t,e)}}),x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:yn,type:"GET",isLocal:Cn.test(mn[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Dn,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":x.parseJSON,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?_n(_n(e,x.ajaxSettings),t):_n(x.ajaxSettings,e)},ajaxPrefilter:Hn(An),ajaxTransport:Hn(jn),ajax:function(e,n){"object"==typeof e&&(n=e,e=t),n=n||{};var r,i,o,a,s,l,u,c,p=x.ajaxSetup({},n),f=p.context||p,d=p.context&&(f.nodeType||f.jquery)?x(f):x.event,h=x.Deferred(),g=x.Callbacks("once memory"),m=p.statusCode||{},y={},v={},b=0,w="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(2===b){if(!c){c={};while(t=Tn.exec(a))c[t[1].toLowerCase()]=t[2]}t=c[e.toLowerCase()]}return null==t?null:t},getAllResponseHeaders:function(){return 2===b?a:null},setRequestHeader:function(e,t){var n=e.toLowerCase();return b||(e=v[n]=v[n]||e,y[e]=t),this},overrideMimeType:function(e){return b||(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(2>b)for(t in e)m[t]=[m[t],e[t]];else C.always(e[C.status]);return this},abort:function(e){var t=e||w;return u&&u.abort(t),k(0,t),this}};if(h.promise(C).complete=g.add,C.success=C.done,C.error=C.fail,p.url=((e||p.url||yn)+"").replace(xn,"").replace(kn,mn[1]+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=x.trim(p.dataType||"*").toLowerCase().match(T)||[""],null==p.crossDomain&&(r=En.exec(p.url.toLowerCase()),p.crossDomain=!(!r||r[1]===mn[1]&&r[2]===mn[2]&&(r[3]||("http:"===r[1]?"80":"443"))===(mn[3]||("http:"===mn[1]?"80":"443")))),p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),qn(An,p,n,C),2===b)return C;l=p.global,l&&0===x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Nn.test(p.type),o=p.url,p.hasContent||(p.data&&(o=p.url+=(bn.test(o)?"&":"?")+p.data,delete p.data),p.cache===!1&&(p.url=wn.test(o)?o.replace(wn,"$1_="+vn++):o+(bn.test(o)?"&":"?")+"_="+vn++)),p.ifModified&&(x.lastModified[o]&&C.setRequestHeader("If-Modified-Since",x.lastModified[o]),x.etag[o]&&C.setRequestHeader("If-None-Match",x.etag[o])),(p.data&&p.hasContent&&p.contentType!==!1||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+Dn+"; q=0.01":""):p.accepts["*"]);for(i in p.headers)C.setRequestHeader(i,p.headers[i]);if(p.beforeSend&&(p.beforeSend.call(f,C,p)===!1||2===b))return C.abort();w="abort";for(i in{success:1,error:1,complete:1})C[i](p[i]);if(u=qn(jn,p,n,C)){C.readyState=1,l&&d.trigger("ajaxSend",[C,p]),p.async&&p.timeout>0&&(s=setTimeout(function(){C.abort("timeout")},p.timeout));try{b=1,u.send(y,k)}catch(N){if(!(2>b))throw N;k(-1,N)}}else k(-1,"No Transport");function k(e,n,r,i){var c,y,v,w,T,N=n;2!==b&&(b=2,s&&clearTimeout(s),u=t,a=i||"",C.readyState=e>0?4:0,c=e>=200&&300>e||304===e,r&&(w=Mn(p,C,r)),w=On(p,w,C,c),c?(p.ifModified&&(T=C.getResponseHeader("Last-Modified"),T&&(x.lastModified[o]=T),T=C.getResponseHeader("etag"),T&&(x.etag[o]=T)),204===e||"HEAD"===p.type?N="nocontent":304===e?N="notmodified":(N=w.state,y=w.data,v=w.error,c=!v)):(v=N,(e||!N)&&(N="error",0>e&&(e=0))),C.status=e,C.statusText=(n||N)+"",c?h.resolveWith(f,[y,N,C]):h.rejectWith(f,[C,N,v]),C.statusCode(m),m=t,l&&d.trigger(c?"ajaxSuccess":"ajaxError",[C,p,c?y:v]),g.fireWith(f,[C,N]),l&&(d.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,n){return x.get(e,t,n,"script")}}),x.each(["get","post"],function(e,n){x[n]=function(e,r,i,o){return x.isFunction(r)&&(o=o||i,i=r,r=t),x.ajax({url:e,type:n,dataType:o,data:r,success:i})}});function Mn(e,n,r){var i,o,a,s,l=e.contents,u=e.dataTypes;while("*"===u[0])u.shift(),o===t&&(o=e.mimeType||n.getResponseHeader("Content-Type"));if(o)for(s in l)if(l[s]&&l[s].test(o)){u.unshift(s);break}if(u[0]in r)a=u[0];else{for(s in r){if(!u[0]||e.converters[s+" "+u[0]]){a=s;break}i||(i=s)}a=a||i}return a?(a!==u[0]&&u.unshift(a),r[a]):t}function On(e,t,n,r){var i,o,a,s,l,u={},c=e.dataTypes.slice();if(c[1])for(a in e.converters)u[a.toLowerCase()]=e.converters[a];o=c.shift();while(o)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=c.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(a=u[l+" "+o]||u["* "+o],!a)for(i in u)if(s=i.split(" "),s[1]===o&&(a=u[l+" "+s[0]]||u["* "+s[0]])){a===!0?a=u[i]:u[i]!==!0&&(o=s[0],c.unshift(s[1]));break}if(a!==!0)if(a&&e["throws"])t=a(t);else try{t=a(t)}catch(p){return{state:"parsererror",error:a?p:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",function(e){e.cache===t&&(e.cache=!1),e.crossDomain&&(e.type="GET",e.global=!1)}),x.ajaxTransport("script",function(e){if(e.crossDomain){var n,r=a.head||x("head")[0]||a.documentElement;return{send:function(t,i){n=a.createElement("script"),n.async=!0,e.scriptCharset&&(n.charset=e.scriptCharset),n.src=e.url,n.onload=n.onreadystatechange=function(e,t){(t||!n.readyState||/loaded|complete/.test(n.readyState))&&(n.onload=n.onreadystatechange=null,n.parentNode&&n.parentNode.removeChild(n),n=null,t||i(200,"success"))},r.insertBefore(n,r.firstChild)},abort:function(){n&&n.onload(t,!0)}}}});var Fn=[],Bn=/(=)\?(?=&|$)|\?\?/;x.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Fn.pop()||x.expando+"_"+vn++;return this[e]=!0,e}}),x.ajaxPrefilter("json jsonp",function(n,r,i){var o,a,s,l=n.jsonp!==!1&&(Bn.test(n.url)?"url":"string"==typeof n.data&&!(n.contentType||"").indexOf("application/x-www-form-urlencoded")&&Bn.test(n.data)&&"data");return l||"jsonp"===n.dataTypes[0]?(o=n.jsonpCallback=x.isFunction(n.jsonpCallback)?n.jsonpCallback():n.jsonpCallback,l?n[l]=n[l].replace(Bn,"$1"+o):n.jsonp!==!1&&(n.url+=(bn.test(n.url)?"&":"?")+n.jsonp+"="+o),n.converters["script json"]=function(){return s||x.error(o+" was not called"),s[0]},n.dataTypes[0]="json",a=e[o],e[o]=function(){s=arguments},i.always(function(){e[o]=a,n[o]&&(n.jsonpCallback=r.jsonpCallback,Fn.push(o)),s&&x.isFunction(a)&&a(s[0]),s=a=t}),"script"):t});var Pn,Rn,Wn=0,$n=e.ActiveXObject&&function(){var e;for(e in Pn)Pn[e](t,!0)};function In(){try{return new e.XMLHttpRequest}catch(t){}}function zn(){try{return new e.ActiveXObject("Microsoft.XMLHTTP")}catch(t){}}x.ajaxSettings.xhr=e.ActiveXObject?function(){return!this.isLocal&&In()||zn()}:In,Rn=x.ajaxSettings.xhr(),x.support.cors=!!Rn&&"withCredentials"in Rn,Rn=x.support.ajax=!!Rn,Rn&&x.ajaxTransport(function(n){if(!n.crossDomain||x.support.cors){var r;return{send:function(i,o){var a,s,l=n.xhr();if(n.username?l.open(n.type,n.url,n.async,n.username,n.password):l.open(n.type,n.url,n.async),n.xhrFields)for(s in n.xhrFields)l[s]=n.xhrFields[s];n.mimeType&&l.overrideMimeType&&l.overrideMimeType(n.mimeType),n.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest");try{for(s in i)l.setRequestHeader(s,i[s])}catch(u){}l.send(n.hasContent&&n.data||null),r=function(e,i){var s,u,c,p;try{if(r&&(i||4===l.readyState))if(r=t,a&&(l.onreadystatechange=x.noop,$n&&delete Pn[a]),i)4!==l.readyState&&l.abort();else{p={},s=l.status,u=l.getAllResponseHeaders(),"string"==typeof l.responseText&&(p.text=l.responseText);try{c=l.statusText}catch(f){c=""}s||!n.isLocal||n.crossDomain?1223===s&&(s=204):s=p.text?200:404}}catch(d){i||o(-1,d)}p&&o(s,c,p,u)},n.async?4===l.readyState?setTimeout(r):(a=++Wn,$n&&(Pn||(Pn={},x(e).unload($n)),Pn[a]=r),l.onreadystatechange=r):r()},abort:function(){r&&r(t,!0)}}}});var Xn,Un,Vn=/^(?:toggle|show|hide)$/,Yn=RegExp("^(?:([+-])=|)("+w+")([a-z%]*)$","i"),Jn=/queueHooks$/,Gn=[nr],Qn={"*":[function(e,t){var n=this.createTween(e,t),r=n.cur(),i=Yn.exec(t),o=i&&i[3]||(x.cssNumber[e]?"":"px"),a=(x.cssNumber[e]||"px"!==o&&+r)&&Yn.exec(x.css(n.elem,e)),s=1,l=20;if(a&&a[3]!==o){o=o||a[3],i=i||[],a=+r||1;do s=s||".5",a/=s,x.style(n.elem,e,a+o);while(s!==(s=n.cur()/r)&&1!==s&&--l)}return i&&(a=n.start=+a||+r||0,n.unit=o,n.end=i[1]?a+(i[1]+1)*i[2]:+i[2]),n}]};function Kn(){return setTimeout(function(){Xn=t}),Xn=x.now()}function Zn(e,t,n){var r,i=(Qn[t]||[]).concat(Qn["*"]),o=0,a=i.length;for(;a>o;o++)if(r=i[o].call(n,t,e))return r}function er(e,t,n){var r,i,o=0,a=Gn.length,s=x.Deferred().always(function(){delete l.elem}),l=function(){if(i)return!1;var t=Xn||Kn(),n=Math.max(0,u.startTime+u.duration-t),r=n/u.duration||0,o=1-r,a=0,l=u.tweens.length;for(;l>a;a++)u.tweens[a].run(o);return s.notifyWith(e,[u,o,n]),1>o&&l?n:(s.resolveWith(e,[u]),!1)},u=s.promise({elem:e,props:x.extend({},t),opts:x.extend(!0,{specialEasing:{}},n),originalProperties:t,originalOptions:n,startTime:Xn||Kn(),duration:n.duration,tweens:[],createTween:function(t,n){var r=x.Tween(e,u.opts,t,n,u.opts.specialEasing[t]||u.opts.easing);return u.tweens.push(r),r},stop:function(t){var n=0,r=t?u.tweens.length:0;if(i)return this;for(i=!0;r>n;n++)u.tweens[n].run(1);return t?s.resolveWith(e,[u,t]):s.rejectWith(e,[u,t]),this}}),c=u.props;for(tr(c,u.opts.specialEasing);a>o;o++)if(r=Gn[o].call(u,e,c,u.opts))return r;return x.map(c,Zn,u),x.isFunction(u.opts.start)&&u.opts.start.call(e,u),x.fx.timer(x.extend(l,{elem:e,anim:u,queue:u.opts.queue})),u.progress(u.opts.progress).done(u.opts.done,u.opts.complete).fail(u.opts.fail).always(u.opts.always)}function tr(e,t){var n,r,i,o,a;for(n in e)if(r=x.camelCase(n),i=t[r],o=e[n],x.isArray(o)&&(i=o[1],o=e[n]=o[0]),n!==r&&(e[r]=o,delete e[n]),a=x.cssHooks[r],a&&"expand"in a){o=a.expand(o),delete e[r];for(n in o)n in e||(e[n]=o[n],t[n]=i)}else t[r]=i}x.Animation=x.extend(er,{tweener:function(e,t){x.isFunction(e)?(t=e,e=["*"]):e=e.split(" ");var n,r=0,i=e.length;for(;i>r;r++)n=e[r],Qn[n]=Qn[n]||[],Qn[n].unshift(t)},prefilter:function(e,t){t?Gn.unshift(e):Gn.push(e)}});function nr(e,t,n){var r,i,o,a,s,l,u=this,c={},p=e.style,f=e.nodeType&&nn(e),d=x._data(e,"fxshow");n.queue||(s=x._queueHooks(e,"fx"),null==s.unqueued&&(s.unqueued=0,l=s.empty.fire,s.empty.fire=function(){s.unqueued||l()}),s.unqueued++,u.always(function(){u.always(function(){s.unqueued--,x.queue(e,"fx").length||s.empty.fire()})})),1===e.nodeType&&("height"in t||"width"in t)&&(n.overflow=[p.overflow,p.overflowX,p.overflowY],"inline"===x.css(e,"display")&&"none"===x.css(e,"float")&&(x.support.inlineBlockNeedsLayout&&"inline"!==ln(e.nodeName)?p.zoom=1:p.display="inline-block")),n.overflow&&(p.overflow="hidden",x.support.shrinkWrapBlocks||u.always(function(){p.overflow=n.overflow[0],p.overflowX=n.overflow[1],p.overflowY=n.overflow[2]}));for(r in t)if(i=t[r],Vn.exec(i)){if(delete t[r],o=o||"toggle"===i,i===(f?"hide":"show"))continue;c[r]=d&&d[r]||x.style(e,r)}if(!x.isEmptyObject(c)){d?"hidden"in d&&(f=d.hidden):d=x._data(e,"fxshow",{}),o&&(d.hidden=!f),f?x(e).show():u.done(function(){x(e).hide()}),u.done(function(){var t;x._removeData(e,"fxshow");for(t in c)x.style(e,t,c[t])});for(r in c)a=Zn(f?d[r]:0,r,u),r in d||(d[r]=a.start,f&&(a.end=a.start,a.start="width"===r||"height"===r?1:0))}}function rr(e,t,n,r,i){return new rr.prototype.init(e,t,n,r,i)}x.Tween=rr,rr.prototype={constructor:rr,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||"swing",this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=rr.propHooks[this.prop];return e&&e.get?e.get(this):rr.propHooks._default.get(this)},run:function(e){var t,n=rr.propHooks[this.prop];return this.pos=t=this.options.duration?x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):rr.propHooks._default.set(this),this}},rr.prototype.init.prototype=rr.prototype,rr.propHooks={_default:{get:function(e){var t;return null==e.elem[e.prop]||e.elem.style&&null!=e.elem.style[e.prop]?(t=x.css(e.elem,e.prop,""),t&&"auto"!==t?t:0):e.elem[e.prop]},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):e.elem.style&&(null!=e.elem.style[x.cssProps[e.prop]]||x.cssHooks[e.prop])?x.style(e.elem,e.prop,e.now+e.unit):e.elem[e.prop]=e.now}}},rr.propHooks.scrollTop=rr.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.each(["toggle","show","hide"],function(e,t){var n=x.fn[t];x.fn[t]=function(e,r,i){return null==e||"boolean"==typeof e?n.apply(this,arguments):this.animate(ir(t,!0),e,r,i)}}),x.fn.extend({fadeTo:function(e,t,n,r){return this.filter(nn).css("opacity",0).show().end().animate({opacity:t},e,n,r)},animate:function(e,t,n,r){var i=x.isEmptyObject(e),o=x.speed(t,n,r),a=function(){var t=er(this,x.extend({},e),o);(i||x._data(this,"finish"))&&t.stop(!0)};return a.finish=a,i||o.queue===!1?this.each(a):this.queue(o.queue,a)},stop:function(e,n,r){var i=function(e){var t=e.stop;delete e.stop,t(r)};return"string"!=typeof e&&(r=n,n=e,e=t),n&&e!==!1&&this.queue(e||"fx",[]),this.each(function(){var t=!0,n=null!=e&&e+"queueHooks",o=x.timers,a=x._data(this);if(n)a[n]&&a[n].stop&&i(a[n]);else for(n in a)a[n]&&a[n].stop&&Jn.test(n)&&i(a[n]);for(n=o.length;n--;)o[n].elem!==this||null!=e&&o[n].queue!==e||(o[n].anim.stop(r),t=!1,o.splice(n,1));(t||!r)&&x.dequeue(this,e)})},finish:function(e){return e!==!1&&(e=e||"fx"),this.each(function(){var t,n=x._data(this),r=n[e+"queue"],i=n[e+"queueHooks"],o=x.timers,a=r?r.length:0;for(n.finish=!0,x.queue(this,e,[]),i&&i.stop&&i.stop.call(this,!0),t=o.length;t--;)o[t].elem===this&&o[t].queue===e&&(o[t].anim.stop(!0),o.splice(t,1));for(t=0;a>t;t++)r[t]&&r[t].finish&&r[t].finish.call(this);delete n.finish})}});function ir(e,t){var n,r={height:e},i=0;for(t=t?1:0;4>i;i+=2-t)n=Zt[i],r["margin"+n]=r["padding"+n]=e;return t&&(r.opacity=r.width=e),r}x.each({slideDown:ir("show"),slideUp:ir("hide"),slideToggle:ir("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(e,t){x.fn[e]=function(e,n,r){return this.animate(t,e,n,r)}}),x.speed=function(e,t,n){var r=e&&"object"==typeof e?x.extend({},e):{complete:n||!n&&t||x.isFunction(e)&&e,duration:e,easing:n&&t||t&&!x.isFunction(t)&&t};return r.duration=x.fx.off?0:"number"==typeof r.duration?r.duration:r.duration in x.fx.speeds?x.fx.speeds[r.duration]:x.fx.speeds._default,(null==r.queue||r.queue===!0)&&(r.queue="fx"),r.old=r.complete,r.complete=function(){x.isFunction(r.old)&&r.old.call(this),r.queue&&x.dequeue(this,r.queue)},r},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2}},x.timers=[],x.fx=rr.prototype.init,x.fx.tick=function(){var e,n=x.timers,r=0;for(Xn=x.now();n.length>r;r++)e=n[r],e()||n[r]!==e||n.splice(r--,1);n.length||x.fx.stop(),Xn=t},x.fx.timer=function(e){e()&&x.timers.push(e)&&x.fx.start()},x.fx.interval=13,x.fx.start=function(){Un||(Un=setInterval(x.fx.tick,x.fx.interval))},x.fx.stop=function(){clearInterval(Un),Un=null},x.fx.speeds={slow:600,fast:200,_default:400},x.fx.step={},x.expr&&x.expr.filters&&(x.expr.filters.animated=function(e){return x.grep(x.timers,function(t){return e===t.elem}).length}),x.fn.offset=function(e){if(arguments.length)return e===t?this:this.each(function(t){x.offset.setOffset(this,e,t)});var n,r,o={top:0,left:0},a=this[0],s=a&&a.ownerDocument;if(s)return n=s.documentElement,x.contains(n,a)?(typeof a.getBoundingClientRect!==i&&(o=a.getBoundingClientRect()),r=or(s),{top:o.top+(r.pageYOffset||n.scrollTop)-(n.clientTop||0),left:o.left+(r.pageXOffset||n.scrollLeft)-(n.clientLeft||0)}):o},x.offset={setOffset:function(e,t,n){var r=x.css(e,"position");"static"===r&&(e.style.position="relative");var i=x(e),o=i.offset(),a=x.css(e,"top"),s=x.css(e,"left"),l=("absolute"===r||"fixed"===r)&&x.inArray("auto",[a,s])>-1,u={},c={},p,f;l?(c=i.position(),p=c.top,f=c.left):(p=parseFloat(a)||0,f=parseFloat(s)||0),x.isFunction(t)&&(t=t.call(e,n,o)),null!=t.top&&(u.top=t.top-o.top+p),null!=t.left&&(u.left=t.left-o.left+f),"using"in t?t.using.call(e,u):i.css(u)}},x.fn.extend({position:function(){if(this[0]){var e,t,n={top:0,left:0},r=this[0];return"fixed"===x.css(r,"position")?t=r.getBoundingClientRect():(e=this.offsetParent(),t=this.offset(),x.nodeName(e[0],"html")||(n=e.offset()),n.top+=x.css(e[0],"borderTopWidth",!0),n.left+=x.css(e[0],"borderLeftWidth",!0)),{top:t.top-n.top-x.css(r,"marginTop",!0),left:t.left-n.left-x.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent||s;while(e&&!x.nodeName(e,"html")&&"static"===x.css(e,"position"))e=e.offsetParent;return e||s})}}),x.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(e,n){var r=/Y/.test(n);x.fn[e]=function(i){return x.access(this,function(e,i,o){var a=or(e);return o===t?a?n in a?a[n]:a.document.documentElement[i]:e[i]:(a?a.scrollTo(r?x(a).scrollLeft():o,r?o:x(a).scrollTop()):e[i]=o,t)},e,i,arguments.length,null)}});function or(e){return x.isWindow(e)?e:9===e.nodeType?e.defaultView||e.parentWindow:!1}x.each({Height:"height",Width:"width"},function(e,n){x.each({padding:"inner"+e,content:n,"":"outer"+e},function(r,i){x.fn[i]=function(i,o){var a=arguments.length&&(r||"boolean"!=typeof i),s=r||(i===!0||o===!0?"margin":"border");return x.access(this,function(n,r,i){var o;return x.isWindow(n)?n.document.documentElement["client"+e]:9===n.nodeType?(o=n.documentElement,Math.max(n.body["scroll"+e],o["scroll"+e],n.body["offset"+e],o["offset"+e],o["client"+e])):i===t?x.css(n,r,s):x.style(n,r,i,s)},n,a?i:t,a,null)}})}),x.fn.size=function(){return this.length},x.fn.andSelf=x.fn.addBack,"object"==typeof module&&module&&"object"==typeof module.exports?module.exports=x:(e.jQuery=e.$=x,"function"==typeof define&&define.amd&&define("jquery",[],function(){return x}))})(window);
diff --git a/simpleid/www/html/jquery.qrcode.js b/simpleid/www/html/jquery.qrcode.js
new file mode 100644
index 0000000..fe9680e
--- /dev/null
+++ b/simpleid/www/html/jquery.qrcode.js
@@ -0,0 +1,28 @@
+(function(r){r.fn.qrcode=function(h){var s;function u(a){this.mode=s;this.data=a}function o(a,c){this.typeNumber=a;this.errorCorrectLevel=c;this.modules=null;this.moduleCount=0;this.dataCache=null;this.dataList=[]}function q(a,c){if(void 0==a.length)throw Error(a.length+"/"+c);for(var d=0;d<a.length&&0==a[d];)d++;this.num=Array(a.length-d+c);for(var b=0;b<a.length-d;b++)this.num[b]=a[b+d]}function p(a,c){this.totalCount=a;this.dataCount=c}function t(){this.buffer=[];this.length=0}u.prototype={getLength:function(){return this.data.length},
+write:function(a){for(var c=0;c<this.data.length;c++)a.put(this.data.charCodeAt(c),8)}};o.prototype={addData:function(a){this.dataList.push(new u(a));this.dataCache=null},isDark:function(a,c){if(0>a||this.moduleCount<=a||0>c||this.moduleCount<=c)throw Error(a+","+c);return this.modules[a][c]},getModuleCount:function(){return this.moduleCount},make:function(){if(1>this.typeNumber){for(var a=1,a=1;40>a;a++){for(var c=p.getRSBlocks(a,this.errorCorrectLevel),d=new t,b=0,e=0;e<c.length;e++)b+=c[e].dataCount;
+for(e=0;e<this.dataList.length;e++)c=this.dataList[e],d.put(c.mode,4),d.put(c.getLength(),j.getLengthInBits(c.mode,a)),c.write(d);if(d.getLengthInBits()<=8*b)break}this.typeNumber=a}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(a,c){this.moduleCount=4*this.typeNumber+17;this.modules=Array(this.moduleCount);for(var d=0;d<this.moduleCount;d++){this.modules[d]=Array(this.moduleCount);for(var b=0;b<this.moduleCount;b++)this.modules[d][b]=null}this.setupPositionProbePattern(0,0);this.setupPositionProbePattern(this.moduleCount-
+7,0);this.setupPositionProbePattern(0,this.moduleCount-7);this.setupPositionAdjustPattern();this.setupTimingPattern();this.setupTypeInfo(a,c);7<=this.typeNumber&&this.setupTypeNumber(a);null==this.dataCache&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList));this.mapData(this.dataCache,c)},setupPositionProbePattern:function(a,c){for(var d=-1;7>=d;d++)if(!(-1>=a+d||this.moduleCount<=a+d))for(var b=-1;7>=b;b++)-1>=c+b||this.moduleCount<=c+b||(this.modules[a+d][c+b]=
+0<=d&&6>=d&&(0==b||6==b)||0<=b&&6>=b&&(0==d||6==d)||2<=d&&4>=d&&2<=b&&4>=b?!0:!1)},getBestMaskPattern:function(){for(var a=0,c=0,d=0;8>d;d++){this.makeImpl(!0,d);var b=j.getLostPoint(this);if(0==d||a>b)a=b,c=d}return c},createMovieClip:function(a,c,d){a=a.createEmptyMovieClip(c,d);this.make();for(c=0;c<this.modules.length;c++)for(var d=1*c,b=0;b<this.modules[c].length;b++){var e=1*b;this.modules[c][b]&&(a.beginFill(0,100),a.moveTo(e,d),a.lineTo(e+1,d),a.lineTo(e+1,d+1),a.lineTo(e,d+1),a.endFill())}return a},
+setupTimingPattern:function(){for(var a=8;a<this.moduleCount-8;a++)null==this.modules[a][6]&&(this.modules[a][6]=0==a%2);for(a=8;a<this.moduleCount-8;a++)null==this.modules[6][a]&&(this.modules[6][a]=0==a%2)},setupPositionAdjustPattern:function(){for(var a=j.getPatternPosition(this.typeNumber),c=0;c<a.length;c++)for(var d=0;d<a.length;d++){var b=a[c],e=a[d];if(null==this.modules[b][e])for(var f=-2;2>=f;f++)for(var i=-2;2>=i;i++)this.modules[b+f][e+i]=-2==f||2==f||-2==i||2==i||0==f&&0==i?!0:!1}},setupTypeNumber:function(a){for(var c=
+j.getBCHTypeNumber(this.typeNumber),d=0;18>d;d++){var b=!a&&1==(c>>d&1);this.modules[Math.floor(d/3)][d%3+this.moduleCount-8-3]=b}for(d=0;18>d;d++)b=!a&&1==(c>>d&1),this.modules[d%3+this.moduleCount-8-3][Math.floor(d/3)]=b},setupTypeInfo:function(a,c){for(var d=j.getBCHTypeInfo(this.errorCorrectLevel<<3|c),b=0;15>b;b++){var e=!a&&1==(d>>b&1);6>b?this.modules[b][8]=e:8>b?this.modules[b+1][8]=e:this.modules[this.moduleCount-15+b][8]=e}for(b=0;15>b;b++)e=!a&&1==(d>>b&1),8>b?this.modules[8][this.moduleCount-
+b-1]=e:9>b?this.modules[8][15-b-1+1]=e:this.modules[8][15-b-1]=e;this.modules[this.moduleCount-8][8]=!a},mapData:function(a,c){for(var d=-1,b=this.moduleCount-1,e=7,f=0,i=this.moduleCount-1;0<i;i-=2)for(6==i&&i--;;){for(var g=0;2>g;g++)if(null==this.modules[b][i-g]){var n=!1;f<a.length&&(n=1==(a[f]>>>e&1));j.getMask(c,b,i-g)&&(n=!n);this.modules[b][i-g]=n;e--; -1==e&&(f++,e=7)}b+=d;if(0>b||this.moduleCount<=b){b-=d;d=-d;break}}}};o.PAD0=236;o.PAD1=17;o.createData=function(a,c,d){for(var c=p.getRSBlocks(a,
+c),b=new t,e=0;e<d.length;e++){var f=d[e];b.put(f.mode,4);b.put(f.getLength(),j.getLengthInBits(f.mode,a));f.write(b)}for(e=a=0;e<c.length;e++)a+=c[e].dataCount;if(b.getLengthInBits()>8*a)throw Error("code length overflow. ("+b.getLengthInBits()+">"+8*a+")");for(b.getLengthInBits()+4<=8*a&&b.put(0,4);0!=b.getLengthInBits()%8;)b.putBit(!1);for(;!(b.getLengthInBits()>=8*a);){b.put(o.PAD0,8);if(b.getLengthInBits()>=8*a)break;b.put(o.PAD1,8)}return o.createBytes(b,c)};o.createBytes=function(a,c){for(var d=
+0,b=0,e=0,f=Array(c.length),i=Array(c.length),g=0;g<c.length;g++){var n=c[g].dataCount,h=c[g].totalCount-n,b=Math.max(b,n),e=Math.max(e,h);f[g]=Array(n);for(var k=0;k<f[g].length;k++)f[g][k]=255&a.buffer[k+d];d+=n;k=j.getErrorCorrectPolynomial(h);n=(new q(f[g],k.getLength()-1)).mod(k);i[g]=Array(k.getLength()-1);for(k=0;k<i[g].length;k++)h=k+n.getLength()-i[g].length,i[g][k]=0<=h?n.get(h):0}for(k=g=0;k<c.length;k++)g+=c[k].totalCount;d=Array(g);for(k=n=0;k<b;k++)for(g=0;g<c.length;g++)k<f[g].length&&
+(d[n++]=f[g][k]);for(k=0;k<e;k++)for(g=0;g<c.length;g++)k<i[g].length&&(d[n++]=i[g][k]);return d};s=4;for(var j={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,
+78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(a){for(var c=a<<10;0<=j.getBCHDigit(c)-j.getBCHDigit(j.G15);)c^=j.G15<<j.getBCHDigit(c)-j.getBCHDigit(j.G15);return(a<<10|c)^j.G15_MASK},getBCHTypeNumber:function(a){for(var c=a<<12;0<=j.getBCHDigit(c)-
+j.getBCHDigit(j.G18);)c^=j.G18<<j.getBCHDigit(c)-j.getBCHDigit(j.G18);return a<<12|c},getBCHDigit:function(a){for(var c=0;0!=a;)c++,a>>>=1;return c},getPatternPosition:function(a){return j.PATTERN_POSITION_TABLE[a-1]},getMask:function(a,c,d){switch(a){case 0:return 0==(c+d)%2;case 1:return 0==c%2;case 2:return 0==d%3;case 3:return 0==(c+d)%3;case 4:return 0==(Math.floor(c/2)+Math.floor(d/3))%2;case 5:return 0==c*d%2+c*d%3;case 6:return 0==(c*d%2+c*d%3)%2;case 7:return 0==(c*d%3+(c+d)%2)%2;default:throw Error("bad maskPattern:"+
+a);}},getErrorCorrectPolynomial:function(a){for(var c=new q([1],0),d=0;d<a;d++)c=c.multiply(new q([1,l.gexp(d)],0));return c},getLengthInBits:function(a,c){if(1<=c&&10>c)switch(a){case 1:return 10;case 2:return 9;case s:return 8;case 8:return 8;default:throw Error("mode:"+a);}else if(27>c)switch(a){case 1:return 12;case 2:return 11;case s:return 16;case 8:return 10;default:throw Error("mode:"+a);}else if(41>c)switch(a){case 1:return 14;case 2:return 13;case s:return 16;case 8:return 12;default:throw Error("mode:"+
+a);}else throw Error("type:"+c);},getLostPoint:function(a){for(var c=a.getModuleCount(),d=0,b=0;b<c;b++)for(var e=0;e<c;e++){for(var f=0,i=a.isDark(b,e),g=-1;1>=g;g++)if(!(0>b+g||c<=b+g))for(var h=-1;1>=h;h++)0>e+h||c<=e+h||0==g&&0==h||i==a.isDark(b+g,e+h)&&f++;5<f&&(d+=3+f-5)}for(b=0;b<c-1;b++)for(e=0;e<c-1;e++)if(f=0,a.isDark(b,e)&&f++,a.isDark(b+1,e)&&f++,a.isDark(b,e+1)&&f++,a.isDark(b+1,e+1)&&f++,0==f||4==f)d+=3;for(b=0;b<c;b++)for(e=0;e<c-6;e++)a.isDark(b,e)&&!a.isDark(b,e+1)&&a.isDark(b,e+
+2)&&a.isDark(b,e+3)&&a.isDark(b,e+4)&&!a.isDark(b,e+5)&&a.isDark(b,e+6)&&(d+=40);for(e=0;e<c;e++)for(b=0;b<c-6;b++)a.isDark(b,e)&&!a.isDark(b+1,e)&&a.isDark(b+2,e)&&a.isDark(b+3,e)&&a.isDark(b+4,e)&&!a.isDark(b+5,e)&&a.isDark(b+6,e)&&(d+=40);for(e=f=0;e<c;e++)for(b=0;b<c;b++)a.isDark(b,e)&&f++;a=Math.abs(100*f/c/c-50)/5;return d+10*a}},l={glog:function(a){if(1>a)throw Error("glog("+a+")");return l.LOG_TABLE[a]},gexp:function(a){for(;0>a;)a+=255;for(;256<=a;)a-=255;return l.EXP_TABLE[a]},EXP_TABLE:Array(256),
+LOG_TABLE:Array(256)},m=0;8>m;m++)l.EXP_TABLE[m]=1<<m;for(m=8;256>m;m++)l.EXP_TABLE[m]=l.EXP_TABLE[m-4]^l.EXP_TABLE[m-5]^l.EXP_TABLE[m-6]^l.EXP_TABLE[m-8];for(m=0;255>m;m++)l.LOG_TABLE[l.EXP_TABLE[m]]=m;q.prototype={get:function(a){return this.num[a]},getLength:function(){return this.num.length},multiply:function(a){for(var c=Array(this.getLength()+a.getLength()-1),d=0;d<this.getLength();d++)for(var b=0;b<a.getLength();b++)c[d+b]^=l.gexp(l.glog(this.get(d))+l.glog(a.get(b)));return new q(c,0)},mod:function(a){if(0>
+this.getLength()-a.getLength())return this;for(var c=l.glog(this.get(0))-l.glog(a.get(0)),d=Array(this.getLength()),b=0;b<this.getLength();b++)d[b]=this.get(b);for(b=0;b<a.getLength();b++)d[b]^=l.gexp(l.glog(a.get(b))+c);return(new q(d,0)).mod(a)}};p.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],
+[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,
+116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,
+43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,
+3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,
+55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,
+45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]];p.getRSBlocks=function(a,c){var d=p.getRsBlockTable(a,c);if(void 0==d)throw Error("bad rs block @ typeNumber:"+a+"/errorCorrectLevel:"+c);for(var b=d.length/3,e=[],f=0;f<b;f++)for(var h=d[3*f+0],g=d[3*f+1],j=d[3*f+2],l=0;l<h;l++)e.push(new p(g,j));return e};p.getRsBlockTable=function(a,c){switch(c){case 1:return p.RS_BLOCK_TABLE[4*(a-1)+0];case 0:return p.RS_BLOCK_TABLE[4*(a-1)+1];case 3:return p.RS_BLOCK_TABLE[4*
+(a-1)+2];case 2:return p.RS_BLOCK_TABLE[4*(a-1)+3]}};t.prototype={get:function(a){return 1==(this.buffer[Math.floor(a/8)]>>>7-a%8&1)},put:function(a,c){for(var d=0;d<c;d++)this.putBit(1==(a>>>c-d-1&1))},getLengthInBits:function(){return this.length},putBit:function(a){var c=Math.floor(this.length/8);this.buffer.length<=c&&this.buffer.push(0);a&&(this.buffer[c]|=128>>>this.length%8);this.length++}};"string"===typeof h&&(h={text:h});h=r.extend({},{render:"canvas",width:256,height:256,typeNumber:-1,
+correctLevel:2,background:"#ffffff",foreground:"#000000"},h);return this.each(function(){var a;if("canvas"==h.render){a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();var c=document.createElement("canvas");c.width=h.width;c.height=h.height;for(var d=c.getContext("2d"),b=h.width/a.getModuleCount(),e=h.height/a.getModuleCount(),f=0;f<a.getModuleCount();f++)for(var i=0;i<a.getModuleCount();i++){d.fillStyle=a.isDark(f,i)?h.foreground:h.background;var g=Math.ceil((i+1)*b)-Math.floor(i*b),
+j=Math.ceil((f+1)*b)-Math.floor(f*b);d.fillRect(Math.round(i*b),Math.round(f*e),g,j)}}else{a=new o(h.typeNumber,h.correctLevel);a.addData(h.text);a.make();c=r("<table></table>").css("width",h.width+"px").css("height",h.height+"px").css("border","0px").css("border-collapse","collapse").css("background-color",h.background);d=h.width/a.getModuleCount();b=h.height/a.getModuleCount();for(e=0;e<a.getModuleCount();e++){f=r("<tr></tr>").css("height",b+"px").appendTo(c);for(i=0;i<a.getModuleCount();i++)r("<td></td>").css("width",
+d+"px").css("background-color",a.isDark(e,i)?h.foreground:h.background).appendTo(f)}}a=c;jQuery(a).appendTo(this)})}})(jQuery);
diff --git a/simpleid/www/html/lock-open.png b/simpleid/www/html/lock-open.png
new file mode 100644
index 0000000..a471765
--- /dev/null
+++ b/simpleid/www/html/lock-open.png
Binary files differ
diff --git a/simpleid/www/html/lock.png b/simpleid/www/html/lock.png
new file mode 100644
index 0000000..2ebc4f6
--- /dev/null
+++ b/simpleid/www/html/lock.png
Binary files differ
diff --git a/simpleid/www/html/nav-toggle.png b/simpleid/www/html/nav-toggle.png
new file mode 100644
index 0000000..063079e
--- /dev/null
+++ b/simpleid/www/html/nav-toggle.png
Binary files differ
diff --git a/simpleid/www/html/normalize.css b/simpleid/www/html/normalize.css
new file mode 100644
index 0000000..c2de8df
--- /dev/null
+++ b/simpleid/www/html/normalize.css
@@ -0,0 +1,406 @@
+/*! normalize.css v2.1.3 | MIT License | git.io/normalize */
+
+/* ==========================================================================
+   HTML5 display definitions
+   ========================================================================== */
+
+/**
+ * Correct `block` display not defined in IE 8/9.
+ */
+
+article,
+aside,
+details,
+figcaption,
+figure,
+footer,
+header,
+hgroup,
+main,
+nav,
+section,
+summary {
+    display: block;
+}
+
+/**
+ * Correct `inline-block` display not defined in IE 8/9.
+ */
+
+audio,
+canvas,
+video {
+    display: inline-block;
+}
+
+/**
+ * Prevent modern browsers from displaying `audio` without controls.
+ * Remove excess height in iOS 5 devices.
+ */
+
+audio:not([controls]) {
+    display: none;
+    height: 0;
+}
+
+/**
+ * Address `[hidden]` styling not present in IE 8/9.
+ * Hide the `template` element in IE, Safari, and Firefox < 22.
+ */
+
+[hidden],
+template {
+    display: none;
+}
+
+/* ==========================================================================
+   Base
+   ========================================================================== */
+
+/**
+ * 1. Set default font family to sans-serif.
+ * 2. Prevent iOS text size adjust after orientation change, without disabling
+ *    user zoom.
+ */
+
+html {
+    font-family: sans-serif; /* 1 */
+    -ms-text-size-adjust: 100%; /* 2 */
+    -webkit-text-size-adjust: 100%; /* 2 */
+}
+
+/**
+ * Remove default margin.
+ */
+
+body {
+    margin: 0;
+}
+
+/* ==========================================================================
+   Links
+   ========================================================================== */
+
+/**
+ * Remove the gray background color from active links in IE 10.
+ */
+
+a {
+    background: transparent;
+}
+
+/**
+ * Address `outline` inconsistency between Chrome and other browsers.
+ */
+
+a:focus {
+    outline: thin dotted;
+}
+
+/**
+ * Improve readability when focused and also mouse hovered in all browsers.
+ */
+
+a:active,
+a:hover {
+    outline: 0;
+}
+
+/* ==========================================================================
+   Typography
+   ========================================================================== */
+
+/**
+ * Address variable `h1` font-size and margin within `section` and `article`
+ * contexts in Firefox 4+, Safari 5, and Chrome.
+ */
+
+h1 {
+    font-size: 2em;
+    margin: 0.67em 0;
+}
+
+/**
+ * Address styling not present in IE 8/9, Safari 5, and Chrome.
+ */
+
+abbr[title] {
+    border-bottom: 1px dotted;
+}
+
+/**
+ * Address style set to `bolder` in Firefox 4+, Safari 5, and Chrome.
+ */
+
+b,
+strong {
+    font-weight: bold;
+}
+
+/**
+ * Address styling not present in Safari 5 and Chrome.
+ */
+
+dfn {
+    font-style: italic;
+}
+
+/**
+ * Address differences between Firefox and other browsers.
+ */
+
+hr {
+    -moz-box-sizing: content-box;
+    box-sizing: content-box;
+    height: 0;
+}
+
+/**
+ * Address styling not present in IE 8/9.
+ */
+
+mark {
+    background: #ff0;
+    color: #000;
+}
+
+/**
+ * Correct font family set oddly in Safari 5 and Chrome.
+ */
+
+code,
+kbd,
+pre,
+samp {
+    font-family: monospace, serif;
+    font-size: 1em;
+}
+
+/**
+ * Improve readability of pre-formatted text in all browsers.
+ */
+
+pre {
+    white-space: pre-wrap;
+}
+
+/**
+ * Set consistent quote types.
+ */
+
+q {
+    quotes: "\201C" "\201D" "\2018" "\2019";
+}
+
+/**
+ * Address inconsistent and variable font size in all browsers.
+ */
+
+small {
+    font-size: 80%;
+}
+
+/**
+ * Prevent `sub` and `sup` affecting `line-height` in all browsers.
+ */
+
+sub,
+sup {
+    font-size: 75%;
+    line-height: 0;
+    position: relative;
+    vertical-align: baseline;
+}
+
+sup {
+    top: -0.5em;
+}
+
+sub {
+    bottom: -0.25em;
+}
+
+/* ==========================================================================
+   Embedded content
+   ========================================================================== */
+
+/**
+ * Remove border when inside `a` element in IE 8/9.
+ */
+
+img {
+    border: 0;
+}
+
+/**
+ * Correct overflow displayed oddly in IE 9.
+ */
+
+svg:not(:root) {
+    overflow: hidden;
+}
+
+/* ==========================================================================
+   Figures
+   ========================================================================== */
+
+/**
+ * Address margin not present in IE 8/9 and Safari 5.
+ */
+
+figure {
+    margin: 0;
+}
+
+/* ==========================================================================
+   Forms
+   ========================================================================== */
+
+/**
+ * Define consistent border, margin, and padding.
+ */
+
+fieldset {
+    border: 1px solid #c0c0c0;
+    margin: 0 2px;
+    padding: 0.35em 0.625em 0.75em;
+}
+
+/**
+ * 1. Correct `color` not being inherited in IE 8/9.
+ * 2. Remove padding so people aren't caught out if they zero out fieldsets.
+ */
+
+legend {
+    border: 0; /* 1 */
+    padding: 0; /* 2 */
+}
+
+/**
+ * 1. Correct font family not being inherited in all browsers.
+ * 2. Correct font size not being inherited in all browsers.
+ * 3. Address margins set differently in Firefox 4+, Safari 5, and Chrome.
+ */
+
+button,
+input,
+select,
+textarea {
+    font-family: inherit; /* 1 */
+    font-size: 100%; /* 2 */
+    margin: 0; /* 3 */
+}
+
+/**
+ * Address Firefox 4+ setting `line-height` on `input` using `!important` in
+ * the UA stylesheet.
+ */
+
+button,
+input {
+    line-height: normal;
+}
+
+/**
+ * Address inconsistent `text-transform` inheritance for `button` and `select`.
+ * All other form control elements do not inherit `text-transform` values.
+ * Correct `button` style inheritance in Chrome, Safari 5+, and IE 8+.
+ * Correct `select` style inheritance in Firefox 4+ and Opera.
+ */
+
+button,
+select {
+    text-transform: none;
+}
+
+/**
+ * 1. Avoid the WebKit bug in Android 4.0.* where (2) destroys native `audio`
+ *    and `video` controls.
+ * 2. Correct inability to style clickable `input` types in iOS.
+ * 3. Improve usability and consistency of cursor style between image-type
+ *    `input` and others.
+ */
+
+button,
+html input[type="button"], /* 1 */
+input[type="reset"],
+input[type="submit"] {
+    -webkit-appearance: button; /* 2 */
+    cursor: pointer; /* 3 */
+}
+
+/**
+ * Re-set default cursor for disabled elements.
+ */
+
+button[disabled],
+html input[disabled] {
+    cursor: default;
+}
+
+/**
+ * 1. Address box sizing set to `content-box` in IE 8/9/10.
+ * 2. Remove excess padding in IE 8/9/10.
+ */
+
+input[type="checkbox"],
+input[type="radio"] {
+    box-sizing: border-box; /* 1 */
+    padding: 0; /* 2 */
+}
+
+/**
+ * 1. Address `appearance` set to `searchfield` in Safari 5 and Chrome.
+ * 2. Address `box-sizing` set to `border-box` in Safari 5 and Chrome
+ *    (include `-moz` to future-proof).
+ */
+
+input[type="search"] {
+    -webkit-appearance: textfield; /* 1 */
+    -moz-box-sizing: content-box;
+    -webkit-box-sizing: content-box; /* 2 */
+    box-sizing: content-box;
+}
+
+/**
+ * Remove inner padding and search cancel button in Safari 5 and Chrome
+ * on OS X.
+ */
+
+input[type="search"]::-webkit-search-cancel-button,
+input[type="search"]::-webkit-search-decoration {
+    -webkit-appearance: none;
+}
+
+/**
+ * Remove inner padding and border in Firefox 4+.
+ */
+
+button::-moz-focus-inner,
+input::-moz-focus-inner {
+    border: 0;
+    padding: 0;
+}
+
+/**
+ * 1. Remove default vertical scrollbar in IE 8/9.
+ * 2. Improve readability and alignment in all browsers.
+ */
+
+textarea {
+    overflow: auto; /* 1 */
+    vertical-align: top; /* 2 */
+}
+
+/* ==========================================================================
+   Tables
+   ========================================================================== */
+
+/**
+ * Remove most spacing between table cells.
+ */
+
+table {
+    border-collapse: collapse;
+    border-spacing: 0;
+}
diff --git a/simpleid/www/html/openid-consent.js b/simpleid/www/html/openid-consent.js
new file mode 100644
index 0000000..52bd63c
--- /dev/null
+++ b/simpleid/www/html/openid-consent.js
@@ -0,0 +1,7 @@
+$(document).ready(function() {
+    $('.return-to-suspect').click(function() {
+        if ($(this).attr('checked') == false) return true;
+        
+        return confirm(l.openid_suspect);
+    });
+});
diff --git a/simpleid/www/html/page-profile.js b/simpleid/www/html/page-profile.js
new file mode 100644
index 0000000..a64da93
--- /dev/null
+++ b/simpleid/www/html/page-profile.js
@@ -0,0 +1,21 @@
+var discovery_refresh = function() {
+    var code = '';
+    
+    if ($('#discovery-openid1')[0].checked) {
+        code += $('#discovery-templates .openid1').html() + '\n';
+        if ($('#discovery-local-id')[0].checked) code += $('.openid1-local-id').html() + '\n';
+    }
+    if ($('#discovery-openid2')[0].checked) {
+        code += $('#discovery-templates .openid2').html() + '\n';
+        if ($('#discovery-local-id')[0].checked) code += $('.openid2-local-id').html() + '\n';
+    }
+    
+    if (code == '') code = l.code;
+    
+    $('#discovery-link-tags').html(code);
+}
+
+$(document).ready(function() {
+    $('.discovery-checkbox').click(discovery_refresh);
+    discovery_refresh();
+});
diff --git a/simpleid/www/html/simpleid.css b/simpleid/www/html/simpleid.css
new file mode 100644
index 0000000..02dc644
--- /dev/null
+++ b/simpleid/www/html/simpleid.css
@@ -0,0 +1,383 @@
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2009
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+@import url(normalize.css);
+
+/* General elements -------------------------------------------------------- */
+html {
+    font: 12px/19px Helvetica, Arial, sans-serif;
+}
+
+h1 {
+    font-weight: normal;
+    color: #666666;
+}
+
+a {
+    border-bottom: 1px solid #CCCCCC;
+    color: #1144AA;
+    text-decoration: none !important;
+    font-weight: bold;
+}
+a:visited {
+    border-color: #CCCCCC;
+    color: #114499;
+}
+a:focus, a:hover {
+    border-color: #4488EE;
+    color: #4488EE;
+}
+
+table {
+    border-collapse: collapse;
+    margin: 0 0 1em 0;
+    width: 100%;
+}
+
+td, th {
+    border-bottom: 1px solid #CCCCCC;
+    text-align: left;
+    vertical-align: top;
+    padding: 5px 5px;
+}
+th {
+    border-bottom: 0px;
+    background-color: #666666;
+    color: #FFFFFF;
+    white-space: nowrap;
+    font-weight: bold;
+}
+
+pre {
+    border:1px solid #CCCCCC;
+    padding: 5px;
+    font-family:"Bitstream Vera Sans Mono","Courier New",monospace;
+    font-size: 0.9em;
+    white-space: nowrap;
+    overflow: scroll;
+}
+
+/* Page layout ------------------------------------------------------------- */
+#header {
+    background-color: #666666;
+    color: #CCCCCC;
+    padding: 0px 10px;
+    line-height: 1;
+}
+#header-inner { margin: 0px auto; max-width: 1140px; }
+
+#header h1 {
+    font-weight: bold;
+    font-size: 14px;
+    text-transform: uppercase;
+    margin: 0.5em 0;
+    color: #CCCCCC;
+    letter-spacing: 0;
+}
+
+#header h1 a {
+    color: #FFFFFF;
+    text-decoration: none;
+    border-bottom: none;
+}
+
+#nav-toggle, #logo { float: left; padding: 5px 0px; }
+#nav-toggle {
+    padding: 5px;
+    border-right: 1px solid #FFFFFF;
+    margin-right: 0.5em;
+    cursor: pointer;
+    display: none;
+}
+#nav-toggle img { padding: 0.5em; }
+
+#nav {
+    background-color: #666666;
+    color: #CCCCCC;
+    padding: 5px 10px;
+}
+#nav-inner { margin: 0px auto; max-width: 1140px; }
+#nav ul {
+    margin: 0;
+    padding: 0;
+    text-align: left;
+}
+#nav li {
+    display: inline;
+    list-style-type: none;
+}
+#nav a {
+    background-color: #888888;
+    padding: 6px 8px;
+    border-width: 0;
+    color: #FFFFFF;
+}
+#nav ul#nav-left { float: left; }
+#nav ul#nav-right { float: right; }
+
+#user {
+    float: right;
+    margin: 0.5em 0;
+    padding: 5px 0;
+}
+.logged-in-as .identity {
+    padding-left: 20px;
+    background: transparent url(user.png) no-repeat top left;
+    color: #FFFFFF;
+}
+.logged-in-as a {
+    color: #FFFFFF;
+    border-bottom-color: #FFFFFF;
+    font-weight: normal;
+}
+#logout:before { content: " · "; }
+
+#user-toggle {
+    float: right;
+    padding: 5px;
+    margin-left: 0.5em;
+    border-left: 1px solid #FFFFFF;
+    cursor: pointer;
+    display: none;
+}
+#user-toggle img { padding: 0.5em; }
+
+#footer {
+    margin: 2em 0;
+    padding: 0px 10px;
+    text-align: right;
+    font-size: 0.9em;
+    color: #999999;
+}
+#footer address { font-style: normal }
+#footer a { color: #999999; }
+
+#content {
+    margin: auto;
+    padding: 1em 10px;
+    max-width: 1140px;
+    clear: both;
+}
+
+
+/* Specific elements ------------------------------------------------------- */
+.realm, .site {
+    padding-left: 20px;
+    background: transparent url(world.png) no-repeat top left;
+}
+.app {
+    padding-left: 20px;
+    background: transparent url(application.png) no-repeat top left;
+}
+.device {
+    padding-left: 20px;
+    background: transparent url(drive.png) no-repeat top left;
+}
+.url-elide { color: #999999; }
+
+span.last-time { display: none; }
+
+.message, .login-security {
+    border: 1px solid #666666;
+    border-radius: 4px;
+    padding: 0 10px;
+    background: #DDDDDD;
+    margin-bottom: 10px;
+}
+.message p { line-height: 1; }
+
+.unsecure {
+    border: 1px solid #AAAA11;
+    background: #FFFFDD;
+}
+.unsecure p { padding-left: 20px; background: transparent url(lock-open.png) no-repeat top left; }
+.secure {
+    border: 1px solid #44AA11;
+    background: #EEFFDD;
+}
+.secure p { padding-left: 20px; background: transparent url(lock.png) no-repeat top left; }
+
+.block {
+    background-color: #EEEEEE;
+    margin-bottom: 20px;
+}
+.block-header {
+    background-color: #666666;
+    margin:0 0 5px;
+    padding: 5px 10px;
+}
+.block-header h2 {
+    font-size: 1.2em;
+    font-weight: bold;
+    color: #FFFFFF;
+    margin: 0;
+    padding: 0;
+    border-top-width: 0;
+}
+.block-header-links {
+    float: right;
+    font-size: 0.9em;
+    text-align: right;
+    white-space: nowrap;
+}
+.block-header-links a {
+    color: #FFFFFF;
+    border-bottom-color: #FFFFFF;
+    font-weight: normal;
+}
+.block-content {
+    padding: 5px 10px;
+}
+.block-content p {
+    margin: 0 0 5px 0;
+    padding: 0;
+}
+.block-content h3 {
+    font-size: 1em;
+    font-weight: bold;
+    margin: 0;
+    padding: 5px 0 0 0;
+}
+
+#discovery label { display: inline; }
+#discovery-templates { display: none; }
+
+.otp-key {
+    font-size: 18px;
+    font-family: "Bitstream Vera Sans Mono","Courier New",monospace;
+    margin: 5px;
+}
+.otp-letters { padding: 0 2px; }
+#otp-key-qr { padding: 16px 0; }
+
+/* Forms */
+.form-item { margin: 1em 0; }
+
+label {
+    display: block;
+    font-weight: bold;
+    padding: 2px 0;
+}
+label.option { font-weight: normal; }
+
+select, textarea, input[type="text"], input[type="password"], input[type="number"] {
+    display: inline-block;
+    padding: 0.5em;    
+    border: 1px solid #AAAAAA;
+    border-radius: 2px;
+}
+select:focus, textarea:focus, input[type="text"]:focus, input[type="password"]:focus, input[type="number"]:focus {
+    border-color: #1144AA;
+}
+
+input[type="submit"], input[type="button"] {
+    padding: 0.5em 1em;
+    background-color: #EEEEEE;
+    border: 1px solid #999999;
+    border-radius: 2px;
+    zoom: 1;
+    vertical-align: middle;
+    font-weight: bold;
+}
+input[type="submit"]:active, input[type="button"]:active {
+    box-shadow: 0 0 0 1px rgba(0,0,0, 0.15) inset, 0 0 6px rgba(0,0,0, 0.20) inset;
+}
+input[type="submit"][disabled], input[type="button"][disabled] {
+    color: #999999 !important;
+    background-color: #EEEEEE !important;
+    border-color: #999999 !important;
+}
+input[type="submit"].form-default, input[type="button"].form-default {
+    color: #FFFFFF;
+    background-color: #1144AA;
+    border-color: #114499;
+}
+
+input[type="radio"], input[type="checkbox"] { margin: 0.5em 0; }
+input[type="radio"]:focus, input[type="checkbox"]:focus {
+    outline: 1px auto #1144AA;
+}
+
+/* Dialogs and dialog pages */
+.dialog-page { background: #EEEEEE; }
+.dialog-page #content {
+    padding-top: 50px;
+    max-width: 400px;
+}
+.dialog-page #content-inner {
+    padding: 20px;
+    border: 10px solid #DDDDDD;
+    background: #FFFFFF;
+}
+
+.dialog-page form { padding-right: 2px; } /* Used to adjust the padding in text boxes */
+.dialog-page .form-item { padding-right: 1em; } /* Used to adjust the padding in text boxes */
+.dialog-page select, .dialog-page textarea, .dialog-page input[type="text"], .dialog-page input[type="password"], .dialog-page input[type="number"] {
+    width: 100%;
+}
+
+/* Mobile devices ---------------------------------------------------------- */
+@media only screen and (max-width: 767px) {
+    html { font-size: 14px; }
+
+    #logo .version { display: none; }
+
+    #nav-toggle, #user-toggle { display: block; }
+    #nav-toggle.expand, #user-toggle.expand { background-color: #888888; }
+
+    #nav {
+        display: none;
+        position: absolute;
+        float: none;
+        left: 10px;
+        top: 40px;
+        padding: 0;
+    }
+    #nav.expand { display: block; }
+    #nav li { display: block; }
+    #nav a { display: block; }
+
+    #user {
+        display: none;
+        position: absolute;
+        float: none;
+        right: 10px;
+        top: 40px;
+        background-color: #888888;
+        margin: 0;
+        padding: 0 8px;
+    }
+    #user.expand { display: block; }
+    #user span {
+        display: block;
+        padding: 6px 0;
+    }
+    #logout:before { content: ""; }
+    
+    .dialog-page { background: #FFFFFF; }
+    .dialog-page #content { padding-top: 10px; }
+    .dialog-page #content-inner {
+        padding: 0px;
+        border-width: 0px;
+    }
+}
+
diff --git a/simpleid/www/html/simpleid.ico b/simpleid/www/html/simpleid.ico
new file mode 100644
index 0000000..b35053e
--- /dev/null
+++ b/simpleid/www/html/simpleid.ico
Binary files differ
diff --git a/simpleid/www/html/simpleid.png b/simpleid/www/html/simpleid.png
new file mode 100644
index 0000000..25bde22
--- /dev/null
+++ b/simpleid/www/html/simpleid.png
Binary files differ
diff --git a/simpleid/www/html/template.xtpl b/simpleid/www/html/template.xtpl
new file mode 100644
index 0000000..66d1aff
--- /dev/null
+++ b/simpleid/www/html/template.xtpl
@@ -0,0 +1,419 @@
+<!-- BEGIN: main --><!DOCTYPE html>
+<html lang="en">
+    <!-- :mode=html: $Id$ -->
+    <head>
+        <title>{title} - SimpleID</title>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+        <meta name="SimpleID-Version" content="{version}" />
+        <meta name="robots" content="noindex,nofollow" />
+        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
+        <link rel="shortcut icon" href="{base_path}html/simpleid.ico" type="image/x-icon" />
+        
+        <!-- BEGIN: provider -->
+            <link rel="openid.server" href="{provider}" />
+            <link rel="openid2.provider" href="{provider}" />
+            <meta content="{xrds}" http-equiv="X-XRDS-Location" />
+        <!-- END: provider -->
+        <!-- BEGIN: local_id -->
+            <link rel="openid.delegate" href="{local_id}" />
+            <link rel="openid2.local_id" href="{local_id}" />
+        <!-- END: local_id -->
+        
+        <link rel="stylesheet" href="{base_path}html/simpleid.css" />
+        <style type="text/css" media="screen">
+            {css}
+        </style>
+        
+        <script src="{base_path}html/jquery.js" type="text/javascript"></script>
+        <script type="text/javascript">
+        var l = {
+            <!-- BEGIN: js_locale -->"{js_locale_label}": "{js_locale_text}",<!-- END: js_locale -->
+        };
+        </script>
+        <!-- BEGIN: framekiller -->
+        <script type="text/javascript">
+            $(document).ready(function() {
+                if (top !== self) top.location.replace(self.location.href);
+            });
+        </script>
+        <!-- END: framekiller -->
+        {javascript}
+    </head>
+    <body class="{page_class}">
+        <div id="header"><div id="header-inner">
+            <!-- BEGIN: nav_toggle --><div id="nav-toggle"><img src="{base_path}html/nav-toggle.png" /></div><!-- END: nav_toggle -->
+            <div id="logo">
+                <h1><a href="http://simpleid.org/">SimpleID</a> <span class="version">{version}</span></h1>
+            </div>
+            <!-- BEGIN: user -->
+            <div id="user-toggle"><img src="{base_path}html/user-toggle.png" /></div>
+            <div id="user">
+                <div class="logged-in-as">
+                    <span><strong title="{identity}" class="identity">{uid}</strong></span>
+                <!-- BEGIN: logout --><span id="logout"><a href="{url}">{logout}</a></span><!-- END: logout -->
+                </div>
+            </div>
+            <!-- END: user -->
+            <div style="clear: both;"></div>
+        </div></div>
+        <!-- BEGIN: nav -->
+        <div id="nav"><div id="nav-inner">
+            <ul id="nav-left">
+                <li><a href="{nav_base}">{nav_dashboard_label}</a></li>
+                <li><a href="{nav_base}my/profile">{nav_profile_label}</a></li>
+                <li><a href="{nav_base}my/sites">{nav_sites_label}</a></li>
+            </ul>
+            <div style="clear: both"></div>
+        </div></div>
+        <!-- END: nav -->
+        <div id="content"><div id="content-inner">
+            <h1>{title}</h1>
+            
+            <!-- BEGIN: message -->
+            <div class="message">
+                <p>{message}</p>
+            </div>
+            <!-- END: message -->
+            
+            <!-- BEGIN: login -->
+            <!-- BEGIN: login_security -->
+            <div class="login-security {security_class}">
+                <p>{security_message}</p>
+            </div>
+            <!-- END: login_security -->
+            
+            <form action="{base_path}index.php" method="post" enctype="application/x-www-form-urlencoded" id="login-form">
+                <input type="hidden" name="q" value="login"/><input name="destination" type="hidden" value="{destination}"/>
+                <input type="hidden" name="mode" value="{mode}"/><input type="hidden" name="nonce" value="{nonce}" />
+
+                <!-- BEGIN: credentials -->
+                <input type="hidden" name="digest" id="edit-digest" value="" />
+                
+                <div class="form-item">
+                    <label for="edit-name">{name_label}</label>
+                    <!-- BEGIN: input_uid --><input type="text" maxlength="60" name="name" id="edit-name" value="" autocapitalize="off" autocorrect="off" class="form-text required" {security_disabled} /><!-- END: input_uid -->
+                    <!-- BEGIN: fixed_uid --><input type="hidden" name="name" value="{uid}"/><input type="hidden" name="fixed_uid" value="1"/><div id="edit-name">{uid}</div><!-- END: fixed_uid -->
+                </div>
+                <div class="form-item">
+                    <label for="edit-pass">{pass_label}</label>
+                    <input type="password" name="pass" id="edit-pass" size="60" class="form-text required" {security_disabled} />
+                </div>                
+                <div class="form-item">
+                    <label class="option">
+                        <input type="checkbox" name="autologin" value="1" />
+                        {autologin_label}
+                    </label>
+                </div>
+                <!-- END: credentials -->
+
+                <!-- BEGIN: otp -->
+                <input type="hidden" name="autologin" value="{autologin}" />
+                
+                <p>{otp_instructions_label}</p>
+
+                <p>{otp_recovery_label}</p>
+                
+                <div class="form-item">
+                    <label for="edit-otp">{otp_label}</label>
+                    <input type="number" maxlength="6" name="otp" id="edit-otp" size="10" value="" autocapitalize="off" autocorrect="off" class="form-text required" />
+                </div>
+                <!--div class="form-item">
+                    <label class="option">
+                        <input type="checkbox" name="autoverify" value="1" />
+                        {autoverify_label}
+                    </label>
+                </div-->
+                <!-- END: otp -->
+
+                <input type="submit" name="op" id="edit-submit" value="{submit_button}" class="form-default" {security_disabled} />
+                <!-- BEGIN: state -->
+                    <input type="submit" name="op" id="edit-cancel" value="{cancel_button}" />
+                    <input type="hidden" name="s" value="{state}"/>
+                <!-- END: state -->
+            </form>
+            <!-- END: login -->
+            
+            <!-- BEGIN: openid_consent -->
+            <form action="{base_path}index.php" method="post" enctype="application/x-www-form-urlencoded" id="rp-form">
+                <input type="hidden" name="q" value="openid/consent" />
+                <input type="hidden" name="s" value="{state}" />
+                <input name="tk" type="hidden" value="{token}"/>
+                
+                <!-- BEGIN: icon -->
+                <div class="icon">
+                    <img src="{icon_url}" alt="" />
+                </div>
+                <!-- END: icon -->
+                
+                <!-- BEGIN: setup -->
+                <input type="hidden" name="openid.realm" value="{realm}" />
+                
+                <p>{realm_label}</p>
+                
+                <!-- BEGIN: suspect -->
+                <div class="message unsecure">
+                    <p>{suspect_label}</p>
+                </div>
+                <!-- END: suspect -->
+                
+                <div class="form-item">
+                    <label class="option">
+                        <input class="{realm_class}" type="checkbox" name="autorelease" {auto_release} value="1" />
+                        {auto_release_label}
+                    </label>
+                </div>
+
+                {extensions}
+                
+                <input type="submit" name="op" id="edit-submit" value="{ok_button}" class="form-default" />
+                <input type="submit" name="op" id="edit-cancel" value="{cancel_button}" />
+                <!-- END: setup -->
+
+                <!-- BEGIN: cancel -->
+                <input type="hidden" name="openid.return_to" value="{return_to}" />
+                
+                <p>{unable_label}</p>
+                
+                <p>{identity_not_matching_label}</p>
+                
+                <p>{switch_user_label}</p>
+                
+                <input type="submit" name="op" id="edit-cancel" value="{cancel_button}" class="form-default" />
+                <!-- END: cancel -->                
+            </form>
+            <!-- END: openid_consent -->
+            
+            <!-- BEGIN: blocks -->
+                {blocks}
+            <!-- END: blocks -->
+
+            <!-- BEGIN: sites -->
+            <form action="{base_path}index.php" method="post" enctype="application/x-www-form-urlencoded" >
+            <input name="q" type="hidden" value="my/sites" />
+            <input name="tk" type="hidden" value="{token}"/>
+            <input name="update-all" type="hidden" value="1"/>
+            <table id="sites">
+                <thead>
+                    <tr>
+                        <th>{realm_label}</th>
+                        <th>{last_time_label}</th>
+                        <th>{auto_release_label}</th>
+                        <th>{remove_label}</th>
+                    </tr>
+                </thead>
+                <tbody>
+                    <!-- BEGIN:realm -->
+                    <tr>
+                        <td><span class="realm">{realm_name}</span></td>
+                        <td><span class="last-time">{last_time}</span> {last_time_formatted}</td>
+                        <td><input class="{realm_class}" type="checkbox" value="1" name="autorelease[{realm}]" {auto_release}/></td>
+                        <td><input type="checkbox" value="1" name="remove[{realm}]"/></td>
+                    </tr>
+                    <!-- END: realm -->
+                </tbody>
+            </table>
+            <input type="submit" name="op" id="edit-submit" value="{submit_button}" class="form-default" {disabled} />
+            </form>
+            <!-- END: sites -->
+
+            <!-- BEGIN: otp -->
+            <p>{about_otp}</p>
+
+            <p>{otp_warning}</p>
+            
+            <p>{setup_otp}</p>
+
+            <ol>
+                <li>{download_app}</li>
+                <li>{add_account}
+                    <div class="otp-key"><span class="otp-letters">{secret1}</span><span class="otp-letters">{secret5}</span><span class="otp-letters">{secret9}</span><span class="otp-letters">{secret13}</span></div>
+                    <div id="otp-key-qr"></div>
+                </li>
+                <li>{verify_code}</li>
+            </ol>
+
+            <script src="{base_path}html/jquery.qrcode.js" type="text/javascript"></script><script type="text/javascript">$('#otp-key-qr').qrcode("{qr}");</script>
+
+            <form action="{base_path}index.php" method="post" enctype="application/x-www-form-urlencoded">
+                <input type="hidden" name="q" value="otp"/><input type="hidden" name="tk" value="{token}"/>
+                
+                <div class="form-item">
+                    <label for="edit-otp">{otp_label}</label>
+                    <input type="number" maxlength="6" name="otp" id="edit-otp" size="10" value="" autocapitalize="off" autocorrect="off" class="form-text required" />
+                </div>
+                <input type="submit" name="op" id="edit-submit" value="{submit_button}" class="form-default" />
+            </form>
+
+            <!-- END: otp -->
+            
+            <!-- BEGIN: upgrade_access_denied -->
+            <p>{login_required}</p>
+            
+            <p>{edit_upgrade_php}</p>
+            
+            <ol>
+                <li>{edit_upgrade_php1}</li>
+                <li>{edit_upgrade_php2}</li>
+                <li>{edit_upgrade_php3}</li>
+                <li>{edit_upgrade_php4}</li>
+            </ol>
+            
+            <p>{simpleid_docs}</p>
+            <!-- END: upgrade_access_denied -->
+
+            <!-- BEGIN: upgrade_info -->
+            <p>{intro}</p>
+            
+            <p>{simpleid_docs}</p>
+            
+            <ol>
+                <li>{step1}</li>
+                <li>{step2}</li>
+            </ol>
+  
+            <p>{click_continue}</p>
+
+            <form method="post" action="{base_path}upgrade.php">
+                <input type="hidden" name="q" value="upgrade-selection" />
+                <input type="hidden" name="tk" value="{token}" />
+                <input type="submit" value="{continue_button}" />
+            </form>
+            <!-- END: upgrade_info -->
+            
+            <!-- BEGIN: upgrade_selection -->
+            <p>{version_detected}</p>
+            
+            <p>{original_version_label}: <strong class="upgrade-version original-version">{original_version}</strong></p>
+            
+            <p>{this_version_label}: <strong class="upgrade-version this-version">{this_version}</strong></p>
+            
+                <!-- BEGIN: selection_complete -->
+                    <p>{script_complete}</p>
+                    <!-- BEGIN: upgrade_access_check -->
+                    <div class="message unsecure">
+                        <p>{edit_upgrade_php}</p>
+                    </div>
+                    <!-- END: upgrade_access_check -->
+                <!-- END: selection_complete -->
+                
+                <!-- BEGIN: selection_continue -->
+                <p>{click_continue}</p>
+
+                <form method="post" action="{base_path}upgrade.php">
+                    <input type="hidden" name="q" value="upgrade-apply" />
+                    <input type="hidden" name="tk" value="{token}" />
+                    <input type="hidden" name="handle" value="{handle}" />
+                    <input type="submit" value="{continue_button}" />
+                </form>
+                <!-- END: selection_continue -->
+                
+            <!-- END: upgrade_selection -->
+            
+            <!-- BEGIN: upgrade_results -->
+            <p>{upgrade_complete}</p>
+            <!-- BEGIN: upgrade_access_check -->
+            <div class="message unsecure">
+                <p>{edit_upgrade_php}</p>
+            </div>
+            <!-- END: upgrade_access_check -->
+            
+            <div class="upgrade-results">
+            {results}
+            </div>
+            <!-- END: upgrade_results -->
+        </div></div>
+
+        <div id="footer">
+            <address>
+                SimpleID {version} &copy; Kelvin Mo &middot;
+                <a href="http://simpleid.org/docs/1/">{footer_doc}</a> &middot;
+                <a href="http://github.com/simpleid/simpleid/">{footer_support}</a>
+            </address>
+        </div>
+
+        <script type="text/javascript">
+        (function() {
+            var nav, nav_toggle, user, user_toggle;
+
+            nav = document.getElementById('nav');
+            nav_toggle = document.getElementById('nav-toggle');
+            user = document.getElementById('user');
+            user_toggle = document.getElementById('user-toggle');
+
+            if (nav) {
+                nav_toggle.onclick = function() {
+                    if (nav.className.indexOf('expand') !== -1) {
+                        nav.className = nav.className.replace(' expand', '');
+                        nav_toggle.className = nav_toggle.className.replace(' expand', '');
+                    } else {
+                        nav.className += ' expand';
+                        nav_toggle.className += ' expand';
+                    }
+                }
+            }
+
+            if (user) {
+                user_toggle.onclick = function() {
+                    if (user.className.indexOf('expand') !== -1) {
+                        user.className = user.className.replace(' expand', '');
+                        user_toggle.className = user_toggle.className.replace(' expand', '');
+                    } else {
+                        user.className += ' expand';
+                        user_toggle.className += ' expand';
+                    }
+                }
+            }
+        })();
+        </script>
+    </body>
+</html>
+<!-- END: main -->
+
+<!-- BEGIN: xrds --><?xml version="1.0" encoding="UTF-8"?>
+<xrds:XRDS xmlns="xri://$xrd*($v*2.0)" xmlns:xrds="xri://$xrds" xmlns:simple="http://xrds-simple.net/core/1.0">
+    <XRD version="2.0">
+        <!-- BEGIN: user_xrds -->
+        <Service priority="10">
+            <Type>http://specs.openid.net/auth/2.0/signon</Type>
+            <URI>{simpleid_base_url}</URI>
+            <!-- BEGIN: local_id2 -->
+            <LocalID>{local_id}</LocalID>            
+            <!-- END: local_id2 -->
+        </Service>
+        <Service priority="20" xmlns:openid="http://openid.net/xmlns/1.0">
+            <Type>http://openid.net/signon/1.0</Type>
+            <URI>{simpleid_base_url}</URI>
+            <!-- BEGIN: local_id -->
+            <openid:Delegate>{local_id}</openid:Delegate>
+            <!-- END: local_id -->
+        </Service>
+        <!-- END: user_xrds -->
+        <!-- BEGIN: op_xrds -->
+        <Service>
+            <Type>http://specs.openid.net/auth/2.0/server</Type>
+            <!-- Keep old domain -->
+            <Type>http://simpleid.koinic.net/type/version#{version}</Type>
+            <!-- BEGIN: type --><Type>{uri}</Type><!-- END: type -->
+            <URI>{simpleid_base_url}</URI>
+        </Service>
+        <!-- END: op_xrds -->
+    </XRD>
+</xrds:XRDS>
+<!-- END: xrds -->
+
+<!-- BEGIN: xrd --><?xml version="1.0" encoding="UTF-8"?>
+<XRD xmlns="http://docs.oasis-open.org/ns/xri/xrd-1.0">
+    {signature}
+    <!-- BEGIN: user_xrd -->
+    <Subject>{acct_uri}</Subject>
+    <Alias>{simpleid_user_uri}</Alias>
+    <!-- BEGIN: local_id -->
+    <Alias>{local_id}</Alias>
+    <!-- END: local_id -->
+    <Link rel="http://specs.openid.net/auth/2.0/provider" href="{simpleid_base_url}" />
+    <!-- END: user_xrd -->
+    <!-- BEGIN: xrd_link -->
+    <Link rel="{rel}" href="{href}" />
+    <!-- END: xrd_link -->
+</XRD>
+<!-- END: xrd -->
diff --git a/simpleid/www/html/upgrade.css b/simpleid/www/html/upgrade.css
new file mode 100644
index 0000000..780daee
--- /dev/null
+++ b/simpleid/www/html/upgrade.css
@@ -0,0 +1,14 @@
+.upgrade-version {
+    font-weight: bold;
+    font-size: 1.5em;
+}
+
+.original-version { color: #666666; }
+.this-version { color: #4A80ED; }
+
+.upgrade-results {
+    overflow: auto;
+    height: 200px;
+    border: 1px solid #666666;
+    background-color: #EEEEEE;
+}
diff --git a/simpleid/www/html/user-login.js b/simpleid/www/html/user-login.js
new file mode 100644
index 0000000..bbcc227
--- /dev/null
+++ b/simpleid/www/html/user-login.js
@@ -0,0 +1,7 @@
+$(document).ready(function() {
+    if (!$('.login-security').is('.allow-autocomplete')) $('#edit-pass').attr('autocomplete', 'off');
+    
+    if ($('#edit-name').is('.form-text')) $('#edit-name').focus();
+    if ($('#edit-otp').is('.form-text')) $('#edit-otp').focus();
+});
+
diff --git a/simpleid/www/html/user-toggle.png b/simpleid/www/html/user-toggle.png
new file mode 100644
index 0000000..a68304c
--- /dev/null
+++ b/simpleid/www/html/user-toggle.png
Binary files differ
diff --git a/simpleid/www/html/user.png b/simpleid/www/html/user.png
new file mode 100644
index 0000000..79f35cc
--- /dev/null
+++ b/simpleid/www/html/user.png
Binary files differ
diff --git a/simpleid/www/html/world.png b/simpleid/www/html/world.png
new file mode 100644
index 0000000..68f21d3
--- /dev/null
+++ b/simpleid/www/html/world.png
Binary files differ
diff --git a/simpleid/www/http.inc.php b/simpleid/www/http.inc.php
new file mode 100644
index 0000000..37c1345
--- /dev/null
+++ b/simpleid/www/http.inc.php
@@ -0,0 +1,359 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-9
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+ 
+/**
+ * Functions for making and processing HTTP requests.
+ *
+ * @package simpleid
+ * @since 0.7
+ * @filesource
+ */
+
+/**
+ * The user agent to use during HTTP requests.
+ */
+define('SIMPLEHTTP_USER_AGENT', 'SimpleHTTP/' . substr('$Rev$', 6, -2));
+
+/**
+ * Performs an HTTP request.
+ *
+ * Communication with the web server is conducted using libcurl where possible.
+ * Where libcurl does not exist, then sockets will be used.
+ *
+ * Note that the request must be properly prepared before passing onto this function.
+ * For example, for POST requests, the Content-Type and Content-Length headers must be
+ * included in $headers.
+ *
+ * @param string $url the URL
+ * @param array $headers HTTP headers containing name => value pairs
+ * @param string $body the request body
+ * @param string $method the HTTP request method
+ * @param int $retry the maximum number of redirects allowed
+ * @return array containing keys 'error-code' (for communication errors), 'error'
+ * (for communication errors), 'data' (content returned), 'code' (the HTTP status code), 'http-error'
+ * (if the HTTP status code is not 200 or 304), 'protocol' (the HTTP protocol in the response),
+ * 'headers' (an array of return headers in lowercase),
+ * 'content-type' (the HTTP content-type returned)
+ */
+function http_make_request($url, $headers = array(), $body = NULL, $method = 'GET', $retry = 3) {
+    // If CURL is available, we use it
+    if (extension_loaded('curl')) {
+        $response = _http_make_request_curl($url, $headers, $body, $method, $retry);
+    } else {
+        $response = _http_make_request_fsock($url, $headers, $body, $method, $retry);
+    }
+    
+    if (!isset($response['error-code'])) {
+        $valid_codes = array(
+            100, 101,
+            200, 201, 202, 203, 204, 205, 206,
+            300, 301, 302, 303, 304, 305, 307,
+            400, 401, 402, 403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415, 416, 417,
+            500, 501, 502, 503, 504, 505
+        );
+    
+        // RFC 2616 states that all unknown HTTP codes must be treated the same as the
+        // base code in their class.
+        if (!in_array($response['code'], $valid_codes)) {
+            $response['code'] = floor($response['code'] / 100) * 100;
+        }
+        
+        if (($response['code'] != 200) && ($response['code'] != 304)) {
+            $response['http-error'] = $response['code'];
+        }
+        
+    }
+
+    return $response;
+}
+
+/**
+ * Returns the protocols currently supported for making remote requests.
+ *
+ * If libcurl is used, this function returns a list of protocols supported by the
+ * included build of the library.  If libcurl is not used, then HTTP is the
+ * only protocol supported.
+ *
+ * @return array an array of protocols
+ */
+function http_protocols() {
+    if (extension_loaded('curl')) {
+        $curl_version = curl_version();
+        return $curl_version['protocols'];
+    } else {
+        return array('http');
+    }
+}
+
+/**
+ * Performs an HTTP request using libcurl.
+ *
+ * @param string $url the URL
+ * @param array $headers HTTP headers containing name => value pairs
+ * @param string $body the request body
+ * @param string $method the HTTP request method
+ * @param int $retry the maximum number of redirects allowed
+ * @return array containing keys 'error-code' (for communication errors), 'error'
+ * (for communication errors), 'data' (content returned), 'code' (the HTTP status code), 'http-error'
+ * (if the HTTP status code is not 200 or 304), 'headers' (an array of return headers),
+ * 'content-type' (the HTTP content-type returned)
+ */
+function _http_make_request_curl($url, $headers = array(), $body = NULL, $method = 'GET', $retry = 3) {
+    // CURLOPT_FOLLOWLOCATION only works when safe mode is off or when open_basedir is set
+    // In these instances we will need to follow redirects manually
+    $manual_redirect = ((@ini_get('safe_mode') === 1)   // safe mode
+        || (strtolower(@ini_get('safe_mode')) == 'on')  // safe mode
+        || (@ini_get('open_basedir') != false)); // open_basedir
+    
+    $version = curl_version();
+    
+    $curl = curl_init($url);
+    
+    if (version_compare($version['version'], '7.10.5', '>=')) {
+        curl_setopt($curl, CURLOPT_ENCODING, '');
+    }
+    
+    if (!$manual_redirect) curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
+    
+    curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
+    curl_setopt($curl, CURLOPT_MAXREDIRS, $retry);
+    curl_setopt($curl, CURLOPT_HTTPHEADER, array(implode("\n", $headers) . "\n"));
+    curl_setopt($curl, CURLOPT_USERAGENT, SIMPLEHTTP_USER_AGENT);
+    
+    curl_setopt($curl, CURLOPT_TIMEOUT, 20);
+    curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 20);
+    
+    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
+    curl_setopt($curl, CURLOPT_HEADER, true);
+    
+    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
+    curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
+    
+    if ($body != NULL) curl_setopt($curl, CURLOPT_POSTFIELDS, $body);
+    
+    $response = curl_exec($curl);
+    
+    if (($response === FALSE) && ((curl_errno($curl) == 23) || (curl_errno($curl) == 61))) {
+        curl_setopt($curl, CURLOPT_ENCODING, 'none');
+        $response = curl_exec($curl);
+    }
+    
+    if ($response === FALSE) {
+        $result = array();
+        $result['error-code'] = curl_errno($curl);
+        $result['error'] = curl_error($curl);
+    } else {
+        $result['code'] = curl_getinfo($curl, CURLINFO_HTTP_CODE);
+        $result['url'] = curl_getinfo($curl, CURLINFO_EFFECTIVE_URL);
+        $result['content-type'] = curl_getinfo($curl, CURLINFO_CONTENT_TYPE);
+        
+        // Parse response.
+        $result['raw'] = $response;
+        
+        $header_size = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
+        $result['data'] = substr($response, $header_size);
+        
+        $response_headers = substr($response, 0, $header_size - 4);
+
+        // In case where redirect occurs, we want the last set of headers
+        $header_blocks = explode("\r\n\r\n", $response_headers);
+        $header_block = array_pop($header_blocks);
+
+        $result = array_merge($result, _http_parse_headers($header_block, TRUE));
+        
+        // If we are in safe mode, we need to process redirects manually
+        if ($manual_redirect && (($result['code'] == 301) || ($result['code'] == 302) || ($result['code'] == 307))) {
+            if ($retry == 0) {
+                // Too many times, return an error
+                $result['error-code'] = 47;
+                $result['error'] = 'Too many redirects';
+            } else {
+                curl_close($curl);
+                return _http_make_request_curl($result['headers']['location'], $headers, $body, $method, $retry - 1);
+            }
+        }
+    }
+    
+    curl_close($curl);
+
+    return $result;
+}
+
+/**
+ * Performs an HTTP request using sockets.
+ *
+ * @param string $url the URL
+ * @param array $headers HTTP headers containing name => value pairs
+ * @param string $body the request body
+ * @param string $method the HTTP request method
+ * @param int $retry the maximum number of redirects allowed
+ * @return array containing keys 'error-code' (for communication errors), 'error'
+ * (for communication errors), 'data' (content returned), 'code' (the HTTP status code), 'http-error'
+ * (if the HTTP status code is not 200 or 304), 'headers' (an array of return headers),
+ * 'content-type' (the HTTP content-type returned)
+ */
+function _http_make_request_fsock($url, $headers = array(), $body = NULL, $method = 'GET', $retry = 3) {
+    $result = array();
+    
+    $parts = parse_url($url);
+    
+    if (!isset($parts)) {
+        $result['error-code'] = 3;
+        $result['error'] = 'URL not properly formatted';
+        return $result;
+    }
+    
+    if ($parts['scheme'] == 'http') {
+        $port = isset($parts['port']) ? $parts['port'] : 80;
+        $host = $parts['host'];
+    } elseif ($parts['scheme'] == 'https') {
+        $port = isset($parts['port']) ? $parts['port'] : 443;
+        $host = 'ssl://' . $parts['host'];
+    } else {
+        $result['error-code'] = 1;
+        $result['error'] = 'Unsupported protocol';
+    }
+    
+    $fp = @fsockopen($host, $port, $errno, $errstr, 15);
+
+    if (!$fp) {
+        $result['error-code'] = 7;
+        $result['error'] = "Cannot connect: Error $errno:" . trim($errstr);
+        return $result;
+    }
+    
+    if (isset($parts['path'])) {
+        $path = $url_parts['path'];
+        if (isset($parts['query'])) $path .= '?' . $url_parts['query'];
+    } else {
+        $path = '/';
+    }
+
+    $headers = array_merge(
+        array(
+            'Host' => $parts['host'],
+            'User-Agent' => SIMPLEHTTP_USER_AGENT,
+            'Connection' => 'close'
+        ),
+        $headers
+    );
+
+    if (isset($parts['user']) && isset($parts['pass'])) {
+        $headers['Authorization'] = 'Basic '. base64_encode($parts['user'] . (!empty($parts['pass']) ? ":". $parts['pass'] : ''));
+    }
+    
+    $request = $method . ' '. $path ." HTTP/1.0\r\n";
+    
+    $keys = array_keys($headers);
+    for ($i = 0; $i < count($keys); $i++) {
+        $request .= $keys[$i] . ': ' . $headers[$keys[$i]] . "\r\n";
+    }
+    
+    // End of headers - separator
+    $request .= "\r\n";
+    
+    if ($body != NULL) $request .= $body;
+    
+    fwrite($fp, $request);
+
+    // Fetch response.
+    $response = '';
+    while (!feof($fp) && $chunk = fread($fp, 1024)) {
+        $response .= $chunk;
+    }
+    fclose($fp);
+
+    // Parse response.
+    list($header_block, $result['data']) = explode("\r\n\r\n", $response, 2);
+    
+    $result = array_merge($result, _http_parse_headers($header_block, FALSE));
+    
+    // Process redirects
+    if (($result['code'] == 301) || ($result['code'] == 302) || ($result['code'] == 307)) {
+        if ($retry == 0) {
+            // Too many times, return an error
+            $result['error-code'] = 47;
+            $result['error'] = 'Too many redirects';
+        } else {
+            $result = _http_make_request_fsock($result['headers']['location'], $headers, $body, $method, $retry - 1);
+        }
+    }
+
+    $result['url'] = $url;
+    return $result;
+}
+
+/**
+ * Parses HTTP response headers.
+ *
+ * @param string $header_block the unparsed header block
+ * @param bool $curl if true, use simplified parsing as libcurl already parses
+ * the headers
+ * @return an array containing the following keys: 'protocol' (the HTTP protocol in the response),
+ * 'headers' (an array of return headers in lowercase).  If $curl is false, additional
+ * parsing is done for 'code' and 'content-type'
+ */
+function _http_parse_headers($header_block, $curl) {
+    $headers = array();
+    $result = array();
+    
+    // Split the status line from the rest of the message header
+    list($status, $header_block) = preg_split("/\r\n|\n|\r/", $header_block, 2);
+    
+    // RFC 2616, section 4.2: Header fields can be extended over multiple lines
+    // by preceding each extra line with at least one space or tab.  So we need
+    // to join them...
+    $header_block = preg_replace('/(\r\n|\n|\r)( |\t)+/', '', $header_block);
+    
+    // Then split them to get the fields
+    $fields = preg_split("/\r\n|\n|\r/", $header_block);
+    
+    // Parse the status line
+    list($protocol, $code, $reason) = explode(' ', trim($status), 3);
+    
+    $result['protocol'] = $protocol;    
+    if (!$curl) $result['code'] = $code;
+
+    // Parse headers.
+    while ($field = trim(array_shift($fields))) {
+        list($header, $value) = explode(':', $field, 2);
+        
+        // Headers are case insensitive
+        $header = strtolower($header);
+        
+        if (isset($headers[$header])) {
+            // RFC 2616, section 4.2: Multiple headers with the same field
+            // name is the same as a concatenating all the headers in a single
+            // header, separated by commas.
+            $headers[$header] .= ','. trim($value);
+        } else {
+            $headers[$header] = trim($value);
+        }
+        
+        if (!$curl && (strtolower($header) == 'content-type')) $result['content-type'] = $value;
+    }
+        
+    $result['headers'] = $headers;
+    return $result;
+}
+?>
diff --git a/simpleid/www/index.php b/simpleid/www/index.php
new file mode 100644
index 0000000..756e725
--- /dev/null
+++ b/simpleid/www/index.php
@@ -0,0 +1,1206 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-8
+ *
+ * Includes code Drupal OpenID module (http://drupal.org/project/openid)
+ * Rowan Kerr <rowan@standardinteractive.com>
+ * James Walker <james@bryght.com>
+ *
+ * Copyright (C) Rowan Kerr and James Walker
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+
+/**
+ * Main SimpleID file.
+ *
+ * @package simpleid
+ * @filesource
+ */
+
+include_once "version.inc.php";
+include_once "locale.inc.php";
+
+// Check if the configuration file has been defined
+if (file_exists('conf/config.php')) {
+    include_once 'conf/config.php';
+} elseif (file_exists('config.php')) {
+    include_once 'config.php';
+} else {
+    die(t('No configuration file found.  See the <a href="!url">manual</a> for instructions on how to set up a configuration file.', array('!url' => 'http://simpleid.org/docs/1/installing/')));
+}
+
+include_once "config.default.php";
+include_once "log.inc.php";
+include_once "common.inc.php";
+include_once "simpleweb.inc.php";
+include_once "openid.inc.php";
+include_once "discovery.inc.php";
+include_once "user.inc.php";
+include_once "cache.inc.php";
+include_once SIMPLEID_STORE . ".store.php";
+include_once "page.inc.php";
+include_once "lib/xtemplate.class.php";
+
+define('CACHE_DIR', SIMPLEID_CACHE_DIR);
+
+/**
+ */
+define('CHECKID_OK', 127);
+define('CHECKID_RETURN_TO_SUSPECT', 3);
+define('CHECKID_APPROVAL_REQUIRED', 2);
+define('CHECKID_LOGIN_REQUIRED', -1);
+define('CHECKID_IDENTITIES_NOT_MATCHING', -2);
+define('CHECKID_IDENTITY_NOT_EXIST', -3);
+define('CHECKID_PROTOCOL_ERROR', -127);
+
+define('ASSOCIATION_PRIVATE', 2);
+define('ASSOCIATION_SHARED', 1);
+
+
+/**
+ * This variable holds the version of the OpenID specification associated with
+ * the current OpenID request.  This can be either {@link OPENID_VERSION_1_1}
+ * or {@link OPENID_VERSION_2}.
+ *
+ * @global float $version
+ */
+$version = OPENID_VERSION_1_1;
+
+/**
+ * This variable holds an instance of the XTemplate engine.
+ *
+ * @global object $xtpl
+ */
+$xtpl = NULL;
+
+/**
+ * This variable holds the combined $_GET and $_POST superglobal arrays.
+ * This is then passed through {@link fix_http_request()}.
+ *
+ * @global array $GETPOST
+ */
+$GETPOST = array();
+
+simpleid_start();
+
+/**
+ * Entry point for SimpleID.
+ *
+ * @see user_init()
+ */
+function simpleid_start() {
+    global $xtpl, $GETPOST;
+
+    locale_init(SIMPLEID_LOCALE);
+
+    $xtpl = new XTemplate('html/template.xtpl');
+    $xtpl->assign('version', SIMPLEID_VERSION);
+    $xtpl->assign('base_path', get_base_path());
+    $xtpl->assign('footer_doc', t('Documentation'));
+    $xtpl->assign('footer_support', t('Support'));
+
+    if (!is_dir(SIMPLEID_IDENTITIES_DIR)) {
+        log_fatal('Identities directory not found.');
+        indirect_fatal_error(t('Identities directory not found.  See the <a href="!url">manual</a> for instructions on how to set up SimpleID.', array('!url' => 'http://simpleid.org/documentation/getting-started')));
+    }
+
+    if (!is_dir(SIMPLEID_CACHE_DIR) || !is_writeable(SIMPLEID_CACHE_DIR)) {
+        log_fatal('Cache directory not found or not writeable.');
+        indirect_fatal_error(t('Cache directory not found or not writeable.  See the <a href="!url">manual</a> for instructions on how to set up SimpleID.', array('!url' => 'http://simpleid.org/docs/1/installing/')));
+    }
+
+
+    if (!is_dir(SIMPLEID_STORE_DIR) || !is_writeable(SIMPLEID_STORE_DIR)) {
+        log_fatal('Store directory not found or not writeable.');
+        indirect_fatal_error(t('Store directory not found or not writeable.  See the <a href="!url">manual</a> for instructions on how to set up SimpleID.', array('!url' => 'http://simpleid.org/docs/1/installing/')));
+    }
+
+    if ((@ini_get('register_globals') === 1) || (@ini_get('register_globals') === '1') || (strtolower(@ini_get('register_globals')) == 'on')) {
+        log_fatal('register_globals is enabled in PHP configuration.');
+        indirect_fatal_error(t('register_globals is enabled in PHP configuration, which is not supported by SimpleID.  See the <a href="!url">manual</a> for further information.', array('!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+
+    if (!bignum_loaded()) {
+        log_fatal('gmp/bcmath PHP extension not loaded.');
+        indirect_fatal_error(t('One or more required PHP extensions (%extension) is not loaded.  See the <a href="!url">manual</a> for further information on system requirements.', array('%extension' => 'gmp/bcmath', '!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+    if (!function_exists('preg_match')) {
+        log_fatal('pcre PHP extension not loaded.');
+        indirect_fatal_error(t('One or more required PHP extensions (%extension) is not loaded.  See the <a href="!url">manual</a> for further information on system requirements.', array('%extension' => 'pcre', '!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+    if (!function_exists('session_start')) {
+        log_fatal('session PHP extension not loaded.');
+        indirect_fatal_error(t('One or more required PHP extensions (%extension) is not loaded.  See the <a href="!url">manual</a> for further information on system requirements.', array('%extension' => 'session', '!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+    if (!function_exists('xml_parser_create_ns')) {
+        log_fatal('xml PHP extension not loaded.');
+        indirect_fatal_error(t('One or more required PHP extensions (%extension) is not loaded.  See the <a href="!url">manual</a> for further information on system requirements.', array('%extension' => 'xml', '!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+    if (!function_exists('hash')) {
+        log_fatal('hash PHP extension not loaded.');
+        indirect_fatal_error(t('One or more required PHP extensions (%extension) is not loaded.  See the <a href="!url">manual</a> for further information on system requirements.', array('%extension' => 'hash', '!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+    if (is_numeric(@ini_get('suhosin.get.max_value_length')) && (@ini_get('suhosin.get.max_value_length') < 1024)) {
+        log_fatal('suhosin.get.max_value_length < 1024');
+        indirect_fatal_error(t('suhosin.get.max_value_length is less than 1024, which will lead to problems. See the <a href="!url">manual</a> for further information on system requirements.', array('!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+
+    fix_http_request();
+    $GETPOST = array_merge($_GET, $_POST);
+    openid_parse_request($GETPOST);
+
+    $q = (isset($GETPOST['q'])) ? $GETPOST['q'] : '';
+
+    $uaid = get_user_agent_id();
+    extension_init();
+    user_init($q);
+    log_info('Session opened for "' . $q . '" from ' . $uaid . ' [' . $_SERVER['REMOTE_ADDR'] . ', ' . gethostbyaddr($_SERVER['REMOTE_ADDR']) . ']');
+
+    // Clean stale assocations
+    cache_expire(array(
+        'association' => SIMPLEID_ASSOC_EXPIRES_IN,
+        'stateless' => 300)
+    );
+
+    simpleid_route($q);
+}
+
+/**
+ * Dispatches to the correct SimpleID function based on the request path.  The
+ * request path usually comes from the q parameter in the query string (which may
+ * be inserted by mod_rewrite), but can come from other functions as well.
+ *
+ * @param string $q the request path
+ */
+function simpleid_route($q) {
+    $routes = array(
+        'continue' => 'simpleid_continue',
+        'login' => 'user_login',
+        'logout' => 'user_logout',
+        'my/dashboard' => 'page_dashboard',
+        'my/sites' => 'page_sites',
+        'my/profile' => 'page_profile',
+        'otp' => 'user_otp_page',
+        'openid/consent' => 'simpleid_openid_consent',
+        'ppid/(.*)' => 'user_ppid_page',
+        'user' => 'user_public_page',
+        'user/(.+)' => 'user_public_page',
+        'xrds/(.*)' => 'user_xrds',
+        'xrds' => 'simpleid_xrds',
+    );
+    $routes = array_merge($routes, extension_invoke_all('routes'), array('.*' => 'simpleid_index'));
+
+    simpleweb_run($routes, $q);
+}
+
+/**
+ * The default route, called when the q parameter is missing or is invalid.
+ *
+ * This function performs the following:
+ *
+ * - If openid.mode is present, then the request is an OpenID request.  This
+ *   is passed to {@link simpleid_process_openid()}
+ * - If the Accept HTTP header contains the expression application/xrds+xml, then
+ *   the request is a YADIS discovery request for SimpleID as an OpenID provider.  Thi
+ *   is passed to {@link simpleid_xrds()}
+ * - Otherwise, the dashboard or the login page is displayed to the user as
+ *   appropriate
+ *
+ */
+function simpleid_index() {
+    global $GETPOST;
+
+    log_debug('simpleid_index');
+
+    $content_type = negotiate_content_type(array('text/html', 'application/xml', 'application/xhtml+xml', 'application/xrds+xml'));
+
+    header('Vary: Accept');
+    if (isset($GETPOST['openid.mode'])) {
+        simpleid_process_openid($GETPOST);
+        return;
+    } elseif ($content_type == 'application/xrds+xml') {
+        simpleid_xrds();
+    } else {
+        // Point to SimpleID's XRDS document
+        header('X-XRDS-Location: ' . simpleid_url('xrds'));
+        page_dashboard();
+    }
+}
+
+
+/**
+ * Process an OpenID request.
+ *
+ * This function determines the version of the OpenID specification that is
+ * relevant to this request, checks openid.mode and passes the
+ * request on to the function required to process the request.
+ *
+ * The OpenID request expressed as an array contain key-value pairs corresponding
+ * to the HTTP request.  This is usually contained in the <code>$_REQUEST</code>
+ * variable.
+ *
+ * @param array $request the OpenID request
+ */
+function simpleid_process_openid($request) {
+    global $version;
+
+    $version = openid_get_version($request);
+
+    switch ($request['openid.mode']) {
+        case 'associate':
+            simpleid_associate($request);
+            return;
+        case 'checkid_immediate':
+        case 'checkid_setup':
+            check_https('redirect', true, simpleid_url('continue', 's=' . rawurlencode(pickle($request)), false, 'https'));
+
+            return simpleid_checkid($request);
+        case 'check_authentication':
+            simpleid_check_authentication($request);
+            break;
+        default:
+            if (isset($request['openid.return_to'])) {
+                // Indirect communication - send error via indirect communication.
+                header_response_code('400 Bad Request');
+                set_message(t('Invalid OpenID message.'));
+                page_dashboard();
+            } else {
+                // Direct communication
+                openid_direct_error('Invalid OpenID message.');
+            }
+    }
+}
+
+/**
+ * Processes an association request from a relying party.
+ *
+ * An association request has an openid.mode value of
+ * associate.  This function checks whether the association request
+ * is valid, and if so, creates an association and sends the response to
+ * the relying party.
+ *
+ * @see _simpleid_create_association()
+ * @param array $request the OpenID request
+ * @link http://openid.net/specs/openid-authentication-1_1.html#mode_associate, http://openid.net/specs/openid-authentication-2_0.html#associations
+ *
+ */
+function simpleid_associate($request) {
+    global $version;
+
+    log_info('OpenID association request: ' . log_array($request));
+
+    $assoc_types = openid_association_types();
+    $session_types = openid_session_types(is_https(), $version);
+
+    // Common Request Parameters [8.1.1]
+    if (($version == OPENID_VERSION_1_1) && !isset($request['openid.session_type'])) $request['openid.session_type'] = '';
+    $assoc_type = $request['openid.assoc_type'];
+    $session_type = $request['openid.session_type'];
+
+    // Diffie-Hellman Request Parameters [8.1.2]
+    $dh_modulus = (isset($request['openid.dh_modulus'])) ? $request['openid.dh_modulus'] : NULL;
+    $dh_gen = (isset($request['openid.dh_gen'])) ? $request['openid.dh_gen'] : NULL;
+    $dh_consumer_public = $request['openid.dh_consumer_public'];
+
+    if (!isset($request['openid.session_type']) || !isset($request['openid.assoc_type'])) {
+        log_error('Association failed: openid.session_type or openid.assoc_type not set');
+        openid_direct_error('openid.session_type or openid.assoc_type not set');
+        return;
+    }
+
+    // Check if the assoc_type is supported
+    if (!array_key_exists($assoc_type, $assoc_types)) {
+        $error = array(
+            'error_code' => 'unsupported-type',
+            'session_type' => 'DH-SHA1',
+            'assoc_type' => 'HMAC-SHA1'
+        );
+        log_error('Association failed: The association type is not supported by SimpleID.');
+        openid_direct_error('The association type is not supported by SimpleID.', $error, $version);
+        return;
+    }
+    // Check if the session_type is supported
+    if (!array_key_exists($session_type, $session_types)) {
+        $error = array(
+            'error_code' => 'unsupported-type',
+            'session_type' => 'DH-SHA1',
+            'assoc_type' => 'HMAC-SHA1'
+        );
+        log_error('Association failed: The session type is not supported by SimpleID.');
+        openid_direct_error('The session type is not supported by SimpleID.', $error, $version);
+        return;
+    }
+
+    if ($session_type == 'DH-SHA1' || $session_type == 'DH-SHA256') {
+        if (!$dh_consumer_public) {
+            log_error('Association failed: openid.dh_consumer_public not set');
+            openid_direct_error('openid.dh_consumer_public not set');
+            return;
+        }
+    }
+
+    $response = _simpleid_create_association(ASSOCIATION_SHARED, $assoc_type, $session_type, $dh_modulus, $dh_gen, $dh_consumer_public);
+
+    openid_direct_response(openid_direct_message($response, $version));
+}
+
+
+/**
+ * Creates an association.
+ *
+ * This function calls {@link openid_dh_server_assoc()} where required, to
+ * generate the cryptographic values required for an association response.
+ *
+ * @param int $mode either ASSOCIATION_SHARED or ASSOCIATION_PRIVATE
+ * @param string $assoc_type a valid OpenID association type
+ * @param string $session_type a valid OpenID session type
+ * @param string $dh_modulus for Diffie-Hellman key exchange, the modulus encoded in Base64
+ * @param string $dh_gen for Diffie-Hellman key exchange, g encoded in Base64
+ * @param string $dh_consumer_public for Diffie-Hellman key exchange, the public key of the relying party encoded in Base64
+ * @return mixed if $mode is ASSOCIATION_SHARED, an OpenID response
+ * to the association request, if $mode is ASSOCIATION_PRIVATE, the
+ * association data for storage.
+ * @link http://openid.net/specs/openid-authentication-1_1.html#anchor14, http://openid.net/specs/openid-authentication-2_0.html#anchor20
+ */
+function _simpleid_create_association($mode = ASSOCIATION_SHARED, $assoc_type = 'HMAC-SHA1', $session_type = 'no-encryption', $dh_modulus = NULL, $dh_gen = NULL, $dh_consumer_public = NULL) {
+    global $version;
+
+    $assoc_types = openid_association_types();
+    $session_types = openid_session_types(is_https(), $version);
+
+    $mac_size = $assoc_types[$assoc_type]['mac_size'];
+    $hmac_func = $assoc_types[$assoc_type]['hmac_func'];
+
+    $assoc_handle = random_id();
+    $expires_in = SIMPLEID_ASSOC_EXPIRES_IN;
+
+    $secret = random_bytes($mac_size);
+
+    $response = array(
+        'assoc_handle' => $assoc_handle,
+        'assoc_type' => $assoc_type,
+        'expires_in' => $expires_in
+    );
+
+    // If $session_type is '', then it must be using OpenID 1.1 (blank parameter
+    // is not allowed for OpenID 2.0.  For OpenID 1.1 blank requests, we don't
+    // put a session_type in the response.
+    if ($session_type != '') $response['session_type'] = $session_type;
+
+    if (($session_type == 'no-encryption') || ($session_type == '')) {
+        $mac_key = base64_encode(call_user_func($hmac_func, $secret, $response['assoc_handle']));
+        $response['mac_key'] = $mac_key;
+    } elseif ($session_type == 'DH-SHA1' || $session_type == 'DH-SHA256') {
+        $hash_func = $session_types[$session_type]['hash_func'];
+
+        $dh_assoc = openid_dh_server_assoc($secret, $dh_consumer_public, $dh_modulus, $dh_gen, $hash_func);
+        $mac_key = base64_encode($secret);
+        $response['dh_server_public'] = $dh_assoc['dh_server_public'];
+        $response['enc_mac_key'] = $dh_assoc['enc_mac_key'];
+    }
+
+    $association = array('assoc_handle' => $assoc_handle, 'assoc_type' => $assoc_type, 'mac_key' => $mac_key, 'created' => time());
+    if ($mode == ASSOCIATION_PRIVATE) $association['private'] = 1;
+    cache_set('association', $assoc_handle, $association);
+
+    if ($mode == ASSOCIATION_SHARED) {
+        log_info('Created association: ' . log_array($response));
+        log_debug('***** MAC key: ' . $association['mac_key']);
+        return $response;
+    } else {
+        log_info('Created association: private; ' . log_array($association, array('assoc_handle', 'assoc_type')));
+        log_debug('***** MAC key: ' . $association['mac_key']);
+        return $association;
+    }
+}
+
+
+/**
+ * Processes an authentication request from a relying party.
+ *
+ * An authentication request has an openid.mode value of
+ * checkid_setup or checkid_immediate.
+ *
+ * If the authentication request is a standard OpenID request about an identity
+ * (i.e. contains the key openid.identity), this function calls
+ * {@link simpleid_checkid_identity()} to see whether the user logged on into SimpleID
+ * matches the identity supplied in the OpenID request.
+ *
+ * If the authentication request is not about an identity, this function calls
+ * the {@link hook_checkid() checkid hook} of the loaded extensions.
+ *
+ * Depending on the OpenID version, this function will supply an appropriate
+ * assertion.
+ *
+ * @param array $request the OpenID request
+ *
+ */
+function simpleid_checkid($request) {
+    global $version;
+
+    $immediate = ($request['openid.mode'] == 'checkid_immediate');
+
+    log_info('OpenID authentication request: ' . (($immediate) ? 'immediate' : 'setup') . '; '. log_array($request));
+
+    // Check for protocol correctness
+    if ($version == OPENID_VERSION_1_1) {
+        if (!isset($request['openid.return_to'])) {
+            log_error('Protocol Error: openid.return_to not set.');
+            indirect_fatal_error(t('Protocol Error: openid.return_to not set.'));
+            return;
+        }
+        if (!isset($request['openid.identity'])) {
+            log_error('Protocol Error: openid.identity not set.');
+            indirect_fatal_error(t('Protocol Error: openid.identity not set.'));
+            return;
+        }
+    }
+
+    if ($version >= OPENID_VERSION_2) {
+        if (isset($request['openid.identity']) && !isset($request['openid.claimed_id'])) {
+            log_error('Protocol Error: openid.identity set, but not openid.claimed_id.');
+            indirect_fatal_error(t('Protocol Error: openid.identity set, but not openid.claimed_id.'));
+            return;
+        }
+
+        if (!isset($request['openid.realm']) && !isset($request['openid.return_to'])) {
+            log_error('Protocol Error: openid.return_to not set when openid.realm is not set.');
+            indirect_fatal_error(t('Protocol Error: openid.return_to not set when openid.realm is not set.'));
+            return;
+        }
+    }
+
+    if (isset($request['openid.return_to'])) {
+        $realm = openid_get_realm($request, $version);
+
+        if (!openid_url_matches_realm($request['openid.return_to'], $realm)) {
+            log_error('Protocol Error: openid.return_to does not match realm.');
+            openid_indirect_error($request['openid.return_to'], 'Protocol Error: openid.return_to does not match realm.');
+            return;
+        }
+    }
+
+    if (isset($request['openid.identity'])) {
+        // Standard request
+        log_debug('openid.identity found, use simpleid_checkid_identity');
+        $result = simpleid_checkid_identity($request, $immediate);
+    } else {
+        log_debug('openid.identity not found, trying extensions');
+        // Extension request
+        $results = extension_invoke_all('checkid', $request, $immediate);
+
+        // Filter out nulls
+        $results = array_merge(array_diff($results, array(NULL)));
+
+        // If there are still results, it is the lowest value, otherwise, it is CHECKID_PROTOCOL_ERROR
+        $result = ($results) ? min($results) : CHECKID_PROTOCOL_ERROR;
+    }
+
+    switch ($result) {
+        case CHECKID_APPROVAL_REQUIRED:
+            log_info('CHECKID_APPROVAL_REQUIRED');
+            if ($immediate) {
+                $response = simpleid_checkid_approval_required($request);
+                simpleid_assertion_response($response, $request['openid.return_to']);
+            } else {
+                $response = simpleid_checkid_ok($request);
+                simpleid_openid_consent_form($request, $response, $result);
+            }
+            break;
+        case CHECKID_RETURN_TO_SUSPECT:
+            log_info('CHECKID_RETURN_TO_SUSPECT');
+            if ($immediate) {
+                $response = simpleid_checkid_error($request, $immediate);
+                simpleid_assertion_response($response, $request['openid.return_to']);
+            } else {
+                $response = simpleid_checkid_ok($request);
+                simpleid_openid_consent_form($request, $response, $result);
+            }
+            break;
+        case CHECKID_OK:
+            log_info('CHECKID_OK');
+            $response = simpleid_checkid_ok($request);
+            $response = simpleid_sign($response, isset($request['openid.assoc_handle']) ? $request['openid.assoc_handle'] : NULL);
+            simpleid_assertion_response($response, $request['openid.return_to']);
+            break;
+        case CHECKID_LOGIN_REQUIRED:
+            log_info('CHECKID_LOGIN_REQUIRED');
+            if ($immediate) {
+                $response = simpleid_checkid_login_required($request);
+                simpleid_assertion_response($response, $request['openid.return_to']);
+            } else {
+                user_login_form('continue', pickle($request));
+                exit;
+            }
+            break;
+        case CHECKID_IDENTITIES_NOT_MATCHING:
+        case CHECKID_IDENTITY_NOT_EXIST:
+            log_info('CHECKID_IDENTITIES_NOT_MATCHING | CHECKID_IDENTITY_NOT_EXIST');
+            $response = simpleid_checkid_error($request, $immediate);
+            if ($immediate) {
+                simpleid_assertion_response($response, $request['openid.return_to']);
+            } else {
+                simpleid_openid_consent_form($request, $response, $result);
+            }
+            break;
+        case CHECKID_PROTOCOL_ERROR:
+            if (isset($request['openid.return_to'])) {
+                $response = simpleid_checkid_error($request, $immediate);
+                simpleid_assertion_response($response, $request['openid.return_to']);
+            } else {
+                indirect_fatal_error('Unrecognised request.');
+            }
+            break;
+    }
+}
+
+/**
+ * Processes a standard OpenID authentication request about an identity.
+ *
+ * Checks whether the current user logged into SimpleID matches the identity
+ * supplied in an OpenID request.
+ *
+ * @param array &$request the OpenID request
+ * @param bool $immediate whether checkid_immediate was used
+ * @return int one of CHECKID_OK, CHECKID_APPROVAL_REQUIRED, CHECKID_RETURN_TO_SUSPECT, CHECKID_IDENTITY_NOT_EXIST,
+ * CHECKID_IDENTITIES_NOT_MATCHING, CHECKID_LOGIN_REQUIRED or CHECKID_PROTOCOL_ERROR
+ * @global array the current logged in user
+ */
+function simpleid_checkid_identity(&$request, $immediate) {
+    global $user, $version;
+
+    $realm = openid_get_realm($request, $version);
+
+    // Check 1: Is the user logged into SimpleID as any user?
+    if ($user == NULL) {
+        return CHECKID_LOGIN_REQUIRED;
+    } else {
+        $uid = $user['uid'];
+    }
+
+    // Check 2: Is the user logged in as the same identity as the identity requested?
+    // Choose the identity URL for the user automatically
+    if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {
+        $test_user = user_load($uid);
+        $identity = $test_user['identity'];
+
+        log_info('OpenID identifier selection: Selected ' . $uid . ' [' . $identity . ']');
+    } else {
+        $identity = $request['openid.identity'];
+        $test_user = user_load_from_identity($identity);
+    }
+    if ($test_user == NULL) return CHECKID_IDENTITY_NOT_EXIST;
+    if ($test_user['uid'] != $user['uid']) {
+        log_notice('Requested user ' . $test_user['uid'] . ' does not match logged in user ' . $user['uid']);
+        return CHECKID_IDENTITIES_NOT_MATCHING;
+    }
+
+    // Pass the assertion to extensions
+    $assertion_results = extension_invoke_all('checkid_identity', $request, $identity, $immediate);
+    $assertion_results = array_merge(array_diff($assertion_results, array(NULL)));
+
+    // Populate the request with the selected identity
+    if ($request['openid.identity'] == OPENID_IDENTIFIER_SELECT) {
+        $request['openid.claimed_id'] = $identity;
+        $request['openid.identity'] = $identity;
+    }
+
+    // Check 3: Discover the realm and match its return_to
+    $user_rp = (isset($user['rp'][$realm])) ? $user['rp'][$realm] : NULL;
+
+    if (($version >= OPENID_VERSION_2) && SIMPLEID_VERIFY_RETURN_URL_USING_REALM) {
+        $verified = FALSE;
+
+        $rp_info = simpleid_get_rp_info($realm);
+        $services = discovery_xrds_services_by_type($rp_info['services'], OPENID_RETURN_TO);
+
+        log_info('OpenID 2 discovery: ' . count($services) . ' matching services');
+
+        if ($services) {
+            $return_to_uris = array();
+
+            foreach ($services as $service) {
+                $return_to_uris = array_merge($return_to_uris, $service['uri']);
+            }
+            foreach ($return_to_uris as $return_to) {
+                if (openid_url_matches_realm($request['openid.return_to'], $return_to)) {
+                    log_info('OpenID 2 discovery: verified');
+                    $verified = TRUE;
+                    break;
+                }
+            }
+        }
+
+        $rp_info['return_to_verified'] = $verified;
+        simpleid_set_rp_info($realm, $rp_info);
+
+        if (!$verified) {
+            if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {
+                log_notice('OpenID 2 discovery: not verified, but overridden by user preference');
+            } else {
+                log_notice('OpenID 2 discovery: not verified');
+                $assertion_results[] = CHECKID_RETURN_TO_SUSPECT;
+            }
+        }
+    }
+
+    // Check 4: For checkid_immediate, the user must already have given
+    // permission to log in automatically.
+    if (($user_rp != NULL) && ($user_rp['auto_release'] == 1)) {
+        log_info('Automatic set for realm ' . $realm);
+        $assertion_results[] = CHECKID_OK;
+        return min($assertion_results);
+    } else {
+        $assertion_results[] = CHECKID_APPROVAL_REQUIRED;
+        return min($assertion_results);
+    }
+}
+
+/**
+ * Obtains information on a relying party by performing discovery on them.  Information
+ * obtained includes the discovery URL, the parsed XRDS document, and any other
+ * information saved by SimpleID extensions
+ *
+ * The results are cached for 1 hour.  For performance reasons, stale results may
+ * be obtained by using the $allow_stale parameter
+ *
+ * @param string $realm the openid.realm parameter
+ * @param bool $allow_stale allow stale results to be returned, otherwise discovery
+ * will occur
+ * @return array containing information on a relying party.
+ * @link http://openid.net/specs/openid-authentication-2_0.html#rp_discovery
+ * @since 0.8
+ */
+function simpleid_get_rp_info($realm, $allow_stale = FALSE) {
+    $url = openid_realm_discovery_url($realm);
+
+    log_info('simpleid_get_rp_info');
+
+    $rp_info = cache_get('rp-info', $realm);
+
+    if (($rp_info == NULL) || (!isset($rp_info['updated'])) || (!$allow_stale && ($rp_info['updated'] < time() - 3600))) {
+        log_info('OpenID 2 RP discovery: realm: ' . $realm . '; url: ' . $url);
+
+        $rp_info = array(
+            'url' => $url,
+            'services' => discovery_xrds_discover($url),
+            'updated' => time()
+        );
+
+        cache_set('rp-info', $realm, $rp_info);
+    }
+
+    return $rp_info;
+}
+
+/**
+ * Saves information on a relying party to disk.
+ *
+ * @param string $realm the openid.realm parameter
+ * @param array $rp_info containing information on a relying party.
+ *
+ * @since 0.8
+ */
+function simpleid_set_rp_info($realm, $rp_info) {
+    if (!isset($rp_info['updated'])) $rp_info['updated'] = time();
+    cache_set('rp-info', $realm, $rp_info, $rp_info['updated']);
+}
+
+/**
+ * Returns an OpenID response indicating a positive assertion.
+ *
+ * @param array $request the OpenID request
+ * @return array an OpenID response with a positive assertion
+ * @link http://openid.net/specs/openid-authentication-1_1.html#anchor17, http://openid.net/specs/openid-authentication-1_1.html#anchor23, http://openid.net/specs/openid-authentication-2_0.html#positive_assertions
+ */
+function simpleid_checkid_ok($request) {
+    global $version;
+
+    $message = array(
+        'openid.mode' => 'id_res',
+        'openid.op_endpoint' => simpleid_url(),
+        'openid.response_nonce' => openid_nonce()
+    );
+
+    if (isset($request['openid.assoc_handle'])) $message['openid.assoc_handle'] = $request['openid.assoc_handle'];
+    if (isset($request['openid.identity'])) $message['openid.identity'] = $request['openid.identity'];
+    if (isset($request['openid.return_to'])) $message['openid.return_to'] = $request['openid.return_to'];
+
+    if (($version >= OPENID_VERSION_2) && isset($request['openid.claimed_id'])) {
+        $message['openid.claimed_id'] = $request['openid.claimed_id'];
+    }
+
+    $message = array_merge($message, extension_invoke_all('response', TRUE, $request));
+
+    log_info('OpenID authentication response: ' . log_array($message));
+    return openid_indirect_message($message, $version);
+}
+
+/**
+ * Returns an OpenID response indicating a negative assertion to a
+ * checkid_immediate request, where an approval of the relying party by the
+ * user is required
+ *
+ * @param mixed $request the OpenID request
+ * @return mixed an OpenID response with a negative assertion
+ * @link http://openid.net/specs/openid-authentication-1_1.html#anchor17, http://openid.net/specs/openid-authentication-1_1.html#anchor23, http://openid.net/specs/openid-authentication-2_0.html#negative_assertions
+ */
+function simpleid_checkid_approval_required($request) {
+    global $version;
+
+    if ($version >= OPENID_VERSION_2) {
+        $message = array('openid.mode' => 'setup_needed');
+    } else {
+        $request['openid.mode'] = 'checkid_setup';
+        $message = array(
+            'openid.mode' => 'id_res',
+            'openid.user_setup_url' => simpleid_url('continue', 's=' . rawurlencode(pickle($request)))
+        );
+    }
+
+    $message = array_merge($message, extension_invoke_all('response', FALSE, $request));
+
+    log_info('OpenID authentication response: ' . log_array($message));
+    return openid_indirect_message($message, $version);
+}
+
+/**
+ * Returns an OpenID response indicating a negative assertion to a
+ * checkid_immediate request, where the user has not logged in.
+ *
+ * @param array $request the OpenID request
+ * @return array an OpenID response with a negative assertion
+ * @link http://openid.net/specs/openid-authentication-1_1.html#anchor17, http://openid.net/specs/openid-authentication-1_1.html#anchor23, http://openid.net/specs/openid-authentication-2_0.html#negative_assertions
+ */
+function simpleid_checkid_login_required($request) {
+    global $version;
+
+    if ($version >= OPENID_VERSION_2) {
+        $message = array('openid.mode' => 'setup_needed');
+    } else {
+        $message = array(
+            'openid.mode' => 'id_res',
+            'openid.user_setup_url' => simpleid_url('login', 'destination=continue&s=' . rawurlencode(pickle($request)))
+        );
+    }
+
+    $message = array_merge($message, extension_invoke_all('response', FALSE, $request));
+
+    log_info('OpenID authentication response: ' . log_array($message));
+    return openid_indirect_message($message, $version);
+}
+
+/**
+ * Returns an OpenID response indicating a generic negative assertion.
+ *
+ * The content of the negative version depends on the OpenID version, and whether
+ * the openid.mode of the request was checkid_immediate
+ *
+ * @param array $request the OpenID request
+ * @param bool $immediate true if openid.mode of the request was checkid_immediate
+ * @return array an OpenID response with a negative assertion
+ * @link http://openid.net/specs/openid-authentication-1_1.html#anchor17, http://openid.net/specs/openid-authentication-1_1.html#anchor23, http://openid.net/specs/openid-authentication-2_0.html#negative_assertions
+ */
+function simpleid_checkid_error($request, $immediate = false) {
+    global $version;
+
+    $message = array();
+    if ($immediate) {
+        if ($version >= OPENID_VERSION_2) {
+            $message['openid.mode'] = 'setup_needed';
+        } else {
+            $message['openid.mode'] = 'id_res';
+        }
+    } else {
+        $message['openid.mode'] = 'cancel';
+    }
+
+    $message = array_merge($message, extension_invoke_all('response', FALSE, $request));
+
+    log_info('OpenID authentication response: ' . log_array($message));
+    return openid_indirect_message($message, $version);
+}
+
+/**
+ * Signs an OpenID response, using signature information from an association
+ * handle.
+ *
+ * @param array &$response the OpenID response
+ * @param array $assoc_handle the association handle containing key information
+ * for the signature.  If $assoc_handle is not specified, a private association
+ * is created
+ * @return array the signed OpenID response
+ *
+ */
+function simpleid_sign(&$response, $assoc_handle = NULL) {
+    global $version;
+
+    if (!$assoc_handle) {
+        $assoc = _simpleid_create_association(ASSOCIATION_PRIVATE);
+        $response['openid.assoc_handle'] = $assoc['assoc_handle'];
+    } else {
+        $assoc = cache_get('association', $assoc_handle);
+
+        if (!is_array($assoc) || ($assoc['created'] + SIMPLEID_ASSOC_EXPIRES_IN < time())) {
+            // Association has expired, need to create a new one
+            log_notice('Association handle ' . ($assoc['assoc_handle'] ?? '(none)') . ' expired.  Using stateless mode.');
+            $response['openid.invalidate_handle'] = $assoc_handle;
+            $assoc = _simpleid_create_association(ASSOCIATION_PRIVATE);
+            $response['openid.assoc_handle'] = $assoc['assoc_handle'];
+        }
+    }
+
+    // If we are using stateless mode, then we need to cache the response_nonce
+    // so that the RP can only verify once
+    if (isset($assoc['private']) && ($assoc['private'] == 1) && isset($response['openid.response_nonce'])) {
+        cache_set('stateless', $response['openid.response_nonce'], array(
+            'response_nonce' => $response['openid.response_nonce'],
+            'assoc_handle' => $response['openid.assoc_handle']));
+    }
+
+    // Get all the signed fields [10.1]
+    openid_parse_request($response); // Fill the namespace array
+    $signed_fields = array('op_endpoint', 'return_to', 'response_nonce', 'assoc_handle', 'identity', 'claimed_id');
+    $signed_fields = array_merge($signed_fields, extension_invoke_all('signed_fields', $response));
+
+    // Check if the signed keys are actually present
+    $to_sign = array();
+    foreach ($signed_fields as $field) {
+        if (isset($response['openid.' . $field])) $to_sign[] = $field;
+    }
+
+    $response['openid.signed'] = implode(',', $to_sign);
+
+    // Generate signature for this message
+    $mac_key = $assoc['mac_key'];
+    $assoc_types = openid_association_types();
+    $hmac_func = $assoc_types[$assoc['assoc_type']]['hmac_func'];
+
+    $response['openid.sig'] = openid_sign($response, $to_sign, $mac_key, $hmac_func, $version);
+
+    log_info('OpenID signed authentication response: ' . log_array($response));
+
+    return $response;
+}
+
+/**
+ * Processes a direct verification request.  This is used in the OpenID specification
+ * to verify signatures generated using stateless mode.
+ *
+ * @param array $request the OpenID request
+ * @see http://openid.net/specs/openid-authentication-1_1.html#mode_check_authentication, http://openid.net/specs/openid-authentication-2_0.html#verifying_signatures
+ */
+function simpleid_check_authentication($request) {
+    global $version;
+
+    log_info('OpenID direct verification: ' . log_array($request));
+
+    $is_valid = simpleid_verify_signatures($request);
+
+    if ($is_valid) {
+        $response = array('is_valid' => 'true');
+    } else {
+        $response = array('is_valid' => 'false');
+    }
+
+    // RP wants to check whether a handle is invalid
+    if (isset($request['openid.invalidate_handle'])) {
+        $invalid_assoc = cache_get('association', $request['openid.invalidate_handle']);
+
+        if (!$invalid_assoc || ($invalid_assoc['created'] + SIMPLEID_ASSOC_EXPIRES_IN < time())) {
+            // Yes, it's invalid
+            $response['invalidate_handle'] = $request['openid.invalidate_handle'];
+        }
+    }
+
+    log_info('OpenID direct verification response: ' . log_array($response));
+
+    openid_direct_response(openid_direct_message($response, $version));
+}
+
+/**
+ * Verifies the signature of a signed OpenID request/response.
+ *
+ * @param array $request the OpenID request/response
+ * @return bool true if the signature is verified
+ * @since 0.8
+ */
+function simpleid_verify_signatures($request) {
+    global $version;
+
+    log_info('simpleid_verify_signatures');
+
+    $is_valid = TRUE;
+
+    $assoc = (isset($request['openid.assoc_handle'])) ? cache_get('association', $request['openid.assoc_handle']) : NULL;
+    $stateless = (isset($request['openid.response_nonce'])) ? cache_get('stateless', $request['openid.response_nonce']) : NULL;
+
+    if (!$assoc) {
+        log_notice('simpleid_verify_signatures: Association not found.');
+        $is_valid = FALSE;
+    } elseif (!$assoc['assoc_type']) {
+        log_error('simpleid_verify_signatures: Association does not contain valid assoc_type.');
+        $is_valid = FALSE;
+    } elseif (!isset($assoc['private']) || ($assoc['private'] != 1)) {
+        log_warn('simpleid_verify_signatures: Attempting to verify an association with a shared key.');
+        $is_valid = FALSE;
+    } elseif (!$stateless || ($stateless['assoc_handle'] != $request['openid.assoc_handle'])) {
+        log_warn('simpleid_verify_signatures: Attempting to verify a response_nonce more than once, or private association expired.');
+        $is_valid = FALSE;
+    } else {
+        $mac_key = $assoc['mac_key'];
+        $assoc_types = openid_association_types();
+        $hmac_func = $assoc_types[$assoc['assoc_type']]['hmac_func'];
+
+        $signed_keys = explode(',', $request['openid.signed']);
+        $signature = openid_sign($request, $signed_keys, $mac_key, $hmac_func, $version);
+        log_debug('***** Signature: ' . $signature);
+
+        if ($signature != $request['openid.sig']) {
+            log_warn('simpleid_verify_signatures: Signature supplied in request does not match the signatured generated.');
+            $is_valid = FALSE;
+        }
+
+        cache_delete('stateless', $request['openid.response_nonce']);
+    }
+
+    return $is_valid;
+}
+
+
+/**
+ * Continues an OpenID authentication request.
+ *
+ * This function decodes an OpenID authentication request specified in the
+ * s request parameter and feeds it to the
+ * {@link simpleid_process_openid} function.  This allows SimpleID to preserve
+ * the state of an OpenID request.
+ */
+function simpleid_continue() {
+    global $GETPOST;
+
+    $request = unpickle($GETPOST['s']);
+    openid_parse_request($request);
+    simpleid_process_openid($request);
+}
+
+/**
+ * Provides a form for user consent of an OpenID relying party, where the
+ * {@link simpleid_checkid_identity()} function returns a CHECKID_APPROVAL_REQUIRED
+ * or CHECKID_RETURN_TO_SUSPECT.
+ *
+ * Alternatively, provide a form for the user to rectify the situation where
+ * {@link simpleid_checkid_identity()} function returns a CHECKID_IDENTITIES_NOT_MATCHING
+ * or CHECKID_IDENTITY_NOT_EXIST
+ *
+ * @param array $request the original OpenID request
+ * @param array $response the proposed OpenID response, subject to user
+ * verification
+ * @param int $reason either CHECKID_APPROVAL_REQUIRED, CHECKID_RETURN_TO_SUSPECT,
+ * CHECKID_IDENTITIES_NOT_MATCHING or CHECKID_IDENTITY_NOT_EXIST
+ */
+function simpleid_openid_consent_form($request, $response, $reason = CHECKID_APPROVAL_REQUIRED) {
+    global $user;
+    global $xtpl;
+    global $version;
+
+    $request_state = pickle($request);
+
+    user_header($request_state);
+
+    $realm = openid_get_realm($request, $version);
+
+    $xtpl->assign('token', get_form_token('rp'));
+    $xtpl->assign('state', pickle($response));
+    $xtpl->assign('realm', htmlspecialchars($realm, ENT_QUOTES, 'UTF-8'));
+
+    $xtpl->assign('cancel_button', t('Cancel'));
+
+    if ($response['openid.mode'] == 'cancel') {
+        $xtpl->assign('return_to', htmlspecialchars($request['openid.return_to'], ENT_QUOTES, 'UTF-8'));
+
+        $xtpl->assign('unable_label', t('Unable to log into <strong class="realm">@realm</strong>.', array('@realm' => $realm)));
+        $xtpl->assign('identity_not_matching_label', t('Your current identity does not match the requested identity %identity.', array('%identity' => $request['openid.identity'])));
+        $xtpl->assign('switch_user_label', t('<a href="!url">Switch to a different user</a> and try again.', array('!url' => simpleid_url('logout', 'destination=continue&s=' . rawurlencode($request_state), true))));
+
+        $xtpl->parse('main.openid_consent.cancel');
+    } else {
+        $xtpl->assign('javascript', '<script src="' . get_base_path() . 'html/openid-consent.js" type="text/javascript"></script>');
+
+        $rp = (isset($user['rp'][$realm])) ? $user['rp'][$realm] : NULL;
+
+        $extensions = extension_invoke_all('consent_form', $request, $response, $rp);
+        $xtpl->assign('extensions', implode($extensions));
+
+        if ($reason == CHECKID_RETURN_TO_SUSPECT) {
+            $xtpl->assign('suspect_label', t('Warning: This web site has not confirmed its identity and might be fraudulent.  Do not share any personal information with this web site unless you are sure it is legitimate. See the <a href="!url" class="popup">SimpleID documentation for details</a> (OpenID version 2.0 return_to discovery failure)',
+                array('!url' => 'http://simpleid.org/docs/1/return_to/')));
+
+            $xtpl->parse('main.openid_consent.setup.suspect');
+            $xtpl->assign('realm_class', 'return-to-suspect');
+        }
+
+        $xtpl->assign('realm_label', t('You are being logged into <strong class="realm">@realm</strong>.', array('@realm' => $realm)));
+        $xtpl->assign('auto_release_label', t('Automatically send my information to this site for any future requests.'));
+        $xtpl->assign('ok_button', t('OK'));
+
+        $xtpl->parse('main.openid_consent.setup');
+    }
+
+    $xtpl->parse('main.openid_consent');
+
+    $xtpl->assign(array('js_locale_label' => 'openid_suspect', 'js_locale_text' => addslashes(t('This web site has not confirmed its identity and might be fraudulent.')) . '\n\n' . addslashes(t('Are you sure you wish to automatically send your information to this site for any future requests?'))));
+    $xtpl->parse('main.js_locale');
+
+    $xtpl->parse('main.framekiller');
+
+    header('X-Frame-Options: DENY');
+
+    $xtpl->assign('title', t('OpenID Login'));
+    $xtpl->assign('page_class', 'dialog-page');
+    $xtpl->parse('main');
+
+    $xtpl->out('main');
+}
+
+
+/**
+ * Processes a user response from the {@link simpleid_openid_consent_form()} function.
+ *
+ * If the user verifies the relying party, an OpenID response will be sent to
+ * the relying party.  Otherwise, the dashboard will be displayed to the user.
+ *
+ */
+function simpleid_openid_consent() {
+    global $xtpl, $user, $version, $GETPOST;
+
+    if ($user == NULL) {
+        user_login_form('');
+        return;
+    }
+
+    if (!validate_form_token($GETPOST['tk'], 'rp')) {
+        set_message(t('SimpleID detected a potential security attack.  Please try again.'));
+        $xtpl->assign('title', t('OpenID Login'));
+        $xtpl->parse('main');
+        $xtpl->out('main');
+        return;
+    }
+
+    $uid = $user['uid'];
+
+    $response = unpickle($GETPOST['s']);
+    $version = openid_get_version($response);
+    openid_parse_request($response);
+    $return_to = $response['openid.return_to'];
+    if (!$return_to) $return_to = $GETPOST['openid.return_to'];
+
+    if ($GETPOST['op'] == t('Cancel')) {
+        $response = simpleid_checkid_error(false);
+        if (!$return_to) set_message(t('Log in cancelled.'));
+    } else {
+        $now = time();
+        $realm = $GETPOST['openid.realm'];
+
+        if (isset($user['rp'][$realm])) {
+            $rp = $user['rp'][$realm];
+        } else {
+            $rp = array('realm' => $realm, 'first_time' => $now);
+        }
+        $rp['last_time'] = $now;
+        $rp['auto_release'] = (isset($GETPOST['autorelease']) && $GETPOST['autorelease']) ? 1 : 0;
+
+        // Mimic extension_invoke_all, but allow for passing by reference {{
+        global $simpleid_extensions;
+
+        foreach ($simpleid_extensions as $extension) {
+            $consent_function = $extension . '_consent';
+            if (function_exists($consent_function)) {
+                $consent_function($GETPOST, $response, $rp);
+            }
+        }
+        // }}
+
+        $user['rp'][$realm] = $rp;
+        user_save($user);
+
+        $response = simpleid_sign($response, isset($response['openid.assoc_handle']) ? $response['openid.assoc_handle'] : NULL);
+        if (!$return_to) set_message(t('You were logged in successfully.'));
+    }
+
+    if ($return_to) {
+        simpleid_assertion_response($response, $return_to);
+    } else {
+        page_dashboard();
+    }
+}
+
+/**
+ * Sends an OpenID assertion response.
+ *
+ * The OpenID specification version 2.0 provides for the sending of assertions
+ * via indirect communication.  However, future versions of the OpenID
+ * specification may provide for sending of assertions via direct communication.
+ *
+ * @param array $response the signed OpenID assertion response to send
+ * @param string $indirect_url the URL to which the OpenID response is sent.  If
+ * this is an empty string, the response is sent via direct communication
+ */
+function simpleid_assertion_response($response, $indirect_url = NULL) {
+    global $xtpl, $version;
+
+    if ($indirect_url) {
+        // We want to see if the extensions want to change the way indirect responses are made
+        $results = extension_invoke_all('indirect_response', $indirect_url, $response);
+        $results = array_filter($results, 'is_null');
+        $component = ($results) ? max($results) : OPENID_RESPONSE_QUERY;
+
+        openid_indirect_response($indirect_url, $response, $component);
+    } else {
+        openid_direct_response(openid_direct_message($response, $version));
+    }
+}
+
+/**
+ * Displays the XRDS document for this SimpleID installation.
+ *
+ */
+function simpleid_xrds() {
+    global $xtpl;
+
+    log_debug('Providing XRDS.');
+
+    header('Content-Type: application/xrds+xml');
+    header('Content-Disposition: inline; filename=yadis.xml');
+
+    $types = extension_invoke_all('xrds_types');
+    foreach ($types as $type) {
+        $xtpl->assign('uri', htmlspecialchars($type, ENT_QUOTES, 'UTF-8'));
+        $xtpl->parse('xrds.op_xrds.type');
+    }
+
+    $xtpl->assign('simpleid_base_url', htmlspecialchars(simpleid_url(), ENT_QUOTES, 'UTF-8'), false, 'detect');
+    $xtpl->parse('xrds.op_xrds');
+    $xtpl->parse('xrds');
+    $xtpl->out('xrds');
+}
+
+
+?>
diff --git a/simpleid/www/lib/gettext/gettext.inc.php b/simpleid/www/lib/gettext/gettext.inc.php
new file mode 100644
index 0000000..00b9666
--- /dev/null
+++ b/simpleid/www/lib/gettext/gettext.inc.php
@@ -0,0 +1,536 @@
+<?php
+/*
+   Copyright (c) 2005 Steven Armstrong <sa at c-area dot ch>
+   Copyright (c) 2009 Danilo Segan <danilo@kvota.net>
+
+   Drop in replacement for native gettext.
+
+   This file is part of PHP-gettext.
+
+   PHP-gettext is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   PHP-gettext is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with PHP-gettext; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+/*
+LC_CTYPE        0
+LC_NUMERIC      1
+LC_TIME         2
+LC_COLLATE      3
+LC_MONETARY     4
+LC_MESSAGES     5
+LC_ALL          6
+*/
+
+// LC_MESSAGES is not available if php-gettext is not loaded
+// while the other constants are already available from session extension.
+if (!defined('LC_MESSAGES')) {
+  define('LC_MESSAGES',	5);
+}
+
+require('streams.php');
+require('gettext.php');
+
+
+// Variables
+
+global $text_domains, $default_domain, $LC_CATEGORIES, $EMULATEGETTEXT, $CURRENTLOCALE;
+$text_domains = array();
+$default_domain = 'messages';
+$LC_CATEGORIES = array('LC_CTYPE', 'LC_NUMERIC', 'LC_TIME', 'LC_COLLATE', 'LC_MONETARY', 'LC_MESSAGES', 'LC_ALL');
+$EMULATEGETTEXT = 0;
+$CURRENTLOCALE = '';
+
+/* Class to hold a single domain included in $text_domains. */
+class domain {
+  var $l10n;
+  var $path;
+  var $codeset;
+}
+
+// Utility functions
+
+/**
+ * Return a list of locales to try for any POSIX-style locale specification.
+ */
+function get_list_of_locales($locale) {
+  /* Figure out all possible locale names and start with the most
+   * specific ones.  I.e. for sr_CS.UTF-8@latin, look through all of
+   * sr_CS.UTF-8@latin, sr_CS@latin, sr@latin, sr_CS.UTF-8, sr_CS, sr.
+   */
+  $locale_names = array();
+  $lang = NULL;
+  $country = NULL;
+  $charset = NULL;
+  $modifier = NULL;
+  if ($locale) {
+    if (preg_match("/^(?P<lang>[a-z]{2,3})"              // language code
+                   ."(?:_(?P<country>[A-Z]{2}))?"           // country code
+                   ."(?:\.(?P<charset>[-A-Za-z0-9_]+))?"    // charset
+                   ."(?:@(?P<modifier>[-A-Za-z0-9_]+))?$/",  // @ modifier
+                   $locale, $matches)) {
+
+      if (isset($matches["lang"])) $lang = $matches["lang"];
+      if (isset($matches["country"])) $country = $matches["country"];
+      if (isset($matches["charset"])) $charset = $matches["charset"];
+      if (isset($matches["modifier"])) $modifier = $matches["modifier"];
+
+      if ($modifier) {
+        if ($country) {
+          if ($charset)
+            array_push($locale_names, "${lang}_$country.$charset@$modifier");
+          array_push($locale_names, "${lang}_$country@$modifier");
+        } elseif ($charset)
+            array_push($locale_names, "${lang}.$charset@$modifier");
+        array_push($locale_names, "$lang@$modifier");
+      }
+      if ($country) {
+        if ($charset)
+          array_push($locale_names, "${lang}_$country.$charset");
+        array_push($locale_names, "${lang}_$country");
+      } elseif ($charset)
+          array_push($locale_names, "${lang}.$charset");
+      array_push($locale_names, $lang);
+    }
+
+    // If the locale name doesn't match POSIX style, just include it as-is.
+    if (!in_array($locale, $locale_names))
+      array_push($locale_names, $locale);
+  }
+  return $locale_names;
+}
+
+/**
+ * Utility function to get a StreamReader for the given text domain.
+ */
+function _get_reader($domain=null, $category=5, $enable_cache=true) {
+    global $text_domains, $default_domain, $LC_CATEGORIES;
+    if (!isset($domain)) $domain = $default_domain;
+    if (!isset($text_domains[$domain]->l10n)) {
+        // get the current locale
+        $locale = _setlocale(LC_MESSAGES, 0);
+        $bound_path = isset($text_domains[$domain]->path) ?
+          $text_domains[$domain]->path : './';
+        $subpath = $LC_CATEGORIES[$category] ."/$domain.mo";
+
+        $locale_names = get_list_of_locales($locale);
+        $input = null;
+        foreach ($locale_names as $locale) {
+          $full_path = $bound_path . $locale . "/" . $subpath;
+          if (file_exists($full_path)) {
+            $input = new FileReader($full_path);
+            break;
+          }
+        }
+
+        if (!array_key_exists($domain, $text_domains)) {
+          // Initialize an empty domain object.
+          $text_domains[$domain] = new domain();
+        }
+        $text_domains[$domain]->l10n = new gettext_reader($input,
+                                                          $enable_cache);
+    }
+    return $text_domains[$domain]->l10n;
+}
+
+/**
+ * Returns whether we are using our emulated gettext API or PHP built-in one.
+ */
+function locale_emulation() {
+    global $EMULATEGETTEXT;
+    return $EMULATEGETTEXT;
+}
+
+/**
+ * Checks if the current locale is supported on this system.
+ */
+function _check_locale_and_function($function=false) {
+    global $EMULATEGETTEXT;
+    if ($function and !function_exists($function))
+        return false;
+    return !$EMULATEGETTEXT;
+}
+
+/**
+ * Get the codeset for the given domain.
+ */
+function _get_codeset($domain=null) {
+    global $text_domains, $default_domain, $LC_CATEGORIES;
+    if (!isset($domain)) $domain = $default_domain;
+    return (isset($text_domains[$domain]->codeset))? $text_domains[$domain]->codeset : ini_get('mbstring.internal_encoding');
+}
+
+/**
+ * Convert the given string to the encoding set by bind_textdomain_codeset.
+ */
+function _encode($text) {
+    $source_encoding = mb_detect_encoding($text);
+    $target_encoding = _get_codeset();
+    if ($source_encoding != $target_encoding) {
+        return mb_convert_encoding($text, $target_encoding, $source_encoding);
+    }
+    else {
+        return $text;
+    }
+}
+
+
+// Custom implementation of the standard gettext related functions
+
+/**
+ * Returns passed in $locale, or environment variable $LANG if $locale == ''.
+ */
+function _get_default_locale($locale) {
+  if ($locale == '') // emulate variable support
+    return getenv('LANG');
+  else
+    return $locale;
+}
+
+/**
+ * Sets a requested locale, if needed emulates it.
+ */
+function _setlocale($category, $locale) {
+    global $CURRENTLOCALE, $EMULATEGETTEXT;
+    if ($locale === 0) { // use === to differentiate between string "0"
+        if ($CURRENTLOCALE != '')
+            return $CURRENTLOCALE;
+        else
+            // obey LANG variable, maybe extend to support all of LC_* vars
+            // even if we tried to read locale without setting it first
+            return _setlocale($category, $CURRENTLOCALE);
+    } else {
+        if (function_exists('setlocale')) {
+          $ret = setlocale($category, $locale);
+          if (($locale == '' and !$ret) or // failed setting it by env
+              ($locale != '' and $ret != $locale)) { // failed setting it
+            // Failed setting it according to environment.
+            $CURRENTLOCALE = _get_default_locale($locale);
+            $EMULATEGETTEXT = 1;
+          } else {
+            $CURRENTLOCALE = $ret;
+            $EMULATEGETTEXT = 0;
+          }
+        } else {
+          // No function setlocale(), emulate it all.
+          $CURRENTLOCALE = _get_default_locale($locale);
+          $EMULATEGETTEXT = 1;
+        }
+        // Allow locale to be changed on the go for one translation domain.
+        global $text_domains, $default_domain;
+        if (array_key_exists($default_domain, $text_domains)) {
+            unset($text_domains[$default_domain]->l10n);
+        }
+        return $CURRENTLOCALE;
+    }
+}
+
+/**
+ * Sets the path for a domain.
+ */
+function _bindtextdomain($domain, $path) {
+    global $text_domains;
+    // ensure $path ends with a slash ('/' should work for both, but lets still play nice)
+    if (substr(php_uname(), 0, 7) == "Windows") {
+      if ($path[strlen($path)-1] != '\\' and $path[strlen($path)-1] != '/')
+        $path .= '\\';
+    } else {
+      if ($path[strlen($path)-1] != '/')
+        $path .= '/';
+    }
+    if (!array_key_exists($domain, $text_domains)) {
+      // Initialize an empty domain object.
+      $text_domains[$domain] = new domain();
+    }
+    $text_domains[$domain]->path = $path;
+}
+
+/**
+ * Specify the character encoding in which the messages from the DOMAIN message catalog will be returned.
+ */
+function _bind_textdomain_codeset($domain, $codeset) {
+    global $text_domains;
+    $text_domains[$domain]->codeset = $codeset;
+}
+
+/**
+ * Sets the default domain.
+ */
+function _textdomain($domain) {
+    global $default_domain;
+    $default_domain = $domain;
+}
+
+/**
+ * Lookup a message in the current domain.
+ */
+function _gettext($msgid) {
+    $l10n = _get_reader();
+    return _encode($l10n->translate($msgid));
+}
+
+/**
+ * Alias for gettext.
+ */
+function __($msgid) {
+    return _gettext($msgid);
+}
+
+/**
+ * Plural version of gettext.
+ */
+function _ngettext($singular, $plural, $number) {
+    $l10n = _get_reader();
+    return _encode($l10n->ngettext($singular, $plural, $number));
+}
+
+/**
+ * Override the current domain.
+ */
+function _dgettext($domain, $msgid) {
+    $l10n = _get_reader($domain);
+    return _encode($l10n->translate($msgid));
+}
+
+/**
+ * Plural version of dgettext.
+ */
+function _dngettext($domain, $singular, $plural, $number) {
+    $l10n = _get_reader($domain);
+    return _encode($l10n->ngettext($singular, $plural, $number));
+}
+
+/**
+ * Overrides the domain and category for a single lookup.
+ */
+function _dcgettext($domain, $msgid, $category) {
+    $l10n = _get_reader($domain, $category);
+    return _encode($l10n->translate($msgid));
+}
+/**
+ * Plural version of dcgettext.
+ */
+function _dcngettext($domain, $singular, $plural, $number, $category) {
+    $l10n = _get_reader($domain, $category);
+    return _encode($l10n->ngettext($singular, $plural, $number));
+}
+
+/**
+ * Context version of gettext.
+ */
+function _pgettext($context, $msgid) {
+    $l10n = _get_reader();
+    return _encode($l10n->pgettext($context, $msgid));
+}
+
+/**
+ * Override the current domain in a context gettext call.
+ */
+function _dpgettext($domain, $context, $msgid) {
+    $l10n = _get_reader($domain);
+    return _encode($l10n->pgettext($context, $msgid));
+}
+
+/**
+ * Overrides the domain and category for a single context-based lookup.
+ */
+function _dcpgettext($domain, $context, $msgid, $category) {
+    $l10n = _get_reader($domain, $category);
+    return _encode($l10n->pgettext($context, $msgid));
+}
+
+/**
+ * Context version of ngettext.
+ */
+function _npgettext($context, $singular, $plural) {
+    $l10n = _get_reader();
+    return _encode($l10n->npgettext($context, $singular, $plural));
+}
+
+/**
+ * Override the current domain in a context ngettext call.
+ */
+function _dnpgettext($domain, $context, $singular, $plural) {
+    $l10n = _get_reader($domain);
+    return _encode($l10n->npgettext($context, $singular, $plural));
+}
+
+/**
+ * Overrides the domain and category for a plural context-based lookup.
+ */
+function _dcnpgettext($domain, $context, $singular, $plural, $category) {
+    $l10n = _get_reader($domain, $category);
+    return _encode($l10n->npgettext($context, $singular, $plural));
+}
+
+
+
+// Wrappers to use if the standard gettext functions are available,
+// but the current locale is not supported by the system.
+// Use the standard impl if the current locale is supported, use the
+// custom impl otherwise.
+
+function T_setlocale($category, $locale) {
+    return _setlocale($category, $locale);
+}
+
+function T_bindtextdomain($domain, $path) {
+    if (_check_locale_and_function()) return bindtextdomain($domain, $path);
+    else return _bindtextdomain($domain, $path);
+}
+function T_bind_textdomain_codeset($domain, $codeset) {
+    // bind_textdomain_codeset is available only in PHP 4.2.0+
+    if (_check_locale_and_function('bind_textdomain_codeset'))
+        return bind_textdomain_codeset($domain, $codeset);
+    else return _bind_textdomain_codeset($domain, $codeset);
+}
+function T_textdomain($domain) {
+    if (_check_locale_and_function()) return textdomain($domain);
+    else return _textdomain($domain);
+}
+function T_gettext($msgid) {
+    if (_check_locale_and_function()) return gettext($msgid);
+    else return _gettext($msgid);
+}
+function T_($msgid) {
+    if (_check_locale_and_function()) return _($msgid);
+    return __($msgid);
+}
+function T_ngettext($singular, $plural, $number) {
+    if (_check_locale_and_function())
+        return ngettext($singular, $plural, $number);
+    else return _ngettext($singular, $plural, $number);
+}
+function T_dgettext($domain, $msgid) {
+    if (_check_locale_and_function()) return dgettext($domain, $msgid);
+    else return _dgettext($domain, $msgid);
+}
+function T_dngettext($domain, $singular, $plural, $number) {
+    if (_check_locale_and_function())
+        return dngettext($domain, $singular, $plural, $number);
+    else return _dngettext($domain, $singular, $plural, $number);
+}
+function T_dcgettext($domain, $msgid, $category) {
+    if (_check_locale_and_function())
+        return dcgettext($domain, $msgid, $category);
+    else return _dcgettext($domain, $msgid, $category);
+}
+function T_dcngettext($domain, $singular, $plural, $number, $category) {
+    if (_check_locale_and_function())
+      return dcngettext($domain, $singular, $plural, $number, $category);
+    else return _dcngettext($domain, $singular, $plural, $number, $category);
+}
+
+function T_pgettext($context, $msgid) {
+  if (_check_locale_and_function('pgettext'))
+      return pgettext($context, $msgid);
+  else
+      return _pgettext($context, $msgid);
+}
+
+function T_dpgettext($domain, $context, $msgid) {
+  if (_check_locale_and_function('dpgettext'))
+      return dpgettext($domain, $context, $msgid);
+  else
+      return _dpgettext($domain, $context, $msgid);
+}
+
+function T_dcpgettext($domain, $context, $msgid, $category) {
+  if (_check_locale_and_function('dcpgettext'))
+      return dcpgettext($domain, $context, $msgid, $category);
+  else
+      return _dcpgettext($domain, $context, $msgid, $category);
+}
+
+function T_npgettext($context, $singular, $plural, $number) {
+    if (_check_locale_and_function('npgettext'))
+        return npgettext($context, $singular, $plural, $number);
+    else
+        return _npgettext($context, $singular, $plural, $number);
+}
+
+function T_dnpgettext($domain, $context, $singular, $plural, $number) {
+  if (_check_locale_and_function('dnpgettext'))
+      return dnpgettext($domain, $context, $singular, $plural, $number);
+  else
+      return _dnpgettext($domain, $context, $singular, $plural, $number);
+}
+
+function T_dcnpgettext($domain, $context, $singular, $plural,
+                       $number, $category) {
+    if (_check_locale_and_function('dcnpgettext'))
+        return dcnpgettext($domain, $context, $singular,
+                           $plural, $number, $category);
+    else
+        return _dcnpgettext($domain, $context, $singular,
+                            $plural, $number, $category);
+}
+
+
+
+// Wrappers used as a drop in replacement for the standard gettext functions
+
+if (!function_exists('gettext')) {
+    function bindtextdomain($domain, $path) {
+        return _bindtextdomain($domain, $path);
+    }
+    function bind_textdomain_codeset($domain, $codeset) {
+        return _bind_textdomain_codeset($domain, $codeset);
+    }
+    function textdomain($domain) {
+        return _textdomain($domain);
+    }
+    function gettext($msgid) {
+        return _gettext($msgid);
+    }
+    function _($msgid) {
+        return __($msgid);
+    }
+    function ngettext($singular, $plural, $number) {
+        return _ngettext($singular, $plural, $number);
+    }
+    function dgettext($domain, $msgid) {
+        return _dgettext($domain, $msgid);
+    }
+    function dngettext($domain, $singular, $plural, $number) {
+        return _dngettext($domain, $singular, $plural, $number);
+    }
+    function dcgettext($domain, $msgid, $category) {
+        return _dcgettext($domain, $msgid, $category);
+    }
+    function dcngettext($domain, $singular, $plural, $number, $category) {
+        return _dcngettext($domain, $singular, $plural, $number, $category);
+    }
+    function pgettext($context, $msgid) {
+        return _pgettext($context, $msgid);
+    }
+    function npgettext($context, $singular, $plural, $number) {
+        return _npgettext($context, $singular, $plural, $number);
+    }
+    function dpgettext($domain, $context, $msgid) {
+        return _dpgettext($domain, $context, $msgid);
+    }
+    function dnpgettext($domain, $context, $singular, $plural, $number) {
+        return _dnpgettext($domain, $context, $singular, $plural, $number);
+    }
+    function dcpgettext($domain, $context, $msgid, $category) {
+        return _dcpgettext($domain, $context, $msgid, $category);
+    }
+    function dcnpgettext($domain, $context, $singular, $plural,
+                         $number, $category) {
+      return _dcnpgettext($domain, $context, $singular, $plural,
+                          $number, $category);
+    }
+}
+
+?>
diff --git a/simpleid/www/lib/gettext/gettext.php b/simpleid/www/lib/gettext/gettext.php
new file mode 100644
index 0000000..5064047
--- /dev/null
+++ b/simpleid/www/lib/gettext/gettext.php
@@ -0,0 +1,432 @@
+<?php
+/*
+   Copyright (c) 2003, 2009 Danilo Segan <danilo@kvota.net>.
+   Copyright (c) 2005 Nico Kaiser <nico@siriux.net>
+
+   This file is part of PHP-gettext.
+
+   PHP-gettext is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   PHP-gettext is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with PHP-gettext; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+/**
+ * Provides a simple gettext replacement that works independently from
+ * the system's gettext abilities.
+ * It can read MO files and use them for translating strings.
+ * The files are passed to gettext_reader as a Stream (see streams.php)
+ *
+ * This version has the ability to cache all strings and translations to
+ * speed up the string lookup.
+ * While the cache is enabled by default, it can be switched off with the
+ * second parameter in the constructor (e.g. whenusing very large MO files
+ * that you don't want to keep in memory)
+ */
+class gettext_reader {
+  //public:
+   var $error = 0; // public variable that holds error code (0 if no error)
+
+   //private:
+  var $BYTEORDER = 0;        // 0: low endian, 1: big endian
+  var $STREAM = NULL;
+  var $short_circuit = false;
+  var $enable_cache = false;
+  var $originals = NULL;      // offset of original table
+  var $translations = NULL;    // offset of translation table
+  var $pluralheader = NULL;    // cache header field for plural forms
+  var $total = 0;          // total string count
+  var $table_originals = NULL;  // table for original strings (offsets)
+  var $table_translations = NULL;  // table for translated strings (offsets)
+  var $cache_translations = NULL;  // original -> translation mapping
+
+
+  /* Methods */
+
+
+  /**
+   * Reads a 32bit Integer from the Stream
+   *
+   * @access private
+   * @return Integer from the Stream
+   */
+  function readint() {
+      if ($this->BYTEORDER == 0) {
+        // low endian
+        $input=unpack('V', $this->STREAM->read(4));
+        return array_shift($input);
+      } else {
+        // big endian
+        $input=unpack('N', $this->STREAM->read(4));
+        return array_shift($input);
+      }
+    }
+
+  function read($bytes) {
+    return $this->STREAM->read($bytes);
+  }
+
+  /**
+   * Reads an array of Integers from the Stream
+   *
+   * @param int count How many elements should be read
+   * @return Array of Integers
+   */
+  function readintarray($count) {
+    if ($this->BYTEORDER == 0) {
+        // low endian
+        return unpack('V'.$count, $this->STREAM->read(4 * $count));
+      } else {
+        // big endian
+        return unpack('N'.$count, $this->STREAM->read(4 * $count));
+      }
+  }
+
+  /**
+   * Constructor
+   *
+   * @param object Reader the StreamReader object
+   * @param boolean enable_cache Enable or disable caching of strings (default on)
+   */
+  function gettext_reader($Reader, $enable_cache = true) {
+    // If there isn't a StreamReader, turn on short circuit mode.
+    if (! $Reader || isset($Reader->error) ) {
+      $this->short_circuit = true;
+      return;
+    }
+
+    // Caching can be turned off
+    $this->enable_cache = $enable_cache;
+
+    $MAGIC1 = "\x95\x04\x12\xde";
+    $MAGIC2 = "\xde\x12\x04\x95";
+
+    $this->STREAM = $Reader;
+    $magic = $this->read(4);
+    if ($magic == $MAGIC1) {
+      $this->BYTEORDER = 1;
+    } elseif ($magic == $MAGIC2) {
+      $this->BYTEORDER = 0;
+    } else {
+      $this->error = 1; // not MO file
+      return false;
+    }
+
+    // FIXME: Do we care about revision? We should.
+    $revision = $this->readint();
+
+    $this->total = $this->readint();
+    $this->originals = $this->readint();
+    $this->translations = $this->readint();
+  }
+
+  /**
+   * Loads the translation tables from the MO file into the cache
+   * If caching is enabled, also loads all strings into a cache
+   * to speed up translation lookups
+   *
+   * @access private
+   */
+  function load_tables() {
+    if (is_array($this->cache_translations) &&
+      is_array($this->table_originals) &&
+      is_array($this->table_translations))
+      return;
+
+    /* get original and translations tables */
+    if (!is_array($this->table_originals)) {
+      $this->STREAM->seekto($this->originals);
+      $this->table_originals = $this->readintarray($this->total * 2);
+    }
+    if (!is_array($this->table_translations)) {
+      $this->STREAM->seekto($this->translations);
+      $this->table_translations = $this->readintarray($this->total * 2);
+    }
+
+    if ($this->enable_cache) {
+      $this->cache_translations = array ();
+      /* read all strings in the cache */
+      for ($i = 0; $i < $this->total; $i++) {
+        $this->STREAM->seekto($this->table_originals[$i * 2 + 2]);
+        $original = $this->STREAM->read($this->table_originals[$i * 2 + 1]);
+        $this->STREAM->seekto($this->table_translations[$i * 2 + 2]);
+        $translation = $this->STREAM->read($this->table_translations[$i * 2 + 1]);
+        $this->cache_translations[$original] = $translation;
+      }
+    }
+  }
+
+  /**
+   * Returns a string from the "originals" table
+   *
+   * @access private
+   * @param int num Offset number of original string
+   * @return string Requested string if found, otherwise ''
+   */
+  function get_original_string($num) {
+    $length = $this->table_originals[$num * 2 + 1];
+    $offset = $this->table_originals[$num * 2 + 2];
+    if (! $length)
+      return '';
+    $this->STREAM->seekto($offset);
+    $data = $this->STREAM->read($length);
+    return (string)$data;
+  }
+
+  /**
+   * Returns a string from the "translations" table
+   *
+   * @access private
+   * @param int num Offset number of original string
+   * @return string Requested string if found, otherwise ''
+   */
+  function get_translation_string($num) {
+    $length = $this->table_translations[$num * 2 + 1];
+    $offset = $this->table_translations[$num * 2 + 2];
+    if (! $length)
+      return '';
+    $this->STREAM->seekto($offset);
+    $data = $this->STREAM->read($length);
+    return (string)$data;
+  }
+
+  /**
+   * Binary search for string
+   *
+   * @access private
+   * @param string string
+   * @param int start (internally used in recursive function)
+   * @param int end (internally used in recursive function)
+   * @return int string number (offset in originals table)
+   */
+  function find_string($string, $start = -1, $end = -1) {
+    if (($start == -1) or ($end == -1)) {
+      // find_string is called with only one parameter, set start end end
+      $start = 0;
+      $end = $this->total;
+    }
+    if (abs($start - $end) <= 1) {
+      // We're done, now we either found the string, or it doesn't exist
+      $txt = $this->get_original_string($start);
+      if ($string == $txt)
+        return $start;
+      else
+        return -1;
+    } else if ($start > $end) {
+      // start > end -> turn around and start over
+      return $this->find_string($string, $end, $start);
+    } else {
+      // Divide table in two parts
+      $half = (int)(($start + $end) / 2);
+      $cmp = strcmp($string, $this->get_original_string($half));
+      if ($cmp == 0)
+        // string is exactly in the middle => return it
+        return $half;
+      else if ($cmp < 0)
+        // The string is in the upper half
+        return $this->find_string($string, $start, $half);
+      else
+        // The string is in the lower half
+        return $this->find_string($string, $half, $end);
+    }
+  }
+
+  /**
+   * Translates a string
+   *
+   * @access public
+   * @param string string to be translated
+   * @return string translated string (or original, if not found)
+   */
+  function translate($string) {
+    if ($this->short_circuit)
+      return $string;
+    $this->load_tables();
+
+    if ($this->enable_cache) {
+      // Caching enabled, get translated string from cache
+      if (array_key_exists($string, $this->cache_translations))
+        return $this->cache_translations[$string];
+      else
+        return $string;
+    } else {
+      // Caching not enabled, try to find string
+      $num = $this->find_string($string);
+      if ($num == -1)
+        return $string;
+      else
+        return $this->get_translation_string($num);
+    }
+  }
+
+  /**
+   * Sanitize plural form expression for use in PHP eval call.
+   *
+   * @access private
+   * @return string sanitized plural form expression
+   */
+  function sanitize_plural_expression($expr) {
+    // Get rid of disallowed characters.
+    $expr = preg_replace('@[^a-zA-Z0-9_:;\(\)\?\|\&=!<>+*/\%-]@', '', $expr);
+
+    // Add parenthesis for tertiary '?' operator.
+    $expr .= ';';
+    $res = '';
+    $p = 0;
+    for ($i = 0; $i < strlen($expr); $i++) {
+      $ch = $expr[$i];
+      switch ($ch) {
+      case '?':
+        $res .= ' ? (';
+        $p++;
+        break;
+      case ':':
+        $res .= ') : (';
+        break;
+      case ';':
+        $res .= str_repeat( ')', $p) . ';';
+        $p = 0;
+        break;
+      default:
+        $res .= $ch;
+      }
+    }
+    return $res;
+  }
+
+  /**
+   * Parse full PO header and extract only plural forms line.
+   *
+   * @access private
+   * @return string verbatim plural form header field
+   */
+  function extract_plural_forms_header_from_po_header($header) {
+    if (preg_match("/(^|\n)plural-forms: ([^\n]*)\n/i", $header, $regs))
+      $expr = $regs[2];
+    else
+      $expr = "nplurals=2; plural=n == 1 ? 0 : 1;";
+    return $expr;
+  }
+
+  /**
+   * Get possible plural forms from MO header
+   *
+   * @access private
+   * @return string plural form header
+   */
+  function get_plural_forms() {
+    // lets assume message number 0 is header
+    // this is true, right?
+    $this->load_tables();
+
+    // cache header field for plural forms
+    if (! is_string($this->pluralheader)) {
+      if ($this->enable_cache) {
+        $header = $this->cache_translations[""];
+      } else {
+        $header = $this->get_translation_string(0);
+      }
+      $expr = $this->extract_plural_forms_header_from_po_header($header);
+      $this->pluralheader = $this->sanitize_plural_expression($expr);
+    }
+    return $this->pluralheader;
+  }
+
+  /**
+   * Detects which plural form to take
+   *
+   * @access private
+   * @param n count
+   * @return int array index of the right plural form
+   */
+  function select_string($n) {
+    $string = $this->get_plural_forms();
+    $string = str_replace('nplurals',"\$total",$string);
+    $string = str_replace("n",$n,$string);
+    $string = str_replace('plural',"\$plural",$string);
+
+    $total = 0;
+    $plural = 0;
+
+    eval("$string");
+    if ($plural >= $total) $plural = $total - 1;
+    return $plural;
+  }
+
+  /**
+   * Plural version of gettext
+   *
+   * @access public
+   * @param string single
+   * @param string plural
+   * @param string number
+   * @return translated plural form
+   */
+  function ngettext($single, $plural, $number) {
+    if ($this->short_circuit) {
+      if ($number != 1)
+        return $plural;
+      else
+        return $single;
+    }
+
+    // find out the appropriate form
+    $select = $this->select_string($number);
+
+    // this should contains all strings separated by NULLs
+    $key = $single . chr(0) . $plural;
+
+
+    if ($this->enable_cache) {
+      if (! array_key_exists($key, $this->cache_translations)) {
+        return ($number != 1) ? $plural : $single;
+      } else {
+        $result = $this->cache_translations[$key];
+        $list = explode(chr(0), $result);
+        return $list[$select];
+      }
+    } else {
+      $num = $this->find_string($key);
+      if ($num == -1) {
+        return ($number != 1) ? $plural : $single;
+      } else {
+        $result = $this->get_translation_string($num);
+        $list = explode(chr(0), $result);
+        return $list[$select];
+      }
+    }
+  }
+
+  function pgettext($context, $msgid) {
+    $key = $context . chr(4) . $msgid;
+    $ret = $this->translate($key);
+    if (strpos($ret, "\004") !== FALSE) {
+      return $msgid;
+    } else {
+      return $ret;
+    }
+  }
+
+  function npgettext($context, $singular, $plural, $number) {
+    $key = $context . chr(4) . $singular;
+    $ret = $this->ngettext($key, $plural, $number);
+    if (strpos($ret, "\004") !== FALSE) {
+      return $singular;
+    } else {
+      return $ret;
+    }
+
+  }
+}
+
+?>
diff --git a/simpleid/www/lib/gettext/streams.php b/simpleid/www/lib/gettext/streams.php
new file mode 100644
index 0000000..3cdc158
--- /dev/null
+++ b/simpleid/www/lib/gettext/streams.php
@@ -0,0 +1,167 @@
+<?php
+/*
+   Copyright (c) 2003, 2005, 2006, 2009 Danilo Segan <danilo@kvota.net>.
+
+   This file is part of PHP-gettext.
+
+   PHP-gettext is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+
+   PHP-gettext is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with PHP-gettext; if not, write to the Free Software
+   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+*/
+
+
+  // Simple class to wrap file streams, string streams, etc.
+  // seek is essential, and it should be byte stream
+class StreamReader {
+  // should return a string [FIXME: perhaps return array of bytes?]
+  function read($bytes) {
+    return false;
+  }
+
+  // should return new position
+  function seekto($position) {
+    return false;
+  }
+
+  // returns current position
+  function currentpos() {
+    return false;
+  }
+
+  // returns length of entire stream (limit for seekto()s)
+  function length() {
+    return false;
+  }
+};
+
+class StringReader {
+  var $_pos;
+  var $_str;
+
+  function StringReader($str='') {
+    $this->_str = $str;
+    $this->_pos = 0;
+  }
+
+  function read($bytes) {
+    $data = substr($this->_str, $this->_pos, $bytes);
+    $this->_pos += $bytes;
+    if (strlen($this->_str)<$this->_pos)
+      $this->_pos = strlen($this->_str);
+
+    return $data;
+  }
+
+  function seekto($pos) {
+    $this->_pos = $pos;
+    if (strlen($this->_str)<$this->_pos)
+      $this->_pos = strlen($this->_str);
+    return $this->_pos;
+  }
+
+  function currentpos() {
+    return $this->_pos;
+  }
+
+  function length() {
+    return strlen($this->_str);
+  }
+
+};
+
+
+class FileReader {
+  var $_pos;
+  var $_fd;
+  var $_length;
+
+  function FileReader($filename) {
+    if (file_exists($filename)) {
+
+      $this->_length=filesize($filename);
+      $this->_pos = 0;
+      $this->_fd = fopen($filename,'rb');
+      if (!$this->_fd) {
+        $this->error = 3; // Cannot read file, probably permissions
+        return false;
+      }
+    } else {
+      $this->error = 2; // File doesn't exist
+      return false;
+    }
+  }
+
+  function read($bytes) {
+    if ($bytes) {
+      fseek($this->_fd, $this->_pos);
+
+      // PHP 5.1.1 does not read more than 8192 bytes in one fread()
+      // the discussions at PHP Bugs suggest it's the intended behaviour
+      $data = '';
+      while ($bytes > 0) {
+        $chunk  = fread($this->_fd, $bytes);
+        $data  .= $chunk;
+        $bytes -= strlen($chunk);
+      }
+      $this->_pos = ftell($this->_fd);
+
+      return $data;
+    } else return '';
+  }
+
+  function seekto($pos) {
+    fseek($this->_fd, $pos);
+    $this->_pos = ftell($this->_fd);
+    return $this->_pos;
+  }
+
+  function currentpos() {
+    return $this->_pos;
+  }
+
+  function length() {
+    return $this->_length;
+  }
+
+  function close() {
+    fclose($this->_fd);
+  }
+
+};
+
+// Preloads entire file in memory first, then creates a StringReader
+// over it (it assumes knowledge of StringReader internals)
+class CachedFileReader extends StringReader {
+  function CachedFileReader($filename) {
+    if (file_exists($filename)) {
+
+      $length=filesize($filename);
+      $fd = fopen($filename,'rb');
+
+      if (!$fd) {
+        $this->error = 3; // Cannot read file, probably permissions
+        return false;
+      }
+      $this->_str = fread($fd, $length);
+      fclose($fd);
+
+    } else {
+      $this->error = 2; // File doesn't exist
+      return false;
+    }
+  }
+};
+
+
+?>
diff --git a/simpleid/www/lib/xtemplate.class.php b/simpleid/www/lib/xtemplate.class.php
new file mode 100644
index 0000000..84713c6
--- /dev/null
+++ b/simpleid/www/lib/xtemplate.class.php
@@ -0,0 +1,1301 @@
+<?php
+
+// When developing uncomment the line below, re-comment before making public
+//error_reporting(E_ALL);
+
+/**
+ * XTemplate PHP templating engine
+ *
+ * @package XTemplate
+ * @author Barnabas Debreceni [cranx@users.sourceforge.net]
+ * @copyright Barnabas Debreceni 2000-2001
+ * @author Jeremy Coates [cocomp@users.sourceforge.net]
+ * @copyright Jeremy Coates 2002-2007
+ * @see license.txt LGPL / BSD license
+ * @since PHP 5
+ * @link $HeadURL: https://xtpl.svn.sourceforge.net/svnroot/xtpl/trunk/xtemplate.class.php $
+ * @version $Id$
+ *
+ *
+ * XTemplate class - http://www.phpxtemplate.org/ (x)html / xml generation with templates - fast & easy
+ * Latest stable & Subversion versions available @ http://sourceforge.net/projects/xtpl/
+ * License: LGPL / BSD - see license.txt
+ * Changelog: see changelog.txt
+ */
+class XTemplate {
+
+	/**
+	 * Properties
+	 */
+
+	/**
+	 * Raw contents of the template file
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $filecontents = '';
+
+	/**
+	 * Unparsed blocks
+	 *
+	 * @access public
+	 * @var array
+	 */
+	public $blocks = array();
+
+	/**
+	 * Parsed blocks
+	 *
+	 * @var unknown_type
+	 */
+	public $parsed_blocks = array();
+
+	/**
+	 * Preparsed blocks (for file includes)
+	 *
+	 * @access public
+	 * @var array
+	 */
+	public $preparsed_blocks = array();
+
+	/**
+	 * Block parsing order for recursive parsing
+	 * (Sometimes reverse :)
+	 *
+	 * @access public
+	 * @var array
+	 */
+	public $block_parse_order = array();
+
+	/**
+	 * Store sub-block names
+	 * (For fast resetting)
+	 *
+	 * @access public
+	 * @var array
+	 */
+	public $sub_blocks = array();
+
+	/**
+	 * Variables array
+	 *
+	 * @access public
+	 * @var array
+	 */
+	public $vars = array();
+
+	/**
+	 * File variables array
+	 *
+	 * @access public
+	 * @var array
+	 */
+	public $filevars = array();
+
+	/**
+	 * Filevars' parent block
+	 *
+	 * @access public
+	 * @var array
+	 */
+	public $filevar_parent = array();
+
+	/**
+	 * File caching during duration of script
+	 * e.g. files only cached to speed {FILE "filename"} repeats
+	 *
+	 * @access public
+	 * @var array
+	 */
+	public $filecache = array();
+
+	/**
+	 * Location of template files
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $tpldir = '';
+
+	/**
+	 * Filenames lookup table
+	 *
+	 * @access public
+	 * @var null
+	 */
+	public $files = null;
+
+	/**
+	 * Template filename
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $filename = '';
+
+	// moved to setup method so uses the tag_start & end_delims
+	/**
+	 * RegEx for file includes
+	 *
+	 * "/\{FILE\s*\"([^\"]+)\"\s*\}/m";
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $file_delim = '';
+
+	/**
+	 * RegEx for file include variable
+	 *
+	 * "/\{FILE\s*\{([A-Za-z0-9\._]+?)\}\s*\}/m";
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $filevar_delim = '';
+
+	/**
+	 * RegEx for file includes with newlines
+	 *
+	 * "/^\s*\{FILE\s*\{([A-Za-z0-9\._]+?)\}\s*\}\s*\n/m";
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $filevar_delim_nl = '';
+
+	/**
+	 * Template block start delimiter
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $block_start_delim = '<!-- ';
+
+	/**
+	 * Template block end delimiter
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $block_end_delim = '-->';
+
+	/**
+	 * Template block start word
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $block_start_word = 'BEGIN:';
+
+	/**
+	 * Template block end word
+	 *
+	 * The last 3 properties and this make the delimiters look like:
+	 * @example <!-- BEGIN: block_name -->
+	 * if you use the default syntax.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $block_end_word = 'END:';
+
+	/**
+	 * Template tag start delimiter
+	 *
+	 * This makes the delimiters look like:
+	 * @example {tagname}
+	 * if you use the default syntax.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $tag_start_delim = '{';
+
+	/**
+	 * Template tag end delimiter
+	 *
+	 * This makes the delimiters look like:
+	 * @example {tagname}
+	 * if you use the default syntax.
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $tag_end_delim = '}';
+	/* this makes the delimiters look like: {tagname} if you use my syntax. */
+
+	/**
+	 * Regular expression element for comments within tags and blocks
+	 *
+	 * @example {tagname#My Comment}
+	 * @example {tagname #My Comment}
+	 * @example <!-- BEGIN: blockname#My Comment -->
+	 * @example <!-- BEGIN: blockname #My Comment -->
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $comment_preg = '( ?#.*?)?';
+
+	/**
+	 * Default main template block name
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $mainblock = 'main';
+
+	/**
+	 * Script output type
+	 *
+	 * @access public
+	 * @var string
+	 */
+	public $output_type = 'HTML';
+
+	/**
+	 * Debug mode
+	 *
+	 * @access public
+	 * @var boolean
+	 */
+	public $debug = false;
+
+	/**
+	 * Null string for unassigned vars
+	 *
+	 * @access protected
+	 * @var array
+	 */
+	protected $_null_string = array('' => '');
+
+	/**
+	 * Null string for unassigned blocks
+	 *
+	 * @access protected
+	 * @var array
+	 */
+	protected $_null_block = array('' => '');
+
+	/**
+	 * Errors
+	 *
+	 * @access protected
+	 * @var string
+	 */
+	protected $_error = '';
+
+	/**
+	 * Auto-reset sub blocks
+	 *
+	 * @access protected
+	 * @var boolean
+	 */
+	protected $_autoreset = true;
+
+	/**
+	 * Set to FALSE to generate errors if a non-existant blocks is referenced
+	 *
+	 * @author NW
+	 * @since 2002/10/17
+	 * @access protected
+	 * @var boolean
+	 */
+	protected $_ignore_missing_blocks = true;
+
+	/**
+     * PHP 5 Constructor - Instantiate the object
+     *
+     * @param string $file Template file to work on
+     * @param string/array $tpldir Location of template files (useful for keeping files outside web server root)
+     * @param array $files Filenames lookup
+     * @param string $mainblock Name of main block in the template
+     * @param boolean $autosetup If true, run setup() as part of constuctor
+     * @return XTemplate
+     */
+	public function __construct($file, $tpldir = '', $files = null, $mainblock = 'main', $autosetup = true) {
+
+		$this->restart($file, $tpldir, $files, $mainblock, $autosetup, $this->tag_start_delim, $this->tag_end_delim);
+	}
+
+	/*
+     * PHP 4 Constructor - Instantiate the object
+     *
+     * @deprecated Use PHP 5 constructor instead
+     * @param string $file Template file to work on
+     * @param string/array $tpldir Location of template files (useful for keeping files outside web server root)
+     * @param array $files Filenames lookup
+     * @param string $mainblock Name of main block in the template
+     * @param boolean $autosetup If true, run setup() as part of constuctor
+     * @return XTemplate
+     *
+	public function XTemplate ($file, $tpldir = '', $files = null, $mainblock = 'main', $autosetup = true) {
+
+		assert('Deprecated - use PHP 5 constructor');
+	}*/
+
+
+	/***************************************************************************/
+	/***[ public stuff ]********************************************************/
+	/***************************************************************************/
+
+	/**
+	 * Restart the class - allows one instantiation with several files processed by restarting
+	 * e.g. $xtpl = new XTemplate('file1.xtpl');
+	 * $xtpl->parse('main');
+	 * $xtpl->out('main');
+	 * $xtpl->restart('file2.xtpl');
+	 * $xtpl->parse('main');
+	 * $xtpl->out('main');
+	 * (Added in response to sf:641407 feature request)
+	 *
+	 * @param string $file Template file to work on
+	 * @param string/array $tpldir Location of template files
+	 * @param array $files Filenames lookup
+	 * @param string $mainblock Name of main block in the template
+	 * @param boolean $autosetup If true, run setup() as part of restarting
+	 * @param string $tag_start {
+	 * @param string $tag_end }
+	 */
+	public function restart ($file, $tpldir = '', $files = null, $mainblock = 'main', $autosetup = true, $tag_start = '{', $tag_end = '}') {
+
+		$this->filename = $file;
+
+		// From SF Feature request 1202027
+		// Kenneth Kalmer
+		$this->tpldir = $tpldir;
+		if (defined('XTPL_DIR') && empty($this->tpldir)) {
+			$this->tpldir = XTPL_DIR;
+		}
+
+		if (is_array($files)) {
+			$this->files = $files;
+		}
+
+		$this->mainblock = $mainblock;
+
+		$this->tag_start_delim = $tag_start;
+		$this->tag_end_delim = $tag_end;
+
+		// Start with fresh file contents
+		$this->filecontents = '';
+
+		// Reset the template arrays
+		$this->blocks = array();
+		$this->parsed_blocks = array();
+		$this->preparsed_blocks = array();
+		$this->block_parse_order = array();
+		$this->sub_blocks = array();
+		$this->vars = array();
+		$this->filevars = array();
+		$this->filevar_parent = array();
+		$this->filecache = array();
+
+		if ($autosetup) {
+			$this->setup();
+		}
+	}
+
+	/**
+     * setup - the elements that were previously in the constructor
+     *
+     * @access public
+     * @param boolean $add_outer If true is passed when called, it adds an outer main block to the file
+     */
+	public function setup ($add_outer = false) {
+
+		$this->tag_start_delim = preg_quote($this->tag_start_delim);
+		$this->tag_end_delim = preg_quote($this->tag_end_delim);
+
+		// Setup the file delimiters
+
+		// regexp for file includes
+		$this->file_delim = "/" . $this->tag_start_delim . "FILE\s*\"([^\"]+)\"" . $this->comment_preg . $this->tag_end_delim . "/m";
+
+		// regexp for file includes
+		$this->filevar_delim = "/" . $this->tag_start_delim . "FILE\s*" . $this->tag_start_delim . "([A-Za-z0-9\._]+?)" . $this->comment_preg . $this->tag_end_delim . $this->comment_preg . $this->tag_end_delim . "/m";
+
+		// regexp for file includes w/ newlines
+		$this->filevar_delim_nl = "/^\s*" . $this->tag_start_delim . "FILE\s*" . $this->tag_start_delim . "([A-Za-z0-9\._]+?)" . $this->comment_preg . $this->tag_end_delim . $this->comment_preg . $this->tag_end_delim . "\s*\n/m";
+
+		if (empty($this->filecontents)) {
+			// read in template file
+			$this->filecontents = $this->_r_getfile($this->filename);
+		}
+
+		if ($add_outer) {
+			$this->_add_outer_block();
+		}
+
+		// preprocess some stuff
+		$this->blocks = $this->_maketree($this->filecontents, '');
+		$this->filevar_parent = $this->_store_filevar_parents($this->blocks);
+		$this->scan_globals();
+	}
+
+	/**
+     * assign a variable
+     *
+     * @example Simplest case:
+     * @example $xtpl->assign('name', 'value');
+     * @example {name} in template
+     *
+     * @example Array assign:
+     * @example $xtpl->assign(array('name' => 'value', 'name2' => 'value2'));
+     * @example {name} {name2} in template
+     *
+     * @example Value as array assign:
+     * @example $xtpl->assign('name', array('key' => 'value', 'key2' => 'value2'));
+     * @example {name.key} {name.key2} in template
+     *
+     * @example Reset array:
+     * @example $xtpl->assign('name', array('key' => 'value', 'key2' => 'value2'));
+     * @example // Other code then:
+     * @example $xtpl->assign('name', array('key3' => 'value3'), false);
+     * @example {name.key} {name.key2} {name.key3} in template
+     *
+     * @access public
+     * @param string $name Variable to assign $val to
+     * @param string / array $val Value to assign to $name
+	 * @param boolean $reset_array Reset the variable array if $val is an array
+     */
+	public function assign ($name, $val = '', $reset_array = true) {
+
+		if (is_array($name)) {
+
+			foreach ($name as $k => $v) {
+
+				$this->vars[$k] = $v;
+			}
+		} elseif (is_array($val)) {
+
+			// Clear the existing values
+    		if ($reset_array) {
+    			$this->vars[$name] = array();
+    		}
+
+        	foreach ($val as $k => $v) {
+
+        		$this->vars[$name][$k] = $v;
+        	}
+
+		} else {
+
+			$this->vars[$name] = $val;
+		}
+	}
+
+	/**
+     * assign a file variable
+     *
+     * @access public
+     * @param string $name Variable to assign $val to
+     * @param string / array $val Values to assign to $name
+     */
+	public function assign_file ($name, $val = '') {
+
+		if (is_array($name)) {
+
+			foreach ($name as $k => $v) {
+
+				$this->_assign_file_sub($k, $v);
+			}
+		} else {
+
+			$this->_assign_file_sub($name, $val);
+		}
+	}
+
+	/**
+     * parse a block
+     *
+     * @access public
+     * @param string $bname Block name to parse
+     */
+	public function parse ($bname) {
+
+		if (isset($this->preparsed_blocks[$bname])) {
+
+			$copy = $this->preparsed_blocks[$bname];
+
+		} elseif (isset($this->blocks[$bname])) {
+
+			$copy = $this->blocks[$bname];
+
+		} elseif ($this->_ignore_missing_blocks) {
+			// ------------------------------------------------------
+			// NW : 17 Oct 2002. Added default of ignore_missing_blocks
+			//      to allow for generalised processing where some
+			//      blocks may be removed from the HTML without the
+			//      processing code needing to be altered.
+			// ------------------------------------------------------
+			// JRC: 3/1/2003 added set error to ignore missing functionality
+			$this->_set_error("parse: blockname [$bname] does not exist");
+			return;
+
+		} else {
+
+			$this->_set_error("parse: blockname [$bname] does not exist");
+		}
+
+		/* from there we should have no more {FILE } directives */
+		if (!isset($copy)) {
+			die('Block: ' . $bname);
+		}
+
+		$copy = preg_replace($this->filevar_delim_nl, '', $copy);
+
+		$var_array = array();
+
+		/* find & replace variables+blocks */
+		preg_match_all("|" . $this->tag_start_delim . "([A-Za-z0-9\._]+?" . $this->comment_preg . ")" . $this->tag_end_delim. "|", $copy, $var_array);
+
+		$var_array = $var_array[1];
+
+		foreach ($var_array as $k => $v) {
+
+			// Are there any comments in the tags {tag#a comment for documenting the template}
+			$any_comments = explode('#', $v);
+			$v = rtrim($any_comments[0]);
+
+			if (sizeof($any_comments) > 1) {
+
+				$comments = $any_comments[1];
+			} else {
+
+				$comments = '';
+			}
+
+			$sub = explode('.', $v);
+
+			if ($sub[0] == '_BLOCK_') {
+
+				unset($sub[0]);
+
+				$bname2 = implode('.', $sub);
+
+				// trinary operator eliminates assign error in E_ALL reporting
+				$var = isset($this->parsed_blocks[$bname2]) ? $this->parsed_blocks[$bname2] : null;
+				$nul = (!isset($this->_null_block[$bname2])) ? $this->_null_block[''] : $this->_null_block[$bname2];
+
+				if ($var === '') {
+
+					if ($nul == '') {
+						// -----------------------------------------------------------
+						// Removed requirement for blocks to be at the start of string
+						// -----------------------------------------------------------
+						//                      $copy=preg_replace("/^\s*\{".$v."\}\s*\n*/m","",$copy);
+						// Now blocks don't need to be at the beginning of a line,
+						//$copy=preg_replace("/\s*" . $this->tag_start_delim . $v . $this->tag_end_delim . "\s*\n*/m","",$copy);
+						$copy = preg_replace("|" . $this->tag_start_delim . $v . $this->tag_end_delim . "|m", '', $copy);
+
+					} else {
+
+						$copy = preg_replace("|" . $this->tag_start_delim . $v . $this->tag_end_delim . "|m", "$nul", $copy);
+					}
+				} else {
+
+					//$var = trim($var);
+					switch (true) {
+						case preg_match('/^\n/', $var) && preg_match('/\n$/', $var):
+							$var = substr($var, 1, -1);
+							break;
+
+						case preg_match('/^\n/', $var):
+							$var = substr($var, 1);
+							break;
+
+						case preg_match('/\n$/', $var):
+							$var = substr($var, 0, -1);
+							break;
+					}
+
+					// SF Bug no. 810773 - thanks anonymous
+					$var = str_replace('\\', '\\\\', $var);
+					// Ensure dollars in strings are not evaluated reported by SadGeezer 31/3/04
+					$var = str_replace('$', '\\$', $var);
+					// Replaced str_replaces with preg_quote
+					//$var = preg_quote($var);
+					$var = str_replace('\\|', '|', $var);
+					$copy = preg_replace("|" . $this->tag_start_delim . $v . $this->tag_end_delim . "|m", "$var", $copy);
+
+					if (preg_match('/^\n/', $copy) && preg_match('/\n$/', $copy)) {
+						$copy = substr($copy, 1, -1);
+					}
+				}
+			} else {
+
+				$var = $this->vars;
+
+				foreach ($sub as $v1) {
+
+					// NW 4 Oct 2002 - Added isset and is_array check to avoid NOTICE messages
+					// JC 17 Oct 2002 - Changed EMPTY to stlen=0
+					//                if (empty($var[$v1])) { // this line would think that zeros(0) were empty - which is not true
+					if (!isset($var[$v1]) || (!is_array($var[$v1]) && strlen($var[$v1]) == 0)) {
+
+						// Check for constant, when variable not assigned
+						if (defined($v1)) {
+
+							$var[$v1] = constant($v1);
+
+						} else {
+
+							$var[$v1] = null;
+						}
+					}
+
+					$var = $var[$v1];
+				}
+
+				$nul = (!isset($this->_null_string[$v])) ? ($this->_null_string[""]) : ($this->_null_string[$v]);
+				$var = (!isset($var)) ? $nul : $var;
+
+				if ($var === '') {
+					// -----------------------------------------------------------
+					// Removed requriement for blocks to be at the start of string
+					// -----------------------------------------------------------
+					//                    $copy=preg_replace("|^\s*\{".$v." ?#?".$comments."\}\s*\n|m","",$copy);
+					$copy = preg_replace("|" . $this->tag_start_delim . $v . "( ?#" . $comments . ")?" . $this->tag_end_delim . "|m", '', $copy);
+				}
+
+				$var = trim($var);
+				// SF Bug no. 810773 - thanks anonymous
+				$var = str_replace('\\', '\\\\', $var);
+				// Ensure dollars in strings are not evaluated reported by SadGeezer 31/3/04
+				$var = str_replace('$', '\\$', $var);
+				// Replace str_replaces with preg_quote
+				//$var = preg_quote($var);
+				$var = str_replace('\\|', '|', $var);
+				$copy = preg_replace("|" . $this->tag_start_delim . $v . "( ?#" . $comments . ")?" . $this->tag_end_delim . "|m", "$var", $copy);
+
+				if (preg_match('/^\n/', $copy) && preg_match('/\n$/', $copy)) {
+					$copy = substr($copy, 1);
+				}
+			}
+		}
+
+		if (isset($this->parsed_blocks[$bname])) {
+			$this->parsed_blocks[$bname] .= $copy;
+		} else {
+			$this->parsed_blocks[$bname] = $copy;
+		}
+
+		/* reset sub-blocks */
+		if ($this->_autoreset && (!empty($this->sub_blocks[$bname]))) {
+
+			reset($this->sub_blocks[$bname]);
+
+			foreach ($this->sub_blocks[$bname] as $k => $v) {
+				$this->reset($v);
+			}
+		}
+	}
+
+	/**
+     * returns the parsed text for a block, including all sub-blocks.
+     *
+     * @access public
+     * @param string $bname Block name to parse
+     */
+	public function rparse ($bname) {
+
+		if (!empty($this->sub_blocks[$bname])) {
+
+			reset($this->sub_blocks[$bname]);
+
+			foreach ($this->sub_blocks[$bname] as $k => $v) {
+
+				if (!empty($v)) {
+					$this->rparse($v);
+				}
+			}
+		}
+
+		$this->parse($bname);
+	}
+
+	/**
+     * inserts a loop ( call assign & parse )
+     *
+     * @access public
+     * @param string $bname Block name to assign
+     * @param string $var Variable to assign values to
+     * @param string / array $value Value to assign to $var
+    */
+	public function insert_loop ($bname, $var, $value = '') {
+
+		$this->assign($var, $value);
+		$this->parse($bname);
+	}
+
+	/**
+     * parses a block for every set of data in the values array
+     *
+     * @access public
+     * @param string $bname Block name to loop
+     * @param string $var Variable to assign values to
+     * @param array $values Values to assign to $var
+    */
+	public function array_loop ($bname, $var, &$values) {
+
+		if (is_array($values)) {
+
+			foreach($values as $v) {
+
+				$this->insert_loop($bname, $var, $v);
+			}
+		}
+	}
+
+	/**
+     * returns the parsed text for a block
+     *
+     * @access public
+     * @param string $bname Block name to return
+     * @return string
+     */
+	public function text ($bname = '') {
+
+		$text = '';
+
+		if ($this->debug && $this->output_type == 'HTML') {
+			// JC 20/11/02 echo the template filename if in development as
+			// html comment
+			$text .= '<!-- XTemplate: ' . realpath($this->filename) . " -->\n";
+		}
+
+		$bname = !empty($bname) ? $bname : $this->mainblock;
+
+		$text .= isset($this->parsed_blocks[$bname]) ? $this->parsed_blocks[$bname] : $this->get_error();
+
+		return $text;
+	}
+
+	/**
+     * prints the parsed text
+     *
+     * @access public
+     * @param string $bname Block name to echo out
+     */
+	public function out ($bname) {
+
+		$out = $this->text($bname);
+		//        $length=strlen($out);
+		//header("Content-Length: ".$length); // TODO: Comment this back in later
+
+		echo $out;
+	}
+
+	/**
+     * prints the parsed text to a specified file
+     *
+     * @access public
+     * @param string $bname Block name to write out
+     * @param string $fname File name to write to
+     */
+	public function out_file ($bname, $fname) {
+
+		if (!empty($bname) && !empty($fname) && is_writeable($fname)) {
+
+			$fp = fopen($fname, 'w');
+			fwrite($fp, $this->text($bname));
+			fclose($fp);
+		}
+	}
+
+	/**
+     * resets the parsed text
+     *
+     * @access public
+     * @param string $bname Block to reset
+     */
+	public function reset ($bname) {
+
+		$this->parsed_blocks[$bname] = '';
+	}
+
+	/**
+     * returns true if block was parsed, false if not
+     *
+     * @access public
+     * @param string $bname Block name to test
+     * @return boolean
+     */
+	public function parsed ($bname) {
+
+		return (!empty($this->parsed_blocks[$bname]));
+	}
+
+	/**
+     * sets the string to replace in case the var was not assigned
+     *
+     * @access public
+     * @param string $str Display string for null block
+     * @param string $varname Variable name to apply $str to
+     */
+	public function set_null_string($str, $varname = '') {
+
+		$this->_null_string[$varname] = $str;
+	}
+
+	/**
+	 * Backwards compatibility only
+	 *
+	 * @param string $str
+	 * @param string $varname
+	 * @deprecated Change to set_null_string to keep in with rest of naming convention
+	 */
+	public function SetNullString ($str, $varname = '') {
+		$this->set_null_string($str, $varname);
+	}
+
+	/**
+     * sets the string to replace in case the block was not parsed
+     *
+     * @access public
+     * @param string $str Display string for null block
+     * @param string $bname Block name to apply $str to
+     */
+	public function set_null_block ($str, $bname = '') {
+
+		$this->_null_block[$bname] = $str;
+	}
+
+	/**
+	 * Backwards compatibility only
+	 *
+	 * @param string $str
+	 * @param string $bname
+	 * @deprecated Change to set_null_block to keep in with rest of naming convention
+	 */
+	public function SetNullBlock ($str, $bname = '') {
+		$this->set_null_block($str, $bname);
+	}
+
+	/**
+     * sets AUTORESET to 1. (default is 1)
+     * if set to 1, parse() automatically resets the parsed blocks' sub blocks
+     * (for multiple level blocks)
+     *
+     * @access public
+     */
+	public function set_autoreset () {
+
+		$this->_autoreset = true;
+	}
+
+	/**
+     * sets AUTORESET to 0. (default is 1)
+     * if set to 1, parse() automatically resets the parsed blocks' sub blocks
+     * (for multiple level blocks)
+     *
+     * @access public
+     */
+	public function clear_autoreset () {
+
+		$this->_autoreset = false;
+	}
+
+	/**
+     * scans global variables and assigns to PHP array
+     *
+     * @access public
+     */
+	public function scan_globals () {
+
+		foreach ($GLOBALS as $k => $v) {
+			$GLOB[$k] = $v;
+		}
+
+		/**
+		 * Access global variables as:
+		 * @example {PHP._SERVER.HTTP_HOST}
+		 * in your template!
+		 */
+		$this->assign('PHP', $GLOB);
+	}
+
+	/**
+     * gets error condition / string
+     *
+     * @access public
+     * @return boolean / string
+     */
+	public function get_error () {
+
+		// JRC: 3/1/2003 Added ouptut wrapper and detection of output type for error message output
+		$retval = false;
+
+		if ($this->_error != '') {
+
+			switch ($this->output_type) {
+				case 'HTML':
+				case 'html':
+					$retval = '<b>[XTemplate]</b><ul>' . nl2br(str_replace('* ', '<li>', str_replace(" *\n", "</li>\n", $this->_error))) . '</ul>';
+					break;
+
+				default:
+					$retval = '[XTemplate] ' . str_replace(' *\n', "\n", $this->_error);
+					break;
+			}
+		}
+
+		return $retval;
+	}
+
+	/***************************************************************************/
+	/***[ private stuff ]*******************************************************/
+	/***************************************************************************/
+
+	/**
+     * generates the array containing to-be-parsed stuff:
+     * $blocks["main"],$blocks["main.table"],$blocks["main.table.row"], etc.
+     * also builds the reverse parse order.
+     *
+     * @access public - aiming for private
+     * @param string $con content to be processed
+     * @param string $parentblock name of the parent block in the block hierarchy
+     */
+	public function _maketree ($con, $parentblock='') {
+
+		$blocks = array();
+
+		$con2 = explode($this->block_start_delim, $con);
+
+		if (!empty($parentblock)) {
+
+			$block_names = explode('.', $parentblock);
+			$level = sizeof($block_names);
+
+		} else {
+
+			$block_names = array();
+			$level = 0;
+		}
+
+		// JRC 06/04/2005 Added block comments (on BEGIN or END) <!-- BEGIN: block_name#Comments placed here -->
+		//$patt = "($this->block_start_word|$this->block_end_word)\s*(\w+)\s*$this->block_end_delim(.*)";
+		$patt = "(" . $this->block_start_word . "|" . $this->block_end_word . ")\s*(\w+)" . $this->comment_preg . "\s*" . $this->block_end_delim . "(.*)";
+
+		foreach($con2 as $k => $v) {
+
+			$res = array();
+
+			if (preg_match_all("/$patt/ims", $v, $res, PREG_SET_ORDER)) {
+				// $res[0][1] = BEGIN or END
+				// $res[0][2] = block name
+				// $res[0][3] = comment
+				// $res[0][4] = kinda content
+				$block_word	= $res[0][1];
+				$block_name	= $res[0][2];
+				$comment	= $res[0][3];
+				$content	= $res[0][4];
+
+				if (strtoupper($block_word) == $this->block_start_word) {
+
+					$parent_name = implode('.', $block_names);
+
+					// add one level - array("main","table","row")
+					$block_names[++$level] = $block_name;
+
+					// make block name (main.table.row)
+					$cur_block_name=implode('.', $block_names);
+
+					// build block parsing order (reverse)
+					$this->block_parse_order[] = $cur_block_name;
+
+					//add contents. trinary operator eliminates assign error in E_ALL reporting
+					$blocks[$cur_block_name] = isset($blocks[$cur_block_name]) ? $blocks[$cur_block_name] . $content : $content;
+
+					// add {_BLOCK_.blockname} string to parent block
+					$blocks[$parent_name] .= str_replace('\\', '', $this->tag_start_delim) . '_BLOCK_.' . $cur_block_name . str_replace('\\', '', $this->tag_end_delim);
+
+					// store sub block names for autoresetting and recursive parsing
+					$this->sub_blocks[$parent_name][] = $cur_block_name;
+
+					// store sub block names for autoresetting
+					$this->sub_blocks[$cur_block_name][] = '';
+
+				} else if (strtoupper($block_word) == $this->block_end_word) {
+
+					unset($block_names[$level--]);
+
+					$parent_name = implode('.', $block_names);
+
+					// add rest of block to parent block
+					$blocks[$parent_name] .= $content;
+				}
+			} else {
+
+				// no block delimiters found
+				// Saves doing multiple implodes - less overhead
+				$tmp = implode('.', $block_names);
+
+				if ($k) {
+					$blocks[$tmp] .= $this->block_start_delim;
+				}
+
+				// trinary operator eliminates assign error in E_ALL reporting
+				$blocks[$tmp] = isset($blocks[$tmp]) ? $blocks[$tmp] . $v : $v;
+			}
+		}
+
+		return $blocks;
+	}
+
+	/**
+     * Sub processing for assign_file method
+     *
+     * @access private
+     * @param string $name
+     * @param string $val
+     */
+	private function _assign_file_sub ($name, $val) {
+
+		if (isset($this->filevar_parent[$name])) {
+
+			if ($val != '') {
+
+				$val = $this->_r_getfile($val);
+
+				foreach($this->filevar_parent[$name] as $parent) {
+
+					if (isset($this->preparsed_blocks[$parent]) && !isset($this->filevars[$name])) {
+
+						$copy = $this->preparsed_blocks[$parent];
+
+					} elseif (isset($this->blocks[$parent])) {
+
+						$copy = $this->blocks[$parent];
+					}
+
+					$res = array();
+
+					preg_match_all($this->filevar_delim, $copy, $res, PREG_SET_ORDER);
+
+					if (is_array($res) && isset($res[0])) {
+
+						// Changed as per solution in SF bug ID #1261828
+						foreach ($res as $v) {
+
+							// Changed as per solution in SF bug ID #1261828
+							if ($v[1] == $name) {
+
+								// Changed as per solution in SF bug ID #1261828
+								$copy = preg_replace("/" . preg_quote($v[0]) . "/", "$val", $copy);
+								$this->preparsed_blocks = array_merge($this->preparsed_blocks, $this->_maketree($copy, $parent));
+								$this->filevar_parent = array_merge($this->filevar_parent, $this->_store_filevar_parents($this->preparsed_blocks));
+							}
+						}
+					}
+				}
+			}
+		}
+
+		$this->filevars[$name] = $val;
+	}
+
+	/**
+     * store container block's name for file variables
+     *
+     * @access public - aiming for private
+     * @param array $blocks
+     * @return array
+     */
+	public function _store_filevar_parents ($blocks){
+
+		$parents = array();
+
+		foreach ($blocks as $bname => $con) {
+
+			$res = array();
+
+			preg_match_all($this->filevar_delim, $con, $res);
+
+			foreach ($res[1] as $k => $v) {
+
+				$parents[$v][] = $bname;
+			}
+		}
+		return $parents;
+	}
+
+	/**
+     * Set the error string
+     *
+     * @access private
+     * @param string $str
+     */
+	private function _set_error ($str)    {
+
+		// JRC: 3/1/2003 Made to append the error messages
+		$this->_error .= '* ' . $str . " *\n";
+		// JRC: 3/1/2003 Removed trigger error, use this externally if you want it eg. trigger_error($xtpl->get_error())
+		//trigger_error($this->get_error());
+	}
+
+	/**
+     * returns the contents of a file
+     *
+     * @access protected
+     * @param string $file
+     * @return string
+     */
+	protected function _getfile ($file) {
+
+		if (!isset($file)) {
+			// JC 19/12/02 added $file to error message
+			$this->_set_error('!isset file name!' . $file);
+
+			return '';
+		}
+
+		// check if filename is mapped to other filename
+		if (isset($this->files)) {
+
+			if (isset($this->files[$file])) {
+
+				$file = $this->files[$file];
+			}
+		}
+
+		// prepend template dir
+		if (!empty($this->tpldir)) {
+
+			/**
+			 * Support hierarchy of file locations to search
+			 *
+			 * @example Supply array of filepaths when instantiating
+			 * 			First path supplied that has the named file is prioritised
+			 * 			$xtpl = new XTemplate('myfile.xtpl', array('.','/mypath', '/mypath2'));
+			 * @since 29/05/2007
+			 */
+			if (is_array($this->tpldir)) {
+
+				foreach ($this->tpldir as $dir) {
+
+					if (is_readable($dir . DIRECTORY_SEPARATOR . $file)) {
+						$file = $dir . DIRECTORY_SEPARATOR . $file;
+						break;
+					}
+				}
+			} else {
+
+				$file = $this->tpldir. DIRECTORY_SEPARATOR . $file;
+			}
+		}
+
+		$file_text = '';
+
+		if (isset($this->filecache[$file])) {
+
+			$file_text .= $this->filecache[$file];
+
+			if ($this->debug) {
+				$file_text = '<!-- XTemplate debug cached: ' . realpath($file) . ' -->' . "\n" . $file_text;
+			}
+
+		} else {
+
+			if (is_file($file) && is_readable($file)) {
+
+				if (filesize($file)) {
+
+					if (!($fh = fopen($file, 'r'))) {
+
+						$this->_set_error('Cannot open file: ' . realpath($file));
+						return '';
+					}
+
+					$file_text .= fread($fh,filesize($file));
+					fclose($fh);
+
+				}
+
+				if ($this->debug) {
+					$file_text = '<!-- XTemplate debug: ' . realpath($file) . ' -->' . "\n" . $file_text;
+				}
+
+			} elseif (str_replace('.', '', phpversion()) >= '430' && $file_text = @file_get_contents($file, true)) {
+				// Enable use of include path by using file_get_contents
+				// Implemented at suggestion of SF Feature Request ID #1529478 michaelgroh
+				if ($file_text === false) {
+					$this->_set_error("[" . realpath($file) . "] ($file) does not exist");
+					$file_text = "<b>__XTemplate fatal error: file [$file] does not exist in the include path__</b>";
+				} elseif ($this->debug) {
+					$file_text = '<!-- XTemplate debug: ' . realpath($file) . ' (via include path) -->' . "\n" . $file_text;
+				}
+			} elseif (!is_file($file)) {
+
+				// NW 17 Oct 2002 : Added realpath around the file name to identify where the code is searching.
+				$this->_set_error("[" . realpath($file) . "] ($file) does not exist");
+				$file_text .= "<b>__XTemplate fatal error: file [$file] does not exist__</b>";
+
+			} elseif (!is_readable($file)) {
+
+				$this->_set_error("[" . realpath($file) . "] ($file) is not readable");
+				$file_text .= "<b>__XTemplate fatal error: file [$file] is not readable__</b>";
+			}
+
+			$this->filecache[$file] = $file_text;
+		}
+
+		return $file_text;
+	}
+
+	/**
+     * recursively gets the content of a file with {FILE "filename.tpl"} directives
+     *
+     * @access public - aiming for private
+     * @param string $file
+     * @return string
+     */
+	public function _r_getfile ($file) {
+
+		$text = $this->_getfile($file);
+
+		$res = array();
+
+		while (preg_match($this->file_delim,$text,$res)) {
+
+			$text2 = $this->_getfile($res[1]);
+			$text = preg_replace("'".preg_quote($res[0])."'",$text2,$text);
+		}
+
+		return $text;
+	}
+
+
+	/**
+     * add an outer block delimiter set useful for rtfs etc - keeps them editable in word
+     *
+     * @access private
+     */
+	private function _add_outer_block () {
+
+		$before = $this->block_start_delim . $this->block_start_word . ' ' . $this->mainblock . ' ' . $this->block_end_delim;
+		$after = $this->block_start_delim . $this->block_end_word . ' ' . $this->mainblock . ' ' . $this->block_end_delim;
+
+		$this->filecontents = $before . "\n" . $this->filecontents . "\n" . $after;
+	}
+
+	/**
+     * Debug function - var_dump wrapped in '<pre></pre>' tags
+     *
+     * @access private
+     * @param multiple var_dumps all the supplied arguments
+     */
+	private function _pre_var_dump ($args) {
+
+		if ($this->debug) {
+			echo '<pre>';
+			var_dump(func_get_args());
+			echo '</pre>';
+		}
+	}
+} /* end of XTemplate class. */
+
+?>
diff --git a/simpleid/www/locale.inc.php b/simpleid/www/locale.inc.php
new file mode 100644
index 0000000..837dde7
--- /dev/null
+++ b/simpleid/www/locale.inc.php
@@ -0,0 +1,77 @@
+<?php 
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2012
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+/**
+ * Localisation support.
+ *
+ * @package simpleid
+ * @since 0.9
+ * @filesource
+ */
+ 
+include_once 'lib/gettext/gettext.inc.php';
+ 
+/**
+ * Initialises the localisation system.
+ *
+ * @param string $locale the locale to use
+ */
+function locale_init($locale) {
+    T_setlocale(LC_MESSAGES, $locale);
+    // Set the text domain as 'messages'
+    $domain = 'messages';
+    bindtextdomain($domain, 'locale');
+    // bind_textdomain_codeset is supported only in PHP 4.2.0+
+    if (function_exists('bind_textdomain_codeset')) 
+        bind_textdomain_codeset($domain, 'UTF-8');
+    textdomain($domain);
+}
+
+/**
+ * Translates a string.
+ *
+ * @param string $string the string to translate
+ * @param array $variables an array of replacements variables to be made after
+ * a translation. Prefix the variable with a @ to make the replacement HTML safe,
+ * a % to make the replacement HTML safe and surround with &lt;strong&gt; tags,
+ * and ! to replace as is
+ * @return string the translated string
+ */
+function t($string, $variables = array()) {
+    $translated = gettext($string);
+    
+    foreach ($variables as $variable => $value) {
+        switch ($variable[0]) {
+            case '@':
+                $variables[$variable] = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');
+                break;
+            case '%':
+            default:
+                $variables[$variable] = '<strong>' . htmlspecialchars($value, ENT_QUOTES, 'UTF-8') . '</strong>';
+                break;
+            case '!':
+                // Pass-through.
+        }
+  }
+  return strtr($translated, $variables);
+}
+?>
diff --git a/simpleid/www/locale/messages.pot b/simpleid/www/locale/messages.pot
new file mode 100644
index 0000000..1eff63d
--- /dev/null
+++ b/simpleid/www/locale/messages.pot
@@ -0,0 +1,550 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: PACKAGE VERSION\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2014-03-13 21:46+1100\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
+"Language-Team: LANGUAGE <LL@li.org>\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=CHARSET\n"
+"Content-Transfer-Encoding: 8bit\n"
+
+#: www/common.inc.php:140
+msgid "An encrypted connection (HTTPS) is required for this page."
+msgstr ""
+
+#: www/extensions/ax/ax.extension.php:195
+msgid "SimpleID will also be sending the following information to the site."
+msgstr ""
+
+#: www/extensions/ax/ax.extension.php:196
+#: www/extensions/ax/ax.extension.php:267
+msgid "Type URL"
+msgstr ""
+
+#: www/extensions/ax/ax.extension.php:197
+#: www/extensions/ax/ax.extension.php:268
+#: www/extensions/sreg/sreg.extension.php:134
+#: www/extensions/sreg/sreg.extension.php:186 www/user.inc.php:781
+msgid "Value"
+msgstr ""
+
+#: www/extensions/ax/ax.extension.php:203
+msgid "This web site requested to store information about you on SimpleID. Sadly, SimpleID does not support this feature."
+msgstr ""
+
+#: www/extensions/ax/ax.extension.php:265
+msgid "SimpleID will send the following information to sites which supports the Attribute Exchange Extension.  If you have also supplied OpenID Connect user information in your identity, or have the Simple Registration Extension installed, these may also be sent as part of this Extension."
+msgstr ""
+
+#: www/extensions/ax/ax.extension.php:266
+#: www/extensions/sreg/sreg.extension.php:184 www/user.inc.php:779
+msgid "To change these, <a href=\"!url\">edit your identity file</a>."
+msgstr ""
+
+#: www/extensions/ax/ax.extension.php:274
+msgid "Attribute Exchange Extension"
+msgstr ""
+
+#: www/extensions/pape/pape.extension.php:81
+msgid "This web site's policy requires you to log in again to confirm your identity."
+msgstr ""
+
+#: www/extensions/sreg/sreg.extension.php:114
+msgid "You can view the site's policy in relation to the use of this information at this URL: <a href=\"@url\">@url</a>."
+msgstr ""
+
+#: www/extensions/sreg/sreg.extension.php:132
+msgid "SimpleID will also be sending the following registration information to the site."
+msgstr ""
+
+#: www/extensions/sreg/sreg.extension.php:133
+#: www/extensions/sreg/sreg.extension.php:185
+msgid "Name"
+msgstr ""
+
+#: www/extensions/sreg/sreg.extension.php:182
+msgid "SimpleID will send the following information to sites which supports the Simple Registration Extension."
+msgstr ""
+
+#: www/extensions/sreg/sreg.extension.php:183
+msgid "If you have also supplied OpenID Connect user information in your identity file, these may also be sent as part of this Extension."
+msgstr ""
+
+#: www/extensions/sreg/sreg.extension.php:192
+msgid "Simple Registration Extension"
+msgstr ""
+
+#: www/extensions/ui/ui.extension.php:188
+msgid "Invalid UI icon parameters."
+msgstr ""
+
+#: www/extensions/ui/ui.extension.php:196
+msgid "Unable to get icon."
+msgstr ""
+
+#: www/index.php:42 www/upgrade.php:60
+msgid "No configuration file found.  See the <a href=\"!url\">manual</a> for instructions on how to set up a configuration file."
+msgstr ""
+
+#: www/index.php:113 www/upgrade.php:117
+msgid "Documentation"
+msgstr ""
+
+#: www/index.php:114 www/upgrade.php:118
+msgid "Support"
+msgstr ""
+
+#: www/index.php:118 www/upgrade.php:121
+msgid "Identities directory not found.  See the <a href=\"!url\">manual</a> for instructions on how to set up SimpleID."
+msgstr ""
+
+#: www/index.php:123 www/upgrade.php:125
+msgid "Cache directory not found or not writeable.  See the <a href=\"!url\">manual</a> for instructions on how to set up SimpleID."
+msgstr ""
+
+#: www/index.php:129 www/upgrade.php:129
+msgid "Store directory not found or not writeable.  See the <a href=\"!url\">manual</a> for instructions on how to set up SimpleID."
+msgstr ""
+
+#: www/index.php:134 www/upgrade.php:133
+msgid "register_globals is enabled in PHP configuration, which is not supported by SimpleID.  See the <a href=\"!url\">manual</a> for further information."
+msgstr ""
+
+#: www/index.php:139 www/index.php:143 www/index.php:147 www/index.php:151
+#: www/index.php:155 www/upgrade.php:138 www/upgrade.php:142
+#: www/upgrade.php:146 www/upgrade.php:150 www/upgrade.php:154
+#, php-format
+msgid "One or more required PHP extensions (%extension) is not loaded.  See the <a href=\"!url\">manual</a> for further information on system requirements."
+msgstr ""
+
+#: www/index.php:159 www/upgrade.php:158
+msgid "suhosin.get.max_value_length is less than 1024, which will lead to problems. See the <a href=\"!url\">manual</a> for further information on system requirements."
+msgstr ""
+
+#: www/index.php:279
+msgid "Invalid OpenID message."
+msgstr ""
+
+#: www/index.php:463
+msgid "Protocol Error: openid.return_to not set."
+msgstr ""
+
+#: www/index.php:468
+msgid "Protocol Error: openid.identity not set."
+msgstr ""
+
+#: www/index.php:476
+msgid "Protocol Error: openid.identity set, but not openid.claimed_id."
+msgstr ""
+
+#: www/index.php:482
+msgid "Protocol Error: openid.return_to not set when openid.realm is not set."
+msgstr ""
+
+#: www/index.php:1031 www/index.php:1112 www/user.inc.php:186
+#: www/user.inc.php:485
+msgid "Cancel"
+msgstr ""
+
+#: www/index.php:1036
+msgid "Unable to log into <strong class=\"realm\">@realm</strong>."
+msgstr ""
+
+#: www/index.php:1037
+msgid "Your current identity does not match the requested identity %identity."
+msgstr ""
+
+#: www/index.php:1038
+msgid "<a href=\"!url\">Switch to a different user</a> and try again."
+msgstr ""
+
+#: www/index.php:1050
+msgid "Warning: This web site has not confirmed its identity and might be fraudulent.  Do not share any personal information with this web site unless you are sure it is legitimate. See the <a href=\"!url\" class=\"popup\">SimpleID documentation for details</a> (OpenID version 2.0 return_to discovery failure)"
+msgstr ""
+
+#: www/index.php:1057
+msgid "You are being logged into <strong class=\"realm\">@realm</strong>."
+msgstr ""
+
+#: www/index.php:1058
+msgid "Automatically send my information to this site for any future requests."
+msgstr ""
+
+#: www/index.php:1059
+msgid "OK"
+msgstr ""
+
+#: www/index.php:1066 www/page.inc.php:186
+msgid "This web site has not confirmed its identity and might be fraudulent."
+msgstr ""
+
+#: www/index.php:1066 www/page.inc.php:186
+msgid "Are you sure you wish to automatically send your information to this site for any future requests?"
+msgstr ""
+
+#: www/index.php:1073 www/index.php:1098
+msgid "OpenID Login"
+msgstr ""
+
+#: www/index.php:1097 www/page.inc.php:123 www/upgrade.php:211
+#: www/upgrade.php:262 www/user.inc.php:573 www/user.inc.php:589
+msgid "SimpleID detected a potential security attack.  Please try again."
+msgstr ""
+
+#: www/index.php:1114
+msgid "Log in cancelled."
+msgstr ""
+
+#: www/index.php:1142
+msgid "You were logged in successfully."
+msgstr ""
+
+#: www/page.inc.php:57 www/page.inc.php:222
+msgid "Dashboard"
+msgstr ""
+
+#: www/page.inc.php:88
+msgid "<em>You need to set at least one of OpenID 1.x or OpenID 2 to generate the code.</em>"
+msgstr ""
+
+#: www/page.inc.php:92 www/page.inc.php:223
+msgid "My Profile"
+msgstr ""
+
+#: www/page.inc.php:149
+msgid "Your preferences have been saved."
+msgstr ""
+
+#: www/page.inc.php:178
+msgid "Site"
+msgstr ""
+
+#: www/page.inc.php:179
+msgid "Last access"
+msgstr ""
+
+#: www/page.inc.php:180
+msgid "Automatic"
+msgstr ""
+
+#: www/page.inc.php:181
+msgid "Remove"
+msgstr ""
+
+#: www/page.inc.php:182
+msgid "Submit"
+msgstr ""
+
+#: www/page.inc.php:189 www/page.inc.php:224
+msgid "My Sites"
+msgstr ""
+
+#: www/page.inc.php:265
+msgid "Welcome"
+msgstr ""
+
+#: www/page.inc.php:266
+msgid "You are logged in as %uid (%identity)."
+msgstr ""
+
+#: www/page.inc.php:280 www/user.inc.php:625
+msgid "Login verification adds an extra layer of protection to your account. When enabled, you will need to enter an additional security code whenever you log into SimpleID."
+msgstr ""
+
+#: www/page.inc.php:283
+msgid "Login verification is <strong>enabled</strong>."
+msgstr ""
+
+#: www/page.inc.php:285 www/user.inc.php:571
+msgid "Disable"
+msgstr ""
+
+#: www/page.inc.php:287
+msgid "Login verification is <strong>disabled</strong>. To enable login verification, click the button below."
+msgstr ""
+
+#: www/page.inc.php:289
+msgid "Enable"
+msgstr ""
+
+#: www/page.inc.php:294 www/user.inc.php:642
+msgid "Login Verification"
+msgstr ""
+
+#: www/page.inc.php:307
+msgid "&lt;link&gt; tags"
+msgstr ""
+
+#: www/page.inc.php:309
+msgid "OpenID 1.x"
+msgstr ""
+
+#: www/page.inc.php:310
+msgid "OpenID 2.0"
+msgstr ""
+
+#: www/page.inc.php:311
+msgid "Claim a different identifier"
+msgstr ""
+
+#: www/page.inc.php:319
+msgid "YADIS"
+msgstr ""
+
+#: www/page.inc.php:320
+msgid "Write your own or <a href=\"!url\">download</a> your YADIS document"
+msgstr ""
+
+#: www/page.inc.php:321
+msgid "Add HTTP headers or &lt;meta&gt; tag, e.g.:"
+msgstr ""
+
+#: www/page.inc.php:326
+msgid "Claim your Identifier"
+msgstr ""
+
+#: www/upgrade.php:185
+msgid "Use this script to update your installation whenever you upgrade to a new version of SimpleID."
+msgstr ""
+
+#: www/upgrade.php:186 www/upgrade.php:395
+msgid "For more detailed information, see the <a href=\"!url\">SimpleID documentation</a>."
+msgstr ""
+
+#: www/upgrade.php:187
+msgid "<strong>Back up your installation</strong>. This process will change various files within your SimpleID installation and in case of emergency you may need to revert to a backup."
+msgstr ""
+
+#: www/upgrade.php:188
+msgid "Install your new files in the appropriate location, as described in the <a href=\"!url\">SimpleID documentation</a>."
+msgstr ""
+
+#: www/upgrade.php:189
+msgid "When you have performed the steps above, click <strong>Continue</strong>."
+msgstr ""
+
+#: www/upgrade.php:190 www/upgrade.php:235
+msgid "Continue"
+msgstr ""
+
+#: www/upgrade.php:194 www/upgrade.php:249 www/upgrade.php:286
+msgid "Upgrade"
+msgstr ""
+
+#: www/upgrade.php:220 www/upgrade.php:275
+msgid "Remember to edit upgrade.php to check <code>$upgrade_access_check</code> back to <code>FALSE</code>."
+msgstr ""
+
+#: www/upgrade.php:224
+msgid "Your SimpleID installation is up-to-date.  This script is complete."
+msgstr ""
+
+#: www/upgrade.php:234
+msgid "Click <strong>Continue</strong> to proceed with the upgrade."
+msgstr ""
+
+#: www/upgrade.php:243
+msgid "The version of SimpleID you are updating from has been automatically detected."
+msgstr ""
+
+#: www/upgrade.php:244
+msgid "Original version"
+msgstr ""
+
+#: www/upgrade.php:245
+msgid "Upgrade version"
+msgstr ""
+
+#: www/upgrade.php:280
+msgid "Your SimpleID installation has been upgraded.  Please check the results below for any errors."
+msgstr ""
+
+#: www/upgrade.php:389
+msgid "Access denied. You are not authorised to access this page. Please <a href=\"index.php?q=login\">log in</a> as an administrator (a user whose identity file includes the line <code>administrator=1</code>)."
+msgstr ""
+
+#: www/upgrade.php:390
+msgid "If you cannot log in, you will have to edit <code>upgrade.php</code> to bypass this access check. To do this:"
+msgstr ""
+
+#: www/upgrade.php:391
+msgid "With a text editor find the upgrade.php file."
+msgstr ""
+
+#: www/upgrade.php:392
+msgid "There is a line inside your upgrade.php file that says <code>$upgrade_access_check = TRUE;</code>. Change it to <code>$upgrade_access_check = FALSE;</code>."
+msgstr ""
+
+#: www/upgrade.php:393
+msgid "As soon as the upgrade.php script is done, you must change the file back to its original form with <code>$upgrade_access_check = TRUE;</code>."
+msgstr ""
+
+#: www/upgrade.php:394
+msgid "To avoid having this problem in future, remember to log in to SimpleID as an administrator before you run this script."
+msgstr ""
+
+#: www/upgrade.php:399
+msgid "Access Denied"
+msgstr ""
+
+#: www/user.inc.php:197
+msgid "Login cancelled without a proper OpenID request."
+msgstr ""
+
+#: www/user.inc.php:203 www/user.inc.php:224 www/user.inc.php:234
+msgid "SimpleID detected a potential security attack on your log in.  Please log in again."
+msgstr ""
+
+#: www/user.inc.php:211
+msgid "You seem to be attempting to log in from another web page.  You must use this page to log in."
+msgstr ""
+
+#: www/user.inc.php:229
+msgid "The log in page has expired.  Please log in again."
+msgstr ""
+
+#: www/user.inc.php:248
+msgid "You need to supply the user name and the password in order to log in."
+msgstr ""
+
+#: www/user.inc.php:256
+msgid "The user name or password is not correct."
+msgstr ""
+
+#: www/user.inc.php:270
+msgid "You need to enter the verification code in order to log in."
+msgstr ""
+
+#: www/user.inc.php:279 www/user.inc.php:595
+msgid "The verification code is not correct."
+msgstr ""
+
+#: www/user.inc.php:443
+msgid "You have been logged out."
+msgstr ""
+
+#: www/user.inc.php:503
+msgid "Secure login using <strong>HTTPS</strong>."
+msgstr ""
+
+#: www/user.inc.php:506
+msgid "<strong>WARNING:</strong>  Your password will be sent to SimpleID as plain text."
+msgstr ""
+
+#: www/user.inc.php:513
+msgid "User name:"
+msgstr ""
+
+#: www/user.inc.php:514
+msgid "Password:"
+msgstr ""
+
+#: www/user.inc.php:515
+msgid "Remember me on this computer for two weeks."
+msgstr ""
+
+#: www/user.inc.php:525
+msgid "Log in"
+msgstr ""
+
+#: www/user.inc.php:526
+msgid "Log In"
+msgstr ""
+
+#: www/user.inc.php:530
+msgid "To verify your identity, enter the verification code."
+msgstr ""
+
+#: www/user.inc.php:531
+msgid "If you have lost your verification code, you can <a href=\"!url\">recover your account</a>."
+msgstr ""
+
+#: www/user.inc.php:535 www/user.inc.php:638
+msgid "Verification code:"
+msgstr ""
+
+#: www/user.inc.php:539 www/user.inc.php:585 www/user.inc.php:639
+msgid "Verify"
+msgstr ""
+
+#: www/user.inc.php:540
+msgid "Enter Verification Code"
+msgstr ""
+
+#: www/user.inc.php:593
+msgid "You need to enter the verification code to complete enabling login verification."
+msgstr ""
+
+#: www/user.inc.php:626
+msgid "<strong>WARNING:</strong> If you enable login verification and lose your authenticator app, you will need to <a href=\"!url\">edit your identity file manually</a> before you can log in again."
+msgstr ""
+
+#: www/user.inc.php:630
+msgid "To set up login verification, following these steps."
+msgstr ""
+
+#: www/user.inc.php:631
+msgid "Download an authenticator app that supports TOTP for your smartphone, such as Google Authenticator."
+msgstr ""
+
+#: www/user.inc.php:632
+msgid "Add your SimpleID account to authenticator app using this key.  If you are viewing this page on your smartphone you can use <a href=\"!url\">this link</a> or scan the QR code to add your account."
+msgstr ""
+
+#: www/user.inc.php:635
+msgid "To check that your account has been added properly, enter the verification code from your phone into the box below, and click Verify."
+msgstr ""
+
+#: www/user.inc.php:661
+msgid "User Page"
+msgstr ""
+
+#: www/user.inc.php:664
+msgid "No user specified."
+msgstr ""
+
+#: www/user.inc.php:670
+#, php-format
+msgid "User %uid not found."
+msgstr ""
+
+#: www/user.inc.php:682
+#, php-format
+msgid "This is the user %uid's SimpleID page.  It contains hidden information for the use by OpenID consumers."
+msgstr ""
+
+#: www/user.inc.php:724
+msgid "Private Personal Identifier"
+msgstr ""
+
+#: www/user.inc.php:726
+msgid "This is a private personal identifier."
+msgstr ""
+
+#: www/user.inc.php:778
+msgid "SimpleID may, with your consent, send the following information to sites which supports OpenID Connect."
+msgstr ""
+
+#: www/user.inc.php:781
+msgid "Member"
+msgstr ""
+
+#: www/user.inc.php:799
+msgid "OpenID Connect"
+msgstr ""
+
+#: www/user.inc.php:819
+msgid "Log out and log in as a different user"
+msgstr ""
+
+#: www/user.inc.php:822
+msgid "Log out"
+msgstr ""
diff --git a/simpleid/www/log.inc.php b/simpleid/www/log.inc.php
new file mode 100644
index 0000000..9e1caf0
--- /dev/null
+++ b/simpleid/www/log.inc.php
@@ -0,0 +1,210 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-9
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Functions for logging.
+ *
+ * @package simpleid
+ * @filesource
+ */
+
+/** Log level */
+define('SIMPLEID_LOG_DEBUG', 5);
+/** Log level */
+define('SIMPLEID_LOG_INFO', 4);
+/** Log level */
+define('SIMPLEID_LOG_NOTICE', 3);
+/** Log level */
+define('SIMPLEID_LOG_WARN', 2);
+/** Log level */
+define('SIMPLEID_LOG_ERROR', 1);
+/** Log level */
+define('SIMPLEID_LOG_FATAL', 0);
+
+/**
+ * This variable holds the pointer to the currently opened log file.  If the
+ * log file is not open, this variable is NULL.
+ *
+ * @global resource $log
+ */
+$log = NULL;
+
+
+/**
+ * Opens the log file.
+ *
+ * This function opens a pointed to the log file for later usage.
+ *
+ * @return bool true if the log file is opened successfully.
+ */
+function log_open() {
+    global $log;
+    if (!defined('SIMPLEID_LOGFILE') || (SIMPLEID_LOGFILE == '')) return;
+    $log = fopen(SIMPLEID_LOGFILE, 'a');
+    
+    if ($log === false) {
+        $log = NULL;
+        return false;
+    } else {
+        return true;
+    }
+}
+
+/**
+ * Closes the log file, if it is open.
+ */
+function log_close() {
+    if ($log != NULL) {
+        fflush($log);
+        fclose($log);
+        $log = NULL;
+    }
+}
+
+/**
+ * Logs a DEBUG message.
+ *
+ * @param string $message the message to log
+ * @see _log_write()
+ */
+function log_debug($message) {
+    _log_write($message, SIMPLEID_LOG_DEBUG);
+}
+
+/**
+ * Logs an INFO message.
+ *
+ * @param string $message the message to log
+ * @see _log_write()
+ */
+function log_info($message) {
+    _log_write($message, SIMPLEID_LOG_INFO);
+}
+
+/**
+ * Logs a NOTICE message.
+ *
+ * @param string $message the message to log
+ * @see _log_write()
+ */
+function log_notice($message) {
+    _log_write($message, SIMPLEID_LOG_NOTICE);
+}
+
+/**
+ * Logs a WARN message.
+ *
+ * @param string $message the message to log
+ * @see _log_write()
+ */
+function log_warn($message) {
+    _log_write($message, SIMPLEID_LOG_WARN);
+}
+
+/**
+ * Logs a ERROR message.
+ *
+ * @param string $message the message to log
+ * @see _log_write()
+ */
+function log_error($message) {
+    _log_write($message, SIMPLEID_LOG_ERROR);
+}
+
+/**
+ * Logs a FATAL message.
+ *
+ * @param string $message the message to log
+ * @see _log_write()
+ */
+function log_fatal($message) {
+    _log_write($message, SIMPLEID_LOG_FATAL);
+}
+
+/**
+ * Converts an array into a string for logging purposes.
+ *
+ * @param array $array the array the convert
+ * @param array $keys an array of keys to include in the converted string.  Set
+ * to false if all the keys in the array should be included
+ * @return string the converted string.
+ */
+function log_array($array, $keys = false) {
+    $output = array();
+    
+    if ($keys == false) $keys = array_keys($array);
+    
+    foreach ($keys as $key) {
+        $output[] = $key . ": " . $array[$key];
+    }
+    
+    return implode('; ', $output);
+}
+
+/**
+ * Logs a message
+ *
+ * @param string $message the message to log
+ * @param int $level the log level
+ * @return bool true if the log has been written successfully
+ */
+function _log_write($message, $level = false) {
+    global $log;
+    static $levels;
+    
+    if (!$levels) {
+        $levels = array(
+            SIMPLEID_LOG_DEBUG => 'DEBUG',
+            SIMPLEID_LOG_INFO => 'INFO',
+            SIMPLEID_LOG_NOTICE => 'NOTICE',
+            SIMPLEID_LOG_WARN => 'WARN',
+            SIMPLEID_LOG_ERROR => 'ERROR',
+            SIMPLEID_LOG_FATAL => 'FATAL'
+        );
+    }
+    
+    /* If a priority hasn't been specified, use the default value. */
+    if ($level === false) {
+        $level = SIMPLEID_LOG_INFO;
+    }
+
+    /* Abort early if the priority is above the maximum logging level. */
+    if ($level > SIMPLEID_LOGLEVEL) {
+        return false;
+    }
+
+    /* If the log file isn't already open, open it now. */
+    if (($log == NULL) && !log_open()) {
+        return false;
+    }
+
+    /* Build the string containing the complete log line. */
+    $line = sprintf('%1$s %2$s [%3$s] %4$s', strftime(SIMPLEID_DATE_TIME_FORMAT), session_id(), $levels[$level], $message) . "\n";
+
+    /* Write the log line to the log file. */
+    $success = (fwrite($log, $line) !== false);
+
+    return $success;
+}
+
+?>
diff --git a/simpleid/www/openid.inc.php b/simpleid/www/openid.inc.php
new file mode 100644
index 0000000..8507804
--- /dev/null
+++ b/simpleid/www/openid.inc.php
@@ -0,0 +1,1054 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-10
+ *
+ * Includes code Drupal OpenID module (http://drupal.org/project/openid)
+ * Rowan Kerr <rowan@standardinteractive.com>
+ * James Walker <james@bryght.com>
+ *
+ * Copyright (C) Rowan Kerr and James Walker
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * OpenID related functions.
+ *
+ * @package simpleid
+ * @filesource
+ */
+ 
+include_once "bignum.inc.php";
+include_once "random.inc.php";
+ 
+/**
+ * OpenID default modulus for Diffie-Hellman key exchange.
+ *
+ * @link http://openid.net/specs/openid-authentication-1_1.html#pvalue, http://openid.net/specs/openid-authentication-2_0.html#pvalue
+ */
+define('OPENID_DH_DEFAULT_MOD', '155172898181473697471232257763715539915724801'.
+       '966915404479707795314057629378541917580651227423698188993727816152646631'.
+       '438561595825688188889951272158842675419950341258706556549803580104870537'.
+       '681476726513255747040765857479291291572334510643245094715007229621094194'.
+       '349783925984760375594985848253359305585439638443');
+
+/**
+ * OpenID default generator for Diffie-Hellman key exchange.
+ */
+define('OPENID_DH_DEFAULT_GEN', '2');
+
+/** Constant for the global variable {@link $version} */
+define('OPENID_VERSION_2', 2);
+/** Constant for the global variable {@link $version} */
+define('OPENID_VERSION_1_1', 1);
+
+/** Constant for OpenID namespace */
+define('OPENID_NS_2_0', 'http://specs.openid.net/auth/2.0');
+/** Constant for OpenID namespace */
+define('OPENID_NS_1_1', 'http://openid.net/signon/1.1');
+/** Constant for OpenID namespace */
+define('OPENID_NS_1_0', 'http://openid.net/signon/1.0');
+
+/**
+ * Constant for the OP-local identifier which indicates that SimpleID should choose an identifier
+ *
+ * @link http://openid.net/specs/openid-authentication-2_0.html#anchor27
+ */
+define('OPENID_IDENTIFIER_SELECT', 'http://specs.openid.net/auth/2.0/identifier_select');
+/** Constant for the XRDS service type for return_to verification */
+define('OPENID_RETURN_TO', 'http://specs.openid.net/auth/2.0/return_to');
+
+/** Parameter for {@link openid_indirect_response_url()} */
+define('OPENID_RESPONSE_QUERY', 0);
+/** Parameter for {@link openid_indirect_response_url()} */
+define('OPENID_RESPONSE_FRAGMENT', 1);
+
+/**
+ * A mapping of Type URIs of OpenID extnesions to aliases provided in an OpenID
+ * request.
+ *
+ * @global array $openid_ns_to_alias
+ */
+$openid_ns_to_alias = array("http://openid.net/extensions/sreg/1.1" => "sreg"); // For sreg 1.0 compatibility
+
+
+/**
+ * Detects the OpenID version of the current request
+ *
+ * @param mixed $request the OpenID request
+ * @param string $key the key to look for to determine the OpenID
+ * version
+ * @return float either OPENID_VERSION_2 or OPENID_VERSION_1_1
+ * @see $version
+ *
+ */
+function openid_get_version($request, $key = 'openid.ns') {
+    if (!isset($request[$key])) return OPENID_VERSION_1_1;
+    if ($request[$key] != OPENID_NS_2_0) return OPENID_VERSION_1_1;
+    return OPENID_VERSION_2;
+}
+
+/**
+ * Creates a OpenID message for direct response.
+ *
+ * The response will be encoded using Key-Value Form Encoding.
+ *
+ * @param array $data the data in the response
+ * @param float $version the message version
+ * @return string the message in key-value form encoding
+ * @link http://openid.net/specs/openid-authentication-1_1.html#anchor32, http://openid.net/specs/openid-authentication-2_0.html#kvform
+ */
+function openid_direct_message($data, $version = OPENID_VERSION_2) {
+    $message = '';
+    $ns = '';
+    
+    // Add namespace for OpenID 2
+    if ($version == OPENID_VERSION_2) $ns = OPENID_NS_2_0;
+    if (($ns != '') && !isset($data['ns'])) $data['ns'] = $ns;
+    
+    foreach ($data as $key => $value) {
+        // Filter out invalid characters
+        if (strpos($key, ':') !== false) return null;
+        if (strpos($key, "\n") !== false) return null;
+        if (strpos($value, "\n") !== false) return null;
+        
+        $message .= "$key:$value\n";
+    }
+    return $message;
+}
+
+/**
+ * Sends a direct response.
+ *
+ * @param string $message an OpenID message encoded using Key-Value Form
+ * @param string $status the HTTP status to send
+ */
+function openid_direct_response($message, $status = '200 OK') {
+    if (substr(PHP_SAPI, 0, 3) === 'cgi') {
+        header("Status: $status");
+    } else {
+        header($_SERVER['SERVER_PROTOCOL'] . ' ' . $status);
+    }
+    
+    header("Content-Type: text/plain");
+    print $message;
+}
+
+/**
+ * Creates a OpenID message for indirect response.
+ *
+ * The response will be encoded using HTTP Encoding.
+ *
+ * @param array $data the data in the response
+ * @param float $version the message version
+ * @return array the message
+ * @link http://openid.net/specs/openid-authentication-2_0.html#indirect_comm
+ */
+function openid_indirect_message($data, $version = OPENID_VERSION_2) {
+    $ns = '';
+    
+    // Add namespace for OpenID 2
+    if ($version == OPENID_VERSION_2) $ns = OPENID_NS_2_0;
+    if (($ns != '') && !isset($data['openid.ns'])) $data['openid.ns'] = $ns;
+    
+    return $data;
+}
+
+/**
+ * Sends an indirect response to a URL.
+ *
+ * The indirect message is encoded in the URL and returned to the user agent using
+ * a HTTP redirect response.  The message can be encoded in either the query component
+ * or the fragment component of the URL.
+ *
+ * @param string $url the URL to which the response is to be sent
+ * @param array|string $message an OpenID message, which can either be an array of keys
+ * and values, or a URL-encoded query string
+ * @param int $component the component of the URL in which the indirect message is
+ * encoded, either OPENID_RESPONSE_QUERY or OPENID_RESPONSE_FRAGMENT
+ */ 
+function openid_indirect_response($url, $message, $component = OPENID_RESPONSE_QUERY) {
+    if (substr(PHP_SAPI, 0,3) === 'cgi') {
+        header('Status: 303 See Other');
+    } else {
+        header($_SERVER['SERVER_PROTOCOL'] . ' 303 See Other');
+    }
+
+    header('Location: ' . openid_indirect_response_url($url, $message, $component));
+    exit;
+}
+
+/**
+ * Encodes an indirect message into a URL
+ *
+ * @param string $url the URL to which the response is to be sent
+ * @param array|string $message an OpenID message, which can either be an array of keys
+ * and values, or a URL-encoded query string
+ * @param int $component the component of the URL in which the indirect message is
+ * encoded, either OPENID_RESPONSE_QUERY or OPENID_RESPONSE_FRAGMENT
+ * @return string the URL to which the response is to be sent, with the
+ * encoded message
+ */
+function openid_indirect_response_url($url, $message, $component = OPENID_RESPONSE_QUERY) {
+    // 1. Firstly, get the query string
+    $query = '';
+    
+    if (is_array($message)) {
+        $query = openid_urlencode_message($message);
+    } else {
+        $query = $message;
+    }
+    
+    // 2. If there is no query string, then we just return the URL
+    if (!$query) return $url;
+    
+    // 3. The URL may already have a query and a fragment.  If this is so, we
+    //    need to slot in the new query string properly.  We disassemble and
+    //    reconstruct the URL.
+    $parts = parse_url($url);
+    
+    $url = $parts['scheme'] . '://';
+    if (isset($parts['user'])) {
+        $url .= $parts['user'];
+        if (isset($parts['pass'])) $url .= ':' . $parts['pass'];
+        $url .= '@';
+    }
+    $url .= $parts['host'];
+    if (isset($parts['port'])) $url .= ':' . $parts['port'];
+    if (isset($parts['path'])) $url .= $parts['path'];
+    
+    if (($component == OPENID_RESPONSE_QUERY) || (strpos($url, '#') === FALSE)) {
+        $url .= '?' . ((isset($parts['query'])) ? $parts['query'] . '&' : '') . $query;
+        if (isset($parts['fragment'])) $url .= '#' . $parts['fragment'];
+    } elseif ($component == OPENID_RESPONSE_FRAGMENT) {
+        // In theory $parts['fragment'] should be an empty string, but the
+        // current draft specification does not prohibit putting other things
+        // in the fragment.
+        
+        if (isset($parts['query'])) {
+            $url .= '?' . $parts['query'] . '#' . $parts['fragment'] . '&' . $query;
+        } else {
+            $url .= '#' . $parts['fragment'] . '?' . $query;
+        }
+    }
+    return $url;
+}
+
+/**
+ * Encodes a message in application/x-www-form-urlencoded format.
+ *
+ * @param array $message the OpenID message to encode
+ * @return string the encoded message
+ * @since 0.8
+ */
+function openid_urlencode_message($message) {
+    $pairs = array();
+    
+    foreach ($message as $key => $value) {
+        $pairs[] = $key . '=' . rfc3986_urlencode($value);
+    }
+        
+    return implode('&', $pairs);
+}
+
+/**
+ * Sends a direct message indicating an error.  This is a convenience function
+ * for {@link openid_direct_response()}.
+ *
+ * @param string $error the error message
+ * @param array $additional any additional data to be sent with the error
+ * message
+ * @param float $version the message version
+ */
+function openid_direct_error($error, $additional = array(), $version = OPENID_VERSION_2) {
+    $message = openid_direct_message(array_merge(array('error' => $error), $additional), $version);
+    openid_direct_response($message, '400 Bad Request');
+}
+
+/**
+ * Sends an indirect message indicating an error.  This is a convenience function
+ * for {@link openid_indirect_response()}.
+ *
+ * @param string $url the URL to which the error message is to be sent
+ * @param string $error the error message
+ * @param array $additional any additional data to be sent with the error
+ * message
+ * @param float $version the message version
+ * @param int $component the component of the URL in which the indirect message is
+ * encoded, either OPENID_RESPONSE_QUERY or OPENID_RESPONSE_FRAGMENT
+ */
+function openid_indirect_error($url, $error, $additional = array(), $version = OPENID_VERSION_2, $component = OPENID_RESPONSE_QUERY) {
+    $message = openid_indirect_message(array_merge(array('openid.mode'=> 'error', 'openid.error' => $error), $additional), $version);
+    openid_indirect_response($url, $message, $component);
+}
+
+/**
+ * Gets the realm from the OpenID request.  This is specified differently
+ * depending on the OpenID version.
+ *
+ * @param mixed $request the OpenID request
+ * @param float $version the OpenID version for the message
+ * @return string the realm URI
+ */
+function openid_get_realm($request, $version) {
+    if ($version == OPENID_VERSION_1_1) {
+        $realm = $request['openid.trust_root'];
+    }
+
+    if ($version >= OPENID_VERSION_2) {
+        $realm = $request['openid.realm'];
+    }
+    
+    if (!$realm) {
+        $realm = $request['openid.return_to'];
+    }
+    
+    return $realm;
+}
+
+/**
+ * Parses a direct message.
+ *
+ * @param string $message the direct message to parse
+ * @return array an array containing the parsed key-value pairs
+ *
+ * @since 0.7
+ */
+function openid_parse_direct_message($message) {
+    $data = array();
+
+    $items = explode("\n", $message);
+    foreach ($items as $item) {
+        list ($key, $value) = explode(':', $item, 2);
+        $data[$key] = $value;
+    }
+
+    return $data;
+}
+
+/**
+ * Parses a query string.
+ *
+ * Query strings can be used to receive OpenID indirect messages.
+ *
+ * @param string $query the query string to parse
+ * @return array an array containing the parsed key-value pairs
+ *
+ * @since 0.7
+ */
+function openid_parse_query($query) {
+    $data = array();
+    
+    if ($query === NULL) return array();
+    if ($query === '') return array();
+    
+    $pairs = explode('&', $query);
+    
+    foreach ($pairs as $pair) {
+        list ($key, $value) = explode('=', $pair, 2);
+        $data[$key] = urldecode($value);
+    }
+
+    return $data;
+}
+
+/**
+ * Parses the OpenID request to extract namespace information.
+ *
+ * This function builds a map between namespace aliases and their Type URIs.
+ *
+ * @param array $request the OpenID request
+ */
+function openid_parse_request($request) {
+    global $openid_ns_to_alias;
+    
+    foreach ($request as $key => $value) {
+        if (strpos($key, 'openid.ns.') === 0) {
+            $alias = substr($key, 10);
+            $openid_ns_to_alias[$value] = $alias;
+        }
+    }
+}
+
+/**
+ * Determines whether a URL matches a realm.
+ *
+ * A URL matches a realm if:
+ *
+ * 1. The URL scheme and port of the URL are identical to those in the realm.
+ *    See RFC 3986, section 3.1 for rules about URI matching.
+ * 2. The URL's path is equal to or a sub-directory of the realm's path.
+ * 3. Either:
+ *    (a) The realm's domain contains the wild-card characters "*.", and the
+ *        trailing part of the URL's domain is identical to the part of the
+ *        realm following the "*." wildcard, or
+ *    (b) The URL's domain is identical to the realm's domain
+ *
+ * @param string $url to URL to test
+ * @param string $realm the realm
+ * @return bool true if the URL matches the realm
+ * @since 0.6
+ */
+function openid_url_matches_realm($url, $realm) {
+    $url = parse_url($url);
+    $realm = parse_url($realm);
+    
+    foreach(array('user', 'pass', 'fragment') as $key) {
+        if (array_key_exists($key, $url) || array_key_exists($key, $realm))
+            return false;
+    }
+    
+    if ($url['scheme'] != $realm['scheme']) return false;
+    
+    if (!isset($url['port']))
+        $url['port'] = '';
+    if (!isset($realm['port']))
+        $realm['port'] = '';
+    if (($url['port'] != $realm['port']))
+        return false;
+    
+    if (substr($realm['host'], 0, 2) == '*.') {
+        $realm_re = '/^([^.]+\.)?' . preg_quote(substr($realm['host'], 2)) . '$/i';
+    } else {
+        $realm_re = '/^' . preg_quote($realm['host']) . '$/i';
+    }
+    
+    if (!preg_match($realm_re, $url['host'])) return false;
+    
+    if (!isset($url['path']))
+        $url['path'] = '';
+    if (!isset($realm['path']))
+        $realm['path'] = '';
+    if (substr($realm['path'], -1) == '/') $realm['path'] = substr($realm['path'], 0, -1);
+    if (($url['path'] != $realm['path']) && !preg_match('#^' . preg_quote($realm['path']) . '/.*$#', $url['path'])) return false;
+    
+    return true;
+}
+
+/**
+ * Returns the URL of a relying party endpoint for a specified realm.  This URL
+ * is used to discover services associated with the realm.
+ *
+ * If the realm's domain contains the wild-card characters "*.", this is substituted
+ * with "www.".
+ *
+ * @param string $realm the realm
+ * @url string the URL
+ *
+ * @since 0.7
+ */
+function openid_realm_discovery_url($realm) {
+    $parts = parse_url($realm);
+    $host = strtr($parts['host'], array('*.' => 'www.'));;
+    
+    $url = $parts['scheme'] . '://';
+    if (isset($parts['user'])) {
+        $url .= $parts['user'];
+        if (isset($parts['pass'])) $url .= ':' . $parts['pass'];
+        $url .= '@';
+    }
+    $url .= $host;
+    if (isset($parts['port'])) $url .= ':' . $parts['port'];
+    if (isset($parts['path'])) $url .= $parts['path'];
+    if (isset($parts['query'])) $url .= '?' . $parts['query'];
+    if (isset($parts['fragment'])) $url .= '#' . $parts['fragment'];
+    return $url;
+}
+
+/**
+ * Verifies a return_to URL against the actual URL of the HTTP request.
+ *
+ * The return_to URL matches if:
+ *
+ * - The URL scheme, authority, and path are the same; and
+ * - Any query parameters that are present in the return_to URL are also present
+ *   with the same values in the actual request.
+ *
+ * @param string $return_to the URL specified in the openid.return_to parameter
+ * @param string $actual_url the actual URL requested
+ * @return bool true if the URLs match
+ *
+ * @since 0.7
+ */
+function openid_verify_return_to($return_to, $actual_url) {
+    $expected = parse_url($return_to);
+    $actual = parse_url($actual_url);
+    
+    // Schemes are case insensitive
+    if (strtoupper($expected['scheme']) != strtoupper($actual['scheme'])) return false;
+    
+    // Hosts are case insensitive
+    if (strtoupper($expected['host']) != strtoupper($actual['host'])) return false;
+    
+    if (!isset($expected['port']))
+        $expected['port'] = '';
+    if (!isset($actual['port']))
+        $actual['port'] = '';
+    if ($expected['port'] != $actual['port']) return false;
+    
+    if (!isset($expected['path']))
+        $expected['path'] = '';
+    if (!isset($actual['path']))
+        $actual['path'] = '';
+    if ($expected['path'] != $actual['path']) return false;
+    
+    if ($expected['query']) {
+        $expected_query = openid_parse_query($expected['query']);
+        $actual_query = openid_parse_query($actual['query']);
+        
+        foreach ($expected_query as $key => $value) {            
+            if (!array_key_exists($key, $actual_query)) return false;
+            if ($value != $actual_query[$key]) return false;
+        }
+    }
+    
+    return true;
+}
+
+/**
+ * Filters an OpenID request to find keys specific to an extension, as specified
+ * by the Type URI.
+ *
+ * For exmaple, if the extension has the Type URI http://example.com/ and the
+ * alias example, this function will return an array of all the keys in the
+ * OpenID request which starts with openid.example
+ *
+ * @param string $ns the Type URI of the extension
+ * @param array $request the OpenID request
+ * @return array the filtered request, with the prefix (in the example above,
+ * openid.example.) stripped in the keys.
+ */
+function openid_extension_filter_request($ns, $request) {
+    global $openid_ns_to_alias;
+    
+    if (!isset($openid_ns_to_alias[$ns])) return array();
+    
+    $alias = $openid_ns_to_alias[$ns];
+    $return = array();
+    
+    if (is_array($request)) {
+        foreach ($request as $key => $value) {
+            if ($key == 'openid.' . $alias) {
+                $return['#default'] = $value;
+            }
+            if (strpos($key, 'openid.' . $alias . '.') === 0) {
+                $return[substr($key, strlen('openid.' . $alias . '.'))] = $value;
+            }
+        }
+    }
+    
+    return $return;
+}
+
+/**
+ * Determines whether an extension is present in an OpenID request.
+ *
+ * @param string $ns the Type URI of the extension
+ * @param array $request the OpenID request
+ * @return bool true if the extension is present in the request
+ */
+function openid_extension_requested($ns, $request) {
+    global $openid_ns_to_alias;
+    
+    if (!isset($openid_ns_to_alias[$ns])) return false;
+    $alias = $openid_ns_to_alias[$ns];
+    
+    if (is_array($request)) {
+        foreach ($request as $key => $value) {
+            if ((strpos($key, 'openid.' . $alias . '.') === 0) || (strpos($key, 'openid.' . $alias . '=') === 0)) {
+                return true;
+            }
+        }
+    }
+    
+    return false;
+}
+
+/**
+ * Returns the OpenID alias for an extension, given a Type URI, based on the
+ * alias definitions in the current OpenID request.
+ *
+ * @param string $ns the Type URI
+ * @param bool|string $create whether to create an alias if the Type URI does not already
+ * have an alias in the current OpenID request.  If this parameter is a string,
+ * then the string specified is the preferred alias to be created, unless a collision
+ * occurs
+ * @return string the alias, or NULL if the Type URI does not already
+ * have an alias in the current OpenID request <i>and</i> $create is false
+ */
+function openid_extension_alias($ns, $create = FALSE) {
+    global $openid_ns_to_alias;
+    static $e = 1;
+    
+    if (isset($openid_ns_to_alias[$ns])) return $openid_ns_to_alias[$ns];
+    if ($create !== FALSE) {
+        if ($create === TRUE) {
+            $alias = 'e' . $e;
+            $e++;
+        } elseif (is_string($create)) {
+            $used_aliases = array_values($openid_ns_to_alias);
+        
+            $alias = $create;
+            $i = 0;
+        
+            while (in_array($alias, $used_aliases)) {
+                $i++;
+                $alias = $create . $i;
+            }
+        }
+        $openid_ns_to_alias[$ns] = $alias;
+        return $alias;
+    }
+    return NULL;
+}
+
+
+/* ------- OpenID nonce functions -------------------------------------------- */
+/**
+ * Generates a nonce for use in OpenID responses
+ *
+ * @return string an OpenID nonce
+ * @link http://openid.net/specs/openid-authentication-2_0.html#positive_assertions
+ */
+function openid_nonce() {
+    return gmstrftime('%Y-%m-%dT%H:%M:%SZ') . bin2hex(random_bytes(4));
+}
+
+/* ------- Diffie-Hellman Key Exchange functions ----------------------------- */
+
+/**
+ * Returns the association types supported by this server.
+ *
+ * @return array an array containing the association types supported by this server as keys
+ * and an array containing the key size (mac_size) and HMAC function (hmac_func) as
+ * values
+ */
+function openid_association_types() {
+    $association_types = array('HMAC-SHA1' => array('mac_size' => 20, 'hmac_func' => '_openid_hmac_sha1'));
+    if (OPENID_SHA256_SUPPORTED) $association_types['HMAC-SHA256'] = array('mac_size' => 32, 'hmac_func' => '_openid_hmac_sha256');
+    return $association_types;
+}
+
+/**
+ * Returns the association types supported by this server and the version of
+ * OpenID.
+ *
+ * OpenID version 1 supports an empty string as the session type.  OpenID version 2
+ * reqires a session type to be sent.
+ *
+ * @param bool $is_https whether the transport layer encryption is used for the current
+ * connection
+ * @param float $version the OpenID version, either OPENID_VERSION_1_1 and OPENID_VERSION_2
+ * @return array an array containing the session types supported by this server as keys
+ * and an array containing the hash function (hash_func) as
+ * values
+ */
+function openid_session_types($is_https = FALSE, $version = OPENID_VERSION_2) {
+    $session_types = array(
+        'DH-SHA1' => array('hash_func' => '_openid_sha1'),
+    );
+    if (OPENID_SHA256_SUPPORTED) $session_types['DH-SHA256'] = array('hash_func' => '_openid_sha256');
+    if (($version >= OPENID_VERSION_2) && ($is_https == TRUE)) {
+        // Under OpenID 2.0 no-encryption is only allowed if TLS is used
+        $session_types['no-encryption'] = array();
+    }
+    if ($version == OPENID_VERSION_1_1) $session_types[''] = array();
+    return $session_types;
+}
+
+/**
+ * Generates the cryptographic values required for responding to association
+ * requests
+ *
+ * This involves generating a key pair for the OpenID provider, then calculating
+ * the shared secret.  The shared secret is then used to encrypt the MAC key.
+ *
+ * @param string $mac_key the MAC key, in binary representation
+ * @param string $dh_consumer_public the consumer's public key, in Base64 representation
+ * @param string $dh_modulus modulus - a large prime number
+ * @param string $dh_gen generator - a primitive root modulo
+ * @param string $hash_func the hash function
+ * @return array an array containing (a) dh_server_public - the server's public key (in Base64), and (b)
+ * enc_mac_key encrypted MAC key (in Base64), encrypted using the Diffie-Hellman shared secret
+ */
+function openid_dh_server_assoc($mac_key, $dh_consumer_public, $dh_modulus = NULL, $dh_gen = NULL, $hash_func = '_openid_sha1') {
+    
+    // Generate a key pair for the server
+    $key_pair = openid_dh_generate_key_pair($dh_modulus, $dh_gen);
+    
+    // Generate the shared secret
+    $ZZ = openid_dh_shared_secret($dh_consumer_public, $key_pair['private'], $dh_modulus);
+
+    return array(
+        'dh_server_public' => $key_pair['public'],
+        'enc_mac_key' => openid_encrypt_mac_key($ZZ, $mac_key, $hash_func)
+    );
+}
+
+/**
+ * Complete association by obtaining the session MAC key from the key obtained
+ * from the Diffie-Hellman key exchange
+ *
+ * @param string $enc_mac_key the encrypted session MAC key, in Base64 represnetation
+ * @param string $dh_server_public the server's public key, in Base64 representation
+ * @param string $dh_consumer_private the consumer's private key, in Base64 representation
+ * @param string $dh_modulus modulus, in Base64 representation
+ * @param string $hash_func the hash function
+ * @return string the decrypted session MAC key, in Base64 representation
+ */
+function openid_dh_consumer_assoc($enc_mac_key, $dh_server_public, $dh_consumer_private, $dh_modulus = NULL, $hash_func = '_openid_sha1') {
+    // Retrieve the shared secret
+    $ZZ = openid_dh_shared_secret($dh_server_public, $dh_consumer_private, $dh_modulus);
+    
+    // Decode the encrypted MAC key
+    $encrypted_mac_key = base64_decode($enc_mac_key);
+    
+    return openid_encrypt_mac_key($ZZ, $encrypted_mac_key, $hash_func);
+}
+
+/**
+ * Calculates the shared secret for Diffie-Hellman key exchange.
+ *
+ * This is the second step in the Diffle-Hellman key exchange process.  The other
+ * party (in OpenID 1.0 terms, the consumer) has already generated the public
+ * key ($dh_consumer_public) and sent it to this party (the server).  The Diffie-Hellman
+ * modulus ($dh_modulus) and generator ($dh_gen) have either been sent or previously agreed.
+ *
+ * @param string $their_public the other party's public key, in Base64 representation
+ * @param string $my_private this party's private key, in Base64 representation
+ * @param string $dh_modulus modulus, in Base64 representation
+ * @return resource the shared secret (as a bignum)
+ *
+ * @see openid_dh_generate_key_pair()
+ * @link http://www.ietf.org/rfc/rfc2631.txt RFC 2631
+ */
+function openid_dh_shared_secret($their_public, $my_private, $dh_modulus = NULL) {
+    // Decode the keys
+    $y = _openid_base64_to_bignum($their_public);
+    $x = _openid_base64_to_bignum($my_private);
+    
+    if ($dh_modulus != NULL) {
+        $p = _openid_base64_to_bignum($dh_modulus);
+    } else {
+        $p = bignum_new(OPENID_DH_DEFAULT_MOD);
+    }
+
+    // Generate the shared secret = their public ^ my private mod p = my public ^ their private mod p
+    $ZZ = bignum_powmod($y, $x, $p);
+
+    return $ZZ;
+}
+
+/**
+ * Generates a key pair for Diffie-Hellman key exchange.
+ *
+ * @param string $dh_modulus modulus, in Base64 representation
+ * @param string $dh_gen generator, in Base64 representation
+ * @return array an array containing: (a) private - the private key, in Base64
+ * and (b) public - the public key, in Base64
+ */
+function openid_dh_generate_key_pair($dh_modulus = NULL, $dh_gen = NULL) {
+    if ($dh_modulus != NULL) {
+        $p = _openid_base64_to_bignum($dh_modulus);
+    } else {
+        $p = bignum_new(OPENID_DH_DEFAULT_MOD);
+    }
+
+    if ($dh_gen != NULL) {
+        $g = _openid_base64_to_bignum($dh_gen);
+    } else {
+        $g = bignum_new(OPENID_DH_DEFAULT_GEN);
+    }
+
+    // Generate the private key - a random number which is less than p
+    $rand = _openid_dh_rand($p);
+    $x = bignum_add($rand, 1);
+    
+    // Calculate the public key is g ^ private mod p
+    $y = bignum_powmod($g, $x, $p);
+    
+    return array('private' => _openid_bignum_to_base64($x), 'public' => _openid_bignum_to_base64($y));
+}
+
+
+/**
+ * Encrypts/decrypts and encodes the MAC key.
+ *
+ * @param resource $ZZ the Diffie-Hellman key exchange shared secret as a bignum
+ * @param string $mac_key a byte stream containing the MAC key
+ * @param string $hash_func the hash function
+ * @return string the encrypted MAC key in Base64 representation
+ */
+function openid_encrypt_mac_key($ZZ, $mac_key, $hash_func = '_openid_sha1') {
+    // Encrypt/decrypt the MAC key using the shared secret and the hash function
+    $encrypted_mac_key = _openid_xor($ZZ, $mac_key, $hash_func);
+    
+    // Encode the encrypted/decrypted MAC key
+    $enc_mac_key = base64_encode($encrypted_mac_key);
+    
+    return $enc_mac_key;
+}
+
+/**
+ * Encrypts/decrypts using XOR.
+ *
+ * @param string $key the encryption key as a bignum.  This is usually
+ * the shared secret (ZZ) calculated from the Diffie-Hellman key exchange
+ * @param string $plain_cipher the plaintext or ciphertext
+ * @param string $hash_func the hash function
+ * @return string the ciphertext or plaintext
+ */
+function _openid_xor($key, $plain_cipher, $hash_func = '_openid_sha1') {
+    $decoded_key = bignum_val($key, 256);
+    $hashed_key = call_user_func($hash_func, $decoded_key);
+    
+    $cipher_plain = "";
+    for ($i = 0; $i < strlen($plain_cipher); $i++) {
+        $cipher_plain .= chr(ord($plain_cipher[$i]) ^ ord($hashed_key[$i]));
+    }
+  
+    return $cipher_plain;
+}
+
+/**
+ * Generates a random integer, which will be used to derive a private key
+ * for Diffie-Hellman key exchange.  The integer must be less than $stop
+ *
+ * @param resource $stop a prime number as a bignum
+ * @return resource the random integer as a bignum
+ */
+function _openid_dh_rand($stop) {
+    static $duplicate_cache = array();
+  
+    // Used as the key for the duplicate cache
+    $rbytes = bignum_val($stop, 256);
+  
+    if (array_key_exists($rbytes, $duplicate_cache)) {
+        list($duplicate, $nbytes) = $duplicate_cache[$rbytes];
+    } else {
+        if ($rbytes[0] == "\x00") {
+            $nbytes = strlen($rbytes) - 1;
+        } else {
+            $nbytes = strlen($rbytes);
+        }
+    
+        $mxrand = bignum_pow(bignum_new(256), $nbytes);
+
+        // If we get a number less than this, then it is in the
+        // duplicated range.
+        $duplicate = bignum_mod($mxrand, $stop);
+
+        if (count($duplicate_cache) > 10) {
+            $duplicate_cache = array();
+        }
+    
+        $duplicate_cache[$rbytes] = array($duplicate, $nbytes);
+    }
+  
+    do {
+        $bytes = "\x00" . random_bytes($nbytes);
+        $n = bignum_new($bytes, 256);
+        // Keep looping if this value is in the low duplicated range
+    } while (bignum_cmp($n, $duplicate) < 0);
+
+    return bignum_mod($n, $stop);
+}
+
+/* ------- Arbitary precision arithmetic and conversion functions ------------ */
+/**
+ * Converts an arbitary precision integer, encoded in Base64, to a bignum
+ *
+ * @param string $str arbitary precision integer, encoded in Base64
+ * @return resource the string representation
+ */
+function _openid_base64_to_bignum($str) {
+    return bignum_new(base64_decode($str), 256);
+}
+
+/**
+ * Converts a string representation of an integer to an arbitary precision
+ * integer, then converts it to Base64 encoding.
+ *
+ * @param string $str the string representation
+ * @return string the Base64 encoded arbitary precision integer
+ */
+function _openid_bignum_to_base64($str) {
+    return base64_encode(bignum_val($str, 256));
+}
+
+/**
+ * Encode an integer as big-endian signed two's complement binary string.
+ *
+ * @param string $num the binary integer
+ * @return string the signed two's complement binary string
+ * @link http://openid.net/specs/openid-authentication-2_0.html#btwoc
+ */
+function _openid_btwoc($num) {
+    return pack('H*', $num);
+}
+
+/* ------- Hash and HMAC functions ------------------------------------------- */
+/**
+ * Calculates a signature of an OpenID message
+ *
+ * @param array $data the data in the message
+ * @param array $keys a list of keys in the message to be signed (without the
+ * 'openid.' prefix)
+ * @param string $mac_key the MAC key used to sign the message, in Base64 representation
+ * @param string $hmac_func the HMAC function used in the signing process
+ * @param float $version the OpenID version
+ * @return string the signature encoded in Base64
+ */
+function openid_sign($data, $keys, $mac_key, $hmac_func = '_openid_hmac_sha1', $version = OPENID_VERSION_2) {
+    $signature = '';
+    $sign_data = array();
+
+    foreach ($keys as $key) {
+        if (array_key_exists('openid.' . $key, $data)) {
+            $sign_data[$key] = $data['openid.' . $key];
+        }
+    }
+    
+    $signature_base_string = _openid_signature_base_string($sign_data, $version);
+    $secret = base64_decode($mac_key);
+    $signature = call_user_func($hmac_func, $secret, $signature_base_string);
+
+    return base64_encode($signature);
+}
+
+/**
+ * Calculates the base string from which an OpenID signature is generated.
+ *
+ * OpenID versions 1 and 2 specify that messages are to be encoded using Key-Value
+ * Encoding when generating signatures.  However, future OpenID version may
+ * specify different ways of encoding the message, such as OAuth.
+ * 
+ * @param array $data the data to sign
+ * @param float $version the OpenID version
+ * @return string the signature base string
+ * @link http://openid.net/specs/openid-authentication-2_0.html#anchor11
+ */
+function _openid_signature_base_string($data, $version) {
+    switch ($version) {
+        case OPENID_VERSION_1_1:
+        case OPENID_VERSION_2:
+            // We set OPENID_VERSION_1_1 because we don't want to sign the namespace header
+            $signature_base_string = openid_direct_message($data, OPENID_VERSION_1_1);
+            break;
+        default:
+            // We set OPENID_VERSION_1_1 because we don't want to sign the namespace header
+            $signature_base_string = openid_direct_message($data, OPENID_VERSION_1_1);
+    }
+    return $signature_base_string;
+}
+
+/**
+ * Obtains the SHA1 hash of a string in binary representation.
+ *
+ * @param string $text the text to be hashed
+ * @return string the hash in binary representation
+ */
+function _openid_sha1($text) {
+    return sha1($text, true);
+}
+
+/**
+ * Obtains the keyed hash value using the HMAC method and the SHA1 algorithm
+ *
+ * @param string $key the key in binary representation
+ * @param string $text the text to be hashed
+ * @return string the hash in binary representation
+ */
+function _openid_hmac_sha1($key, $text) {
+    if (function_exists('hash_hmac') && function_exists('hash_algos') && (in_array('sha1', hash_algos()))) {
+        return hash_hmac('sha1', $text, $key, true);
+    } else {
+        if (!defined('OPENID_SHA1_BLOCKSIZE')) define('OPENID_SHA1_BLOCKSIZE', 64);
+        
+        if (strlen($key) > OPENID_SHA1_BLOCKSIZE) {
+            $key = _openid_sha1($key);
+        }
+    
+        $key = str_pad($key, OPENID_SHA1_BLOCKSIZE, chr(0x00));
+        $ipad = str_repeat(chr(0x36), OPENID_SHA1_BLOCKSIZE);
+        $opad = str_repeat(chr(0x5c), OPENID_SHA1_BLOCKSIZE);
+        $hash1 = _openid_sha1(($key ^ $ipad) . $text);
+        $hmac = _openid_sha1(($key ^ $opad) . $hash1);
+        return $hmac;
+    }
+}
+
+// Check if SHA-256 support is available
+if (function_exists('hash_hmac') && function_exists('hash_algos') && (in_array('sha256', hash_algos()))) {
+    
+    /**
+     * Whether the current installation of PHP supports SHA256.  SHA256 is supported
+     * if the hash module is properly compiled and loaded into PHP.
+     */
+    define('OPENID_SHA256_SUPPORTED', true);
+    
+    /**
+     * Obtains the SHA256 hash of a string in binary representation.
+     *
+     * @param string $text the text to be hashed
+     * @return string $hash the hash in binary representation
+     */
+    function _openid_sha256($text) {
+        return hash('sha256', $text, true);
+    }
+    
+    /**
+     * Obtains the keyed hash value using the HMAC method and the SHA256 algorithm
+     *
+     * @param string $key the key in binary representation
+     * @param string $text the text to be hashed
+     * @return string the hash in binary representation
+     */
+    function _openid_hmac_sha256($key, $text) {
+        return hash_hmac('sha256', $text, $key, true);
+    }
+} else {
+    /** @ignore */
+    define('OPENID_SHA256_SUPPORTED', false);
+}
+
+if (!function_exists('rfc3986_urlencode')) {
+    /**
+     * Encodes a URL using RFC 3986.
+     *
+     * PHP's rfc3986_urlencode function encodes a URL using RFC 1738 for PHP versions
+     * prior to 5.3.  RFC 1738 has been
+     * updated by RFC 3986, which change the list of characters which needs to be
+     * encoded.
+     *
+     * Strictly correct encoding is required for various purposes, such as OAuth
+     * signature base strings.
+     *
+     * @param string $s the URL to encode
+     * @return string the encoded URL
+     */
+    function rfc3986_urlencode($s) {
+        if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
+            return rawurlencode($s);
+        } else {
+            return str_replace('%7E', '~', rawurlencode($s));
+        }
+    }
+}
+?>
\ No newline at end of file
diff --git a/simpleid/www/page.inc.php b/simpleid/www/page.inc.php
new file mode 100644
index 0000000..c1c5ef6
--- /dev/null
+++ b/simpleid/www/page.inc.php
@@ -0,0 +1,331 @@
+<?php 
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2009
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Functions for displaying various pages in SimpleID.
+ *
+ * @package simpleid
+ * @filesource
+ * @since 0.7
+ */
+ 
+/**
+ * Displays the dashboard page.
+ */
+function page_dashboard() {
+    global $user;
+    global $xtpl;
+    
+    // Require HTTPS, redirect if necessary
+    check_https('redirect', true);
+    
+    if ($user == NULL) {
+        user_login_form('');
+        return;
+    }
+    
+    user_header();
+    page_nav();
+    
+    $blocks = _page_welcome_block();
+    
+    $blocks = array_merge($blocks, _page_dashboard_otp_block(), extension_invoke_all('page_dashboard'));
+    $blocks = array_map('page_render_block', $blocks);
+    $xtpl->assign('blocks', implode($blocks));
+    $xtpl->parse('main.blocks');
+    
+    $xtpl->assign('title', t('Dashboard'));
+    $xtpl->parse('main');
+    $xtpl->out('main');
+
+}
+
+/**
+ * Displays the profile page.
+ */
+function page_profile() {
+    global $user;
+    global $xtpl;
+    
+    // Require HTTPS, redirect if necessary
+    check_https('redirect', true);
+    
+    if ($user == NULL) {
+        user_login_form('my/profile');
+        return;
+    }
+    
+    user_header();
+    page_nav();
+    
+    $blocks = _page_discovery_block();
+
+    $blocks = array_merge($blocks, _user_page_profile(), extension_invoke_all('page_profile'));
+    $blocks = array_map('page_render_block', $blocks); 
+    $xtpl->assign('blocks', implode($blocks));
+    $xtpl->parse('main.blocks');
+    
+    $xtpl->assign(array('js_locale_label' => 'code', 'js_locale_text' => addslashes(t('<em>You need to set at least one of OpenID 1.x or OpenID 2 to generate the code.</em>'))));
+    $xtpl->parse('main.js_locale');
+    
+    $xtpl->assign('javascript', '<script src="' . get_base_path() . 'html/page-profile.js" type="text/javascript"></script>');
+    $xtpl->assign('title', t('My Profile'));
+    $xtpl->parse('main');
+    $xtpl->out('main');
+}
+
+/**
+ * Returns the user's home page.
+ */
+function page_sites() {
+    global $user;
+    global $xtpl;
+    
+    // Require HTTPS, redirect if necessary
+    check_https('redirect', true);
+    
+    if ($user == NULL) {
+        user_login_form('my/sites');
+        return;
+    }
+    
+    user_header();
+    page_nav();
+    
+    if (isset($user['rp'])) {
+        $user_rps =& $user['rp'];
+    } else {
+        $user_rps = array();
+    }
+    
+    if (isset($_POST['tk'])) {
+        if (!validate_form_token($_POST['tk'], 'autorelease')) {
+            set_message(t('SimpleID detected a potential security attack.  Please try again.'));
+        } else {
+            if (isset($_POST['autorelease'])) {
+                foreach ($_POST['autorelease'] as $realm => $autorelease) {
+                    if (isset($user_rps[$realm])) {
+                        $user_rps[$realm]['auto_release'] = ($autorelease) ? 1 : 0;
+                    }
+                }
+            }
+            
+            if (isset($_POST['remove'])) {
+                foreach ($_POST['remove'] as $realm => $autorelease) {
+                    if (isset($user_rps[$realm])) {
+                        unset($user_rps[$realm]);
+                    }
+                }
+            }
+            
+            if (isset($_POST['update-all'])) {
+                foreach ($user_rps as $realm => $values) {
+                    $user_rps[$realm]['auto_release'] = (isset($_POST['autorelease'][$realm]) && $_POST['autorelease'][$realm]) ? 1 : 0;
+                }
+            }
+            
+            user_save($user);
+    
+            set_message(t('Your preferences have been saved.'));
+        }
+    }
+    
+    if ($user_rps) {
+        uksort($user_rps, '_page_sites_sort');
+        foreach ($user_rps as $realm => $rp) {
+            $xtpl->assign('realm_name', preg_replace('@^https?://(www\.|\*\.)?@', '<span class="url-elide">$0</span>', htmlspecialchars($rp['realm'], ENT_QUOTES, 'UTF-8')));
+            $xtpl->assign('realm', htmlspecialchars($rp['realm'], ENT_QUOTES, 'UTF-8'));
+            $xtpl->assign('last_time', htmlspecialchars($rp['last_time'], ENT_QUOTES, 'UTF-8'));
+            $xtpl->assign('last_time_formatted', htmlspecialchars(strftime(SIMPLEID_DATE_TIME_FORMAT, $rp['last_time']), ENT_QUOTES, 'UTF-8'));
+            $xtpl->assign('auto_release', (isset($rp['auto_release']) && $rp['auto_release']) ? 'checked="checked"' : '');
+            
+            if (SIMPLEID_VERIFY_RETURN_URL_USING_REALM) {
+                // $rp_info would usually expire by now, so we allow for stale results to be retrieved to improve performance
+                $rp_info = simpleid_get_rp_info($realm, TRUE);
+                if (!isset($rp_info['return_to_verified']) || !$rp_info['return_to_verified']) $xtpl->assign('realm_class', 'return-to-suspect');
+            }
+            
+            $xtpl->parse('main.sites.realm');
+        }
+    }
+    
+    if (!$user_rps || (count($user_rps) == 0)) {
+        $xtpl->assign('disabled', 'disabled="disabled"');
+    }
+    
+    $xtpl->assign('token', get_form_token('autorelease'));
+    
+    $xtpl->assign('realm_label', t('Site'));
+    $xtpl->assign('last_time_label', t('Last access'));
+    $xtpl->assign('auto_release_label', t('Automatic'));
+    $xtpl->assign('remove_label', t('Remove'));
+    $xtpl->assign('submit_button', t('Submit'));    
+    
+    $xtpl->parse('main.sites');
+    
+    $xtpl->assign(array('js_locale_label' => 'openid_suspect', 'js_locale_text' => addslashes(t('This web site has not confirmed its identity and might be fraudulent.')) . '\n\n' . addslashes(t('Are you sure you wish to automatically send your information to this site for any future requests?'))));
+    $xtpl->parse('main.js_locale');
+    
+    $xtpl->assign('title', t('My Sites'));
+    $xtpl->assign('javascript', '<script src="' . get_base_path() . 'html/openid-consent.js" type="text/javascript"></script>');
+    $xtpl->parse('main');
+    $xtpl->out('main');
+}
+
+/**
+ * A custom sort function for realms.  This strips out the following:
+ *
+ * - http://
+ * - https://
+ * - www.
+ * - *.
+ *
+ * @param string $a
+ * @param string $b
+ * @return int
+ */
+function _page_sites_sort($a, $b) {
+    $a = preg_replace('@^https?://(www\.|\*\.)?@', '', $a);
+    $b = preg_replace('@^https?://(www\.|\*\.)?@', '', $b);
+    return strcasecmp($a, $b);
+}
+
+/**
+ * Set up the navigation section in the header
+ */
+function page_nav() {
+    global $user;
+    global $xtpl;
+    
+    $xtpl->assign('nav_base', trim(simpleid_url(' ', '', true)));
+    
+    $xtpl->assign('nav_dashboard_label', t('Dashboard'));
+    $xtpl->assign('nav_profile_label', t('My Profile'));
+    $xtpl->assign('nav_sites_label', t('My Sites'));
+    
+    $xtpl->parse('main.nav_toggle');
+    $xtpl->parse('main.nav');
+}
+
+/**
+ * Renders a particular block.
+ *
+ * @param array $block the block to render
+ * @return string the HTML of the rendered block
+ */
+function page_render_block($block) {
+    static $xtpl_block;
+    
+    if (!$xtpl_block) $xtpl_block = new XTemplate('html/block.xtpl');
+    
+    $xtpl_block->reset('block');
+    $xtpl_block->assign('id', $block['id']);
+    $xtpl_block->assign('title', $block['title']);
+    $xtpl_block->assign('content', $block['content']);
+    
+    if (isset($block['links'])) {
+        $xtpl_block->assign('links', $block['links']);
+        $xtpl_block->parse('block.links');
+    }
+    
+    $xtpl_block->parse('block');
+    return $xtpl_block->text('block');
+}
+
+/**
+ * Returns the welcome block.
+ *
+ * @return array the welcome block
+ */
+function _page_welcome_block() {
+    global $user;
+    
+    return array(array(
+        'id' => 'welcome',
+        'title' => t('Welcome'),
+        'content' => t('You are logged in as %uid (%identity).', array('%uid' => $user['uid'], '%identity' => $user['identity']))
+    ));
+}
+
+/**
+ * Returns the dashboard OTP block.
+ *
+ * @return array the dashboard OTP block
+ */
+function _page_dashboard_otp_block() {
+    global $user;
+
+    $base_path = get_base_path();
+
+    $html = '<p>' . t('Login verification adds an extra layer of protection to your account. When enabled, you will need to enter an additional security code whenever you log into SimpleID.') . '</p>';
+
+    if (isset($user['otp'])) {
+        $html .= '<p>' . t('Login verification is <strong>enabled</strong>.') . '</p>';
+        $html .= '<form action="' . $base_path . 'index.php" method="post" enctype="application/x-www-form-urlencoded"><input type="hidden" name="tk" value="'. get_form_token('dashboard_otp') . '"/>';
+        $html .= '<input type="hidden" name="q" value="otp"/><input type="submit" name="op" value="' . t('Disable') . '" /></form>';
+    } else {
+        $html .= '<p>' . t('Login verification is <strong>disabled</strong>. To enable login verification, click the button below.') . '</p>';
+        $html .= '<form action="' . $base_path . 'index.php" method="post" enctype="application/x-www-form-urlencoded"><input type="hidden" name="tk" value="'. get_form_token('dashboard_otp') . '"/>';
+        $html .= '<input type="hidden" name="q" value="otp"/><input type="submit" name="op" value="' . t('Enable') . '" /></form>';
+    }
+    
+    return array(array(
+        'id' => 'otp',
+        'title' => t('Login Verification'),
+        'content' => $html
+    ));
+}
+
+/**
+ * Returns a block containing discovery information.
+ *
+ * @return array the discovery block
+ */
+function _page_discovery_block() {
+    global $user;
+    
+    $html = "<h3>" . t('&lt;link&gt; tags') . "</h3>";
+    
+    $html .= "<div><label><input type=\"checkbox\" name=\"openid1\" value=\"1\" id=\"discovery-openid1\" class=\"discovery-checkbox\" />" . t('OpenID 1.x') . "</label>";
+    $html .= "<label><input type=\"checkbox\" name=\"openid2\" value=\"1\" id=\"discovery-openid2\" class=\"discovery-checkbox\" />" . t('OpenID 2.0') . "</label>";
+    $html .= "<label><input type=\"checkbox\" name=\"local-id\" value=\"1\" id=\"discovery-local-id\" class=\"discovery-checkbox\" />" . t('Claim a different identifier') . "</label></div>";
+    $html .= "<pre id=\"discovery-link-tags\">";
+    $html .= "</pre>";
+    $html .= "<ul id=\"discovery-templates\"><li class=\"openid1\">&lt;link rel=&quot;openid.server&quot; href=&quot;" . htmlspecialchars(simpleid_url(), ENT_QUOTES, 'UTF-8') . "&quot; /&gt;</li>\n";
+    $html .= "<li class=\"openid2\">&lt;link rel=&quot;openid2.provider&quot; href=&quot;" . htmlspecialchars(simpleid_url(), ENT_QUOTES, 'UTF-8') ."&quot; /&gt;</li>\n";
+    $html .= "<li class=\"openid1-local-id\">&lt;link rel=&quot;openid.delegate&quot; href=&quot;" . htmlspecialchars($user['identity'], ENT_QUOTES, 'UTF-8') . "&quot; /&gt;</li>\n";
+    $html .= "<li class=\"openid2-local-id\">&lt;link rel=&quot;openid2.local_id&quot; href=&quot;" . htmlspecialchars($user['identity'], ENT_QUOTES, 'UTF-8') ."&quot; /&gt;</li></ul>\n";
+
+    $html .= "<h3>" . t('YADIS') . "</h3>";
+    $html .= "<ol><li>" . t('Write your own or <a href="!url">download</a> your YADIS document', array('!url' => simpleid_url('xrds/'. $user['uid'], '', true))) . "</li>";
+    $html .= "<li><div>" . t('Add HTTP headers or &lt;meta&gt; tag, e.g.:') . "<div><pre>&lt;meta http-equiv=&quot;X-XRDS-Location&quot; content=&quot;" . htmlspecialchars(simpleid_url('xrds/'. $user['uid']), ENT_QUOTES, 'UTF-8') . "&quot; /></pre>";
+    $html .= "</li></ol>";
+    
+    return array(array(
+        'id' => 'discovery',
+        'title' => t('Claim your Identifier'),
+        'content' => $html,
+        'links' => '<a href="http://simpleid.org/docs/1/identity-claim/">More information</a>'
+    ));
+}
+?>
diff --git a/simpleid/www/random.inc.php b/simpleid/www/random.inc.php
new file mode 100644
index 0000000..efee496
--- /dev/null
+++ b/simpleid/www/random.inc.php
@@ -0,0 +1,107 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2010
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Functions related to generating random bits and unique values.
+ *
+ * @package simpleid
+ * @since 0.8
+ * @filesource
+ */
+
+if (!defined('SIMPLEID_RAND_SOURCE')) {
+    /**
+     * The source of random bits.  On Unix-like systems, this could be /dev/random
+     * or /dev/urandom
+     */
+    define('SIMPLEID_RAND_SOURCE', '/dev/urandom');
+}
+
+/**
+ * Obtains a number of random bytes.  This function uses an entropy source specified
+ * in SIMPLEID_RAND_SOURCE.  If SIMPLEID_RAND_SOURCE is not available, the mt_rand()
+ * PHP function is used
+ * If the native PHP random_bytes function exists (PHP 7+), this function won't be defined here.
+ *
+ * @param int $num_bytes the number of bytes to generate
+ * @return string a string containing random bytes
+ */
+if(!function_exists('random_bytes')) {
+    function random_bytes($num_bytes) {
+        static $f = null;
+        $bytes = '';
+        if ($f === null) {
+            if (SIMPLEID_RAND_SOURCE === null) {
+                $f = FALSE;
+            } else {
+                $f = @fopen(SIMPLEID_RAND_SOURCE, "r");
+            }
+        }
+        if ($f === FALSE) {
+            $bytes = '';
+            for ($i = 0; $i < $num_bytes; $i += 4) {
+                $bytes .= pack('L', mt_rand());
+            }
+            $bytes = substr($bytes, 0, $num_bytes);
+        } else {
+            $bytes = fread($f, $num_bytes);
+        }
+        return $bytes;
+    }
+}
+
+/**
+ * Obtains a random string of a specified number of bytes of entropy.
+ *
+ * The function calls the {@link random_bytes()} function with the specified
+ * number of bytes, then converts to a string containing only alphanumeric
+ * characters (case sensitive), plus the characters ., _ and -.
+ *
+ * The conversion method is based on the Base64 encoding.  However, non-standard
+ * characters are used so that users are not confused and attempt to decode
+ * the returned string.
+ *
+ * @param int $num_bytes the approximate number of bytes of entropy in the
+ * random string
+ * @return string the random string
+ */
+function random_secret($num_bytes = 32) {
+    return strtr(base64_encode(random_bytes($num_bytes)),
+        'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
+        '-_.9876543210zyxwvutsrqponmlkjihgfedcbaZYXWVUTSRQPONMLKJIHGFEDCBA');
+}
+
+/**
+ * Generates a relatively unique identifier which can be used as, among other things,
+ * an OpenID association handle or an OAuth client identifier.  The identifier
+ * returned is at least 24 characters long and contains only hexadecimal characters.
+ *
+ * Note that the identifier returned is not cryptographically secure.
+ *
+ * @return string a relatively unique identifier
+ */
+function random_id() {
+    $timeofday = gettimeofday();
+    return vsprintf('%08x%08x', $timeofday) . bin2hex(random_bytes(4));
+}
+?>
diff --git a/simpleid/www/simpleweb.inc.php b/simpleid/www/simpleweb.inc.php
new file mode 100644
index 0000000..48cdbc6
--- /dev/null
+++ b/simpleid/www/simpleweb.inc.php
@@ -0,0 +1,157 @@
+<?php 
+/*
+ * SimpleWeb
+ *
+ * Copyright (C) Kelvin Mo 2009
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * Simpleweb is a minimalist web framework.  It is similar to {@link http://webpy.org web.py},
+ * but in PHP.
+ *
+ * The key to Simpleweb is the <i>route array</i>.  The route array is an array that maps
+ * URLs (called <i>patterns</i>) to PHP functions or methods (called <i>routes</i>).
+ *
+ * Patterns are regular expressions, which are tested against the URL one at a time.
+ * Subpatterns (i.e. patterns within parentheses) are then passed on as arguments
+ * to the route.
+ *
+ * Routes are either functions, static methods or object methods.  A function is
+ * denoted by the function name.  A static method is denoted by the class name,
+ * followed by :: then the method name.  An object method is denoted by the class
+ * name, followed by -&gt; then the method name.  An instance of the class will be
+ * created before an object method is called.
+ *
+ * An example of a routes array is given below:
+ *
+ * <code>
+ * <?php
+ * $routes = array(
+ *     'a' => 'function1',
+ *     'b/(.+)' => 'function2',   // arguments
+ *     'c' => 'ClassA::method',   // static method
+ *     'd' => 'ClassB->method',   // object method
+ * );
+ * ?>
+ * </code>
+ *
+ * Once the route array is populated, the {@link simpleweb_run()} function
+ * is then called to handle the URL.
+ *
+ * @package simpleweb
+ * @since 0.7
+ */
+
+/**
+ * Handles a supplied request, based on a set of routes.
+ *
+ * @param array $routes the routes array, as described in {@link simpleweb.inc this page}
+ * @param string $request_path the request path against which the routes are applied.  If
+ * NULL, then the request URI supplied by the web server will be used.
+ * @param string $not_found_route the default route if none of the patterns match.  If
+ * NULL, then an HTTP 404 error is raised
+ * @return mixed the result from calling the route.
+ *
+ */
+ 
+function simpleweb_run($routes, $request_path = NULL, $not_found_route = NULL) {
+    if ($request_path == NULL) {
+        // We take the request path from the request URI
+        $request_path = $_SERVER['REQUEST_URI'];
+        
+        // Strip off all parts to the script file name.  Sadly, PHP is historically
+        // buggy in its treatment of SCRIPT_NAME, so we need to try a few methods
+        // to strip them
+        $script_name = basename($_SERVER['SCRIPT_NAME']);
+        $script_dir = dirname($_SERVER['SCRIPT_NAME']);
+        
+        if (strpos($request_path, $script_name) !== false) {
+            $request_path = substr($request_path, strpos($request_path, $script_name) + strlen($script_name));
+        } elseif ($script_dir != '/') {
+            $request_path = str_replace($script_dir, '', $request_path);
+        }
+        
+        $request_path = trim($request_path, '/');
+    }
+    
+    // Strip off GET parameters when passed in SAPI CGI mode
+    $request_path = strtok($request_path, '?');
+    
+    foreach ($routes as $pattern => $route) {
+        
+        if (!isset($route)) continue;
+        $regex = '#^' . trim($pattern, '/') . '$#i';
+        
+        if (!preg_match($regex, $request_path, $args) > 0) continue;
+        
+        $args = (count($args) > 1) ? array_slice($args, 1) : array();
+        return _simpleweb_invoke($route, $args);
+    }
+    
+    if ($not_found_route) return _simpleweb_invoke($not_found_route, array($request_path));
+    
+    _simpleweb_not_found();
+}
+
+/**
+ * Invokes a route.
+ *
+ * @param string $route the route
+ * @param array $args the arguments
+ * @return mixed the result from calling the route.
+ */
+function _simpleweb_invoke($route, $args = array()) {
+    if (strpos($route, '::') !== false) {
+        list($class, $method) = split($route, '::', 2);
+        return call_user_func_array(array($class, $method), $args);
+    } elseif(strpos($route, '->') !== false) {
+        list($class, $method) = split($route, '->', 2);
+        $object &= new $class;
+        return call_user_func_array(array($object, $method), $args);
+    } else {
+        return call_user_func_array($route, $args);
+    }
+}
+
+/**
+ * Displays a HTTP 404 Not Found error and exits.
+ */
+function _simpleweb_not_found() {
+    switch ($_SERVER['REDIRECT_STATUS']) { 
+ 	    case '403':
+ 	        $status = '403 Forbidden';  
+ 	        break;
+ 	    case '404':
+ 		default: 
+ 		    $status = '404 Not Found'; 
+ 		    break; 
+    } 
+    
+    if (substr(PHP_SAPI, 0, 3) === 'cgi') {
+        header('Status: ' . $status);
+    } else {
+        header($_SERVER['SERVER_PROTOCOL'] . ' ' . $status);
+    }
+    header('Content-Type: text/html');
+    
+    print '<!doctype html><html><head><title>' . $status . '</title></head><body><h1>' . $status . '</h1></body></html>';
+    
+    exit;
+}
+?>
diff --git a/simpleid/www/upgrade.php b/simpleid/www/upgrade.php
new file mode 100644
index 0000000..a4d5940
--- /dev/null
+++ b/simpleid/www/upgrade.php
@@ -0,0 +1,466 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2009
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+
+/**
+ * SimpleID upgrade script.
+ *
+ * This script performs various upgrades to SimpleID's storage backend, which
+ * are required for different versions of SimpleID.
+ *
+ * @package simpleid
+ * @since 0.7
+ * @filesource
+ */
+
+/**
+ * Access control for this script.
+ *
+ * If you are upgrading your SimpleID installation using the upgrade.php script,
+ * and you are not logged in as an administrator, you will need to modify the access
+ * check statement below.
+ *
+ * Change the TRUE to a FALSE to disable the access
+ * check. After finishing the upgrade, be sure to open this file again
+ * and change the FALSE back to a TRUE.
+ *
+ * @global bool $upgrade_access_check
+ */
+$upgrade_access_check = TRUE;
+
+/* ----- Do not modify anything following this line ------------------------- */
+
+include_once "version.inc.php";
+include_once "locale.inc.php";
+if (file_exists("config.php")) {
+    include_once "config.php";
+} elseif (file_exists("config.inc")) {
+    include_once "config.inc";
+    define('UPGRADE_LEGACY_CONFIG_INC', TRUE);
+} else {
+    die(t('No configuration file found.  See the <a href="!url">manual</a> for instructions on how to set up a configuration file.', array('!url' => 'http://simpleid.org/docs/1/installing/')));
+}
+include_once "config.default.php";
+include_once "log.inc.php";
+include_once "common.inc.php";
+include_once "simpleweb.inc.php";
+include_once "openid.inc.php";
+include_once "user.inc.php";
+include_once "cache.inc.php";
+include_once SIMPLEID_STORE . ".store.php";
+include "lib/xtemplate.class.php";
+
+define('CACHE_DIR', SIMPLEID_CACHE_DIR);
+
+define('PRE_0_7_0_VERSION', '0.6.0 or earlier');
+
+/**
+ * This variable holds the upgrade functions for each version of SimpleID
+ *
+ * @global array $upgrade_functions
+ */
+$upgrade_functions = array(
+    '0.9.0' => array('upgrade_config_inc_to_php', 'upgrade_delete_token'),
+    '0.7.0' => array('upgrade_rp_to_store', 'upgrade_token_to_store')
+);
+
+
+/**
+ * This variable holds an instance of the XTemplate engine.
+ *
+ * @global object $xtpl
+ */
+$xtpl = NULL;
+
+/**
+ * This variable holds the combined $_GET and $_POST superglobal arrays.
+ *
+ * @global array $GETPOST
+ */
+$GETPOST = array_merge($_GET, $_POST);
+
+upgrade_start();
+
+/**
+ * Entry point for SimpleID upgrade script.
+ *
+ * @see user_init()
+ */
+function upgrade_start() {
+    global $xtpl, $GETPOST;
+    
+    locale_init(SIMPLEID_LOCALE);
+        
+    $xtpl = new XTemplate('html/template.xtpl');
+    $xtpl->assign('version', SIMPLEID_VERSION);
+    $xtpl->assign('base_path', get_base_path());
+    $xtpl->assign('css', '@import url(' . get_base_path() . 'html/upgrade.css);');
+    $xtpl->assign('footer_doc', t('Documentation'));
+    $xtpl->assign('footer_support', t('Support'));
+    
+    if (!is_dir(SIMPLEID_IDENTITIES_DIR)) {
+        indirect_fatal_error(t('Identities directory not found.  See the <a href="!url">manual</a> for instructions on how to set up SimpleID.', array('!url' => 'http://simpleid.org/docs/1/installing/')));
+    }
+    
+    if (!is_dir(SIMPLEID_CACHE_DIR) || !is_writeable(SIMPLEID_CACHE_DIR)) {
+        indirect_fatal_error(t('Cache directory not found or not writeable.  See the <a href="!url">manual</a> for instructions on how to set up SimpleID.', array('!url' => 'http://simpleid.org/docs/1/installing/')));
+    }
+    
+    if (!is_dir(SIMPLEID_STORE_DIR) || !is_writeable(SIMPLEID_STORE_DIR)) {
+        indirect_fatal_error(t('Store directory not found or not writeable.  See the <a href="!url">manual</a> for instructions on how to set up SimpleID.', array('!url' => 'http://simpleid.org/docs/1/installing/')));
+    }
+
+    if ((@ini_get('register_globals') === 1) || (@ini_get('register_globals') === '1') || (strtolower(@ini_get('register_globals')) == 'on')) {
+        indirect_fatal_error(t('register_globals is enabled in PHP configuration, which is not supported by SimpleID.  See the <a href="!url">manual</a> for further information.', array('!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+    
+    if (!bignum_loaded()) {
+        log_fatal('gmp/bcmath PHP extension not loaded.');
+        indirect_fatal_error(t('One or more required PHP extensions (%extension) is not loaded.  See the <a href="!url">manual</a> for further information on system requirements.', array('%extension' => 'gmp/bcmath', '!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+    if (!function_exists('preg_match')) {
+        log_fatal('pcre PHP extension not loaded.');
+        indirect_fatal_error(t('One or more required PHP extensions (%extension) is not loaded.  See the <a href="!url">manual</a> for further information on system requirements.', array('%extension' => 'pcre', '!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+    if (!function_exists('session_start')) {
+        log_fatal('session PHP extension not loaded.');
+        indirect_fatal_error(t('One or more required PHP extensions (%extension) is not loaded.  See the <a href="!url">manual</a> for further information on system requirements.', array('%extension' => 'session', '!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+    if (!function_exists('xml_parser_create_ns')) {
+        log_fatal('xml PHP extension not loaded.');
+        indirect_fatal_error(t('One or more required PHP extensions (%extension) is not loaded.  See the <a href="!url">manual</a> for further information on system requirements.', array('%extension' => 'xml', '!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+    if (!function_exists('hash')) {
+        log_fatal('hash PHP extension not loaded.');
+        indirect_fatal_error(t('One or more required PHP extensions (%extension) is not loaded.  See the <a href="!url">manual</a> for further information on system requirements.', array('%extension' => 'hash', '!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+    if (is_numeric(@ini_get('suhosin.get.max_value_length')) && (@ini_get('suhosin.get.max_value_length') < 1024)) {
+        log_fatal('suhosin.get.max_value_length < 1024');
+        indirect_fatal_error(t('suhosin.get.max_value_length is less than 1024, which will lead to problems. See the <a href="!url">manual</a> for further information on system requirements.', array('!url' => 'http://simpleid.org/docs/1/system-requirements/')));
+    }
+
+    $q = (isset($GETPOST['q'])) ? $GETPOST['q'] : '';
+    $q = explode('/', $q);
+    
+    extension_init();
+    user_init(NULL);
+    upgrade_user_init();
+    
+    $routes = array(
+        'upgrade-selection' => 'upgrade_selection',
+        'upgrade-apply' => 'upgrade_apply',
+        '.*' => 'upgrade_info'
+    );
+    
+    simpleweb_run($routes, implode('/', $q));
+}
+
+/**
+ * Displays the upgrade info page.
+ */
+function upgrade_info() {
+    global $xtpl;
+    
+    $xtpl->assign('token', get_form_token('upgrade_info'));
+    
+    $xtpl->assign('intro', t('Use this script to update your installation whenever you upgrade to a new version of SimpleID.'));
+    $xtpl->assign('simpleid_docs', t('For more detailed information, see the <a href="!url">SimpleID documentation</a>.', array('!url' => 'http://simpleid.org/docs/1/upgrading/')));
+    $xtpl->assign('step1', t('<strong>Back up your installation</strong>. This process will change various files within your SimpleID installation and in case of emergency you may need to revert to a backup.'));
+    $xtpl->assign('step2', t('Install your new files in the appropriate location, as described in the <a href="!url">SimpleID documentation</a>.', array('!url' => 'http://simpleid.org/docs/1/installing/')));
+    $xtpl->assign('click_continue', t('When you have performed the steps above, click <strong>Continue</strong>.'));
+    $xtpl->assign('continue_button', t('Continue'));
+    
+    $xtpl->parse('main.upgrade_info');
+    
+    $xtpl->assign('title', t('Upgrade'));
+    $xtpl->parse('main');
+    
+    $xtpl->out('main');
+}
+
+/**
+ * Detects the current installed version of SimpleID, selects the individual upgrade
+ * functions applicable to this upgrade and displays the upgrade
+ * selection page.
+ */
+function upgrade_selection() {
+    global $xtpl, $upgrade_access_check;
+    
+    cache_expire(array('upgrade' => 0));
+    
+    if (!validate_form_token($_POST['tk'], 'upgrade_info')) {
+        set_message(t('SimpleID detected a potential security attack.  Please try again.'));
+        upgrade_info();
+        return;
+    }
+
+    $functions = upgrade_get_functions();
+    
+    if (count($functions) == 0) {
+        if (!$upgrade_access_check) {
+            $xtpl->assign('edit_upgrade_php', t('Remember to edit upgrade.php to check <code>$upgrade_access_check</code> back to <code>FALSE</code>.'));
+            $xtpl->parse('main.selection.selection_complete.upgrade_access_check');
+        }
+        
+        $xtpl->assign('script_complete', t('Your SimpleID installation is up-to-date.  This script is complete.'));
+        
+        $xtpl->parse('main.upgrade_selection.selection_complete');
+    } else {
+        $handle = random_id();
+        cache_set('upgrade', $handle, $functions);
+        
+        $xtpl->assign('handle', $handle);
+        $xtpl->assign('token', get_form_token('upgrade_selection'));
+        
+        $xtpl->assign('click_continue', t('Click <strong>Continue</strong> to proceed with the upgrade.'));
+        $xtpl->assign('continue_button', t('Continue'));
+        
+        $xtpl->parse('main.upgrade_selection.selection_continue');
+    }
+    
+    $xtpl->assign('original_version', upgrade_get_version());
+    $xtpl->assign('this_version', SIMPLEID_VERSION);
+    
+    $xtpl->assign('version_detected', t('The version of SimpleID you are updating from has been automatically detected.'));
+    $xtpl->assign('original_version_label', t('Original version'));
+    $xtpl->assign('this_version_label', t('Upgrade version'));
+    
+    $xtpl->parse('main.upgrade_selection');
+    
+    $xtpl->assign('title', t('Upgrade'));
+    $xtpl->parse('main');
+    
+    $xtpl->out('main');
+}
+
+/**
+ * Applies the upgrade.
+ */
+function upgrade_apply() {
+    global $xtpl, $upgrade_access_check;
+    
+    if (!validate_form_token($_POST['tk'], 'upgrade_selection')) {
+        set_message(t('SimpleID detected a potential security attack.  Please try again.'));
+        upgrade_selection();
+        return;
+    }
+    
+    $results = '';
+    $functions = cache_get('upgrade', $_POST['handle']);
+    
+    foreach ($functions as $function) {
+        $results .= call_user_func($function);
+    }
+    
+    if (!$upgrade_access_check) {
+        $xtpl->assign('edit_upgrade_php', t('Remember to edit upgrade.php to check <code>$upgrade_access_check</code> back to <code>TRUE</code>.'));
+        $xtpl->parse('main.upgrade_results.upgrade_access_check');
+    }
+    $xtpl->assign('results', $results);
+    
+    $xtpl->assign('upgrade_complete', t('Your SimpleID installation has been upgraded.  Please check the results below for any errors.'));
+    
+    $xtpl->parse('main.upgrade_results');
+    
+    cache_expire(array('upgrade' => 0));
+    
+    $xtpl->assign('title', t('Upgrade'));
+    $xtpl->parse('main');
+    
+    $xtpl->out('main');
+}
+
+/**
+ * Detects the current installed version of SimpleID
+ *
+ * The current installed version of SimpleID is taken from the {@link store_get() version}
+ * application setting.  This setting is only available for versions 0.7 or later, so
+ * if it is absent we can assume it's prior to version 0.7.
+ *
+ * @return string the detected version, or the string '0.6.0 or earlier'
+ */
+function upgrade_get_version() {
+    return store_get('version', '0.6.0 or earlier');
+}
+
+/**
+ * Sets the current version of SimpleID.
+ *
+ * This function sets the version application setting via {@link store_get()}.
+ * A specific version can be specified, or it can be taken from {@link SIMPLEID_VERSION}.
+ *
+ * @param string $version the version to set
+ */
+function upgrade_set_version($version = NULL) {
+    if ($version == NULL) $version = SIMPLEID_VERSION;
+    store_set('version', $version);
+}
+
+/**
+ * Selects the upgrade functions applicable for this upgrade.
+ *
+ * The upgrade functions are specified by the {@link $upgrade_functions}
+ * variable.  This variable is an associative array containing version numbers
+ * as keys and an array of upgrade function names as values.  This function
+ * merges all the upgrade function names of the version between the current
+ * installed version and the upgraded version.
+ *
+ * @param string $version the version of SimpleID to upgrade from, calls
+ * {@link upgrade_get_version()} if not specified
+ * @return array an array of strings, containing the list of upgrade functions
+ * to call.  The functions should be called in the same order as they appear
+ * in this array
+ *
+ */
+function upgrade_get_functions($version = NULL) {
+    global $upgrade_functions;
+    
+    if ($version == NULL) $version = upgrade_get_version();
+    $functions = array();
+    
+    uksort($upgrade_functions, '_upgrade_version_reverse_sort');
+    
+    foreach ($upgrade_functions as $upgrade_version => $upgrades) {
+        if (version_compare($version, $upgrade_version, '<')) {
+            $functions = array_merge($functions, $upgrades);
+        }
+    }
+    
+    if (version_compare($version, SIMPLEID_VERSION, '<')) $functions[] = 'upgrade_set_version';
+    
+    return $functions;
+}
+
+/**
+ * Callback function for uksort() to reverse sort version numbers.
+ *
+ * @param string $a
+ * @param string $b
+ * @return int
+ */
+function _upgrade_version_reverse_sort($a, $b) {
+    return -version_compare($a, $b);
+}
+
+/**
+ * Determines whether the current user has permission to run this script.
+ *
+ * A user has permission to run this script if:
+ *
+ * - administrator=1 appears in the user's identity file; or
+ * - {@link $upgrade_access_check} is false
+ *
+ * If the user does not have permission, {@link upgade_access_denied()} is called
+ */
+function upgrade_user_init() {
+    global $user, $upgrade_access_check;
+    
+    if ($upgrade_access_check) {
+        if (($user == NULL) || ($user['administrator'] != 1)) upgrade_access_denied();
+    }
+}
+
+/**
+ * Displays a page notifying the user that he or she does not have permission to
+ * run the upgrade script.
+ */
+function upgrade_access_denied() {
+    global $xtpl;
+    
+    $xtpl->assign('login_required', t('Access denied. You are not authorised to access this page. Please <a href="index.php?q=login">log in</a> as an administrator (a user whose identity file includes the line <code>administrator=1</code>).'));    
+    $xtpl->assign('edit_upgrade_php', t('If you cannot log in, you will have to edit <code>upgrade.php</code> to bypass this access check. To do this:'));
+    $xtpl->assign('edit_upgrade_php1', t('With a text editor find the upgrade.php file.'));
+    $xtpl->assign('edit_upgrade_php2', t('There is a line inside your upgrade.php file that says <code>$upgrade_access_check = TRUE;</code>. Change it to <code>$upgrade_access_check = FALSE;</code>.'));
+    $xtpl->assign('edit_upgrade_php3', t('As soon as the upgrade.php script is done, you must change the file back to its original form with <code>$upgrade_access_check = TRUE;</code>.'));
+    $xtpl->assign('edit_upgrade_php4', t('To avoid having this problem in future, remember to log in to SimpleID as an administrator before you run this script.'));
+    $xtpl->assign('simpleid_docs', t('For more detailed information, see the <a href="!url">SimpleID documentation</a>.', array('!url' => 'http://simpleid.org/docs/1/upgrading/')));
+    
+    $xtpl->parse('main.upgrade_access_denied');
+    
+    $xtpl->assign('title', t('Access Denied'));
+    $xtpl->parse('main');
+    
+    $xtpl->out('main');
+    exit;
+}
+
+/* ------------------------------------------------------------------------------------------------------- */
+
+/**
+ * Moves the user's site preferences from the cache to the store.
+ *
+ * @since 0.7
+ */
+function upgrade_rp_to_store() {
+    $dir = opendir(SIMPLEID_IDENTITIES_DIR);
+    
+    while (($file = readdir($dir)) !== false) {
+        $filename = SIMPLEID_IDENTITIES_DIR . '/' . $file;
+        
+        if ((filetype($filename) != "file") || (!preg_match('/^(.+)\.identity$/', $file, $matches))) continue;
+        
+        $uid = $matches[1];
+        
+        $user = user_load($uid);
+        $rp = cache_get('rp', $uid);
+        if ($rp != NULL) {
+            $user['rp'] = $rp;
+            user_save($user);
+            cache_delete('rp', $uid);
+        }
+    }
+}
+
+/**
+ * Moves the site token from the cache to the store.
+ *
+ * @since 0.7
+ */
+function upgrade_token_to_store() {
+    $site_token = cache_get('token', SIMPLEID_BASE_URL);
+    
+    if ($site_token != NULL) {
+        store_set('site-token', $site_token);
+        cache_delete('token', SIMPLEID_BASE_URL);
+    }
+}
+
+/**
+ * Checks that config.inc has been renamed to config.php
+ *
+ * @since 0.9
+ */
+function upgrade_config_inc_to_php() {
+    if (defined('UPGRADE_LEGACY_CONFIG_INC')) {
+        return '<p>You will need to rename <code>config.inc</code> to <code>config.php</code>.</p>';
+    }
+}
+
+/**
+ * Deletes the site-token setting for a more secure version
+ *
+ * @since 0.9
+ */
+function upgrade_delete_token() {
+    store_del('site-token');
+}
+?>
diff --git a/simpleid/www/user.inc.php b/simpleid/www/user.inc.php
new file mode 100644
index 0000000..d10b5c0
--- /dev/null
+++ b/simpleid/www/user.inc.php
@@ -0,0 +1,1065 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-8
+ *
+ * Includes code Drupal OpenID module (http://drupal.org/project/openid)
+ * Rowan Kerr <rowan@standardinteractive.com>
+ * James Walker <james@bryght.com>
+ *
+ * Copyright (C) Rowan Kerr and James Walker
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ * $Id$
+ */
+
+/**
+ * User functions.
+ *
+ * @package simpleid
+ * @filesource
+ */
+
+/**
+ * The time the nonce used in the login process will last.
+ */
+define('SIMPLEID_LOGIN_NONCE_EXPIRES_IN', 3600);
+
+/**
+ * The time (in seconds) the auto login cookie will last.  This is currently
+ * set as 2 weeks.
+ */
+define('SIMPLEID_USER_AUTOLOGIN_EXPIRES_IN', 1209600);
+
+/**
+ * This variable holds data on the currently logged-in user.  If the user is
+ * not logged in, this variable is NULL.
+ *
+ * @global array $user
+ */
+$user = NULL;
+
+/**
+ * Initialises the user system.  Loads data for the currently logged-in user,
+ * if any.
+ *
+ * @param string $q the SimpleID command, if any
+ */
+function user_init($q = NULL) {
+    global $user;
+    global $xtpl;
+
+    log_debug('user_init');
+
+    $user = NULL;
+
+    // session_name() has to be called before session_set_cookie_params()
+    session_name(simpleid_cookie_name('sess'));
+
+    // Note the last parameter (httponly) requires PHP 5.2
+    session_set_cookie_params(0, get_base_path(), ini_get('session.cookie_domain'), false, true);
+    session_start();
+
+    if (isset($_SESSION['user']) && (cache_get('user', $_SESSION['user']) == session_id())) {
+        $user = user_load($_SESSION['user']);
+
+        // If user has just been actively been authenticated in the previous request, then we
+        // make it as actively authenticated in this request.
+        if (isset($_SESSION['user_auth_active']) && $_SESSION['user_auth_active']) {
+            $user['auth_active'] = true;
+            unset($_SESSION['user_auth_active']);
+        }
+    } else {
+        if (($q == 'login') || ($q == 'logout')) return;
+        user_auto_login();
+    }
+}
+
+/**
+ * Attempts to automatically login using credentials presented by the user agent.
+ *
+ * The user agent may present various credentials as part of its request.  These
+ * may include cookies and SSL client certificates.  This function calls the
+ * {@link hook_user_auto_login()} hook of enabled extensions to see if any
+ * of these credentials can be used to automatically login a user.
+ */
+function user_auto_login() {
+    global $simpleid_extensions;
+
+    $extensions = $simpleid_extensions;
+
+    if (!in_array('user_cookieauth', $extensions)) $extensions[] = 'user_cookieauth';
+
+    foreach ($extensions as $extension) {
+        $test_user = extension_invoke($extension, 'user_auto_login');
+        if ($test_user != NULL) {
+            _user_login($test_user);
+        }
+    }
+}
+
+/**
+ * Loads user data for a specified user name.
+ *
+ * @param string $uid the name of the user to load
+ * @return mixed data for the specified user, or NULL if the user name does not
+ * exist
+ * @see user_load_from_identity()
+ */
+function user_load($uid) {
+    if (store_user_exists($uid)) {
+        $user = store_user_load($uid);
+        $user["uid"] = $uid;
+
+        if (isset($user["identity"])) {
+            $user["local_identity"] = true;
+        } else {
+            $user["identity"] = simpleid_url('user/' . rawurlencode($uid));
+            $user["local_identity"] = false;
+        }
+
+        return $user;
+    } else {
+        return NULL;
+    }
+}
+
+/**
+ * Loads user data for a specified OpenID Identity URI.
+ *
+ * @param string $identity the Identity URI of the user to load
+ * @return mixed data for the specified user, or NULL if the user name does not
+ * exist
+ * @see user_load()
+ */
+function user_load_from_identity($identity) {
+    $uid = store_get_uid($identity);
+    if ($uid !== NULL) return user_load($uid);
+
+    return NULL;
+}
+
+/**
+ * Stores user data for a specified user name.
+ *
+ * @param array $user the user to save
+ */
+function user_save($user) {
+    $uid = $user['uid'];
+    store_user_save($uid, $user, array('uid', 'identity', 'pass'));
+}
+
+/**
+ * Attempts to log in a user, using the user name and password specified in the
+ * HTTP request.
+ */
+function user_login() {
+    global $user, $GETPOST;
+
+    // If the user is already logged in, return
+    if (isset($user['uid'])) openid_indirect_response(simpleid_url(), '');
+
+    // Require HTTPS or return an error
+    check_https('error', true);
+
+    $destination = (isset($GETPOST['destination'])) ? $GETPOST['destination'] : '';
+    $state = (isset($GETPOST['s'])) ? $GETPOST['s'] : '';
+    $fixed_uid = (isset($_POST['fixed_uid'])) ? $_POST['name'] : NULL;
+    $mode = $_POST['mode'];
+
+    $query = ($state) ? 's=' . rawurlencode($state) : '';
+
+    if (isset($_POST['op']) && $_POST['op'] == t('Cancel')) {
+        global $version;
+
+        $request = unpickle($state);
+        $version = openid_get_version($request);
+
+        if (isset($request['openid.return_to'])) {
+            $return_to = $request['openid.return_to'];
+            $response = simpleid_checkid_error(FALSE);
+            simpleid_assertion_response($response, $return_to);
+        } else {
+            indirect_fatal_error(t('Login cancelled without a proper OpenID request.'));
+        }
+        return;
+    }
+
+    if (!isset($_POST['mode']) || !in_array($_POST['mode'], array('credentials', 'otp'))) {
+        set_message(t('SimpleID detected a potential security attack on your log in.  Please log in again.'));
+        user_login_form($destination, $state, $fixed_uid);
+        return;
+    }
+
+    if (!isset($_POST['nonce'])) {
+        if (isset($_POST['destination'])) {
+            // User came from a log in form.
+            set_message(t('You seem to be attempting to log in from another web page.  You must use this page to log in.'));
+        }
+        user_login_form($destination, $state, $fixed_uid, $mode);
+        return;
+    }
+
+    $time = strtotime(substr($_POST['nonce'], 0, 20));
+    // Some old versions of PHP does not recognise the T in the ISO 8601 date.  We may need to convert the T to a space
+    if (($time == -1) || ($time === FALSE)) $time = strtotime(strtr(substr($_POST['nonce'], 0, 20), 'T', ' '));
+    $nonce = cache_get('user-nonce', $_POST['nonce']);
+
+    if (!$nonce) {
+        log_warn('Login attempt: Nonce ' . $_POST['nonce'] . ' not issued or is being reused.');
+        set_message(t('SimpleID detected a potential security attack on your log in.  Please log in again.'));
+        user_login_form($destination, $state, $fixed_uid, $mode);
+        return;
+    } elseif ($time < time() - SIMPLEID_LOGIN_NONCE_EXPIRES_IN) {
+        log_notice('Login attempt: Nonce ' . $_POST['nonce'] . ' expired.');
+        set_message(t('The log in page has expired.  Please log in again.'));
+        user_login_form($destination, $state, $fixed_uid, $mode);
+        return;
+    } elseif ($nonce['mode'] != $mode) {
+        log_warn('Login attempt: Mode saved with nonce ' . $_POST['nonce'] . ' (' . $nonce['mode'] . ') does not match ' . $mode);
+        set_message(t('SimpleID detected a potential security attack on your log in.  Please log in again.'));
+        user_login_form($destination, $state, $fixed_uid, $mode);
+    } else {
+        cache_delete('user-nonce', $_POST['nonce']);
+    }
+
+    switch ($mode) {
+        case 'credentials':
+            if (!isset($_POST['name'])) $_POST['name'] = '';
+            if (!isset($_POST['pass'])) $_POST['pass'] = '';
+
+            if (($_POST['name'] == '') || ($_POST['pass'] == '')) {
+                if (isset($_POST['destination'])) {
+                    // User came from a log in form.
+                    set_message(t('You need to supply the user name and the password in order to log in.'));
+                }
+                if (isset($_POST['nonce'])) cache_delete('user-nonce', $_POST['nonce']);
+                user_login_form($destination, $state, $fixed_uid);
+                return;
+            }
+
+            if (user_verify_credentials($_POST['name'], $_POST) === false) {
+                set_message(t('The user name or password is not correct.'));
+                user_login_form($destination, $state, $fixed_uid);
+                return;
+            }
+
+            $test_user = user_load($_POST['name']);
+            if (isset($test_user['otp']) && ($test_user['otp']['type'] != 'recovery')) {
+                log_info('One time password required');
+                user_login_form($destination, $state, $test_user['uid'], 'otp');
+                return;
+            }
+            break;
+        case 'otp':
+            if (!isset($_POST['otp']) || ($_POST['otp'] == '')) {
+                set_message(t('You need to enter the verification code in order to log in.'));
+                if (isset($_POST['nonce'])) cache_delete('user-nonce', $_POST['nonce']);
+                user_login_form($destination, $state, $nonce['uid'], 'otp');
+                return;
+            }
+
+            $test_user = user_load($nonce['uid']);
+
+            if (user_verify_otp($test_user['otp'], $_POST['otp']) === false) {
+                set_message(t('The verification code is not correct.'));
+                user_login_form($destination, $state, $nonce['uid'], 'otp');
+                return;
+            }
+            user_save($test_user); // Save the drift
+
+            break;
+    }
+
+    _user_login($test_user, true);
+
+    openid_indirect_response(simpleid_url($destination, $query), '');
+}
+
+/**
+ * Verifies a set of credentials for a specified user.
+ *
+ * A set of credentials comprises:
+ *
+ * - A user name
+ * - Some kind of verifying information, such as a plaintext password, a hashed
+ *   password (e.g. digest) or some other kind of identifying information.
+ *
+ * The user name is passed to this function using the $uid parameter.  The user
+ * name may or may not exist.  If the user name does not exist, this function
+ * <strong>must</strong> return false.
+ *
+ * The credentials are supplied as an array using the $credentials parameter.
+ * Typically this array will be a subset of the $_POST superglobal passed to the
+ * {@link user_login()} function.  Thus it will generally contain the keys 'pass' and
+ * 'digest'.
+ *
+ * This function calls the {@link hook_user_verify_credentials()} hook to
+ * check whether the credentials supplied matches the credentials
+ * for the specified user in the store.
+ *
+ * @param string $uid the name of the user to verify
+ * @param array $credentials the credentials supplied by the browser
+ * @return bool whether the credentials supplied matches those for the specified
+ * user
+ */
+function user_verify_credentials($uid, $credentials) {
+    global $simpleid_extensions;
+
+    $extensions = $simpleid_extensions;
+
+    if (!in_array('user_passauth', $extensions)) $extensions[] = 'user_passauth';
+
+    foreach ($extensions as $extension) {
+        $result = extension_invoke($extension, 'user_verify_credentials', $uid, $credentials);
+        if ($result === true) {
+            return true;
+        }
+    }
+
+    return false;
+}
+
+/**
+ * Verifies a one time password (OTP) specified by the user.
+ *
+ * This function compares an OTP supplied by a user with the OTP
+ * calculated based on the current time and the parameters of the
+ * algorithm.  The parameters, such as the secret key, are supplied
+ * using in $params.  These parameters are typically stored for each
+ * user in the user store.
+ *
+ * To allow for clocks going out of sync, the current time will be
+ * by a number (in time steps) specified in $params['drift'].  If
+ * the OTP supplied by the user is accepted, $params['drift'] will
+ * be also be updated with the latest difference.
+ *
+ * To allow for network delay, the function will accepts OTPs which
+ * is a number of time steps away from the OTP calculated from the
+ * adjusted time.  The maximum number of time steps is specified in
+ * the $max_drift parameter.
+ *
+ * @param array &$params the OTP parameters stored
+ * @param string $code the OTP supplied by the user
+ * @param int $max_drift the maximum drift allowed for network delay, in
+ * time steps
+ * @return bool whether the OTP supplied matches the OTP generated based on
+ * the specified parameters, within the maximum drift
+ */
+function user_verify_otp(&$params, $code, $max_drift = 1) {
+    switch ($params['type']) {
+        case 'totp':
+            $time = time();
+
+            $test_code = user_totp($params['secret'], $time, $params['period'], $params['drift'], $params['algorithm'], $params['digits']);
+
+            if ($test_code == intval($code)) return true;
+
+            for ($i = -$max_drift; $i <= $max_drift; $i++) {
+                $test_code = user_totp($params['secret'], $time, $params['period'], $params['drift'] + $i, $params['algorithm'], $params['digits']);
+                if ($test_code == intval($code)) {
+                    $params['drift'] = $i;
+                    return true;
+                }
+            }
+            return false;
+            break;
+        default:
+            return false;
+    }
+}
+
+
+/**
+ * Sets the user specified by the parameter as the active user.
+ *
+ * @param array $login_user the user to log in
+ * @param bool $auth_active whether the user has been actively authenticated
+ * in this session
+ *
+ */
+function _user_login($login_user, $auth_active = false) {
+    global $user;
+
+    if ($auth_active) {
+        // Set the current authentication time
+        $login_user['auth_time'] = time();
+        user_save($login_user);
+
+        // Set user has been actively authenticated this and the next request only
+        $login_user['auth_active'] = true;
+        $_SESSION['user_auth_active'] = true;
+        log_info('Login successful: ' . $login_user['uid'] . '['. gmstrftime('%Y-%m-%dT%H:%M:%SZ', $login_user['auth_time']) . ']');
+
+    }
+
+    $user = $login_user;
+    $_SESSION['user'] = $login_user['uid'];
+    cache_set('user', $login_user['uid'], session_id());
+
+
+    if ($auth_active) {
+        if (isset($_POST['autologin']) && ($_POST['autologin'] == 1)) user_cookieauth_create_cookie();
+    }
+}
+
+/**
+ * Attempts to log out a user and returns to the login form.
+ *
+ * @param string $destination the destination value to be included in the
+ * login form
+ */
+function user_logout($destination = NULL) {
+    global $user, $GETPOST;
+
+    // Require HTTPS, redirect if necessary
+    check_https('redirect', true);
+
+    $state = (isset($GETPOST['s'])) ? $GETPOST['s'] : '';
+    if ($destination == NULL) {
+        if (isset($GETPOST['destination'])) {
+            $destination = $GETPOST['destination'];
+        } else {
+            $destination = '';
+        }
+    }
+
+    _user_logout();
+
+    set_message(t('You have been logged out.'));
+
+    user_login_form($destination, $state);
+}
+
+/**
+ * Logs out the user by deleting the relevant session information.
+ */
+function _user_logout() {
+    global $user;
+
+    $uid = $user['uid'];
+
+    user_cookieauth_invalidate();
+    session_destroy();
+
+    cache_delete('user', $uid);
+    unset($_SESSION['user']);
+    $user = NULL;
+
+    log_info('Logout successful: ' . $uid);
+}
+
+/**
+ * Displays a user login or a login verification form.
+ *
+ * @param string $destination the SimpleID location to which the user is directed
+ * if login is successful
+ * @param string $state the current SimpleID state, if required by the location
+ * @param string $fixed_uid the user name to be included in the login form; if NULL, the user
+ * is asked to supply the user name.  If $mode is otp this cannot be null
+ * @param string $mode either credentials (login form) or otp (login verification
+ * form)
+ */
+function user_login_form($destination = '', $state = NULL, $fixed_uid = NULL, $mode = 'credentials') {
+    global $xtpl;
+
+    // Require HTTPS, redirect if necessary
+    check_https('redirect', true);
+
+    if ($state) {
+        $xtpl->assign('state', htmlspecialchars($state, ENT_QUOTES, 'UTF-8'));
+        $xtpl->assign('cancel_button', t('Cancel'));
+        $xtpl->parse('main.login.state');
+    }
+
+    cache_expire(array('user-nonce' => SIMPLEID_LOGIN_NONCE_EXPIRES_IN));
+    $nonce = openid_nonce();
+    cache_set('user-nonce', $nonce, array('mode' => $mode, 'uid' => $fixed_uid));
+
+    $base_path = get_base_path();
+    $xtpl->assign('javascript', '<script src="' . $base_path . 'html/user-login.js" type="text/javascript"></script>');
+
+    header('X-Frame-Options: DENY');
+
+    switch ($mode) {
+        case 'credentials':
+            $security_class = (SIMPLEID_ALLOW_AUTOCOMPLETE) ? 'allow-autocomplete ' : '';
+            if (is_https()) {
+                $security_class .= 'secure';
+                $xtpl->assign('security_message', t('Secure login using <strong>HTTPS</strong>.'));
+            } elseif (SIMPLEID_ALLOW_PLAINTEXT) {
+                $security_class .= 'unsecure';
+                $xtpl->assign('security_message', t('<strong>WARNING:</strong>  Your password will be sent to SimpleID as plain text.'));
+            }
+            $xtpl->assign('security_class', $security_class);
+            $xtpl->parse('main.login.login_security');
+
+            extension_invoke_all('user_login_form', $destination, $state);
+
+            $xtpl->assign('name_label', t('User name:'));
+            $xtpl->assign('pass_label', t('Password:'));
+            $xtpl->assign('autologin_label', t('Remember me on this computer for two weeks.'));
+
+            if ($fixed_uid == NULL) {
+                $xtpl->parse('main.login.credentials.input_uid');
+            } else {
+                $xtpl->assign('uid', htmlspecialchars($fixed_uid, ENT_QUOTES, 'UTF-8'));
+                $xtpl->parse('main.login.credentials.fixed_uid');
+            }
+
+            $xtpl->parse('main.login.credentials');
+            $xtpl->assign('submit_button', t('Log in'));
+            $xtpl->assign('title', t('Log In'));
+            break;
+        case 'otp':
+            // Note this is called from user_login(), so $_POST is always filled
+            $xtpl->assign('otp_instructions_label', t('To verify your identity, enter the verification code.'));
+            $xtpl->assign('otp_recovery_label', t('If you have lost your verification code, you can <a href="!url">recover your account</a>.',
+                array('!url' => 'http://simpleid.org/docs/1/common-problems/#otp')
+            ));
+
+            $xtpl->assign('otp_label', t('Verification code:'));
+            $xtpl->assign('autologin', (isset($_POST['autologin']) && ($_POST['autologin'] == 1)) ? '1' : '0');
+            $xtpl->parse('main.login.otp');
+
+            $xtpl->assign('submit_button', t('Verify'));
+            $xtpl->assign('title', t('Enter Verification Code'));
+        default:
+    }
+
+
+    $xtpl->assign('mode', $mode);
+    $xtpl->assign('page_class', 'dialog-page');
+    $xtpl->assign('destination', htmlspecialchars($destination, ENT_QUOTES, 'UTF-8'));
+    $xtpl->assign('nonce', htmlspecialchars($nonce, ENT_QUOTES, 'UTF-8'));
+
+    $xtpl->parse('main.login');
+    $xtpl->parse('main.framekiller');
+    $xtpl->parse('main');
+    $xtpl->out('main');
+}
+
+/**
+ * Displays the page used to set up login verification using one-time
+ * passwords.
+ */
+function user_otp_page() {
+    global $xtpl, $user;
+
+    // Require HTTPS, redirect if necessary
+    check_https('redirect', true);
+
+    if ($user == NULL) {
+        user_login_form('my/profile');
+        return;
+    }
+
+    if ($_POST['op'] == t('Disable')) {
+        if (!isset($_POST['tk']) || !validate_form_token($_POST['tk'], 'dashboard_otp')) {
+            set_message(t('SimpleID detected a potential security attack.  Please try again.'));
+            page_dashboard();
+            return;
+        }
+
+        if (isset($user['otp'])) {
+            unset($user['otp']);
+            user_save($user);
+        }
+        set_message('Login verification has been disabled.');
+        page_dashboard();
+        return;
+    } elseif ($_POST['op'] == t('Verify')) {
+        $params = $_SESSION['otp_setup'];
+
+        if (!isset($_POST['tk']) || !validate_form_token($_POST['tk'], 'otp')) {
+            set_message(t('SimpleID detected a potential security attack.  Please try again.'));
+            page_dashboard();
+            return;
+        } elseif (!isset($_POST['otp']) || ($_POST['otp'] == '')) {
+            set_message(t('You need to enter the verification code to complete enabling login verification.'));
+        } elseif (user_verify_otp($params, $_POST['otp'], 10) === false) {
+            set_message(t('The verification code is not correct.'));
+        } else {
+            unset($_SESSION['otp_setup']);
+            $user['otp'] = $params;
+            user_save($user);
+
+            set_message('Login verification has been enabled.');
+            page_dashboard();
+            return;
+        }
+    } else {
+        $params = array(
+            'type' => 'totp',
+            'secret' => random_bytes(10),
+            'algorithm' => 'sha1',
+            'digits' => 6,
+            'period' => 30,
+            'drift' => 0,
+        );
+        $_SESSION['otp_setup'] = $params;
+    }
+
+    $code = strtr(bignum_val(bignum_new($params['secret'], 256), 32), '0123456789abcdefghijklmnopqrstuv', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ234567');
+    for ($i = 0; $i < strlen($code); $i += 4) {
+        $xtpl->assign('secret' . ($i + 1), substr($code, $i, 4));
+    }
+
+    $url = 'otpauth://totp/SimpleID?secret=' . $code . '&digits=' . $params['digits'] . '&period=' . $params['period'];
+    $xtpl->assign('qr', addslashes($url));
+
+    $xtpl->assign('about_otp', t('Login verification adds an extra layer of protection to your account. When enabled, you will need to enter an additional security code whenever you log into SimpleID.'));
+    $xtpl->assign('otp_warning', t('<strong>WARNING:</strong> If you enable login verification and lose your authenticator app, you will need to <a href="!url">edit your identity file manually</a> before you can log in again.',
+        array('!url' => 'http://simpleid.org/docs/1/common-problems/#otp')
+    ));
+
+    $xtpl->assign('setup_otp', t('To set up login verification, following these steps.'));
+    $xtpl->assign('download_app', t('Download an authenticator app that supports TOTP for your smartphone, such as Google Authenticator.'));
+    $xtpl->assign('add_account', t('Add your SimpleID account to authenticator app using this key.  If you are viewing this page on your smartphone you can use <a href="!url">this link</a> or scan the QR code to add your account.',
+        array('!url' => $url)
+    ));
+    $xtpl->assign('verify_code', t('To check that your account has been added properly, enter the verification code from your phone into the box below, and click Verify.'));
+
+    $xtpl->assign('token', get_form_token('otp'));
+    $xtpl->assign('otp_label', t('Verification code:'));
+    $xtpl->assign('submit_button', t('Verify'));
+
+    $xtpl->assign('page_class', 'dialog-page');
+    $xtpl->assign('title', t('Login Verification'));
+
+    $xtpl->parse('main.otp');
+    $xtpl->parse('main.framekiller');
+
+    $xtpl->parse('main');
+    $xtpl->out('main');
+
+}
+
+
+/**
+ * Returns the user's public page.
+ *
+ * @param string $uid the user ID
+ */
+function user_public_page($uid = NULL) {
+    global $xtpl, $user;
+
+    $xtpl->assign('title', t('User Page'));
+    if ($uid == NULL) {
+        header_response_code('400 Bad Request');
+        set_message(t('No user specified.'));
+    } else {
+        $user = user_load($uid);
+
+        if ($user == NULL) {
+            header_response_code('404 Not Found');
+            set_message(t('User %uid not found.', array('%uid' => $uid)));
+        } else {
+            header('Vary: Accept');
+
+            $content_type = negotiate_content_type(array('text/html', 'application/xml', 'application/xhtml+xml', 'application/xrds+xml'));
+
+            if ($content_type == 'application/xrds+xml') {
+                user_xrds($uid);
+                return;
+            } else {
+                header('X-XRDS-Location: ' . simpleid_url('xrds/' . rawurlencode($uid)));
+
+                set_message(t('This is the user %uid\'s SimpleID page.  It contains hidden information for the use by OpenID consumers.', array('%uid' => $uid)));
+
+                $xtpl->assign('title', htmlspecialchars($uid, ENT_QUOTES, 'UTF-8'));
+                $xtpl->assign('provider', htmlspecialchars(simpleid_url(), ENT_QUOTES, 'UTF-8'));
+                $xtpl->assign('xrds', htmlspecialchars(simpleid_url('xrds/' . rawurlencode($uid)), ENT_QUOTES, 'UTF-8'));
+                if ($user["local_identity"]) {
+                    $xtpl->assign('local_id', htmlspecialchars($user["identity"], ENT_QUOTES, 'UTF-8'));
+                }
+            }
+        }
+    }
+
+    $xtpl->parse('main.provider');
+    if ($user["local_identity"]) $xtpl->parse('main.local_id');
+    $xtpl->parse('main');
+    $xtpl->out('main');
+}
+
+/**
+ * Returns the public page for a private personal ID.
+ *
+ * @param string $ppid the PPID
+ */
+function user_ppid_page($ppid = NULL) {
+    global $xtpl;
+
+    header('Vary: Accept');
+
+    $content_type = negotiate_content_type(array('text/html', 'application/xml', 'application/xhtml+xml', 'application/xrds+xml'));
+
+    if (($content_type == 'application/xrds+xml') || ($_GET['format'] == 'xrds')) {
+        header('Content-Type: application/xrds+xml');
+        header('Content-Disposition: inline; filename=yadis.xml');
+
+        $xtpl->assign('simpleid_base_url', htmlspecialchars(simpleid_url(), ENT_QUOTES, 'UTF-8'));
+        $xtpl->parse('xrds.user_xrds');
+        $xtpl->parse('xrds');
+        $xtpl->out('xrds');
+        return;
+    } else {
+        header('X-XRDS-Location: ' . simpleid_url('ppid/' . rawurlencode($ppid), 'format=xrds'));
+
+        $xtpl->assign('title', t('Private Personal Identifier'));
+
+        set_message(t('This is a private personal identifier.'));
+
+        $xtpl->parse('main');
+        $xtpl->out('main');
+    }
+}
+
+/**
+ * Returns the user's public XRDS page.
+ *
+ * @param string $uid the user ID
+ */
+function user_xrds($uid) {
+    global $xtpl;
+
+    $user = user_load($uid);
+
+    if ($user != NULL) {
+        header('Content-Type: application/xrds+xml');
+        header('Content-Disposition: inline; filename=yadis.xml');
+
+        if (($user != NULL) && ($user["local_identity"])) {
+            $xtpl->assign('local_id', htmlspecialchars($user["identity"], ENT_QUOTES, 'UTF-8'));
+            $xtpl->parse('xrds.user_xrds.local_id');
+            $xtpl->parse('xrds.user_xrds.local_id2');
+        }
+
+        $xtpl->assign('simpleid_base_url', htmlspecialchars(simpleid_url(), ENT_QUOTES, 'UTF-8'));
+        $xtpl->parse('xrds.user_xrds');
+        $xtpl->parse('xrds');
+        $xtpl->out('xrds');
+    } else {
+        if (substr(PHP_SAPI, 0,3) === 'cgi') {
+            header('Status: 404 Not Found');
+        } else {
+            header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found');
+        }
+
+        set_message('User <strong>' . htmlspecialchars($uid, ENT_QUOTES, 'UTF-8') . '</strong> not found.');
+        $xtpl->parse('main');
+        $xtpl->out('main');
+    }
+}
+
+/**
+ * Returns a block containing OpenID Connect user information.
+ *
+ * @return array the OpenID Connect user information block
+ */
+function _user_page_profile() {
+    global $user;
+
+    $html = '<p>' . t('SimpleID may, with your consent, send the following information to sites which supports OpenID Connect.') . '</p>';
+    $html .= '<p>' . t('To change these, <a href="!url">edit your identity file</a>.', array('!url' => 'http://simpleid.org/docs/1/identity-files/')) . '</p>';
+
+    $html .= "<table><tr><th>" . t('Member') . "</th><th>" . t('Value') . "</th></tr>";
+
+    if (isset($user['user_info'])) {
+        foreach ($user['user_info'] as $member => $value) {
+            if (is_array($value)) {
+                foreach ($value as $submember => $subvalue) {
+                    $html .= "<tr><td>" . htmlspecialchars($member, ENT_QUOTES, 'UTF-8') . " (" .htmlspecialchars($submember, ENT_QUOTES, 'UTF-8') . ")</td><td>" . htmlspecialchars($subvalue, ENT_QUOTES, 'UTF-8') . "</td></tr>";
+                }
+            } else {
+                $html .= "<tr><td>" . htmlspecialchars($member, ENT_QUOTES, 'UTF-8') . "</td><td>" . htmlspecialchars($value, ENT_QUOTES, 'UTF-8') . "</td></tr>";
+            }
+        }
+    }
+
+    $html .= "</table>";
+
+    return array(array(
+        'id' => 'userinfo',
+        'title' => t('OpenID Connect'),
+        'content' => $html
+    ));
+}
+
+/**
+ * Set up the user section in the header, showing the currently logged in user.
+ *
+ * @param string $state the SimpleID state to retain once the user has logged out,
+ * if required.
+ */
+function user_header($state = NULL) {
+    global $user;
+    global $xtpl;
+
+    if ($user != NULL) {
+        $xtpl->assign('uid', htmlspecialchars($user['uid'], ENT_QUOTES, 'UTF-8'));
+        $xtpl->assign('identity', htmlspecialchars($user['identity'], ENT_QUOTES, 'UTF-8'));
+        if ($state != NULL) {
+            $xtpl->assign('url', htmlspecialchars(simpleid_url('logout', 'destination=continue&s=' . rawurlencode($state), true)));
+            $xtpl->assign('logout', t('Log out and log in as a different user'));
+        } else {
+            $xtpl->assign('url', htmlspecialchars(simpleid_url('logout', '', true)));
+            $xtpl->assign('logout', t('Log out'));
+        }
+        $xtpl->parse('main.user.logout');
+        $xtpl->parse('main.user');
+    }
+}
+
+/**
+ * Verifies a set of credentials using the default user name-password authentication
+ * method.
+ *
+ * @param string $uid the name of the user to verify
+ * @param array $credentials the credentials supplied by the browser
+ * @return bool whether the credentials supplied matches those for the specified
+ * user
+ */
+function user_passauth_user_verify_credentials($uid, $credentials) {
+    $allowed_algorithms = array('md5', 'sha1');
+    if (function_exists('hash_algos')) $allowed_algorithms = array_merge($allowed_algorithms, hash_algos());
+    if (function_exists('hash_pbkdf2')) $allowed_algorithms[] = 'pbkdf2';
+
+    $test_user = user_load($uid);
+
+    if ($test_user == NULL) return false;
+
+    $hash_function_salt = explode(':', $test_user['pass'], 3);
+
+    $hash = $hash_function_salt[0];
+    $function = (isset($hash_function_salt[1])) ? $hash_function_salt[1] : 'md5';
+    if (!in_array($function, $allowed_algorithms)) $function = 'md5';
+    $salt_suffix = (isset($hash_function_salt[2])) ? ':' . $hash_function_salt[2] : '';
+
+    switch ($function) {
+        case 'pbkdf2':
+            list ($algo, $iterations, $salt) = explode(':', $hash_function_salt[2]);
+            $length = (function_exists('hash')) ? strlen(hash($algo, '')) : 0;
+            $test_hash = hash_pbkdf2($algo, $credentials['pass'], $salt, $iterations, $length);
+            break;
+        case 'md5':
+        case 'sha1':
+            $test_hash = call_user_func($function, $credentials['pass'] . $salt_suffix);
+            break;
+        default:
+            $test_hash = hash($function, $credentials['pass'] . $salt_suffix);
+    }
+
+    return secure_compare($test_hash, $hash);
+}
+
+/**
+ * Creates a auto login cookie.  The login cookie will be based on the
+ * current log in user.
+ *
+ * @param string $id the ID of the series of auto login cookies,  Cookies
+ * belonging to the same user and computer have the same ID.  If none is specified,
+ * one will be generated
+ * @param int $expires the time at which the cookie will expire.  If none is specified
+ * the time specified in {@link SIMPLEID_USER_AUTOLOGIN_EXPIRES_IN} will be
+ * used
+ *
+ */
+function user_cookieauth_create_cookie($id = NULL, $expires = NULL) {
+    global $user;
+
+    if ($expires == NULL) {
+        log_debug('Automatic login token created for ' . $user['uid']);
+    } else {
+        log_debug('Automatic login token renewed for ' . $user['uid']);
+    }
+
+    if ($id == NULL) $id = random_id();
+    if ($expires == NULL) $expires = time() + SIMPLEID_USER_AUTOLOGIN_EXPIRES_IN;
+    $token = random_secret();
+    $uid_hash = get_form_token($user['uid'], FALSE);
+
+    $data = array(
+        'uid' => $user['uid'],
+        'token' => $token,
+        'expires' => $expires,
+        'uaid' => get_user_agent_id(),
+        'ip' => $_SERVER['REMOTE_ADDR']
+    );
+
+    cache_set('autologin-'. $uid_hash, $id, $data);
+
+    // Note the last parameter (httponly) requires PHP 5.2
+    setcookie(simpleid_cookie_name('auth'), 'cookieauth:' . $uid_hash . ':' . $id . ':' . $token, $expires, get_base_path(), '', false, true);
+}
+
+/**
+ * Verifies a auto login cookie.  If valid, log in the user automatically.
+ */
+function user_cookieauth_user_auto_login() {
+    if (!isset($_COOKIE[simpleid_cookie_name('auth')])) return NULL;
+
+    $cookie = $_COOKIE[simpleid_cookie_name('auth')];
+
+    list($authtype, $uid_hash, $id, $token) = explode(':', $cookie);
+    if ($authtype != 'cookieauth') return NULL;
+
+    log_debug('Automatic login token detected: ' . implode(':', ['cookieauth', $uid_hash, $id]));
+
+    cache_expire(array('autologin-' . $uid_hash => SIMPLEID_USER_AUTOLOGIN_EXPIRES_IN));
+    $data = cache_get('autologin-' . $uid_hash, $id);
+
+    if (!$data) {  // Cookie doesn't exist
+        log_notice('Automatic login: Token does not exist on server');
+        return NULL;
+    }
+
+    if ($data['expires'] < time()) {  // Cookie expired
+        log_notice('Automatic login: Token on server expired');
+        return NULL;
+    }
+
+    if ($data['token'] != $token) {
+        log_warn('Automatic login: Token on server does not match');
+        // Token not the same - panic
+        cache_expire(array('autologin-' . $uid_hash => 0));
+        user_cookieauth_invalidate();
+        return NULL;
+    }
+
+    if ($data['uaid'] != get_user_agent_id()) {
+        log_warn('Automatic login: User agent ID does not match');
+        // Token not the same - panic
+        cache_expire(array('autologin-' . $uid_hash => 0));
+        user_cookieauth_invalidate();
+        return NULL;
+    }
+
+    // Load the user, tag it as an auto log in
+    $test_user = user_load($data['uid']);
+
+    if ($test_user != NULL) {
+        log_debug('Automatic login token accepted for ' . $data['uid']);
+
+        $test_user['autologin'] = TRUE;
+
+        // Renew the token
+        user_cookieauth_create_cookie($id, $data['expires']);
+
+        return $test_user;
+    } else {
+        log_warn('Automatic login token accepted for ' . $data['uid'] . ', but no such user exists');
+        return NULL;
+    }
+}
+
+/**
+ * Removes the auto login cookie from the user agent and the SimpleID
+ * cache.
+ */
+function user_cookieauth_invalidate() {
+    if (isset($_COOKIE[simpleid_cookie_name('auth')])) {
+        $cookie = $_COOKIE[simpleid_cookie_name('auth')];
+
+        list($uid_hash, $id, $token) = explode(':', $cookie);
+
+        cache_delete('autologin-' . $uid_hash, $id);
+
+        setcookie(simpleid_cookie_name('auth'), "", time() - 3600);
+    }
+}
+
+/**
+ * Calculates a Time-Based One-Time Password (TOTP) based on RFC 6238.
+ *
+ * This function returns an integer calculated from the TOTP algorithm.
+ * The returned integer may need to be zero-padded to return a string
+ * with the required number of digits
+ *
+ * @param string $secret the shared secret as a binary string
+ * @param int $time the time to use in the HOTP algorithm.  If NULL, the
+ * current time is used
+ * @param int $period the time step in seconds
+ * @param int $drift the number of time steps to be added to the time to
+ * adjust for transmission delay
+ * @param string $algorithm the hashing algorithm as supported by
+ * the hash_hmac() function
+ * @param int $digits the number of digits in the one-time password
+ * @return int the one-time password
+ * @link http://tools.ietf.org/html/rfc6238
+ */
+function user_totp($secret, $time = NULL, $period = 30, $drift = 0, $algorithm = 'sha1', $digits = 6) {
+    if ($time == NULL) $time = time();
+    $counter = floor($time / $period) + $drift;
+    $data = pack('NN', 0, $counter);
+    return user_hotp($secret, $data, $algorithm, $digits);
+}
+
+/**
+ * Calculates a HMAC-Based One-Time Password (HOTP) based on RFC 4226.
+ *
+ * This function returns an integer calculated from the HOTP algorithm.
+ * The returned integer may need to be zero-padded to return a string
+ * with the required number of digits
+ *
+ * @param string $secret the shared secret as a binary string
+ * @param string $data the counter value as a 64 bit in
+ * big endian encoding
+ * @param string $algorithm the hashing algorithm as supported by
+ * the hash_hmac() function
+ * @param int $digits the number of digits in the one-time password
+ * @return int the one-time password
+ * @link http://tools.ietf.org/html/rfc4226
+ */
+function user_hotp($secret, $data, $algorithm = 'sha1', $digits = 6) {
+    // unpack produces a 1-based array, we use array_merge to convert it to 0-based
+    $hmac = array_merge(unpack('C*', hash_hmac(strtolower($algorithm), $data, $secret, true)));
+    $offset = $hmac[19] & 0xf;
+    $code = ($hmac[$offset + 0] & 0x7F) << 24 |
+        ($hmac[$offset + 1] & 0xFF) << 16 |
+        ($hmac[$offset + 2] & 0xFF) << 8 |
+        ($hmac[$offset + 3] & 0xFF);
+    return $code % pow(10, $digits);
+}
+
+
+if (!function_exists('hash_pbkdf2') && function_exists('hash_hmac')) {
+    function hash_pbkdf2($algo, $password, $salt, $iterations, $length = 0, $raw_output = false) {
+        $result = '';
+        $hLen = strlen(hash($algo, '', true));
+        if ($length == 0) {
+            $length = $hLen;
+            if (!$raw_output) $length *= 2;
+        }
+        $l = ceil($length / $hLen);
+
+        for ($i = 1; $i <= $l; $i++) {
+            $U = hash_hmac($algo, $salt . pack('N', $i), $password, true);
+            $T = $U;
+            for ($j = 1; $j < $iterations; $j++) {
+                $T ^= ($U = hash_hmac($algo, $U, $password, true));
+            }
+            $result .= $T;
+        }
+
+        return substr(($raw_output) ? $result : bin2hex($result), 0, $length);
+    }
+}
+
+
+?>
diff --git a/simpleid/www/version.inc.php b/simpleid/www/version.inc.php
new file mode 100644
index 0000000..fb318c2
--- /dev/null
+++ b/simpleid/www/version.inc.php
@@ -0,0 +1,34 @@
+<?php
+/*
+ * SimpleID
+ *
+ * Copyright (C) Kelvin Mo 2007-8
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public
+ * License along with this program; if not, write to the Free
+ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * 
+ * $Id$
+ */
+ 
+/**
+ * Defines the current version of SimpleID.
+ *
+ * @package simpleid
+ */
+ 
+/**
+ * The current version of SimpleID
+ */
+define('SIMPLEID_VERSION', '1.0.5');
+?>
