login() public method

public login ( $demo = NULL, $email = NULL, $pass = NULL, $first_login )
Exemplo n.º 1
0
$app->get($basePath . '/userInfos', function (Request $request) use($app, $UsersController, $UserModel) {
    $params = $request->query->all();
    $errorMessage = $UserModel->validate($params, "index");
    if ($errorMessage) {
        return Utils::formatErrorMessage(ERROR_BAD_MODEL, $errorMessage);
    } else {
        return $UsersController->index($params);
    }
});
$app->get($basePath . '/users/login', function (Request $request) use($app, $UsersController, $UserModel) {
    $params = $request->query->all();
    $errorMessage = $UserModel->validate($params, 'login');
    if ($errorMessage) {
        return Utils::formatErrorMessage(ERROR_BAD_MODEL, $errorMessage);
    } else {
        return $UsersController->login($params);
    }
});
$app->post($basePath . '/users/create', function (Request $request) use($app, $UsersController, $UserModel) {
    $params = $request->query->all();
    $errorMessage = $UserModel->validate($params, 'create');
    if ($errorMessage) {
        return Utils::formatErrorMessage(ERROR_BAD_MODEL, $errorMessage);
    } else {
        return $UsersController->create($params);
    }
});
$app->post($basePath . '/users/createFB', function (Request $request) use($app, $UsersController, $UserModel) {
    $params = $request->query->all();
    $errorMessage = $UserModel->validate($params, 'createFB');
    if ($errorMessage) {
Exemplo n.º 2
0
<?php

if (isset($_POST['submit'])) {
    $user = new UsersController();
    $email = $_POST['email'];
    $password = $_POST['password'];
    if ($data = $user->login($email, $password)) {
        echo 'gelukt';
    } else {
        echo 'Er ging iets fout probeer het nog eens. ' . $data;
    }
}
?>

<h1>Inloggen</h1>
<form method="post">
    <input type="text" name="email" placeholder="email">
    <input type="password" name="password" placeholder="password">
    <input type="submit" name="submit" value="Inloggen">
</form>
Exemplo n.º 3
0
    OrdersController::add();
});
$routes->get('/tilaukset/:id/muokkaa', 'check_logged_in', function ($id) {
    OrdersController::edit_form($id);
});
$routes->post('/tilaukset/:id/muokkaa', 'check_logged_in', 'check_if_admin', function ($id) {
    OrdersController::edit($id);
});
$routes->get('/tilaushistoria', 'check_logged_in', function () {
    OrdersController::get_orders();
});
$routes->get('/kirjaudu', function () {
    UsersController::login_form();
});
$routes->post('/kirjaudu', function () {
    UsersController::login();
});
$routes->get('/rekisteroidy', function () {
    UsersController::add_form();
});
$routes->post('/rekisteroidy', function () {
    UsersController::add();
});
$routes->post('/kirjaudu_ulos', 'check_logged_in', function () {
    UsersController::logout();
});
$routes->get('/omat_tiedot', 'check_logged_in', function () {
    UsersController::edit_form();
});
$routes->post('/omat_tiedot', 'check_logged_in', function () {
    UsersController::edit();