Exemplo n.º 1
0
session_start();
require_once "rapid.php";
// if the config.php files hasn't been setup then go to the install page
if (!defined('DBHOST')) {
    header("location: http://" . dirname($_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME']) . "/install.php");
}
// if we are logging out then unset uid
if ($_GET['action'] == "logout") {
    unset($_SESSION['rapid_uid']);
    unset($_SESSION['rapid_uuid']);
}
// if we are not logged in.
if (!isset($_SESSION['rapid_uid'])) {
    // if we have not sent the login form?
    if (!isset($_POST['txt_username'])) {
        show_login_page();
        exit;
    } else {
        $cms->user->username = $_POST['txt_username'];
        $cms->user->unencrypted_password = $_POST['pwd_password'];
        $cms->user->authenticate();
        if ($cms->user->error != "") {
            include "header.php";
            $cms->hooks->add_action('admin_login_error_header');
            echo "<h1>Oops. Try again.</h1>";
            foreach ($cms->user->error as $error) {
                echo "<p>{$error}</p>";
            }
            echo "<a href=\"./\">Give it another try</a>";
            $cms->hooks->add_action('admin_login_error_footer');
            include "footer.php";
Exemplo n.º 2
0
    $params[] = $u->hlmttufimisikukood;
    $params[] = $w->lang;
    $params[] = $u->mail;
    $params[] = $u->telephonenumber;
    $params[] = $u->mobile;
    $params[] = $u->private_mobile;
    $params[] = $s->org_id;
    $params[] = $u->streetaddress;
    $params[] = $u->roomnumber;
    $params[] = $u->title;
    $params[] = $u->memberof;
    $params[] = date('Y-m-d H:i:s', time());
    $params[] = $u->thumbnailphoto;
    if (!$s->create_user($params)) {
        $t->errors[ERROR][] = 'L007 ' . $l->txt_err_user_update;
        show_login_page($t, $o);
    }
    unset($c);
    unset($params);
} else {
    $s->update_user($u);
    //exit;
}
$w->displayname = $u->displayname;
// Sess OK jaoks!
if (!$s->get_session_id($w->login_name)) {
    // kui aktiivset sessiooni pole
    // $s->lang = $w->lang;
    if (!$s->create_session()) {
        // auth-session exp. ei pea pikk olema. eeldus on, et sellele tehakse update kiirelt
        $t->errors[ERROR][] = 'L008 ' . $l->txt_err_nosession;