示例#1
0
<?php

include_once './peerlib/peerutils.inc';
require_once './peerlib/validators.inc';
//require_once('rubberstuff.php');
include_once 'navigation2.inc';
require_once './peerlib/conffileeditor2.php';
requireCap(CAP_SYSTEM);
// anticipate a save initiated by user.
$saveResult = ConfFileEditor::save();
$page_opening = "Rubber editor file ";
$page = new PageContainer();
$page->setTitle($page_opening);
$nav = new Navigation($navtable, basename($PHP_SELF), $page_opening);
$page->addBodyComponent($nav);
if ($saveResult != '') {
    $page->addBodyComponent(new Component($saveResult));
}
if (isset($_REQUEST['formEditFile'])) {
    $_SESSION['formFileToEdit'] = $_REQUEST['formEditFile'];
}
$_SESSION['formFileToEdit'] = './templates/editform/html';
$pp = array();
$fileEditor = new ConfFileEditor($PHP_SELF, 'templates/formedit.html');
$fileEditor->setDescription("Edit query, template or tex file");
$fileEditor->getWidgetForPage($page);
$page->show();
示例#2
0
// see if we can find the root repos for this project
if (isset($_SESSION['repos_id'])) {
    $repos_id = $_SESSION['repos_id'];
    $sql = "select repospath,url_tail,description as repos_description,isroot,id from repositories \n" . "\t where prjm_id={$prjm_id} and id={$repos_id} and isroot=true order by id limit 1";
} else {
    $sql = "select repospath,url_tail,description as repos_description,isroot,id from repositories \n" . "\t where prjm_id={$prjm_id}  and isroot=true order by id limit 1";
}
//$dbConn->log($sql);
$resultSet = $dbConn->Execute($sql);
if (!$resultSet->EOF) {
    extract($resultSet->fields);
    $authzfile = $url_tail . '/conf/authz';
    $authzfilepath = '/home' . $authzfile;
    if (is_file($authzfilepath)) {
        $_SESSION['mustCommit'] = 1;
        $pp['executionResult'] = ConfFileEditor::save();
        $_SESSION['conf_editor_basedir'] = '/home';
        $_SESSION['fileToEdit'] = $authzfile;
        $pp['repos_id'] = $id;
        $pp['fileeditor'] = new ConfFileEditor($PHP_SELF, 'templates/authzeditor.html');
    }
}
$pp['page'] = $page;
$sql = "select repospath,grp_num,description as repos_description," . "url_tail,isroot,id,last_commit from repositories \n" . "\t where prjm_id={$prjm_id} order by repospath";
$resultSet = $dbConn->Execute($sql);
$repolist = '';
$repobase = '';
$reposTable = '';
if (!$resultSet->EOF) {
    $reposTable .= "<fieldset><legend>Available repositories</legend>" . "<table>\n" . "<tr><th>Id</th><td>grp</td><th>Path</th><th>description</th><th>revisions</th><th>last commit</th><th>Edit authorizations</th></tr>\n";
    while (!$resultSet->EOF) {