Skip to content

Commit

Permalink
refs #514
Browse files Browse the repository at this point in the history
  * trunk  를 branches/1.8  과 동기화
  • Loading branch information
inureyes committed Oct 9, 2009
1 parent 6880f94 commit b60479c
Show file tree
Hide file tree
Showing 61 changed files with 353 additions and 222 deletions.
6 changes: 3 additions & 3 deletions library/auth.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function login($loginid, $password, $preKnownPassword = null) {
global $service;
Expand Down Expand Up @@ -161,15 +161,15 @@ function generatePassword() {
}

function resetPassword($blogid, $loginid) {
global $database;
global $service, $blog, $hostURL, $blogURL, $serviceURL;
if (!isLoginId($blogid, $loginid))
return false;
$userid = User::getUserIdByEmail($loginid);
$password = POD::queryCell("SELECT password FROM {$database['prefix']}Users WHERE userid = $userid");
$authtoken = md5(generatePassword());

$query = new DBModel($database['prefix'].'UserSettings');
$query = DBModel::getInstance();
$query->reset('UserSettings');
$query->setAttribute('userid',$userid);
$query->setAttribute('name','Authtoken',true);
$query->setAttribute('value',$authtoken,true);
Expand Down
11 changes: 7 additions & 4 deletions library/blog.skin.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

global $__gDressTags;

Expand Down Expand Up @@ -366,14 +366,16 @@ function getDressTags($contents) {

function saveCache() {
$skinCache = get_object_vars($this);
$cache = new pageCache('skinCache');
$cache = pageCache::getInstance();
$cache->reset('skinCache');
$cache->contents = serialize($skinCache);
return $cache->update();
}

function loadCache() {
global $__gDressTags;
$cache = new pageCache('skinCache');
$cache = pageCache::getInstance();
$cache->reset('skinCache');
if(!$cache->load()) return false;
$skinCache = unserialize($cache->contents);
foreach($skinCache as $key=>$value) {
Expand All @@ -385,7 +387,8 @@ function loadCache() {

function purgeCache() {
global $gCacheStorage;
$cache = new pageCache('skinCache');
$cache = pageCache::getInstance();
$cache->reset('skinCache');
$cache->purge();
$gCacheStorage->purge();
}
Expand Down
5 changes: 2 additions & 3 deletions library/config.default.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

// Define basic signatures.
define('TEXTCUBE_NAME', 'Textcube');
define('TEXTCUBE_VERSION', '1.9 : alpha 1');
define('TEXTCUBE_COPYRIGHT', 'Copyright &copy; 2004-2009. Needlworks / Tatter Network Foundation. All rights reserved. Licensed under the GPL.');
define('TEXTCUBE_HOMEPAGE', 'http://www.textcube.org/');
define('TEXTCUBE_RESOURCE_URL', 'http://resources.textcube.org/1.8');
define('TEXTCUBE_SYNC_URL', 'http://ping.eolin.com/');
define('TEXTCUBE_RESOURCE_URL', 'http://resources.textcube.org/1.9');
define('CRLF', "\r\n");
define('TAB', " ");
define('INT_MAX',2147483647);
Expand Down
2 changes: 1 addition & 1 deletion library/debug.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

class DebuggerError extends Exception {};

Expand Down
2 changes: 1 addition & 1 deletion library/function/file.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function getFileExtension($path) {
for ($i = strlen($path) - 1; $i >= 0; $i--) {
Expand Down
2 changes: 1 addition & 1 deletion library/function/html.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function stripHTML($text, $allowTags = array()) {
$text = preg_replace('/<(script|style)[^>]*>.*?<\/\1>/si', '', $text);
Expand Down
2 changes: 1 addition & 1 deletion library/function/image.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

// img의 width/height에 맞춰 이미지를 리샘플링하는 함수. 썸네일 함수가 아님! 주의.
function resampleImage($imgString, $originSrc, $useAbsolutePath) {
Expand Down
2 changes: 1 addition & 1 deletion library/function/javascript.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function escapeJSInAttribute($str) {
return htmlspecialchars(str_replace(array('\\', '\r', '\n', '\''), array('\\\\', '\\r', '\\n', '\\\''), $str));
Expand Down
2 changes: 1 addition & 1 deletion library/function/logrotate.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function cutlog( $file, $size )
{
Expand Down
2 changes: 1 addition & 1 deletion library/function/mail.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function encodeMail($str) {
return '=?utf-8?b?' . base64_encode($str) . '?=';
Expand Down
2 changes: 1 addition & 1 deletion library/function/misc.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function getArrayValue($array, $key) {
return $array[$key];
Expand Down
2 changes: 1 addition & 1 deletion library/function/nsupdate.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function setDomainAddress($domain, $address, $server, $ttl = 86400) {
$process = proc_open('/usr/bin/nsupdate', array(array('pipe', 'r'), array('pipe', 'w'), array('pipe', 'w')), $pipes);
Expand Down
2 changes: 1 addition & 1 deletion library/function/string.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function str_trans($str) {
return str_replace("'", "&#39;", str_replace("\"", "&quot;", $str));
Expand Down
2 changes: 1 addition & 1 deletion library/function/time.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function checkPeriod($period) {
if (is_numeric($period)) {
Expand Down
2 changes: 1 addition & 1 deletion library/function/watermark.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

// 사용되지 않는 함수이나 만약을 위해 남겨둠.
function isLarge($target, $maxX, $maxY) {
Expand Down
2 changes: 1 addition & 1 deletion library/function/xml.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function xml_parser($url, $mdate) {
if ($mdate == "0")
Expand Down
2 changes: 1 addition & 1 deletion library/include.blog.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('__NO_ADMINPANEL__',true);
$__requireComponent = array();
$__requireBasics = array(
Expand Down
2 changes: 1 addition & 1 deletion library/include.checkup.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

require_once(ROOT.'/library/include.blog.php');
?>
2 changes: 1 addition & 1 deletion library/include.feeder.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

if(isset($config->service['reader']) && $config->service['reader'] === false) exit;

Expand Down
2 changes: 1 addition & 1 deletion library/include.icon.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)
define('NO_SESSION',true);
define('NO_INITIALIZATION',true);

Expand Down
2 changes: 1 addition & 1 deletion library/include.mobile.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

require_once(ROOT.'/library/include.blog.php');
?>
2 changes: 1 addition & 1 deletion library/include.owner.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

$__requireComponent = array();
$__requireBasics = array(
Expand Down
2 changes: 1 addition & 1 deletion library/include.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

/** Pre-define basic components */
global $__requireBasics, $__requireComponent, $__requireLibrary, $__requireModel, $__requireView;
Expand Down
2 changes: 1 addition & 1 deletion library/include.reader.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

if(isset($config->service['reader']) && $config->service['reader'] === false) exit;

Expand Down
2 changes: 1 addition & 1 deletion library/model/blog.api.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

/*--------- Basic functions -----------*/

Expand Down
4 changes: 2 additions & 2 deletions library/model/blog.archive.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function getArchives($blogid, $option = 'yearmonth') {
global $database;
$archives = array();
$visibility = doesHaveOwnership() ? '' : 'AND e.visibility > 0'.getPrivateCategoryExclusionQuery($blogid);
$skinSetting = getSkinSetting($blogid);
$skinSetting = getSkinSettings($blogid);
$archivesOnPage = $skinSetting['archivesOnPage'];

switch (POD::dbms()) {
Expand Down
2 changes: 1 addition & 1 deletion library/model/blog.attachment.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

global $__gCacheAttachment;
$__gCacheAttachment = array();
Expand Down
8 changes: 4 additions & 4 deletions library/model/blog.blogSetting.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/// Copyright (c) 2004-2009, Needlworks / Tatter Network Foundation
/// All rights reserved. Licensed under the GPL.
/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT)
/// See the GNU General Public License for more details. (/documents/LICENSE, /documents/COPYRIGHT)

function setBlogTitle($blogid, $title) {
global $blog;
Expand Down Expand Up @@ -187,7 +187,7 @@ function setCommentsOnRSS($blogid, $commentsOnRSS) {
return true;
if(setBlogSetting('commentsOnRSS',$commentsOnRSS) === false) return false;
$blog['commentsOnRSS'] = $commentsOnRSS;
$cache = new pageCache;
$cache = pageCache::getInstance();
$cache->name = 'commentRSS';
$cache->purge();
return true;
Expand Down Expand Up @@ -368,8 +368,8 @@ function getBlogName($blogid) {
WHERE blogid = $blogid AND name = 'name'");
}
function getAuthToken($userid){
global $database;
$query = new DBModel($database['prefix'].'UserSettings');
$query = DBModel::getInstance();
$query->reset('UserSettings');
$query->setQualifier('userid', 'equals', $userid);
$query->setQualifier('name', 'equals', 'AuthToken', true);
return $query->getCell('value');
Expand Down
Loading

0 comments on commit b60479c

Please sign in to comment.