} else {
                $strength_error = exponent_security_checkPasswordStrength($_POST['username'], $_POST['pass1']);
                if ($strength_error != '') {
                    $post = $_POST;
                    unset($post['pass1']);
                    unset($post['pass2']);
                    $post['_formError'] = sprintf($i18n['not_strong_enough'], $strength_error);
                    exponent_sessions_set('last_POST', $post);
                    header('Location: ' . $_SERVER['HTTP_REFERER']);
                } else {
                    // Finally, check the capcha
                    if (SITE_USE_CAPTCHA && strtoupper($_POST['captcha_string']) != $capcha_real) {
                        $post = $_POST;
                        unset($post['captcha_string']);
                        $post['_formError'] = $i18n['bad_captcha'];
                        exponent_sessions_set('last_POST', $post);
                        header('Location: ' . $_SERVER['HTTP_REFERER']);
                    } else {
                        exponent_sessions_unset('capcha_string');
                        $u = exponent_users_create($_POST, null);
                        $u = exponent_users_saveProfileExtensions($_POST, $u, true);
                        exponent_users_login($_POST['username'], $_POST['pass1']);
                        exponent_flow_redirect();
                    }
                }
            }
        }
    }
} else {
    echo SITE_403_HTML;
}
##################################################
#
# Copyright (c) 2004-2006 OIC Group, Inc.
# Written and Designed by James Hunt
#
# This file is part of Exponent
#
# Exponent 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.
#
# GPL: http://www.gnu.org/licenses/gpl.txt
#
##################################################
if (!defined('EXPONENT')) {
    exit('');
}
if ($user) {
    if (!defined('SYS_USERS')) {
        require_once 'subsystems/users.php';
    }
    $user = exponent_users_update($_POST, $user);
    $user = exponent_users_saveUser($user);
    $user = exponent_users_saveProfileExtensions($_POST, $user, false);
    $_SESSION[SYS_SESSION_KEY]['user'] = $user;
    exponent_flow_redirect();
} else {
    echo SITE_403_HTML;
}