<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[TNF : Tatter Network Foundation forum - 세션 절대변수를 추가하니깐로그인이 안되네요...]]></title>
	<link rel="self" href="http://forum.tattersite.com/ko/extern.php?action=feed&amp;tid=6070&amp;type=atom"/>
	<updated>2008-07-03T06:28:32Z</updated>
	<generator>PunBB</generator>
	<id>http://forum.tattersite.com/ko/viewtopic.php?id=6070</id>
		<entry>
			<title type="html"><![CDATA[세션 절대변수를 추가하니깐로그인이 안되네요...]]></title>
			<link rel="alternate" href="http://forum.tattersite.com/ko/viewtopic.php?pid=28760#p28760"/>
			<content type="html"><![CDATA[<p>폐쇠형 게이트 대문 구현으로 텍스트큐브로 접속하는 세션인증제도를만들었습니다.</p><p>다름이 아니라, </p><br /><p>rewrite.php // 소스...</p><p>&lt;? session_start(); ?&gt;<br />&lt;?php<br />&nbsp; &nbsp; define(&#039;ROOT&#039;, &#039;.&#039;); <br />&nbsp; &nbsp; /* Workaround for IIS environment */<br />&nbsp; &nbsp; if(!isset($_SERVER[&#039;REQUEST_URI&#039;]) &amp;&amp; isset($_SERVER[&#039;SCRIPT_NAME&#039;])) {<br />&nbsp; &nbsp; &nbsp; &nbsp; $_SERVER[&#039;REQUEST_URI&#039;] = $_SERVER[&#039;SCRIPT_NAME&#039;];<br />&nbsp; &nbsp; &nbsp; &nbsp; if(isset($_SERVER[&#039;QUERY_STRING&#039;]) &amp;&amp; !empty($_SERVER[&#039;QUERY_STRING&#039;])) $_SERVER[&#039;REQUEST_URI&#039;] .= &#039;?&#039;.$_SERVER[&#039;QUERY_STRING&#039;];<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; if (!empty($_SERVER[&#039;PRELOAD_CONFIG&#039;]) &amp;&amp; file_exists(&#039;config.php&#039;)) require_once ROOT.&quot;/config.php&quot;;<br />&nbsp; &nbsp; &nbsp; &nbsp; /* Retrieve Access Parameter Information. */<br />&nbsp; &nbsp; $accessInfo = array(<br />&nbsp; &nbsp; &nbsp; &nbsp; &#039;host&#039;&nbsp; &nbsp; &nbsp;=&gt; $_SERVER[&#039;HTTP_HOST&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &#039;fullpath&#039; =&gt; str_replace(&#039;index.php&#039;, &#039;&#039;, $_SERVER[&quot;REQUEST_URI&quot;]),<br />&nbsp; &nbsp; &nbsp; &nbsp; &#039;position&#039; =&gt; $_SERVER[&quot;SCRIPT_NAME&quot;],<br />&nbsp; &nbsp; &nbsp; &nbsp; &#039;root&#039;&nbsp; &nbsp; &nbsp;=&gt; rtrim(str_replace(&#039;rewrite.php&#039;, &#039;&#039;, $_SERVER[&quot;SCRIPT_NAME&quot;]), &#039;index.php&#039;)<br />&nbsp; &nbsp; &nbsp; &nbsp; );<br />&nbsp; &nbsp; if (strpos($accessInfo[&#039;fullpath&#039;],$accessInfo[&#039;root&#039;]) !== 0)<br />&nbsp; &nbsp; &nbsp; &nbsp; $accessInfo[&#039;fullpath&#039;] = $accessInfo[&#039;root&#039;].substr($accessInfo[&#039;fullpath&#039;], strlen($accessInfo[&#039;root&#039;]) - 1);<br />&nbsp; &nbsp; // Workaround for compartibility with fastCGI / Other environment<br />&nbsp; &nbsp; $accessInfo[&#039;input&#039;] = ltrim(substr($accessInfo[&#039;fullpath&#039;],<br />&nbsp; &nbsp; &nbsp; &nbsp; strlen($accessInfo[&#039;root&#039;]) + (defined(&#039;__TEXTCUBE_NO_FANCY_URL__&#039;) ? 1 : 0)),&#039;/&#039;);<br />&nbsp; &nbsp; // Support Tattertools 0.9x legacy address (for upgrade users)<br />&nbsp; &nbsp; if (array_key_exists(&#039;pl&#039;, $_GET) &amp;&amp; strval(intval($_GET[&#039;pl&#039;])) == $_GET[&#039;pl&#039;]) { header(&quot;Location: &quot;.$accessInfo[&#039;root&#039;].$_GET[&#039;pl&#039;]); exit;}<br />&nbsp; &nbsp; $part = strtok($accessInfo[&#039;input&#039;], &#039;/&#039;);<br />&nbsp; &nbsp; if (in_array($part, array(&#039;image&#039;,&#039;plugins&#039;,&#039;script&#039;,&#039;cache&#039;,&#039;skin&#039;,&#039;style&#039;,&#039;attach&#039;,&#039;thumbnail&#039;))) {<br />&nbsp; &nbsp; &nbsp; &nbsp; $part = ltrim(rtrim($part == &#039;thumbnail&#039; ?<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; preg_replace(&#039;/thumbnail/&#039;, &#039;cache/thumbnail&#039;, $accessInfo[&#039;input&#039;], 1) :<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $accessInfo[&#039;input&#039;]), &#039;/&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; if(file_exists($part)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; require_once ROOT.&#039;/lib/function/file.php&#039;;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dumpWithEtag($part);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; exit;<br />&nbsp; &nbsp; &nbsp; &nbsp; } else {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; header(&quot;HTTP/1.0 404 Not Found&quot;);exit;<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; if (strtok($part, &#039;?&#039;) == &#039;setup.php&#039;) {require &#039;setup.php&#039;; exit;}<br />&nbsp; &nbsp; $accessInfo[&#039;URLfragment&#039;] = explode(&#039;/&#039;,strtok($accessInfo[&#039;input&#039;],&#039;?&#039;));<br />&nbsp; &nbsp; unset($part);<br />&nbsp; &nbsp; @session_start();<br />&nbsp; &nbsp; /* Check the existence of config.php (whether installed or not) */<br />&nbsp; &nbsp; if (!file_exists(&#039;config.php&#039;)) {<br />&nbsp; &nbsp; &nbsp; &nbsp; if (file_exists(&#039;.htaccess&#039;)) {print &quot;&lt;html&gt;&lt;body&gt;Remove &#039;.htaccess&#039; file first!&lt;/body&gt;&lt;/html&gt;&quot;;exit;}<br />&nbsp; &nbsp; &nbsp; &nbsp; print &quot;&lt;html&gt;&lt;body&gt;&lt;a id=&#039;setup&#039; href=&#039;&quot;.rtrim($_SERVER[&quot;REQUEST_URI&quot;],&quot;/&quot;).&quot;/setup.php&#039;&gt;Click to setup.&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;&quot;;exit;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; /* Determine that which interface should be loaded. */<br />&nbsp; &nbsp; require_once &#039;config.php&#039;;<br />&nbsp; &nbsp; if(defined(&#039;__TEXTCUBE_NO_FANCY_URL__&#039;)) $service[&#039;type&#039;] = &#039;single&#039;;<br />&nbsp; &nbsp; switch ($service[&#039;type&#039;]) {<br />&nbsp; &nbsp; &nbsp; &nbsp; case &#039;path&#039;: // For path-based multi blog.<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; array_splice($accessInfo[&#039;URLfragment&#039;],0,1); <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $pathPart = ltrim(rtrim(strtok(strstr($accessInfo[&#039;input&#039;],&#039;/&#039;), &#039;?&#039;), &#039;/&#039;), &#039;/&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />&nbsp; &nbsp; &nbsp; &nbsp; case &#039;single&#039;:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $pathPart = (strpos($accessInfo[&#039;input&#039;],&#039;?&#039;) !== 0 ? ltrim(rtrim(strtok($accessInfo[&#039;input&#039;], &#039;?&#039;), &#039;/&#039;), &#039;/&#039;) : &#039;&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />&nbsp; &nbsp; &nbsp; &nbsp; case &#039;domain&#039;: default: <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $pathPart = ltrim(rtrim(strtok($accessInfo[&#039;fullpath&#039;], &#039;?&#039;), &#039;/&#039;), &#039;/&#039;);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if(!empty($service[&#039;path&#039;])) $pathPart = ltrim($pathPart,$service[&#039;path&#039;]);<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; $pathPart = strtok($pathPart,&#039;&amp;&#039;);<br />&nbsp; &nbsp; /* Load interface. */<br />&nbsp; &nbsp; $interfacePath = null;<br />&nbsp; &nbsp; if (in_array($pathPart, array(&#039;favicon.ico&#039;,&#039;index.gif&#039;))) {require_once &#039;interface/&#039;.$pathPart.&#039;.php&#039;;&nbsp; &nbsp; exit;}<br />&nbsp; &nbsp; if (!empty($accessInfo[&#039;URLfragment&#039;]) &amp;&amp;<br />&nbsp; &nbsp; &nbsp; &nbsp; in_array($accessInfo[&#039;URLfragment&#039;][0],<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;array(&#039;api&#039;,&#039;archive&#039;,&#039;attachment&#039;,&#039;author&#039;,&#039;category&#039;,&#039;checkup&#039;,&#039;cover&#039;,&#039;cron&#039;,&#039;entry&#039;,&#039;feeder&#039;,&#039;foaf&#039;,&#039;guestbook&#039;,&#039;keylog&#039;,&#039;location&#039;,&#039;logout&#039;,&#039;notice&#039;,&#039;page&#039;,&#039;plugin&#039;,&#039;pluginForOwner&#039;,&#039;search&#039;,&#039;suggest&#039;,&#039;sync&#039;,&#039;tag&#039;,&#039;ttxml&#039;)))<br />&nbsp; &nbsp; {<br />&nbsp; &nbsp; &nbsp; &nbsp; $pathPart = $accessInfo[&#039;URLfragment&#039;][0];<br />&nbsp; &nbsp; &nbsp; &nbsp; $interfacePath = &#039;interface/blog/&#039;.$pathPart.&#039;.php&#039;;<br />&nbsp; &nbsp; } else if (is_numeric(strtok(end($accessInfo[&#039;URLfragment&#039;]), &#039;&amp;&#039;))) {<br />&nbsp; &nbsp; &nbsp; &nbsp; $pathPart = count($accessInfo[&#039;URLfragment&#039;])==1 ? null : implode(&#039;/&#039;, array_slice($accessInfo[&#039;URLfragment&#039;], 0, count($accessInfo[&#039;URLfragment&#039;]) - 1));<br />&nbsp; &nbsp; }<br />&nbsp; &nbsp; if (empty($interfacePath)) $interfacePath = &#039;interface/&#039;.(empty($pathPart) ? &#039;&#039; : $pathPart.&#039;/&#039;).&#039;index.php&#039;;<br />&nbsp; &nbsp; define(&#039;PATH&#039;, &#039;interface/&#039;.(empty($pathPart) ? &#039;&#039; : $pathPart.&#039;/&#039;));<br />&nbsp; &nbsp; unset($pathPart);<br />&nbsp; &nbsp; if (!file_exists($interfacePath)) { require &quot;lib/error.php&quot;;errorExit(404);}<br />&nbsp; &nbsp; if (empty($service[&#039;debugmode&#039;])) {&nbsp; &nbsp; @include_once $interfacePath;}<br />&nbsp; &nbsp; else {include_once $interfacePath;}<br />?&gt;</p><p>맨윗줄에, 절대 변수 세션 &lt;? session_start(); ?&gt; 을 넣으니깐, 제가만든 인증세션은 작동하는데,</p><p>텍스터큐브 의 관리자 로그인이나, 메뉴 하이퍼링크를 클릭하면, 기능들이 죽어버립니다. 안된다는거죠...</p><p>&lt;? session_start(); ?&gt; 을 넣고싶은데, 어데다가 넣으면 좋을까요?</p>]]></content>
			<author>
				<name><![CDATA[크리스톱]]></name>
				<uri>http://forum.tattersite.com/ko/profile.php?id=2959</uri>
			</author>
			<updated>2008-07-03T06:28:32Z</updated>
			<id>http://forum.tattersite.com/ko/viewtopic.php?pid=28760#p28760</id>
		</entry>
</feed>
