Пример #1
0
function TestSuite_upgrade_repos_via_user()
{
    if (doesHaveOwnership()) {
        $result = TestSuite_upgrade_repos(null, null);
        if ($result) {
            Respond::ResultPage(0);
        }
    }
    Respond::Resultpage(-1);
}
 public function process()
 {
     $context = \CADB\Model\Context::instance();
     if ($this->params['request_URI']) {
         $redirect_uri .= "?requestURI=" . rawurldecode($this->params['request_URI']);
     }
     if ($this->params['output'] != "json" && $this->params['output'] != "xml") {
         \CADB\Lib\importResource('app-login', true);
     }
     if (\CADB\Lib\doesHaveMembership()) {
         if ($this->params['output'] == "xml") {
             Respond::ResultPage(array(2, "이미 로그인하셨습니다"));
         } else {
             if ($this->params['output'] == "json") {
                 RespondJson::ResultPage(array(2, "이미 로그인하셨습니다"));
             } else {
                 Respond::ResultPage(array(-3, "이미 로그인하셨습니다."));
             }
         }
     }
     $this->title = $context->getProperty('service.title') . " 로그인";
 }
Пример #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('names' => array('string', 'default' => null)));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.attachment");
requireStrictRoute();
if (!empty($_POST['names']) && deleteAttachmentMulti($blogid, $suri['id'], $_POST['names'])) {
    Respond::ResultPage(0);
} else {
    Respond::ResultPage(-1);
}
Пример #4
0
<?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);
Пример #5
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';
importlib("model.blog.link");
if (!($link = getLink($blogid, $suri['id']))) {
    Respond::ErrorPage(_t('링크 정보가 존재하지 않습니다.'));
}
$method = empty($link['rss']) ? 1 : 0;
require ROOT . '/interface/common/owner/header.php';
$tabsClass['edit'] = true;
?>
						<script type="text/javascript">
							//<![CDATA[
								function getSiteInfo() {
									if(document.getElementById('editForm').rss.value == '') {
										alert("<?php 
echo _t('RSS 주소를 입력해 주십시오.');
?>
\t");
										return false;		
									}
							
									if(document.getElementById('editForm').rss.value.indexOf('http://')==-1) {
										uri = 'http://'+document.getElementById('editForm').rss.value;
									} else {
										uri = document.getElementById('editForm').rss.value;
									}
									var request = new HTTPRequest("GET", "<?php 
Пример #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('owner' => array('id'), 'blogid' => array('id')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
requirePrivilege('group.creators');
if (changeBlogOwner($_GET['blogid'], $_GET['owner'])) {
    return Respond::ResultPage(true);
}
Respond::ResultPage(false);
Пример #7
0
    if (!Acl::check("group.editors")) {
        if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) {
            Respond::ResultPage(-1);
            exit;
        }
    }
    if ($isAjaxRequest) {
        if (deleteEntry($blogid, $suri['id']) === true) {
            Respond::ResultPage(0);
        } else {
            Respond::ResultPage(-1);
        }
    } else {
        deleteEntry($blogid, $suri['id']);
        header("Location: " . $_SERVER['HTTP_REFERER']);
    }
} else {
    foreach (explode(',', $_POST['targets']) as $target) {
        // TeamBlog check
        if (!Acl::check('group.writers', 'entry.delete.' . $target)) {
            if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) {
                Respond::ResultPage(-1);
                exit;
            }
        }
        if (!deleteEntry($blogid, $target)) {
            Respond::ResultPage(-1);
        }
    }
    Respond::ResultPage(0);
}
Пример #8
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('url' => array('url', 'default' => null)));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.remoteresponse");
requireStrictRoute();
Respond::ResultPage(!empty($_GET['url']) && sendTrackback($blogid, $suri['id'], trim($_GET['url'])));
Пример #9
0
<?php

require_once 'config.php';
require_once 'inc/respond.php';
$db = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
// connect to the DB
$respond = new Respond();
// Send out JSON responses
$table = 'fv_data';
if ($db->connect_errno) {
    $respond->fail("Failed to connect to MySQL: " . $db->connect_error);
}
// All setup - let's get started with handling any data.
$res = $db->query("SELECT *,DATE_FORMAT(dob,'%D %M %Y') as dob_formatted FROM {$table} ORDER BY id DESC");
while ($row = $res->fetch_assoc()) {
    $data['results'][] = $row;
}
$respond->success("results", $data);
Пример #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)
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));
Пример #11
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('adminSkin' => array('directory', 'default' => 'default')));
require ROOT . '/library/preprocessor.php';
if (empty($_POST['adminSkin']) || !file_exists(ROOT . "/skin/admin/{$_POST['adminSkin']}/index.xml") || !Setting::setBlogSettingGlobal("adminSkin", $_POST['adminSkin'])) {
    Respond::ResultPage(false);
} else {
    Respond::ResultPage(true);
}
Пример #12
0
<?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()));
}
Пример #13
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)
require ROOT . '/library/preprocessor.php';
$IV = array('GET' => array('user' => array('email'), 'blogid' => array('id')));
requireStrictRoute();
requirePrivilege('group.creators');
$userid = User::getUserIdByEmail($_GET['user']);
$bid = $_GET['blogid'];
if (empty($userid)) {
    Respond::ResultPage(array(-1, "존재하지 않는 사용자"));
}
$pool = DBModel::getInstance();
$pool->init("Privileges");
$pool->setQualifier("blogid", "eq", $bid);
$pool->setQualifier("userid", "eq", $userid);
$acl = $pool->getCell("acl");
if ($acl === null) {
    // If there is no ACL, add user into the blog.
    $pool->init("Privileges");
    $pool->setAttribute("blogid", $bid);
    $pool->setAttribute("userid", $userid);
    $pool->setAttribute("acl", 0);
    $pool->setAttribute("created", Timestamp::getUNIXtime());
    $pool->setAttribute("lastlogin", 0);
    $pool->insert();
    Respond::ResultPage(0);
} else {
    Respond::ResultPage(array(-2, "이미 참여중인 사용자"));
}
Пример #14
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('id' => array('id')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
Respond::ResultPage(markAsStar($blogid, $_POST['id'], true));
Пример #15
0
 function __construct($filename)
 {
     $context = Model_Context::getInstance();
     if (!($sval = file_get_contents($filename))) {
         Respond::ErrorPage("KeywordSkin");
     }
     $origPath = $context->getProperty('uri.service') . substr($filename, strlen(ROOT));
     $origPath = substr($origPath, 0, 0 - strlen(Path::getBaseName($origPath)));
     $sval = str_replace('./', $origPath, $sval);
     replaceSkinTag($sval, 'html');
     replaceSkinTag($sval, 'head');
     replaceSkinTag($sval, 'body');
     list($sval, $this->keylogItem) = $this->cutSkinTag($sval, 'blog_rep');
     list($sval, $this->keylog) = $this->cutSkinTag($sval, 'blog');
     $this->outter = $sval;
 }
Пример #16
0
$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();
    list($comment['entry']) = getCommentAttributes($blogid, $suri['id'], 'entry');
    if (count($comment) == 0) {
        Respond::ErrorPage(_text('댓글이 존재하지 않습니다.'));
    }
    $comment['parent'] = $suri['id'];
    $comment['name'] = empty($_POST['name']) ? '' : trim($_POST['name']);
    $comment['password'] = empty($_POST['password']) ? '' : $_POST['password'];
    $comment['homepage'] = empty($_POST['homepage']) || $_POST['homepage'] == 'http://' ? '' : trim($_POST['homepage']);
    $comment['secret'] = empty($_POST['secret']) ? 0 : 1;
    $comment['comment'] = trim($_POST['comment']);
    $comment['ip'] = $_SERVER['REMOTE_ADDR'];
    if (!doesHaveMembership() && !doesHaveOwnership() && $comment['name'] == '') {
        ?>
<script type="text/javascript">
	//<![CDATA[
		alert("<?php 
        echo _text('이름을 입력해 주십시오.');
        ?>
Пример #17
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';
fireEvent($suri['directive'] . '/' . $suri['value']);
if (!headers_sent()) {
    Respond::NotFoundPage();
}
Пример #18
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('name' => array('string'), 'rss' => array('string', 'default' => ''), 'url' => array('string'), 'category' => array('int', 'mandatory' => false), 'newCategory' => array('string', 'mandatory' => false)));
require ROOT . '/library/preprocessor.php';
importlib("model.blog.link");
requireStrictRoute();
if (strpos($_POST['rss'], 'http://') !== 0) {
    $_POST['rss'] = 'http://' . $_POST['rss'];
}
if (strpos($_POST['url'], 'http://') !== 0) {
    $_POST['url'] = 'http://' . $_POST['url'];
}
Respond::ResultPage(addLink($blogid, $_POST));
Пример #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)
require ROOT . '/library/preprocessor.php';
Respond::ResultPage(Setting::setBlogSettingGlobal($_POST['name'], $_POST['value']));
Пример #20
0
<?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)
define('__TEXTCUBE_KEYLOG__', true);
require ROOT . '/library/preprocessor.php';
if (strlen($suri['value'])) {
    if (!($keylog = getKeylogByTitle($blogid, $suri['value']))) {
        Respond::ErrorPage();
        exit;
    }
    $entries = array();
    $entries = getEntriesByKeyword($blogid, $keylog['title']);
    $skinSetting['keylogSkin'] = fireEvent('setKeylogSkin');
    if (!is_null($skinSetting['keylogSkin'])) {
        require ROOT . '/interface/common/blog/keylog.php';
    } else {
        Respond::ErrorPage(_t('No handling plugin'));
    }
} else {
    $keywords = getKeywordNames($blogid, true);
    $skinSetting['keylogSkin'] = fireEvent('setKeylogSkin');
    require ROOT . '/interface/common/blog/begin.php';
    require ROOT . '/interface/common/blog/keywords.php';
    require ROOT . '/interface/common/blog/end.php';
}
Пример #21
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));
}
Пример #22
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));
Пример #23
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('id' => array('id')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
Respond::ResultPage(markAsUnread($blogid, $_POST['id']));
Пример #24
0
requireModel("blog.tag");
requireModel("blog.locative");
requireModel("blog.attachment");
$context = Model_Context::getInstance();
$isKeyword = false;
define('__TEXTCUBE_EDIT__', true);
if (defined('__TEXTCUBE_POST__')) {
    $suri['id'] = 0;
}
if (isset($_GET['draft'])) {
    $entry = getEntry(getBlogId(), $suri['id'], true);
} else {
    $entry = getEntry(getBlogId(), $suri['id'], false);
}
if (is_null($entry)) {
    Respond::ErrorPage(_t('포스트 정보가 존재하지 않습니다.'));
    $isKeyword = $entry['category'] == -1;
}
if (defined('__TEXTCUBE_POST__') && isset($_GET['category'])) {
    $entry['category'] = $_GET['category'];
}
if (isset($_POST['slogan'])) {
    $_GET['slogan'] = $_POST['slogan'];
}
if (defined('__TEXTCUBE_POST__') && isset($_GET['slogan'])) {
    $entry['slogan'] = $_GET['slogan'];
    $entry['title'] = $_GET['slogan'];
}
// Check whether or not user has permission to edit.
if (Acl::check('group.editors') === false && !empty($suri['id'])) {
    if (getUserIdOfEntry(getBlogId(), $suri['id']) != getUserId()) {
Пример #25
0
<?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('name' => array('directory', 'default' => null)));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
if (!empty($_POST['name']) && activatePlugin($_POST['name'])) {
    Respond::ResultPage(0);
}
Respond::ResultPage(1);
Пример #26
0
    header("strict-transport-security: max-age=" . $context->getProperty("service.timeout", 3600));
}
/** INITIALIZE : Database I/O
 * -------------------------
 * Performs database connection.
 */
if (!is_null($context->getProperty('database.database'))) {
    $context->useNamespace('database');
    $db['database'] = $context->getProperty('database');
    $db['server'] = $context->getProperty('server');
    $db['port'] = $context->getProperty('port');
    $db['username'] = $context->getProperty('username');
    $db['password'] = $context->getProperty('password');
    $context->useNamespace();
    if (POD::bind($db) === false) {
        Respond::MessagePage('Problem with connecting database.<br /><br />Please re-visit later.');
        exit;
    }
    POD::cacheLoad();
    register_shutdown_function(array('POD', 'cacheSave'));
    $context->setProperty('database.connected', true);
    //register_shutdown_function( array('POD','unbind') );
}
$database['utf8'] = POD::charset() == 'utf8' ? true : false;
/// Memcache module bind (if possible)
global $memcache;
$memcache = null;
if ($context->getProperty('service.memcached') == true) {
    $memcache = new Memcache();
    $memcache->connect(!is_null($context->getProperty('memcached.server')) ? $context->getProperty('memcached.server') : 'localhost');
}
Пример #27
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)
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
Respond::ResultPage(markAsReadAll($blogid));
Пример #28
0
<?php

require_once 'config.php';
require_once 'inc/mail.php';
require_once 'inc/respond.php';
$db = new mysqli(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
// connect to the DB
$mail = new Mailer();
// handle email including validations
$respond = new Respond();
// Send out JSON responses
$table = 'fv_data';
if ($db->connect_errno) {
    $respond->fail("Failed to connect to MySQL: " . $db->connect_error);
}
// All setup - let's get started with handling any data.
// kill the page if nothing posted
if (!$_POST) {
    $respond->fail("error", "no data");
}
#1 Sanitize and prepare the data:
$comments = trim($_POST["comments"]);
$day = trim($_POST["day"]);
$email = trim($_POST["email"]);
$firstname = trim($_POST["firstname"]);
$gender = trim($_POST["gender"]);
$lastname = trim($_POST["lastname"]);
$month = trim($_POST["month"]);
$phone = trim($_POST["phone"]);
$year = trim($_POST["year"]);
$errors = array();
Пример #29
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));
Пример #30
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('homepage' => array('url', 'mandatory' => false), 'type' => array('string'), 'blogid' => array('id')));
require ROOT . '/library/preprocessor.php';
requireStrictRoute();
if (User::setHomepage($_POST['type'], $_POST['homepage'], $_POST['blogid'])) {
    $result = 0;
} else {
    $result = -1;
}
//TODO : 현재 checkAjaxRequest가 동작하지 않으므로 관련부분 주석처리
//if ( checkAjaxRequest() ) {
Respond::ResultPage($result);
/*}
else {
	if (!$result) {
		$message = '대표 주소를 변경하였습니다.';
	}
	else {
		$message = '대표 주소 변경에 실패 하였습니다.';
	}
	Respond::NoticePage($message, $context->getProperty('uri.blog')."/owner/setting/account");
}
*/