コード例 #1
0
ファイル: content.php プロジェクト: Nazg-Gul/gate
 function content_lookup($path)
 {
     global $oldid, $content_security;
     $root = config_get('document-root');
     $pattern = prepare_pattern($root);
     $path = preg_replace("/({$pattern})/", '', $path);
     $id = content_id_by_path($path);
     if ($id == -1) {
         return null;
     }
     $c = wiki_spawn_content($id);
     $content_security = $c->GetRealSecurity();
     return $c;
 }
コード例 #2
0
ファイル: editroot.php プロジェクト: Nazg-Gul/gate
 * Gate - Wiki engine and web-interface for WebTester Server
 *
 * Script for root element editor form generation
 *
 * Copyright (c) 2008-2009 Sergey I. Sharybin <*****@*****.**>
 *
 * This program can be distributed under the terms of the GNU GPL.
 * See the file COPYING.
 */
if ($PHP_SELF != '') {
    print 'HACKERS?';
    die;
}
$id = 1;
formo('title=Редактирование корневого раздела;');
$c = wiki_spawn_content($id);
$si = $c->GetSecurityInformation();
$glist = security_groups();
?>
<script language="JavaScript" type="text/javascript">
  var gDesc = new Array ();
<?php 
foreach ($glist as $k => $g) {
    ?>
  gDesc[<?php 
    echo $g['access'];
    ?>
]='<?php 
    echo addslashes($g['desc']);
    ?>
';
コード例 #3
0
ファイル: 02CSRCRSS.php プロジェクト: Nazg-Gul/gate
 function GetRSSData()
 {
     $res = '';
     $percontent = opt_get('rss_items_per_content');
     $prefix = config_get('http-document-root');
     if (is_array($this->settings['contents'])) {
         foreach ($this->settings['contents'] as $cid => $dummy) {
             $c = wiki_spawn_content($cid);
             if ($c->GetID() <= 0) {
                 unset($this->settings['contents'][$cid]);
                 continue;
             }
             $arr = $c->GetRSSData($percontent);
             $n = min(count($arr), $percontent);
             for ($i = 0; $i < $n; $i++) {
                 $linkPrefix = $prefix . $c->GetFullHTTPPath();
                 $row = $arr[$i];
                 $row['timestamp'] = $timestamp;
                 $res .= "  <item>\n";
                 $res .= '    <title>' . htmlspecialchars($row['title']) . '</title>' . "\n";
                 if ($row['link'] != '') {
                     $res .= '    <link>' . $linkPrefix . '/' . $row['link'] . '</link>' . "\n";
                 }
                 $res .= '    <description>' . htmlspecialchars($row['description']) . '</description>' . "\n";
                 if ($row['comments'] != '') {
                     $res .= '    <comments>' . $row['comments'] . '</comments>' . "\n";
                 }
                 $res .= '    <pubDate>' . FullLocalTime($row['pubdate']) . '</pubDate>' . "\n";
                 if ($row['dccreator'] != '') {
                     $res .= '    <dc:creator>' . htmlspecialchars($row['dccreator']) . '</dc:creator>' . "\n";
                 }
                 $res .= "  </item>\n";
             }
         }
     }
     return setvars($res);
 }
コード例 #4
0
ファイル: edit.php プロジェクト: Nazg-Gul/gate
 * Copyright (c) 2008-2009 Sergey I. Sharybin <*****@*****.**>
 *
 * This program can be distributed under the terms of the GNU GPL.
 * See the file COPYING.
 */
if ($PHP_SELF != '') {
    print 'HACKERS?';
    die;
}
global $id;
if ($id == 1) {
    include 'editroot.php';
} else {
    print '<div id="snavigator"><a href=".">Разделы</a>' . wiki_content_navigator($id, 'action=edit') . '</div>';
    formo('title=Редактирование раздела;');
    $c = wiki_spawn_content($id, 'security');
    $si = $c->GetSecurityInformation();
    $glist = security_groups();
    ?>

<script language="JavaScript" type="text/javascript">
  var gDesc=new Array ();
<?php 
    foreach ($glist as $k => $g) {
        ?>
  gDesc[<?php 
        echo $g['access'];
        ?>
]='<?php 
        echo addslashes($g['desc']);
        ?>
コード例 #5
0
ファイル: data.php プロジェクト: Nazg-Gul/gate
$datacontrol_menu->Draw();
print '${information}';
if ($action == 'edit') {
    include 'edit.php';
} else {
    if ($action == 'editor') {
        include 'editor.php';
    } else {
        if ($action == 'editroot') {
            include 'editroot.php';
        } else {
            if ($action == 'save') {
                if ($id != 1) {
                    wiki_content_update_received($id);
                } else {
                    $c = wiki_spawn_content(1);
                    $c->security->ReceiveData();
                    $c->Update();
                }
            } else {
                if ($action == 'delete') {
                    wiki_content_delete($id);
                } else {
                    if ($action == 'up') {
                        wiki_content_up($id);
                    } else {
                        if ($action == 'down') {
                            wiki_content_down($id);
                        }
                    }
                }