Example #1
0
<?php

/**
 * @package EDK
 */
//TODO: Make a useful registration mod
$page = new Page('User - Registration');
if (config::get('user_regdisabled')) {
    $page->error('Registration has been disabled.');
    return;
}
if (isset($_POST['submit'])) {
    $error = false;
    if (config::get('user_regpass')) {
        if ($_POST['regpass'] != config::get('user_regpass')) {
            $smarty->assign('error', 'Registration password does not match.');
            $error = true;
        }
    }
    if (!$_POST['usrlogin']) {
        $smarty->assign('error', 'You missed to specify a login.');
        $error = true;
    }
    if (!$_POST['usrpass']) {
        $smarty->assign('error', 'You missed to specify a password.');
        $error = true;
    }
    if (strlen($_POST['usrpass']) < 3) {
        $smarty->assign('error', 'Your password needs to have at least 4 chars.');
        $error = true;
    }