Esempio n. 1
0
<?php

require_once dirname(__FILE__) . '/common/delegate.php';
if (!isset($_SESSION)) {
    session_start();
}
require_once dirname(__FILE__) . '/common/rememberme.php';
if (!isset($_SESSION['userId']) || !is_numeric($_SESSION['userId'])) {
    addError("Access denied");
    redirect('./editor.php');
}
$delegate = new Delegate();
$loggedUser = $delegate->userGetById($_SESSION['userId']);
$myDiagrams = $delegate->diagramsForUserNative($loggedUser->id, Userdiagram::LEVEL_AUTHOR);
$otherDiagrams = $delegate->diagramsForUserNative($loggedUser->id, Userdiagram::LEVEL_EDITOR);
$invitations = $delegate->invitationGetAllForEmail($loggedUser->email);
/**Exctracts the name of an email address*/
function firstName($email)
{
    $rez = strpos($email, '@');
    if ($rez) {
        return substr($email, 0, $rez);
    } else {
        return substr($email, 0, 5);
    }
}
?>

<!DOCTYPE html>
<html>
    <!--Copyright 2010 Scriptoid s.r.l-->