Пример #1
0
<?php

include "env.php";
include APP_PATH . "/Bootstrap.php";
// TODO: Change password
AuthHandler::putUserToken();
$db = DatabaseHelper::getInstance();
$contact = AuthHandler::getLoggedInUser();
// Is the user logged; in some cases, user might be logged even if there is no ride
$isLogged = false;
// True if the user is logged and registered to a ride
$hasRide = false;
// True if the user has ride and the ride is active
$isActive = false;
// In single destination mode, hide the "to" fields
$displayDest = getConfiguration('mode.single.dest', 0) == 0;
// In "domain users" mode, only internal mail addresses are allowed
$domainUsersMode = getConfiguration('mode.domain.users', 0) == 1;
// In LDAP authentication, the email cannot be changed
$canUpdateEmail = AuthHandler::getAuthMode() != AuthHandler::AUTH_MODE_LDAP;
if ($contact) {
    $isLogged = true;
    extract($contact, EXTR_PREFIX_ALL, 'contact');
    if ($domainUsersMode) {
        // Trim the domain part
        $contact_Email = substr($contact_Email, 0, strpos($contact_Email, '@'));
    }
    $rideData = $db->getRideProvidedByContactId($contact_Id);
    if ($rideData !== false) {
        $hasRide = true;
        extract($rideData, EXTR_PREFIX_ALL, 'ride');