Exemple #1
0
require_once './lib2/logic/cachelog.class.php';
$tpl->name = 'picture';
$tpl->menuitem = MNU_CACHES_PICTURE;
$login->verify();
if ($login->userid == 0) {
    $tpl->redirect_login();
}
$action = isset($_REQUEST['action']) ? mb_strtolower($_REQUEST['action']) : '';
$redirect = isset($_REQUEST['redirect']) ? $_REQUEST['redirect'] : '';
$redirect = $tpl->checkTarget($redirect, '');
$tpl->assign('action', $action);
$tpl->assign('redirect', $redirect);
if ($action == 'add') {
    $picture = new picture();
    if (isset($_REQUEST['cacheuuid'])) {
        $cache = cache::fromUUID($_REQUEST['cacheuuid']);
        if ($cache === null) {
            $tpl->error(ERROR_CACHE_NOT_EXISTS);
        }
        if ($cache->allowEdit() == false) {
            $tpl->error(ERROR_NO_ACCESS);
        }
        $picture->setObjectId($cache->getCacheId());
        $picture->setObjectType(OBJECT_CACHE);
        $cache = null;
    } else {
        if (isset($_REQUEST['loguuid'])) {
            $cachelog = cachelog::fromUUID($_REQUEST['loguuid']);
            if ($cachelog === null) {
                $tpl->error(ERROR_CACHELOG_NOT_EXISTS);
            }
Exemple #2
0
 *
 *  Unicode Reminder メモ
 ***************************************************************************/
//prepare the templates and include all neccessary
$opt['rootpath'] = '../../';
require_once $opt['rootpath'] . 'lib2/web.inc.php';
require_once $opt['rootpath'] . 'lib2/logic/cache.class.php';
header('Content-type: text/html; charset=utf-8');
$cache = null;
if (isset($_REQUEST['cacheid'])) {
    $cacheid = $_REQUEST['cacheid'] + 0;
    $cache = new cache($cacheid);
} else {
    if (isset($_REQUEST['uuid'])) {
        $uuid = $_REQUEST['uuid'];
        $cache = cache::fromUUID($uuid);
    } else {
        if (isset($_REQUEST['wp'])) {
            $wp = $_REQUEST['wp'];
            $cache = cache::fromWP($wp);
        }
    }
}
if ($cache === null) {
    echo '0';
} else {
    if (!$cache->isPublic()) {
        echo '0';
    } else {
        echo $cache->getCacheId();
        echo ';';