Exemple #1
0
            finish(_t('백업파일이 손상되었거나 가져올 수 없습니다.'));
        }
        break;
}
$migrational = false;
$items = 0;
$item = 0;
$xmls = new XMLStruct();
set_time_limit(0);
setProgress(0, _t('백업파일을 확인하고 있습니다.'));
$xmls->setStream('/blog/setting/banner/content');
$xmls->setStream('/blog/post/attachment/content');
$xmls->setStream('/blog/notice/attachment/content');
$xmls->setStream('/blog/keyword/attachment/content');
$xmls->setConsumer('scanner');
if (!$xmls->openFile($backup, Validator::getBool(@$_POST['correctData']))) {
    finish(_f('백업파일의 %1번째 줄이 올바르지 않습니다.', $xmls->error['line']));
}
$xmls->close();
if ($items == 0) {
    finish(_t('백업파일에 복원할 데이터가 없습니다.'));
}
if (!$migrational) {
    setProgress(0, _t('복원 위치를 준비하고 있습니다.'));
    DataMaintenance::removeAll(false);
    CacheControl::flushAll();
}
$xmls->setConsumer('importer');
if (!$xmls->openFile($backup, Validator::getBool(@$_POST['correctData']))) {
    finish(_t('백업파일이 올바르지 않습니다.'));
}
Exemple #2
0
	define('ROOT', '../../..');
	include ROOT . '/lib/includeForAdmin.php';

	requireAdmin();

	include ROOT. '/lib/piece/adminHeader.php';

	$plugins = array();
	$xmls = new XMLStruct;			
	$pluginXmls = new XMLStruct;
	$dir = dir(ROOT . '/plugins/');
	while (($file = $dir->read()) !== false) {
		if (!preg_match('/^[A-Za-z0-9 _-]+$/', $file)) continue;
		if (!is_dir(ROOT . '/plugins/' . $file)) continue;
		if (!file_exists(ROOT . '/plugins/'.$file.'/index.xml')) continue;
		if (!$xmls->openFile(ROOT . '/plugins/'.$file.'/index.xml')) continue;

		$plugin = array();
		$plugin['name'] = $file;
		$plugin['title'] = $xmls->getValue('/plugin/information/name[lang()]');
		$plugin['description'] = $xmls->getValue('/plugin/information/description[lang()]');

		$pluginAuthor = $xmls->selectNode('/plugin/information/author[lang()]');
		$plugin['author'] = array('name'=>$pluginAuthor['.value'], 'link'=>$pluginAuthor['.attributes']['link'], 'email'=>$pluginAuthor['.attributes']['email']);
		
		$pluginTings = $xmls->selectNode('/plugin/ting[lang()]');
		$plugin['ting'] = array();
		if(isset($pluginTings['pop'])) {
			foreach ($pluginTings['pop'] as $pop) {
				$event = $pop['.attributes']['event'];
				$type = $pop['.attributes']['type'];
Exemple #3
0
		</dl>

		<dl class="normal">
			<dt></dt>
			<dd>
<?php
				ob_start();
?>
				<select name="welcomePack" id="welcomePack">
<?php
					$xmls=new XMLStruct();
					$dir = opendir(ROOT . '/language/welcome');
					while ($file = readdir($dir)) {
						if (func::getExt($file)=='xml') {
							$filename = substr($file, 0, strpos($file, '.xml'));
							$xmls->openFile(ROOT . '/language/welcome/'.$file);
							$name = $xmls->getValue('/welcome/information/name');
							$author = $xmls->getValue('/welcome/information/author/name');
?>
					<option value="<?php echo $filename;?>" <?php if ($filename == $config->welcomePack){?>selected="selected"<?php } ?>><?php echo $name;?> (<?php echo $author;?>)</option>
<?php
						}
					} 
?>
				</select>
<?php
				$arg = ob_get_contents();
				ob_end_clean();

				echo _f('인사말 모음 : %1', $arg);
?>
Exemple #4
0
	include ROOT . '/lib/includeForAdmin.php';

	requireAdmin();
	$pluginName = $_GET['pluginName'];

	if (!is_dir(ROOT . '/plugins/'.$pluginName)) {
		func::alert(_t('플러그인이 존재하지 않습니다'), 'dialog');
	}

	if (!file_exists(ROOT .'/plugins/'.$pluginName.'/index.xml')) {
		func::alert(_t('플러그인 정보를 찾을 수 없습니다'), 'dialog');
	}

	requireComponent('LZ.PHP.XMLStruct');
	$xmls = new XMLStruct;
	if (!$xmls->openFile(ROOT . '/plugins/'.$pluginName.'/index.xml')) {
		func::alert(_t('플러그인 정보를 읽을 수 없습니다'), 'dialog');
	}

	$pluginInfo = array();
	$pluginInfo['name'] = $pluginName;
	$pluginInfo['title'] = $xmls->getValue('/plugin/information/name[lang()]');
	$pluginInfo['config'] = $xmls->selectNode('/plugin/config[lang()]');
	$pluginInfo['description'] = func::filterJavascript($xmls->getValue('/plugin/information/description[lang()]'));
	$pluginInfo['license'] = func::filterJavascript($xmls->getValue('/plugin/information/license[lang()]'));
	$pluginInfo['version'] = func::filterJavascript($xmls->getValue('/plugin/information/version'));
	$pluginInfo['author'] = func::filterJavascript($xmls->getValue('/plugin/information/author[lang()]'));
	$pluginInfo['email'] = func::filterJavascript($xmls->getAttribute('/plugin/information/author[lang()]', 'email'));
	$pluginInfo['homepage'] = func::filterJavascript($xmls->getAttribute('/plugin/information/author[lang()]', 'link'));
	$pluginInfo['status'] = Validator::getBool($db->queryCell("SELECT status FROM {$database['prefix']}Plugins WHERE name='{$pluginName}'"));
Exemple #5
0
	requireComponent('Bloglounge.Model.Exports');

	$programName = Export::getProgramNameByDomain($domainName);

	if (!is_dir(ROOT . '/exports/'.$programName)) {
		func::alert(_t('프로그램이 존재하지 않습니다'), 'dialog');
	}

	if (!file_exists(ROOT .'/exports/'.$programName.'/index.xml')) {
		func::alert(_t('프로그램 정보를 찾을 수 없습니다'), 'dialog');
	}

	requireComponent('LZ.PHP.XMLStruct');
	$xmls = new XMLStruct;
	if (!$xmls->openFile(ROOT . '/exports/'.$programName.'/index.xml')) {
		func::alert(_t('프로그램 정보를 읽을 수 없습니다'), 'dialog');
	}

	$exportInfo = array();
	$exportInfo['domain'] = $domainName;
	$exportInfo['program'] = $programName;
	$exportInfo['title'] = $xmls->getValue('/export/information/name[lang()]');
	$exportInfo['config'] = $xmls->selectNode('/export/config[lang()]');
	$exportInfo['description'] = func::filterJavascript($xmls->getValue('/export/information/description[lang()]'));
	$exportInfo['license'] = func::filterJavascript($xmls->getValue('/export/information/license[lang()]'));
	$exportInfo['version'] = func::filterJavascript($xmls->getValue('/export/information/version'));
	$exportInfo['author'] = func::filterJavascript($xmls->getValue('/export/information/author[lang()]'));
	$exportInfo['email'] = func::filterJavascript($xmls->getAttribute('/export/information/author[lang()]', 'email'));
	$exportInfo['homepage'] = func::filterJavascript($xmls->getAttribute('/export/information/author[lang()]', 'link'));
	$exportInfo['status'] = Validator::getBool($db->queryCell("SELECT status FROM {$database['prefix']}Exports WHERE domain='{$domainName}'"));
Exemple #6
0
		function makeWelcomeMsg($msgPack = 'default') {
			$useClockBase = false;

			$xmls=new XMLStruct();
			if (!$xmls->openFile(ROOT . '/language/welcome/'.$msgPack.'.xml'))
				return msg::getRandomMsg('welcome');

			if ($useClockBase) {
				$hour = date("H");
				switch(true) {
					case (($hour >= 2) && ($hour <= 5)):
						$tick = 'daybreak';
						break;
					case (($hour >= 6) && ($hour <= 11)):
						$tick = 'morning';
						break;
					case (($hour >= 12) && ($hour <= 17)):
						$tick = 'afternoon';
					case (($hour >= 18) && ($hour <= 19)):
						$tick = 'evening';
					case (($hour >= 20) || ($hour <= 1)):
						$tick = 'night';
				}
			} else { // common
				$tick = 'common';
			}

			$max = $xmls->getNodeCount("/welcome/$tick/item");
			$bingo = mt_rand(1, $max);

			return $xmls->getValue("/welcome/$tick/item[$bingo]");
		}
		function getDefaultConfig($programName) {
			requireComponent('LZ.PHP.XMLStruct');
			$xmls = new XMLStruct;
			if (!$xmls->openFile(ROOT . '/exports/'. $programName .'/index.xml'))
				return '';
			
			$config = $xmls->selectNode("/export/config[lang()]");
			if(!isset($config['fieldset'])) return '';

			$configSet = array();
			foreach ($config['fieldset'] as $fieldset) {
				foreach ($fieldset['field'] as $field) {
					$name = $field['.attributes']['name'];
					$value = (isset($field['.attributes']['value'])) ? $field['.attributes']['value'] : '';
					$type = $field['.attributes']['type'];
					$cdata = ($type == 'textarea') ? true : false;
					
					if($type=='checkbox') {
						
						$value = (isset($field['.attributes']['checked'])&&($field['.attributes']['checked']=='true')) ? true : false;
	
					}
					
					array_push($configSet, array('name'=>$name, 'type'=>$type, 'value'=>$value, 'isCDATA'=>$cdata));
				}
			}

			requireComponent('LZ.PHP.XMLWriter');
			$xml = new XMLFile('stdout');
			$xml->startGroup('config', array('version'=>BLOGLOUNGE_VERSION));
			foreach ($configSet as $field) {
				$xml->write('field', $field['value'], $field['isCDATA'], array('name'=>$field['name'], 'type'=>$field['type']));
			}
			$xml->endGroup();
			ob_start();
			$xml->close();
			$configxml = ob_get_clean();

			return $configxml;
		}
Exemple #8
0
			if (preg_match("/(htm|php|inc|cgi|pl|perl|py|asp|jsp|exe|com|bat|dll|sh)/i", func::getExt($_FILES['importFile']['name']))) {
				echo '<script type="text/javascript">alert("'._f('%1는 잘못된 형식의 파일입니다.', $_FILES['importFile']['name']).'");</script>';
				$_FILES = null;
				exit;
			}

			$opmlCacheDir = ROOT . '/cache/opml';
			$tmpFilename = md5($_SERVER['REMOTE_ADDR'].time()).'.xml';
			if (!is_dir($opmlCacheDir)) func::mkpath($opmlCacheDir);
			if (!is_writable($opmlCacheDir) || !move_uploaded_file($_FILES['importFile']['tmp_name'], $opmlCacheDir.'/'.$tmpFilename)) {
				echo '<script type="text/javascript">alert("'._t('파일 가져오기에 실패했습니다.\n날개가 설치된 폴더와 cache 폴더에 쓰기 권한이 있는지 확인해주세요.').'");</script>';
				exit;
			}

			$xmls = new XMLStruct();
			$xmls->openFile($opmlCacheDir.'/'.$tmpFilename, true);
			$xmlURLs = func::multiarray_values($xmls->selectNodes("/opml/body/outline"), 'xmlUrl');

			if (count($xmlURLs)==0) {
				echo '<script type="text/javascript">alert("'._t('바른 형식의 OPML 파일이 아닙니다.').'");</script>';
				exit;
			}

			echo '<script type="text/javascript">"'._t('피드를 추가하고 있습니다').'";</script>';
			flush();
			$_feeder = new Feed;
			foreach($xmlURLs as $xmlURL) {		
				if (empty($xmlURL)) continue; 
				$_feeder->add($xmlURL);			
			}
Exemple #9
0
	include ROOT . '/lib/includeForAdmin.php';

	requireAdmin();

	include ROOT. '/lib/piece/adminHeader.php';

	$exports = array();

	$xmls = new XMLStruct;			
	$exportXmls = new XMLStruct;
	$dir = dir(ROOT . '/exports/');
	while (($file = $dir->read()) !== false) {
		if (!preg_match('/^[A-Za-z0-9 _-]+$/', $file)) continue;
		if (!is_dir(ROOT . '/exports/' . $file)) continue;
		if (!file_exists(ROOT . '/exports/'.$file.'/index.xml')) continue;
		if (!$xmls->openFile(ROOT . '/exports/'.$file.'/index.xml')) continue;

		$export = array();
		$export['name'] = $file;
		$export['title'] = $xmls->getValue('/export/information/name[lang()]');
		$export['description'] = $xmls->getValue('/export/information/description[lang()]');

		$exportAuthor = $xmls->selectNode('/export/information/author[lang()]');
		$export['author'] = array('name'=>$exportAuthor['.value'], 'link'=>$exportAuthor['.attributes']['link'], 'email'=>$exportAuthor['.attributes']['email']);
		
		if ($exportConf = $xmls->selectNode('/export/config[lang()]')) {
			$export['config'] = 'y';	
			$export['window'] = $exportConf['window'][0]['.attributes'];
		} else {
			$export['config'] = 'n';
		}
		function createPluginTable($pluginName) {		
			requireComponent('LZ.PHP.XMLStruct');
			$xmls = new XMLStruct;
			if (!$xmls->openFile(ROOT . '/plugins/'. $pluginName .'/index.xml'))
				return '';

			if ($xmls->doesExist('/plugin/storage')) {

				foreach ($xmls->selectNodes('/plugin/storage/table') as $table) {
					$storageMappings = array();
					$storageKeymappings = array();					 
					if(empty($table['name'][0]['.value'])) continue;
					$tableName = htmlspecialchars($table['name'][0]['.value']);
					if (!empty($table['fields'][0]['field'])) {
						foreach($table['fields'][0]['field'] as $field) 
						{
							if (!isset($field['name']))
								continue; // Error? maybe loading fail, so skipping is needed.
							$fieldName = $field['name'][0]['.value'];
						
							if (!isset($field['attribute']))
								continue; // Error? maybe loading fail, so skipping is needed.
							$fieldAttribute = $field['attribute'][0]['.value'];
						
							$fieldLength = isset($field['length']) ? $field['length'][0]['.value'] : -1;
							$fieldIsNull = isset($field['isnull']) ? $field['isnull'][0]['.value'] : 1;
							$fieldDefault = isset($field['default']) ? $field['default'][0]['.value'] : null;
							$fieldAutoIncrement = isset($field['autoincrement']) ? $field['autoincrement'][0]['.value'] : 0;
						
							array_push($storageMappings, array('name' => $fieldName, 'attribute' => $fieldAttribute, 'length' => $fieldLength, 'isnull' => $fieldIsNull, 'default' => $fieldDefault, 'autoincrement' => $fieldAutoIncrement));
						}
					}
					if (!empty($table['key'][0]['.value'])) {
						foreach($table['key'] as $key) {
							array_push($storageKeymappings, $key['.value']);
						}
					}
					
					plugin::treatPluginTable($pluginName, $tableName,$storageMappings,$storageKeymappings, $version);
					
					unset($tableName);
					unset($storageMappings);
					unset($storageKeymappings);
				}
			}

		}