예제 #1
0
파일: index.php 프로젝트: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('visibility' => array('int', 0, 3)));
require ROOT . '/library/preprocessor.php';
requireModel("blog.link");
requireStrictRoute();
$respond = array();
list($result, $visibility) = toggleLinkVisibility($blogid, $suri['id'], $_POST['visibility']);
Respond::PrintResult(array('error' => $result ? 0 : 1, 'visibility' => $visibility), false);
예제 #2
0
파일: index.php 프로젝트: ni5am/Textcube
function Recaptcha_AddingCommentHandler($target, $mother)
{
    $context = Model_Context::getInstance();
    $config = $context->getProperty('plugin.config');
    if (doesHaveOwnership() || doesHaveMembership()) {
        return true;
    }
    /* Skip validation if signed-in. */
    if (!is_null($config) && isset($config['secretKey'])) {
        $recaptcha_response = $_POST["g-recaptcha-response"];
        $reqURL = "https://www.google.com/recaptcha/api/siteverify?secret={$config['secretKey']}&response={$recaptcha_response}";
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $reqURL);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $output = curl_exec($ch);
        curl_close($ch);
        if ($output === false) {
            Respond::PrintResult(array('error' => 2, 'description' => 'Cannot connect to the Google reCAPTCHA server.'));
            return false;
        } else {
            $resp = json_decode($output, true);
            if ($resp['success'] === true) {
                /* Yay! The user is human. */
                return true;
            } else {
                $err = implode(' ', $resp['error-codes']);
                if (strpos($err, 'missing-input-secret') !== false) {
                    Respond::PrintResult(array('error' => 2, 'description' => 'Missing reCAPTCHA secret key!'));
                } elseif (strpos($err, 'missing-input-response') !== false) {
                    Respond::PrintResult(array('error' => 2, 'description' => 'Missing reCAPTCHA response!'));
                } elseif (strpos($err, 'invalid-input-secret') !== false) {
                    Respond::PrintResult(array('error' => 2, 'description' => 'Invalid reCAPTCHA secret key.'));
                } elseif (strpos($err, 'invalid-input-response') !== false) {
                    Respond::PrintResult(array('error' => 2, 'description' => 'Invalid reCAPTCHA response.'));
                }
            }
        }
        /* It seems to be a robot! Silently fail. */
        return false;
    }
    /* If the plugin is not configured yet, bypass validation. */
    return true;
}
예제 #3
0
<?php

/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('allowBlogVisibility' => array('bool'), 'requireLogin' => array('bool'), 'encoding' => array('string'), 'faviconDailyTraffic' => array('int'), 'flashClipboardPoter' => array('bool'), 'flashUploader' => array('bool'), 'language' => array('string'), 'serviceurl' => array('string'), 'cookieprefix' => array('string', 'mandatory' => false, 'default' => ''), 'skin' => array('string'), 'timeout' => array('int'), 'autologinTimeout' => array('int'), 'timezone' => array('string'), 'useDebugMode' => array('bool'), 'useEncodedURL' => array('bool'), 'useNumericRSS' => array('bool'), 'usePageCache' => array('bool'), 'useCodeCache' => array('bool'), 'useReader' => array('bool'), 'useRewriteDebugMode' => array('bool'), 'useSessionDebugMode' => array('bool'), 'useSkinCache' => array('bool'), 'useMemcached' => array('bool'), 'useExternalResource' => array('bool'), 'externalResourceURL' => array('string', 'mandatory' => false, 'default' => '')));
require ROOT . '/library/preprocessor.php';
importlib('model.blog.service');
requireStrictRoute();
$matchTable = array('timeout' => 'timeout', 'autologinTimeout' => 'autologinTimeout', 'skin' => 'skin', 'language' => 'language', 'timezone' => 'timezone', 'encoding' => 'encoding', 'serviceurl' => 'serviceURL', 'cookieprefix' => 'cookie_prefix', 'usePageCache' => 'pagecache', 'useCodeCache' => 'codecache', 'useSkinCache' => 'skincache', 'useMemcached' => 'memcached', 'useReader' => 'reader', 'useNumericRSS' => 'useNumericRSS', 'useEncodedURL' => 'useEncodedURL', 'useExternalResource' => 'externalresources', 'externalResourceURL' => 'resourcepath', 'allowBlogVisibility' => 'allowBlogVisibilitySetting', 'requireLogin' => 'requirelogin', 'flashClipboardPoter' => 'flashclipboardpoter', 'flashUploader' => 'flashuploader', 'useDebugMode' => 'debugmode', 'useSessionDebugMode' => 'debug_session_dump', 'useRewriteDebugMode' => 'debug_rewrite_module', 'faviconDailyTraffic' => 'favicon_daily_traffic');
$description = array('server' => 'Database server location. Can be socket or address.', 'database' => 'Database name.', 'username' => 'Database username.', 'password' => 'Database password.', 'dbms' => 'Database engine.', 'prefix' => 'Table prefix in database.', 'type' => 'Service type. [single|path|domain] e.g. [http://www.example.com/blog | http://www.example.com/blog/blog1 | http://blog1.example.com].', 'domain' => 'Service domain. (http://www.example.com)', 'path' => 'Service path. (e.g. /blog)', 'timeout' => 'Session timeout limit (sec.)', 'autologinTimeout' => 'Automatic login timeout (sec.)', 'skin' => 'Default blog skin name.', 'language' => 'Server language', 'timezone' => 'Server timezone', 'encoding' => 'Character encoding', 'serviceURL' => 'Specify the default service URL. Useful if using other web program under the same domain.', 'cookie_prefix' => 'Service cookie prefix. Default cookie prefix is Textcube_[VERSION_NUMBER].', 'pagecache' => 'Use pagecache function.', 'codecache' => 'Use codecache function.', 'skincache' => 'Use skin pre-fetching.', 'memcached' => 'Use memcache to handle session and cache', 'reader' => 'Use Textcube reader. You can set it to false if you do not use Textcube reader, and want to decrease DB load.', 'useNumericRSS' => 'Can force permalink to numeric format on RSS output.', 'useEncodedURL' => 'URL encoding using RFC1738', 'externalresources' => 'Loads resources from external CDN from resourceURL.', 'resourcepath' => 'Specify the full URI of external resource.', 'useSSL' => 'Use SSL connection. Every http:// will be replaced with https://', 'allowBlogVisibilitySetting' => 'Allow service users to change blog visibility.', 'requirelogin' => 'Force log-in process to every blogs. (for private blog service)', 'flashclipboardpoter' => 'Use Flash clipboard copy to support one-click trackback address copy.', 'flashuploader' => 'Use Flash uploader to upload multiple files.', 'debugmode' => 'Textcube debug mode. (for core / plugin debug or optimization)', 'debug_session_dump' => 'session info debuging.', 'debug_rewrite_module' => 'rewrite handling module info debuging.', 'favicon_daily_traffic' => 'Set favicon traffic limitation. default is 10MB.');
/* Exception handling */
$config = array();
foreach ($matchTable as $abs => $real) {
    if ($_POST[$abs] === 1) {
        $config[$real] = true;
    } else {
        if ($_POST[$abs] === 0) {
            $config[$real] = false;
        } else {
            $config[$real] = $_POST[$abs];
        }
    }
}
$result = writeConfigFile($config, $description);
if ($result === true) {
    Respond::PrintResult(array('error' => 0));
} else {
    Respond::PrintResult(array('error' => 1, 'msg' => $result));
}
예제 #4
0
<?php

/// Copyright (c) 2004-2014, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('target' => array('any', 'mandatory' => true)));
require ROOT . '/library/preprocessor.php';
require ROOT . '/library/error.php';
requireStrictRoute();
if (substr($_POST['target'], 0, 7) != '/owner/') {
    errorExit(404);
}
if (!defined('__TEXTCUBE_GAE__')) {
    Respond::PrintResult(array('error' => 0, 'url' => $_POST['target']));
    exit;
}
use google\appengine\api\cloud_storage\CloudStorageTools;
$options = ['gs_bucket_name' => $_SERVER['blog_fs_bucket']];
$upload_url = CloudStorageTools::createUploadUrl($_POST['target'], $options);
Respond::PrintResult(array('error' => 0, 'url' => $upload_url));
예제 #5
0
파일: index.php 프로젝트: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('entriesOnPage' => array('int'), 'entriesOnList' => array('int'), 'entriesOnRecent' => array('int'), 'noticesOnRecent' => array('int'), 'commentsOnRecent' => array('int'), 'commentsOnGuestbook' => array('int'), 'archivesOnPage' => array('int'), 'tagboxAlign' => array('int'), 'tagsOnTagbox' => array('int'), 'trackbacksOnRecent' => array('int'), 'showListOnCategory' => array('int'), 'showListOnArchive' => array('int'), 'showListOnTag' => array('int'), 'showListOnAuthor' => array('int'), 'showListOnSearch' => array('int'), 'expandComment' => array('int'), 'expandTrackback' => array('int'), 'sortCommentsBy' => array('string'), 'recentNoticeLength' => array('int'), 'recentPageLength' => array('int'), 'recentEntryLength' => array('int'), 'recentCommentLength' => array('int'), 'recentTrackbackLength' => array('int'), 'linkLength' => array('int'), 'useAjaxComment' => array('int'), 'useMicroformat' => array('int'), 'useFOAF' => array('int')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
if (setSkinSetting($blogid, $_POST)) {
    Respond::PrintResult(array('error' => 0));
} else {
    Respond::PrintResult(array('error' => 1, 'msg' => POD::error()));
}
예제 #6
0
<?php

/// Copyright (c) 2004-2015, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('item' => array('string')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
requirePrivilege('group.creators');
$items = explode(",", $_GET['item']);
if (in_array(getServiceSetting("defaultBlogId", 1), $items)) {
    $result = _t('대표 블로그는 삭제할 수 없습니다.');
    Respond::PrintResult(array('error' => -1, 'result' => $result));
}
foreach ($items as $item) {
    $result = removeBlog($item);
    if ($result !== true) {
        Respond::PrintResult(array('error' => -1, 'result' => $result));
    }
}
Respond::PrintResult(array('error' => 0));
예제 #7
0
    if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) {
        @header("location:" . $context->getProperty('uri.blog') . "/owner/entry");
        exit;
    }
}
//$isAjaxRequest = checkAjaxRequest();
if (!isset($_GET['command'])) {
    $temp = setEntryStar($suri['id'], isset($_GET['mark']) ? $_GET['mark'] : 1) == true ? 0 : 1;
    $countResult = POD::queryExistence("SELECT id \n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = " . getBlogId() . " AND starred = " . $_GET['mark']);
    if ($countResult == false) {
        $countResult = 0;
    } else {
        $countResult = 1;
        fireEvent('ChangeStarred', $_GET['mark'], $suri['id']);
    }
    Respond::PrintResult(array('error' => $temp), false);
} else {
    switch ($_GET['command']) {
        case "unmark":
            $_GET['command'] = 1;
            break;
        case "mark":
            $_GET['command'] = 2;
            break;
        default:
            $_GET['command'] = 0;
            break;
    }
    setEntryStar($suri['id'], $_GET['command']);
    header("Location: " . $_SERVER['HTTP_REFERER']);
}
예제 #8
0
                    $pool->setQualifier('visibility', 'equals', 3);
                    $pool->setQualifier('acceptcomment', 'equals', 1);
                    $row = $pool->getAll('*');
                    if (!empty($row)) {
                        sendCommentPing($entryId, $context->getProperty('uri.default') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/{$row['slogan']}" : $entryId), is_null($user) ? $comment['name'] : $user['name'], is_null($user) ? $comment['homepage'] : $user['homepage']);
                    }
                }
                importlib('model.blog.skin');
                $skin = new Skin($context->getProperty('skin.skin'));
                if ($entryId > 0) {
                    $commentBlock = getCommentView($entry, $skin);
                    dress('article_rep_id', $entryId, $commentBlock);
                    $commentBlock = escapeCData(revertTempTags(removeAllTags($commentBlock)));
                    $recentCommentBlock = escapeCData(revertTempTags(getRecentCommentsView(getRecentComments($blogid), null, $skin->recentCommentItem)));
                    $commentCount = getCommentCount($blogid, $entryId);
                    $commentCount = $commentCount > 0 ? $commentCount : 0;
                    list($tempTag, $commentView) = getCommentCountPart($commentCount, $skin);
                } else {
                    $commentView = '';
                    $commentBlock = getCommentView($entry, $skin);
                    dress('article_rep_id', $entryId, $commentBlock);
                    $commentBlock = escapeCData(revertTempTags(removeAllTags($commentBlock)));
                    $commentCount = 0;
                    $recentCommentBlock = escapeCData(revertTempTags(getRecentCommentsView(getRecentComments($blogid), $skin->recentComment, $skin->recentCommentItem)));
                }
                Respond::PrintResult(array('error' => 0, 'commentView' => $commentView, 'commentCount' => $commentCount, 'commentBlock' => $commentBlock, 'recentCommentBlock' => $recentCommentBlock));
                exit;
            }
        }
    }
}
예제 #9
0
파일: index.php 프로젝트: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('parent' => array('int')));
require ROOT . '/library/preprocessor.php';
requireModel('blog.attachment');
$result = getAttachmentSizeLabel($blogid, $_GET['parent']);
Respond::PrintResult(array('error' => empty($result) ? 1 : 0, 'result' => $result));
?>
 
예제 #10
0
<?php

/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('identify' => array('string', 'min' => 1), 'owner' => array('email')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
requirePrivilege('group.creators');
if ($uid = User::getUserIdByEmail($_GET['owner'])) {
    $result = addBlog('', $uid, $_GET['identify']);
    if ($result === true) {
        if ($_GET['owner'] == User::getEmail(getUserId())) {
            /// Update current user's access list.
            $priv = array();
            array_push($priv, "group.administrators");
            Acl::setAcl($rec['blogid'], $priv, true);
        }
        Respond::PrintResult(array('error' => 0));
    } else {
        Respond::PrintResult(array('error' => -1, 'result' => $result));
    }
} else {
    Respond::PrintResult(array('error' => -2, 'result' => _t('등록되지 않은 소유자 E-mail 입니다.')));
}
예제 #11
0
파일: index.php 프로젝트: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('GET' => array('command' => array('any', 'mandatory' => false, 'default' => 'block'), 'id' => array('id', 'mandatory' => false), 'mode' => array(array('ip', 'url', 'content', 'name', 'whiteurl')), 'value' => array('string', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
$isAjaxRequest = checkAjaxRequest();
$filter = new Filter();
if ($_GET['command'] == 'unblock') {
    if (empty($_GET['id'])) {
        $filter->type = $_GET['mode'];
        $filter->pattern = $_GET['value'];
    } else {
        $filter->id = $_GET['id'];
    }
    if ($filter->remove()) {
        $isAjaxRequest ? Respond::PrintResult(array('error' => 0)) : header("Location: " . $_SERVER['HTTP_REFERER']);
    } else {
        $isAjaxRequest ? Respond::PrintResult(array('error' => 1, 'msg' => POD::error())) : header("Location: " . $_SERVER['HTTP_REFERER']);
    }
} else {
    $filter->type = $_GET['mode'];
    $filter->pattern = $_GET['value'];
    if ($filter->add()) {
        $isAjaxRequest ? Respond::PrintResult(array('error' => 0, 'id' => $filter->id)) : header("Location: " . $_SERVER['HTTP_REFERER']);
    } else {
        $isAjaxRequest ? Respond::PrintResult(array('error' => 1, 'msg' => POD::error())) : header("Location: " . $_SERVER['HTTP_REFERER']);
    }
}
예제 #12
0
파일: index.php 프로젝트: ni5am/Textcube
<?php

/// Copyright (c) 2004-2015, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
$IV = array('POST' => array('targets' => array('list'), 'userid' => array('id')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
importlib("model.blog.entry");
$username = User::getName($_POST['userid']);
if (Acl::check('group.administrators')) {
    if (!is_null($username) && changeAuthorOfEntries($blogid, $_POST['targets'], $_POST['userid'])) {
        Respond::PrintResult(array('error' => 0, 'name' => $username));
    } else {
        Respond::PrintResult(array('error' => 1, 'message' => _t('존재하지 않은 사용자입니다')));
    }
} else {
    Respond::PrintResult(array('error' => 1, 'message' => _t('권한이 없습니다.')));
}
예제 #13
0
파일: feeder.php 프로젝트: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
list($status, $url) = updateRandomFeed();
Respond::PrintResult(array('error' => $status, 'url' => $url));
예제 #14
0
파일: index.php 프로젝트: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
$IV = array('GET' => array('name' => array('string'), 'email' => array('email')));
requireStrictRoute();
$result = User::add($_GET['email'], $_GET['name']);
if ($result === true) {
    Respond::PrintResult(array('error' => 0));
} else {
    Respond::PrintResult(array('error' => -1, 'result' => $result));
}
예제 #15
0
파일: index.php 프로젝트: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
requireModel('blog.trash');
requireModel('blog.response.remote');
requireModel('blog.sidebar');
requireLibrary('blog.skin');
requireStrictRoute();
$blogid = getBlogId();
$entryId = trashTrackback($blogid, $suri['id']);
if ($entryId !== false) {
    $skin = new Skin($skinSetting['skin']);
    $trackbackCount = getTrackbackCount($blogid, $entryId);
    list($tempTag, $trackbackCountContent) = getTrackbackCountPart($trackbackCount, $skin);
    $recentTrackbackContent = getRecentTrackbacksView(getRecentTrackbacks($blogid), $skin->recentTrackback, $skin->recentTrackbackItem);
    $entry = array();
    $entry['id'] = $entryId;
    $entry['slogan'] = getSloganById($blogid, $entry['id']);
    $trackbackListContent = getTrackbacksView($entry, $skin, true);
}
if ($trackbackListContent === false) {
    Respond::PrintResult(array('error' => 1));
} else {
    Respond::PrintResult(array('error' => 0, 'trackbackList' => $trackbackListContent, 'trackbackCount' => $trackbackCountContent, 'recentTrackbacks' => $recentTrackbackContent));
}
예제 #16
0
파일: index.php 프로젝트: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('skinName' => array('directory', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
$isAjaxRequest = checkAjaxRequest();
$result = $isAjaxRequest ? selectSkin($blogid, $_POST['skinName']) : selectSkin($blogid, $_GET['skinName']);
if ($result === true) {
    $isAjaxRequest ? Respond::PrintResult(array('error' => 0)) : header("Location: " . $_SERVER['HTTP_REFERER']);
} else {
    $isAjaxRequest ? Respond::PrintResult(array('error' => 1, 'msg' => _t('스킨을 변경하지 못했습니다.'))) : header("Location: " . $_SERVER['HTTP_REFERER']);
}
예제 #17
0
    $pool->setQualifier("draft", "eq", 0);
    $pool->setQualifier("visibility", "eq", 3);
    $pool->setQualifier("acceptcomment", "eq", 1);
    if ($row = $pool->getRow()) {
        sendTrackbackPing($suri['id'], $context->getProperty('uri.default') . "/" . ($context->getProperty('blog.useSloganOnPost') ? "entry/{$row['slogan']}" : $suri['id']), $url, $blog_name, $title);
    }
    Respond::ResultPage(0);
} else {
    if ($result == 1) {
        Respond::PrintResult(array('error' => 1, 'message' => 'Could not receive'));
    } else {
        if ($result == 2) {
            Respond::PrintResult(array('error' => 1, 'message' => 'Could not receive'));
        } else {
            if ($result == 3) {
                Respond::PrintResult(array('error' => 1, 'message' => 'The entry does not accept trackback'));
            } else {
                if ($result == 4) {
                    Respond::PrintResult(array('error' => 1, 'message' => 'already exists trackback'));
                } else {
                    if ($result == 5) {
                        Respond::PrintResult(array('error' => 1, 'message' => 'URL is not exist or invalid'));
                    }
                }
            }
        }
    }
}
?>
 
예제 #18
0
/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__TEXTCUBE_ADMINPANEL__', true);
require ROOT . '/library/preprocessor.php';
importlib('model.blog.comment');
$IV = array('POST' => array('name' => array('string', 'default' => ''), 'comment' => array('string', 'default' => ''), 'mode' => array(array('commit'), 'default' => ''), 'homepage' => array('string', 'default' => ''), 'password' => array('string', 'default' => ''), 'secret' => array(array('on'), 'default' => null)));
$context = Model_Context::getInstance();
$customIV = fireEvent('ManipulateIVRules', $IV, $context->getProperty('uri.interfaceRoute'));
Validator::addRule($customIV);
if (!Validator::isValid()) {
    Respond::PrintResult(array('error' => 1, 'description' => 'Illegal parameters'));
}
requireStrictRoute();
if (!Setting::getBlogSettingGlobal('acceptComments', 0) && !doesHaveOwnership()) {
    Respond::PrintResult(array('error' => 0, 'commentBlock' => '', 'recentCommentBlock' => ''));
    exit;
}
$pool = DBModel::getInstance();
if ((doesHaveMembership() || !empty($_POST['name'])) && !empty($_POST['comment']) && !empty($_POST['mode']) && $_POST['mode'] == 'commit') {
    if (!empty($_POST['name'])) {
        setcookie('guestName', $_POST['name'], time() + 2592000, $context->getProperty('uri.blog') . "/");
    }
    if (!empty($_POST['homepage']) && $_POST['homepage'] != 'http://') {
        if (strpos($_POST['homepage'], 'http://') === 0) {
            setcookie('guestHomepage', $_POST['homepage'], time() + 2592000, $context->getProperty('uri.blog') . "/");
        } else {
            setcookie('guestHomepage', 'http://' . $_POST['homepage'], time() + 2592000, $context->getProperty('uri.blog') . "/");
        }
    }
    $comment = array();
예제 #19
0
<?php

/// Copyright (c) 2004-2015, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('tree' => array('string', 'default' => 'base'), 'colorOnTree' => array('string', 'default' => '000000'), 'bgColorOnTree' => array('string', 'default' => ''), 'activeColorOnTree' => array('string', 'default' => '000000'), 'activeBgColorOnTree' => array('string', 'default' => ''), 'labelLengthOnTree' => array('int', 'default' => 30), 'showValueOnTree' => array('string', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
if (isset($suri['id'])) {
    $categories = getCategories($blogid);
    Respond::PrintResult(array('code' => urlencode(getCategoriesViewInSkinSetting(getEntriesTotalCount($blogid), $categories, $suri['id']))));
    exit;
} else {
    if (setTreeSetting($blogid, $_POST)) {
        header("Location: {$context->getProperty}('uri.blog')/owner/skin/setting");
    } else {
    }
}
예제 #20
0
<?php

/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
require ROOT . '/library/preprocessor.php';
$password = POD::queryCell("SELECT password\n\t\tFROM {$database['prefix']}Entries\n\t\tWHERE blogid = " . getBlogId() . " AND id = {$suri['id']} AND draft = 0");
if (is_null($password)) {
    $password = '';
}
Respond::PrintResult(array('error' => 0, 'password' => $password));
예제 #21
0
파일: index.php 프로젝트: ragi79/Textcube
if (Acl::check('group.writers') === false && !empty($suri['id'])) {
    if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) {
        @header("location:" . $context->getProperty('uri.blog') . "/owner/entry");
        exit;
    }
}
//$isAjaxRequest = checkAjaxRequest();
if (!isset($_GET['command'])) {
    $temp = setEntryVisibility($suri['id'], isset($_GET['visibility']) ? $_GET['visibility'] : 0) == true ? 0 : 1;
    $countResult = POD::queryExistence("SELECT id \n\t\t\tFROM {$database['prefix']}Entries \n\t\t\tWHERE blogid = " . getBlogId() . " AND visibility = 3");
    if ($countResult == false) {
        $countResult = 0;
    } else {
        $countResult = 1;
    }
    Respond::PrintResult(array('error' => $temp, 'countSyndicated' => $countResult), false);
} else {
    switch ($_GET['command']) {
        case "protect":
            $_GET['command'] = 1;
            break;
        case "public":
            $_GET['command'] = 2;
            break;
        case "syndicate":
            $_GET['command'] = 3;
            break;
        case "private":
        default:
            $_GET['command'] = 0;
            break;
예제 #22
0
<?php

/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('fileName' => array('filename'), 'order' => array(array('0', '1'))));
require ROOT . '/library/preprocessor.php';
importlib('model.blog.attachment');
requireStrictRoute();
$result = setEnclosure($_POST['fileName'], $_POST['order']);
Respond::PrintResult(array('error' => $result < 3 ? 0 : 1, 'order' => $result));
예제 #23
0
<?php

/// Copyright (c) 2004-2016, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('useResamplingAsDefault' => array('string', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
$isAjaxRequest = false;
// checkAjaxRequest();
// 기본 설정
if (isset($_POST['useResamplingAsDefault']) && $_POST['useResamplingAsDefault'] == "yes") {
    Setting::setBlogSettingGlobal("resamplingDefault", "yes");
} else {
    Setting::removeBlogSettingGlobal("resamplingDefault");
}
CacheControl::flushEntry();
$isAjaxRequest ? Respond::PrintResult($errorResult) : header("Location: " . $_SERVER['HTTP_REFERER']);
예제 #24
0
파일: index.php 프로젝트: ragi79/Textcube
<?php

/// Copyright (c) 2004-2012, Needlworks  / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('group' => array('int', 0, 'default' => 0), 'starred' => array(array('0', '1'), 'default' => '0'), 'keyword' => array('string', 'default' => '')));
require ROOT . '/library/preprocessor.php';
$result = array('error' => '0');
ob_start();
printFeedGroups($blogid, $_POST['group'], $_POST['starred'] == '1', $_POST['keyword'] == '' ? null : $_POST['keyword']);
$result['view'] = escapeCData(ob_get_contents());
ob_end_clean();
Respond::PrintResult($result);
예제 #25
0
<?php

/// Copyright (c) 2004-2006, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
$IV = array('POST' => array('file' => array('string')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
$result = getCSSContent($blogid, $_POST['file']);
if ($result === false) {
    Respond::PrintResult(array('error' => 1));
} else {
    Respond::PrintResult(array('error' => 0, 'content' => $result));
}