requireComponent('Tattertools.Data.Post'); requireComponent('Tattertools.Data.Attachment'); requireComponent('Tattertools.Data.Category'); requireComponent('Eolin.PHP.XMLTree'); function doesHaveOwnership(){ global $owner; if(empty($_SESSION['userid'])||($_SESSION['userid']!=$owner)) return false; return true; } function requireLogin(){ global $service,$hostURL,$blogURL; if(!empty($service['loginURL'])) header("Location: {$service['loginURL']}?requestURI=".rawurlencode("$hostURL{$_SERVER['REQUEST_URI']}")); else{ { header("Location: $blogURL/login?requestURI=".rawurlencode("{$_SERVER['REQUEST_URI']}")); } } exit; } function requireOwnership(){ if(doesHaveOwnership()) return true; requireLogin(); return false; } function fetchQueryAll($query,$type=MYSQL_BOTH){ $rows=array(); if($result=mysql_query($query)){ while($row=mysql_fetch_array($result,$type)) array_push($rows,$row); } return $rows; } function check() { global $hostURL,$blogURL,$owner,$database; requireOwnership(); if(!file_exists(ROOT."/attach/$owner")){ mkdir(ROOT."/attach/$owner",0777); } $tempid=uniqid(rand()); while(file_exists(ROOT."/attach/$owner/__DEL$tempid.txt")) { $tempid=uniqid(rand()); } $fp=fopen(ROOT."/attach/$owner/__DEL".$tempid.".txt","w"); fwrite($fp,"hello"); fclose($fp); @chmod(ROOT."/attach/$owner/__DEL".$tempid.".txt",0777); mysql_query("insert into {$database['prefix']}Attachments values ($owner, -1, '__DEL$tempid.txt', '__DEL$tempid.txt', 'text/plain', 0, 0, 0, UNIX_TIMESTAMP(), 0,0)"); $fsn_indexurl=$hostURL.$blogURL; echo "
$fsn_indexurl 의 동작여부를 확인중입니다....잠시만기다려 주세요.