Пример #1
0
        if (isset($_FILES['userfile1']) && is_uploaded_file($_FILES['userfile1']['tmp_name'])) {
            $ret = $tikilib->attach_file($_FILES['userfile1']['name'], $_FILES['userfile1']['tmp_name'], $prefs['w_use_db'] == 'y' ? 'db' : 'dir');
            if ($ret['ok']) {
                // Set "data" field only if we're using db
                if ($prefs['w_use_db'] == 'y') {
                    $wikilib->wiki_attach_file($page, $_FILES['userfile1']['name'], $_FILES['userfile1']['type'], $_FILES['userfile1']['size'], $ret['data'], $_REQUEST['attach_comment'], $user, $ret['fhash']);
                } else {
                    $wikilib->wiki_attach_file($page, $_FILES['userfile1']['name'], $_FILES['userfile1']['type'], $_FILES['userfile1']['size'], '', $_REQUEST['attach_comment'], $user, $ret['fhash']);
                }
            } else {
                $access->display_error('', $ret['error']);
            }
        }
    }
    if (isset($_REQUEST['sort_mode'])) {
        $pageRenderer->setSortMode($_REQUEST['sort_mode']);
    }
    if (isset($_REQUEST['atts_show'])) {
        $pageRenderer->setShowAttachments($_REQUEST['atts_show']);
    }
}
// Watches
if ($prefs['feature_user_watches'] == 'y') {
    if ($user && isset($_REQUEST['watch_event']) && !isset($_REQUEST['watch_group'])) {
        check_ticket('index');
        if (($_REQUEST['watch_action'] == 'add_desc' || $_REQUEST['watch_action'] == 'remove_desc') && !$objectperms->watch_structure) {
            $access->display_error($page, tra('Permission denied'), '403');
        }
        $ret = true;
        if ($_REQUEST['watch_action'] == 'add') {
            $ret = $tikilib->add_user_watch($user, $_REQUEST['watch_event'], $_REQUEST['watch_object'], 'wiki page', $page, "tiki-index.php?page={$page}");