コード例 #1
0
 public static function start($name)
 {
     if (!is_array(self::$vars)) {
         self::$vars = array();
     }
     if (!isset(self::$vars[$name])) {
         self::$vars[$name] = array();
     }
     ob_start();
 }
コード例 #2
0
</div></div>
<?php 
Gorilla3d_Template::load('footer.php');
コード例 #3
0
<?php

require_once 'library/Gorilla3d/Session.php';
require_once 'library/Gorilla3d/Template.php';
require_once 'models/Sites.php';
$session = new Gorilla3d_Session();
if ($session->get('accountId') === null) {
    header('Location: ../login');
    exit;
}
$error = false;
$success = '';
$site = Sites::byId($_REQUEST['id']);
//TODO: Detect protocal
$url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'] . '/runner?id=' . $_REQUEST['id'];
$context = stream_context_create(array('http' => array('timeout' => 1)));
//file_get_contents($url, 0, $context);
if ($site === false) {
    $error = 'Invalid Site';
}
Gorilla3d_Template::load('app/site.php', array('pageTitle' => 'Site | Editor v0.1', 'error' => $error, 'success' => $success, 'site' => $site));
コード例 #4
0
ファイル: edit.php プロジェクト: joseph-montanez/Website-IDE
require_once 'library/Gorilla3d/Session.php';
require_once 'library/Gorilla3d/Template.php';
require_once 'models/Sites.php';
$session = new Gorilla3d_Session();
if ($session->get('accountId') === null) {
    header('Location: ../login');
    exit;
}
$error = false;
$success = false;
$password = isset($_POST['password']) ? $_POST['password'] : '';
$host = isset($_POST['host']) ? $_POST['host'] : '';
$username = isset($_POST['username']) ? $_POST['username'] : '';
if (isset($_POST['host'])) {
    include_once 'library/Gorilla3d/Ssh.php';
    $ssh = new Gorilla3d_Ssh($_POST['host'], $_POST['username'], $_POST['password']);
    if (!$ssh->isConnected()) {
        $error = 'Unable to connect';
    } else {
        $success = true;
        $site = new Sites();
        $site->setHost($host)->setPort(22)->setUsername($username)->setPasswd($password)->setAccountId($session->get('accountId'));
        Sites::insert($site);
        $siteId = $site->lastInsertId();
        header('Location: ../app?success=site');
        exit;
    }
}
Gorilla3d_Template::load('app/sites/edit.php', array('pageTitle' => 'Add/Edit Site | Editor v0.1', 'error' => $error, 'success' => $success, 'username' => $username, 'password' => $password, 'host' => $host));
コード例 #5
0
    );
    float: left;
}
#right-pane-inner {
    margin: 10px;
}
#right-pane-outer {
    width:75%; 
    height: 100%; 
    overflow: auto; 
    float: left;
}
</style>
<?php 
Gorilla3d_Template::end('head');
Gorilla3d_Template::load('header.php', array('pageTitle' => $pageTitle));
?>
<div id="left-pane-outer"><div id="left-pane-inner">
    <h2></h2>
    <ul>
        <li>
            <a href="<?php 
echo $_SERVER['SCRIPT_NAME'];
?>
/app/sites/edit">
                Add FTP/SFTP
            </a>
        </li>
        <?php 
foreach (Sites::fetchAll() as $conn) {
    ?>
コード例 #6
0
ファイル: app.php プロジェクト: joseph-montanez/Website-IDE
<?php

require_once 'library/Gorilla3d/Session.php';
require_once 'library/Gorilla3d/Template.php';
require_once 'models/Sites.php';
$session = new Gorilla3d_Session();
if ($session->get('accountId') === null) {
    header('Location: login');
    exit;
}
$success = isset($_REQUEST['success']) ? $_REQUEST['success'] : '';
Gorilla3d_Template::load('app.php', array('pageTitle' => 'Editor v0.1', 'success' => $success));
コード例 #7
0
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; utf-8" />
    <title><?php 
echo isset($pageTitle) ? $pageTitle : 'Editor';
?>
</title>
    <?php 
echo Gorilla3d_Template::getStatic('head');
?>
</head>
<body>
コード例 #8
0
ファイル: login.php プロジェクト: joseph-montanez/Website-IDE
    header('Location: app');
    exit;
}
$error = false;
$password = isset($_POST['password']) ? $_POST['password'] : '';
$username = isset($_POST['username']) ? $_POST['username'] : '';
if (!empty($_POST)) {
    $newAccount = false;
    if (!Accounts::exists()) {
        Accounts::createTable();
        Sites::createTable();
        $newAccount = true;
    }
    $account = false;
    if ($newAccount) {
        $account = new Accounts();
        $account->setPasswd($password)->setUsername($username);
        Accounts::insert($account);
        unset($account);
    }
    $account = Accounts::byLogin($username, $password);
    if ($account === false) {
        $error = 'Unable to Login';
    } else {
        $session->set('accountId', $account->id);
        header('Location: app');
        exit;
    }
}
Gorilla3d_Template::load('login.php', array('pageTitle' => 'Login', 'error' => $error, 'username' => $username, 'password' => $password));