예제 #1
0
    $listid = $_REQUEST['listid'] + 0;
    if ($listid == 0) {
        $cachelist = new cachelist(ID_NEW, $login->userid);
        $name_error = $cachelist->setNameAndVisibility($newlist_name, $newlist_public ? 2 : 0);
        if ($name_error) {
            $tpl->assign('name_error', $name_error);
        } else {
            $cachelist->setNode($opt['logic']['node']['id']);
            if ($cachelist->save()) {
                $cachelist->addCacheByID($cacheid);
                if ($newlist_watch) {
                    $cachelist->watch(true);
                }
            }
            $tpl->redirect('viewcache.php?cacheid=' . $cacheid);
        }
    } else {
        $cachelist = new cachelist($listid);
        if ($cachelist->exist()) {
            $cachelist->addCacheByID($cacheid);
        }
        $tpl->redirect('viewcache.php?cacheid=' . $cacheid);
    }
}
$tpl->assign('cachename', sql_value("SELECT `name` FROM `caches` WHERE `cache_id`='&1'", '', $cacheid));
$tpl->assign('cachelists', cachelist::getMyLists());
$tpl->assign('default_list', cachelist::getMyLastAddedToListId());
$tpl->assign('newlist_name', $newlist_name);
$tpl->assign('newlist_public', $newlist_public);
$tpl->assign('newlist_watch', $newlist_watch);
$tpl->display();
예제 #2
0
파일: search.php 프로젝트: 4Vs/oc-server3
 } elseif (isset($_REQUEST['searchbycacheid'])) {
     $options['searchtype'] = 'bycacheid';
     $options['cacheid'] = isset($_REQUEST['cacheid']) ? $_REQUEST['cacheid'] : 0;
     if (!is_numeric($options['cacheid'])) {
         $options['cacheid'] = 0;
     }
 } elseif (isset($_REQUEST['searchbywp'])) {
     $options['searchtype'] = 'bywp';
     $options['wp'] = isset($_REQUEST['wp']) ? $_REQUEST['wp'] : '';
 } elseif (isset($_REQUEST['searchbynofilter'])) {
     $options['searchtype'] = 'bynofilter';
 } elseif (isset($_REQUEST['searchbylist'])) {
     $options['searchtype'] = 'bylist';
     $options['listid'] = isset($_REQUEST['listid']) ? $_REQUEST['listid'] + 0 : 0;
     $list = new cachelist($options['listid']);
     if (!$list->exist() || !$list->isMyList() && $list->getVisibility() == 0) {
         $tpl->redirect("cachelists.php");
     }
     $options['cachelist'] = cachelist::getListById($options['listid']);
     // null for invalid ID
 } elseif (isset($_REQUEST['searchall'])) {
     if (!$login->logged_in()) {
         // This operation is very expensive and therefore available only
         // for logged-in users.
         $tpl->error(ERROR_LOGIN_REQUIRED);
     } else {
         $options['searchtype'] = 'all';
     }
 } else {
     if (isset($_REQUEST['showresult'])) {
         $tpl->error('unknown search option');
예제 #3
0
 *  For license information see doc/license.txt
 *
 *  Unicode Reminder メモ
 *
 *  Shortcut for cachelist search
 ***************************************************************************/
require './lib2/web.inc.php';
$id = isset($_REQUEST['id']) ? $_REQUEST['id'] + 0 : 0;
$password = isset($_REQUEST['key']) ? $_REQUEST['key'] : '';
$watch = isset($_REQUEST['watch']);
$dontwatch = isset($_REQUEST['dontwatch']);
$bookmark = isset($_REQUEST['bookmark']);
$unbookmark = isset($_REQUEST['unbookmark']);
if ($id) {
    $login->verify();
    $list = new cachelist($id);
    if ($list->exist()) {
        if ($watch && $list->allowView($password) || $dontwatch) {
            $list->watch($watch);
        }
        if ($bookmark) {
            $list->bookmark($password);
        }
        if ($unbookmark) {
            $list->unbookmark();
        }
    }
    $tpl->redirect("search.php?searchto=searchbylist&listid=" . $id . ($password != "" ? "&listkey=" . urlencode($password) : "") . "&showresult=1&f_disabled=0&f_inactive=0&f_ignored=1&sort=byname");
} else {
    $tpl->redirect("cachelists.php");
}
예제 #4
0
파일: mylists.php 프로젝트: 4Vs/oc-server3
        // switching editor mode while editing existing list
        $list = new cachelist($_REQUEST['listid'] + 0);
        if ($list->exist() && $list->getUserId() == $login->userid) {
            $edit_list = true;
            $tpl->assign('show_editor', true);
        }
    } else {
        // switching desc mode while creating new list
        $tpl->assign('newlist_mode', true);
        $tpl->assign('show_editor', true);
    }
}
// save data entered in the 'edit list' form
if (isset($_REQUEST['save']) && isset($_REQUEST['listid'])) {
    $list = new cachelist($_REQUEST['listid'] + 0);
    if ($list->exist() && $list->getUserId() == $login->userid) {
        $name_error = $list->setNameAndVisibility($list_name, $list_visibility);
        if ($name_error) {
            $edit_list = true;
        }
        $list->setDescription($desctext, $descMode == 3);
        $list->save();
        $list->watch($watch);
        if ($list_caches != '') {
            $result = $list->addCachesByWPs($list_caches);
            $tpl->assign('invalid_waypoints', $result === true ? false : implode(", ", $result));
            $list_caches = '';
        }
        foreach ($_REQUEST as $key => $value) {
            if (substr($key, 0, 7) == 'remove_') {
                $list->removeCacheById(substr($key, 7));