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); }
function redirect($url = '', $skipvars = array()) { global $redirect; foreach ($skipvars as $k => $v) { redirector_add_skipvar($k, $v); } if ($url == 'SELF') { $url = get_redirection(false); } if ($url != '') { $redirect = $url; } if ($redirect == '') { $redirect = config_get('document-root'); } header("Location: {$redirect}"); }
function wiki_menu_parse_item($src, $params) { global $wiki_menu_global_vars; if ($wiki_menu_global_vars == nil) { $wiki_menu_global_vars = array('anon_redirect' => !user_authorized() ? 'redirect=' . get_redirection() : '', 'document_root' => config_get('document-root')); } $vars = $wiki_menu_global_vars; foreach ($vars as $var => $val) { $src = preg_replace('/\\$' . $var . '/', $val, $src); } $params = array(); $modifers = preg_replace('/^([\\:lL]+)?(\\s*)(.*)/si', '\\1', $src); $data = preg_replace('/^([\\:lL]+)?(\\s*)(.*)/si', '\\3', $src); $parse = true; for ($i = 0; $i < count($modifers); $i++) { if ($modifers[$i] == ':') { $parse = false; } if ($modifers[$i] == 'l' && !user_authorized()) { return false; } if ($modifers[$i] == 'L' && user_authorized()) { return false; } } if (!$parse) { $src = $data; } else { global $wiki_menu_rules; $src = htmlspecialchars($data); $n = count($wiki_menu_rules); for ($i = 0; $i < $n; $i++) { $src = preg_replace($wiki_menu_rules[$i]['pattern'], $wiki_menu_rules[$i]['replace'], $src); } } return $src; }
/** * Gate - Wiki engine and web-interface for WebTester Server * * Handlers for profile 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()) { header('Location: ..?redirect=' . get_redirection()); } global $redirect, $action; if ($action == 'save') { global $email, $chpasswd_val; $email = stripslashes($email); $arr = array(); $u = user_get_by_id(user_id()); if ($u['email'] != '' && !check_email($email)) { add_info('Указанный E-Mail не выглядит корректным'); } else { if (user_registered_with_email($email, user_id())) { add_info('Такой E-Mail уже используется.'); } else { $arr['email'] = db_string($email); }
function PAGE_Problems() { global $act, $id, $CORE; $this->gateway->AppendNavigation('Список задач', '.?page=problems'); $manage = $this->IsContestJudge(); $WT_contest_id = $_SESSION['WT_contest_id']; if (!WT_contest_running($WT_contest_id) && !WT_contest_finished($WT_contest_id) && !$manage) { $this->CPrintLn('<span class="contentSub2">Список задач ' . 'недоступен, так как контест незапущен.</span>'); return; } $this->InsertTemplate('problems.page', array('lib' => $this)); //// // if ($this->GetAllowed('CONTEST.MANAGE')) { $this->AppendQuickLink('Редактировать контест', '?page=contest&action=manage&id=' . $WT_contest_id); } if ($this->GetAllowed('PROBLEMS.CREATE')) { $this->AppendQuickLink('Создать задачу', '?page=prbmanager&action=showcreate' . '&promtadd=1&redirect=' . get_redirection()); } }
function user_generate_viewlink($id) { return config_get('document-root') . '/login/viewuser/?id=' . $id . '&redirect=' . get_redirection(); }
<?php /** * Gate - Wiki engine and web-interface for WebTester Server * * WebTester client page generation script * * 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()) { redirect('./login?redirect=' . get_redirection()); } $gw = WT_spawn_new_gateway(); $gw->Handle(); $gw->Draw();
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'); } }
function GetItemEditorLink($id) { $wiki = content_url_var_pop('wiki'); $url = content_url_get_full(); $data = $this->data[$this->idlink[$id]]; $redirect = get_redirection(); if ($this->IsDated()) { $y = preg_replace('/([0-9]+)\\-([0-9]+)\\-([0-9]+)/si', '\\1', $data['date']); $m = preg_replace('/([0-9]+)\\-([0-9]+)\\-([0-9]+)/si', '\\2', $data['date']); $d = preg_replace('/([0-9]+)\\-([0-9]+)\\-([0-9]+)/si', '\\3', $data['date']); return $url . '&wiki=edit&action=edit&year=' . $y . '&month=' . $m . '&day=' . $d . '&uid=' . $data['uid'] . '&redirect=' . $redirect; } else { return $url . '&wiki=edit&action=edit&uid=' . $data['uid'] . '&redirect=' . $redirect; } content_url_var_push('wiki', $wiki); }
<td><input type="text" class="txt" value="" name="login" id="login" size="40"></td> </tr> <tr> <td width="80" style="padding-top: 4px;">Пароль:</td> <td style="padding-top: 4px;"><input type="password" class="passwd" name="passwd" size="40"></td> </tr> </table> </td> </tr> <tr> <td colspan="2" style="padding-left: 32px;"> <div style="margin: 6px 0;">Если у Вас нет логина, то вы можете <a href="<?php echo config_get('document-root'); ?> /login/registration/?redirect=<?php echo get_redirection(true, true); ?> ">зарегистрироваться</a>.</div> <div style="margin: 6px 0;">Если Вы забыли свой пароль, то мы можем <a href="<?php echo config_get('document-root'); ?> /login/restore">выслать новый пароль</a>.</div> </td> </tr> <tr> <td align="center" colspan="2" style="padding-top: 4px;"> <button type="button" class="submitBtn" onclick="nav ('<?php echo redirector_get_backlink(); ?> ');">Назад</button> <button class="submitBtn" type="submit"><b>Представиться</b></button>