Exemplo n.º 1
0
    if (!Ut::strLenght($api->getInputVal('pw'), 6)) {
        $api->setErrors('Password must be min 6 characters length');
    }
    if ($api->getErrors()) {
        Ut::redirectWithValidation(Ut::uri('join'), $api->getErrors(), $api->getInputs());
        exit;
    }
    $api->join();
    if ($api->getErrors()) {
        Ut::redirectWithValidation(Ut::uri('join'), $api->getErrors(), $api->getInputs());
        exit;
    }
    Ut::redirectTo(Ut::uri('report'), array('Your account was created. Please check your email and confirm the registration'), 'success');
    exit;
} elseif ($route->match('join/confirm', 2)) {
    $api->joinConfirm(strip_tags($route->getParam(0)));
    if ($api->getErrors()) {
        Ut::redirectTo(Ut::uri('report'), $api->getErrors());
        exit;
    }
    Ut::redirectTo(Ut::uri('home'), array('Your account was confirmed. Please login'), 'success');
    exit;
} elseif ($route->match('password', null)) {
    //Ut::authRequired();
    $view->view = 'password';
} elseif ($route->match('password/post', 2)) {
    if (!$_POST) {
        Ut::redirectTo(Ut::uri('report'), array('404 Page not found'));
        exit;
    }
    // Prepare and sanitize post input