Exemple #1
0
 function ipc_check_email()
 {
     global $email, $skipId;
     if ($skipId == '') {
         $skipId = -1;
     }
     $user_info = user_info_by_id(user_id());
     if ($email == config_get('null-email') && $user_info['email'] != $email && !user_access_root()) {
         print '-ERR';
     } else {
         if (user_registered_with_email($email, $skipId)) {
             print '-ERR';
         } else {
             print '+OK';
         }
     }
 }
Exemple #2
0
/**
 * Gate - Wiki engine and web-interface for WebTester Server
 *
 * Main handlers for XPFS browser
 *
 * 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;
}
if (!user_authorized() || !user_access_root()) {
    header('Location: ' . config_get('document-root') . '/admin');
}
global $DOCUMENT_ROOT;
include $DOCUMENT_ROOT . '/inc/xpfs_browser.php';
include $DOCUMENT_ROOT . '/admin/inc/menu.php';
include '../menu.php';
$manage_menu->SetActive('to-developer');
$mandev_menu->SetActive('xpfs');
// Printing da page
print $manage_menu->InnerHTML();
print $mandev_menu->InnerHTML();
print '${information}';
$browser = new XPFSBrowser();
$browser->interact();
$browser->Draw();
Exemple #3
0
 function wiki_get_page($url)
 {
     global $wiki, $history, $oldid, $uid;
     $tabacts = array('edit' => 1, 'history' => 1, 'admin' => 1);
     if ($url == '') {
         $url = '/';
     }
     if ($url[strlen($url) - 1] != '') {
         $url .= '/';
     }
     content_url_var_push('wiki', $wiki);
     redirector_add_skipvar('oldid');
     $error = false;
     $src = wiki_eval_page($url, $wiki, &$error);
     if ($error) {
         return $src;
         return;
     }
     $cur = prepare_arg(get_redirection(false, true));
     $items = array();
     $uidurl = $uid != '' ? 'uid\\=' . $uid : '';
     $dir = $url;
     if ($url[strlen($url) - 1] == '/') {
         $url .= '?';
     } else {
         $url .= '&';
     }
     if ($uidurl != '') {
         $uidurl = '&' . $uidurl;
     }
     $items[] = 'title=Статья;hint=Чтение статьи;url=' . (isset($tabacts[$wiki]) ? $url . $uidurl : 'JavaScript:refreshPage (\'' . urlencode(urlencode($cur)) . '\');') . ';active=' . (!isset($tabacts[$wiki]) ? '1' : '0') . ';';
     if (content_get_allowed('EDIT') || content_get_allowed('EDITINFO')) {
         $items[] = 'separator=1;';
         if (file_exists(config_get('site-root') . $dir . 'edit.php')) {
             $items[] = 'title=Редактирование;hint=Редактирование ' . 'содержимого страницы;url=' . ($wiki != 'edit' ? $url . 'wiki\\=edit' . $uidurl : $cur) . ';active=' . ($wiki == 'edit' ? '1' : '0');
         }
         if (file_exists(config_get('site-root') . $dir . 'history.php')) {
             $items[] = 'title=История;hint=История изменения документа;url=' . ($wiki != 'history' ? $url . 'wiki\\=history' . $uidurl : $cur) . ';active=' . ($wiki == 'history' ? '1' : ($oldid != '' ? 'shaded' : '0'));
         }
     }
     $static_rules = config_get('static-privacy-rules');
     if (user_access_root() || $static_rules[strtolower(user_login())][$dir . 'admin.php']) {
         if (file_exists(config_get('site-root') . $dir . 'admin.php')) {
             $items[] = 'title=Администрирование;hint=Администрирование ' . 'раздела;url=' . ($wiki != 'admin' ? $url . 'wiki\\=admin' . $uidurl : $cur) . ';active=' . ($wiki == 'admin' ? '1' : '0');
         }
     }
     return stencil_wiki_page($src, $items);
 }
Exemple #4
0
 function FillTopMenu()
 {
     if (!user_authorized()) {
         $this->topmenu->AppendItem('Представиться системе / Зарегистрироваться', config_get('document-root') . '/login?redirect=' . get_redirection(), 'logout', 'key.gif');
     }
     if (!user_authorized() || user_access_root()) {
         if (nav_inside('/admin') >= 0) {
             $this->topmenu->AppendItem('Основной раздел', config_get('document-root') . '/', 'main', '');
         } else {
             $this->topmenu->AppendItem('Административный интерфейс', config_get('document-root') . '/admin/?redirect=' . get_redirection(), 'main', '');
         }
     }
     if (user_authorized()) {
         $this->topmenu->AppendItem('Выйти из системы', config_get('document-root') . '/?action=logout&redirect=' . get_redirection(), 'logout', 'lock.gif');
     }
 }
Exemple #5
0
 function check_locked()
 {
     global $login, $passwd;
     if (!opt_get('site_lock')) {
         return false;
     }
     if ($login != '') {
         user_authorize($login, $passwd);
     }
     if (user_access_root()) {
         return false;
     }
     tplp('common/site_lock');
     return true;
 }
Exemple #6
0
 function AdminMode()
 {
     $static = config_get('static-privacy-rules');
     return user_access_root() || $static[strtolower(user_login())]['/tester/admin.php'] == 'ROOT';
 }
Exemple #7
0
<?php

/**
 * Gate - Wiki engine and web-interface for WebTester Server
 *
 * Content generator for administration page
 *
 * 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;
}
if (!user_authorized()) {
    include 'inc/login.php';
} else {
    if (user_access_root()) {
        header('Location: content');
    } else {
        include 'inc/denied.php';
    }
}