<?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('./index.php');
}
$delegate = new Delegate();
$loggedUser = $delegate->userGetById($_SESSION['userId']);
$rawLicense = $delegate->settingsGetByKeyNative('LICENSE');
$page = "license";
$DIAGRAMO = $delegate->settingsGetByKeyNative('DIAGRAMO');
?>

<!DOCTYPE html>
<html>
    <head>
        <title>Diagramo - manage license</title>
        <meta http-equiv="X-UA-Compatible" content="IE=9" />
        <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
        <link rel="shortcut icon" href="./favicon.ico" type="image/x-icon" />
        <link href="./assets/css/style.css" type="text/css" rel="stylesheet"/>
        
        <script type="text/javascript" src="./assets/javascript/dropdownmenu.js?<?php 
echo time();
?>
"></script>    
Exemple #2
0
    foreach ($csvLines as $csvLine) {
        $shards = explode(',', $csvLine);
        $links[] = $shards;
    }
}
//check if diagram is public
if (!is_object($diagram)) {
    print "No diagram found";
    exit;
}
if (!$diagram->public) {
    print "Diagram is not public. A Diagram must be public to be publicly visible.";
    exit;
}
//end check
$WEBADDRESS = $delegate->settingsGetByKeyNative('WEBADDRESS');
//exit("here");
?>

<!DOCTYPE html>
<html>
    <!--Copyright 2010 Scriptoid s.r.l-->
    <head>
        <title><?php 
echo $diagram->title;
?>
</title>
        <meta charset="UTF-8">
        <meta name="description" content="<?php 
echo $diagram->description;
?>
Exemple #3
0
if (!isset($_SESSION['userId']) || !is_numeric($_SESSION['userId'])) {
    addError("Access denied");
    redirect('./index.php');
}
if (!is_numeric($_REQUEST['diagramId'])) {
    print "Wrond Diagram";
    exit;
}
$delegate = new Delegate();
$loggedUser = $delegate->userGetById($_SESSION['userId']);
$diagram = $delegate->diagramGetById($_REQUEST['diagramId']);
$selfUrl = selfURL();
//find full URL to this script
$url = strleft($selfUrl, '/exportDiagram.php');
//find the URL of the application
$WEBADDRESS = $delegate->settingsGetByKeyNative('WEBADDRESS');
//$svgLink = $WEBADDRESS . '/editor/raster.php?type=svg&diagramId=' . $diagram->id;
$pngLink = $WEBADDRESS . '/editor/png.php?type=png&diagramId=' . $diagram->id;
//$jpgLink = $WEBADDRESS . '/editor/raster.php?type=jpg&diagramId=' . $diagram->id;
$dmoLink = $WEBADDRESS . '/editor/dmo.php?diagramId=' . $diagram->id;
$page = 'export';
$rawLicense = $delegate->settingsGetByKeyNative('LICENSE');
$l = new License();
if (trim($rawLicense) != '') {
    $l->load($rawLicense);
}
$currentHost = $_SERVER['HTTP_HOST'];
if (strpos($currentHost, ':')) {
    $currentHost = substr($currentHost, 0, strpos($currentHost, ':'));
}
?>
Exemple #4
0
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
require_once dirname(__FILE__) . '/common/delegate.php';
if (!isset($_SESSION)) {
    session_start();
}
$delegate = new Delegate();
$VERSION = $delegate->settingsGetByKeyNative('VERSION');
/**
 * Redirect to 'draw' if we are alredy logged or if we have 'remember me' option active
 * 
 * [1] Session method
 * Check is user id session is set and is numeric
 */
if (isset($_SESSION['userId']) and is_numeric($_SESSION['userId'])) {
    // Load user as object, from SQL by id
    $loggedUser = $delegate->userGetById(abs(intval($_SESSION['userId'])));
    // If exists a logged user
    if (isset($loggedUser) && is_numeric($loggedUser->id)) {
        redirect('./editor.php');
    }
    /**
     * [2] Cookie method
Exemple #5
0
*/
/**Colaborators are per diagram*/
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('./index.php');
}
$delegate = new Delegate();
$loggedUser = $delegate->userGetById($_SESSION['userId']);
$users = $delegate->userGetAll();
$page = 'users';
$rawLicense = $delegate->settingsGetByKeyNative('LICENSE');
$l = new License();
if (trim($rawLicense) != '') {
    $l->load($rawLicense);
}
$currentHost = $_SERVER['HTTP_HOST'];
if (strpos($currentHost, ':')) {
    $currentHost = substr($currentHost, 0, strpos($currentHost, ':'));
}
?>

<!DOCTYPE html>
<html>
    <!--Copyright 2010 Scriptoid s.r.l-->
    <head>
        <title>Users - Diagramo</title>
Exemple #6
0
/**
 */
function forgotPasswordExe()
{
    $email = trim($_POST['email']);
    // Validate data
    if (!validateString($email, 'Empty email or bad email syntax')) {
        print "Wrong email: " . $email;
        exit;
    }
    if ($_REQUEST['captcha'] != $_SESSION['captcha']) {
        addError("Text was wrong. try again!");
    }
    if (errors()) {
        //        print "Errors"; exit(0);
        redirect("../forgot-password.php");
        exit(0);
    }
    $delegate = new Delegate();
    $WEBADDRESS = $delegate->settingsGetByKeyNative('WEBADDRESS');
    $user = $delegate->userGetByEmail($email);
    if (is_object($user)) {
        $url = $WEBADDRESS . '/editor/common/controller.php?action=resetPassword&k=' . $user->password . '&i=' . $user->id;
        $body = "<html>\n                <head>\n                <title>Reset your password</title>\n                </head>\n             <body>\n                Hello, <p/>\n                Here is your request to reset your password. Please click the link to reset your password.\n                <a href=\"{$url}\">{$url}</a>\n             </body>\n             </html>";
        if (sendEmail($user->email, '*****@*****.**', "Password reset", $body)) {
            addMessage("Reset email sent!");
        } else {
            addError("Reset email NOT sent!");
        }
        #outer site
        redirect("../forgot-password.php");
        exit(0);
    } else {
        addError("Email not present in DB");
        redirect("../forgot-password.php");
        exit(0);
    }
}
function saveLicense()
{
    print_r($_REQUEST);
    $serial = $_REQUEST['serial'];
    $host = $_REQUEST['host'];
    $d = new Delegate();
    $DIAGRAMO = $d->settingsGetByKeyNative('DIAGRAMO');
    $url = $DIAGRAMO . "/dcentral/activator.php?serial={$serial}&host={$host}";
    #print 'URL: ' . $url;
    $license = get($url);
    #print 'License: ' . $license;
    #exit();
    $d->settingsSaveNative('LICENSE', $license);
    addMessage("App activated");
    redirect('../license.php');
    exit(0);
}