<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Open Script Solution&#187; avoid</title>
	<atom:link href="http://www.openscriptsolution.com/tag/avoid/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.openscriptsolution.com</link>
	<description>... where solutions for script programming are found ...</description>
	<lastBuildDate>Tue, 31 Jan 2012 03:22:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to Avoid Error Message When Your Visitor Trying to Display Your Atahualpa 3.5.1 Theme Directory in WordPress</title>
		<link>http://www.openscriptsolution.com/2010/07/07/how-to-avoid-error-message-when-your-visitor-trying-to-display-your-atahualpa-3-5-1-theme-directory-in-wordpress/</link>
		<comments>http://www.openscriptsolution.com/2010/07/07/how-to-avoid-error-message-when-your-visitor-trying-to-display-your-atahualpa-3-5-1-theme-directory-in-wordpress/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 02:49:19 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[Atahualpa]]></category>
		<category><![CDATA[avoid]]></category>
		<category><![CDATA[directory]]></category>
		<category><![CDATA[directory listing]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[menghindari]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1217</guid>
		<description><![CDATA[Today I found something that annoying me when I tried to test the security hole by displaying the theme directory for one of my website that using Atahualpa theme version 3.5.1. Some error messages appeared when I tried to access such address: h++p://www.mydomain.com/wp-content/themes/atahualpa351/ . This error message caused by the using of unknown TEMPLATEPATH constant [...]]]></description>
			<content:encoded><![CDATA[<p>Today I found something that annoying me when I tried to test the security hole by displaying the theme directory for one of my website that using <a href="http://wordpress.bytesforall.com/" title="Atahualpa theme" target="_blank">Atahualpa</a> theme version 3.5.1. Some error messages appeared when I tried to access such address: h++p://www.mydomain.com/wp-content/themes/atahualpa351/ . This error message caused by the using of unknown TEMPLATEPATH constant if this file accessed directly without from the index of the website itself. So, here is the modification I created to display &#8220;Access denied&#8221; message instead of error message that displaying the path of the theme directory in my web server. <span id="more-1217"></span></p>
<p>Open your <strong>wp-content/themes/{youratahualpadirectoryname}/index.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">include</span> <span style="color: #009900;">&#40;</span>TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/functions/bfa_get_options.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>before that line of code, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2
3
4
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span>TEMPLATEPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/functions/bfa_get_options.php'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #990000;">die</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Sorry, access denied for displaying this directory!'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>then save the changes.</p>
<p>That&#8217;s it! Now you should see the better error message than before if your visitor trying to display your theme directory. <img src='http://www.openscriptsolution.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2010%2F07%2F07%2Fhow-to-avoid-error-message-when-your-visitor-trying-to-display-your-atahualpa-3-5-1-theme-directory-in-wordpress%2F&amp;title=How%20to%20Avoid%20Error%20Message%20When%20Your%20Visitor%20Trying%20to%20Display%20Your%20Atahualpa%203.5.1%20Theme%20Directory%20in%20WordPress" id="wpa2a_2"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2010/07/07/how-to-avoid-error-message-when-your-visitor-trying-to-display-your-atahualpa-3-5-1-theme-directory-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to Avoid Duplicate Ticket Content Saved in HESK v2.1</title>
		<link>http://www.openscriptsolution.com/2009/12/16/how-to-avoid-duplicate-ticket-content-saved-in-hesk-v2-1/</link>
		<comments>http://www.openscriptsolution.com/2009/12/16/how-to-avoid-duplicate-ticket-content-saved-in-hesk-v2-1/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 16:51:12 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[HESK]]></category>
		<category><![CDATA[avoid]]></category>
		<category><![CDATA[content]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[refresh]]></category>
		<category><![CDATA[reload]]></category>
		<category><![CDATA[ticket]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=1035</guid>
		<description><![CDATA[Actually, this modification I created was being intended for a friend of mine who implemented HESK for his department. I was interested with its interface, so I tried to create a new ticket and tested after submitting the ticket, I reload the &#8220;thank-you&#8221; page. In fact, a new ticket then would be created, the same [...]]]></description>
			<content:encoded><![CDATA[<p>Actually, this modification I created was being intended for a friend of mine who implemented <a href="http://www.hesk.com" target="_blank">HESK</a> for his department. I was interested with its interface, so I tried to create a new ticket and tested after submitting the ticket, I reload the &#8220;thank-you&#8221; page. In fact, a new ticket then would be created, <a href="http://www.openscriptsolution.com/2009/09/03/how-to-avoid-duplicate-ticket-content-in-osticket-system/" target="_blank">the same condition that occured in osTicket</a>, which I have created the modification regarding it to fix the same problem. <span id="more-1035"></span></p>
<ol>
<li>
Open your <strong>submit_ticket.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>192
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">hesk_dbConnect<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>then after that line, please insert this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>193
194
195
196
197
198
199
200
201
202
203
204
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">/* MOD: Avoid duplicate ticket (identified by its Subject &amp; Message) */</span>
<span style="color: #666666; font-style: italic;">/* modified by Masino Sinaga, November 30, 2009 */</span>
<span style="color: #000088;">$sqlcek</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;SELECT `subject`,`message` FROM `&quot;</span><span style="color: #339933;">.</span>hesk_dbEscape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$hesk_settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'db_pfix'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;tickets` 
        WHERE `subject`='&quot;</span><span style="color: #339933;">.</span>hesk_dbEscape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$subject</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;' AND `message`='&quot;</span><span style="color: #339933;">.</span>hesk_dbEscape<span style="color: #009900;">&#40;</span><span style="color: #000088;">$message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;'&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$rescek</span> <span style="color: #339933;">=</span> hesk_dbQuery<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sqlcek</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>hesk_dbNumRows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$rescek</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">//header('Location: index.php?a=add');</span>
    <span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Location: sorry.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;This ticket content already exists in database!&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>	
<span style="color: #009900;">&#125;</span>
<span style="color: #666666; font-style: italic;">/* MOD: Avoid duplicate ticket (identified by its Subject &amp; Message) */</span></pre></td></tr></table></div>

</li>
<li>
Create a new php file, and name it with <strong>sorry.php</strong>, copy and paste this code below, and put this file to your HESK&#8217;s root directory:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* Created by Masino Sinaga, http://www.openscriptsolution.com, November 30, 2009 */</span>
&nbsp;
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'IN_SCRIPT'</span><span style="color: #339933;">,</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'HESK_PATH'</span><span style="color: #339933;">,</span><span style="color: #0000ff;">''</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* Get all the required files and functions */</span>
<span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span>HESK_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'hesk_settings.inc.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span>HESK_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'inc/common.inc.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">/* Print header */</span>
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span>HESK_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'inc/header.inc.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
&lt;tr&gt;
&lt;td width=&quot;3&quot;&gt;&lt;img src=&quot;img/headerleftsm.jpg&quot; width=&quot;3&quot; height=&quot;25&quot; alt=&quot;&quot; /&gt;&lt;/td&gt;
&lt;td class=&quot;headersm&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> hesk_showTopBar<span style="color: #009900;">&#40;</span><span style="color: #000088;">$hesklang</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'invalid_action'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/td&gt;
&lt;td width=&quot;3&quot;&gt;&lt;img src=&quot;img/headerrightsm.jpg&quot; width=&quot;3&quot; height=&quot;25&quot; alt=&quot;&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&nbsp;
&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;3&quot;&gt;
&lt;tr&gt;
&lt;td&gt;&lt;span class=&quot;smaller&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$hesk_settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'site_url'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;smaller&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$hesk_settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'site_title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt; &gt;
&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$hesk_settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'hesk_url'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; class=&quot;smaller&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$hesk_settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'hesk_title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;
&gt; <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$hesklang</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'invalid_action'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/span&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&nbsp;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;
&nbsp;
&lt;table width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;&gt;
&lt;tr&gt;
	&lt;td width=&quot;7&quot; height=&quot;7&quot;&gt;&lt;img src=&quot;img/roundcornerslt.jpg&quot; width=&quot;7&quot; height=&quot;7&quot; alt=&quot;&quot; /&gt;&lt;/td&gt;
	&lt;td class=&quot;roundcornerstop&quot;&gt;&lt;/td&gt;
	&lt;td&gt;&lt;img src=&quot;img/roundcornersrt.jpg&quot; width=&quot;7&quot; height=&quot;7&quot; alt=&quot;&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td class=&quot;roundcornersleft&quot;&gt;&amp;nbsp;&lt;/td&gt;
	&lt;td&gt;
&nbsp;
	&lt;p&gt;&amp;nbsp;&lt;/p&gt;
	&lt;p align=&quot;center&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">&quot;Sorry, the ticket you have just sent already exists in our database.&quot;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/p&gt;
	&lt;p&gt;&amp;nbsp;&lt;/p&gt;
	&lt;p align=&quot;center&quot;&gt;&lt;a href=&quot;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$hesk_settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'hesk_url'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> <span style="color: #000088;">$hesk_settings</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'hesk_title'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/a&gt;&lt;/p&gt;
	&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&nbsp;
	&lt;/td&gt;
	&lt;td class=&quot;roundcornersright&quot;&gt;&amp;nbsp;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
	&lt;td&gt;&lt;img src=&quot;img/roundcornerslb.jpg&quot; width=&quot;7&quot; height=&quot;7&quot; alt=&quot;&quot; /&gt;&lt;/td&gt;
	&lt;td class=&quot;roundcornersbottom&quot;&gt;&lt;/td&gt;
	&lt;td width=&quot;7&quot; height=&quot;7&quot;&gt;&lt;img src=&quot;img/roundcornersrb.jpg&quot; width=&quot;7&quot; height=&quot;7&quot; alt=&quot;&quot; /&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span>
&nbsp;
<span style="color: #b1b100;">require_once</span><span style="color: #009900;">&#40;</span>HESK_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'inc/footer.inc.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
</ol>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F12%2F16%2Fhow-to-avoid-duplicate-ticket-content-saved-in-hesk-v2-1%2F&amp;title=How%20to%20Avoid%20Duplicate%20Ticket%20Content%20Saved%20in%20HESK%20v2.1" id="wpa2a_4"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/12/16/how-to-avoid-duplicate-ticket-content-saved-in-hesk-v2-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Avoid Duplicate Message from Client Saved in osTicket v1.6 RC5</title>
		<link>http://www.openscriptsolution.com/2009/09/20/how-to-avoid-duplicate-message-from-client-saved-in-osticket-v1-6-rc5/</link>
		<comments>http://www.openscriptsolution.com/2009/09/20/how-to-avoid-duplicate-message-from-client-saved-in-osticket-v1-6-rc5/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 15:01:36 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[osTicket]]></category>
		<category><![CDATA[avoid]]></category>
		<category><![CDATA[client]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[duplicate]]></category>
		<category><![CDATA[message]]></category>
		<category><![CDATA[page]]></category>
		<category><![CDATA[refresh]]></category>
		<category><![CDATA[reload]]></category>
		<category><![CDATA[saved]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=374</guid>
		<description><![CDATA[Actually, this modification is similar with another one that I made here: How to Avoid Duplicate Ticket Content in osTicket System. After client post message (reply) to his/her ticket that has been created before, then client reload/refresh that next page, the duplicate message will be saved in database. This modification will avoid that duplicate message [...]]]></description>
			<content:encoded><![CDATA[<p>Actually, this modification is similar with another one that I made here: <a href="http://www.openscriptsolution.com/2009/09/03/how-to-avoid-duplicate-ticket-content-in-osticket-system/" target="_blank"><strong>How to Avoid Duplicate Ticket Content in osTicket System</strong></a>. After client post message (reply) to his/her ticket that has been created before, then client reload/refresh that next page, the duplicate message will be saved in database. This modification will avoid that duplicate message saved in database of your osTicket System. <span id="more-374"></span></p>
<ol>
<li>
Open <strong>\include\class.ticket.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>563
564
565
566
567
568
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #666666; font-style: italic;">//Insert message from client</span>
    <span style="color: #000000; font-weight: bold;">function</span> postMessage<span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg</span><span style="color: #339933;">,</span><span style="color: #000088;">$source</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$msgid</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #339933;">,</span><span style="color: #000088;">$headers</span><span style="color: #339933;">=</span><span style="color: #0000ff;">''</span><span style="color: #339933;">,</span><span style="color: #000088;">$newticket</span><span style="color: #339933;">=</span><span style="color: #009900; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">global</span> <span style="color: #000088;">$cfg</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
            <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>after the last line of the code above, add this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>570
571
572
573
574
575
576
577
578
579
580
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #666666; font-style: italic;">// Begin of MOD Avoid Duplicate Message from Client Saved in Database</span>
        <span style="color: #666666; font-style: italic;">// Added by Masino Sinaga, May 4, 2009</span>
        <span style="color: #000088;">$sql1</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'SELECT ticket_id, message FROM '</span><span style="color: #339933;">.</span>TICKET_MESSAGE_TABLE<span style="color: #339933;">.</span><span style="color: #0000ff;">' 
         WHERE ticket_id='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getId</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'
         AND message='</span><span style="color: #339933;">.</span>db_input<span style="color: #009900;">&#40;</span>Format<span style="color: #339933;">::</span><span style="color: #004000;">striptags</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$msg</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">''</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$res1</span><span style="color: #339933;">=</span>db_query<span style="color: #009900;">&#40;</span><span style="color: #000088;">$sql1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>                
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$res1</span> <span style="color: #339933;">&amp;&amp;</span> db_num_rows<span style="color: #009900;">&#40;</span><span style="color: #000088;">$res1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
          <span style="color: #b1b100;">return</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #666666; font-style: italic;">// End of MOD Avoid Duplicate Message from Client Saved in Database</span>
        <span style="color: #666666; font-style: italic;">// Added by Masino Sinaga, May 4, 2009</span></pre></td></tr></table></div>

</li>
<li>
Open <strong>tickets.php</strong> file, and find this code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>69
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Unable to post the message. Try again'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>replace with this following code:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>69
</pre></td><td class="code"><pre class="php" style="font-family:monospace;">                <span style="color: #000088;">$errors</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'err'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">=</span><span style="color: #0000ff;">'Unable to post the message. Make sure the message you will send never sent before. Try again'</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

</li>
</ol>
<p>Have a nice code!</p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F09%2F20%2Fhow-to-avoid-duplicate-message-from-client-saved-in-osticket-v1-6-rc5%2F&amp;title=How%20to%20Avoid%20Duplicate%20Message%20from%20Client%20Saved%20in%20osTicket%20v1.6%20RC5" id="wpa2a_6"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/09/20/how-to-avoid-duplicate-message-from-client-saved-in-osticket-v1-6-rc5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three Methods to Avoid Directory-Listing in WordPress</title>
		<link>http://www.openscriptsolution.com/2009/09/10/three-methods-to-avoid-directory-listing-in-wordpress/</link>
		<comments>http://www.openscriptsolution.com/2009/09/10/three-methods-to-avoid-directory-listing-in-wordpress/#comments</comments>
		<pubDate>Thu, 10 Sep 2009 03:13:00 +0000</pubDate>
		<dc:creator>Masino Sinaga</dc:creator>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[avoid]]></category>
		<category><![CDATA[daftar direktori]]></category>
		<category><![CDATA[directory listing]]></category>
		<category><![CDATA[index]]></category>
		<category><![CDATA[list]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[prevent]]></category>
		<category><![CDATA[protection]]></category>
		<category><![CDATA[root]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://www.openscriptsolution.com/?p=261</guid>
		<description><![CDATA[In WordPress, almost plugins that I have used, do not include the index.html or index.php file inside its directory. As default, up to WordPress version 2.8.4, there is no protection to prevent or to avoid directory listing the first time you access your website after you install your WordPress. Thus, you or even your visitor [...]]]></description>
			<content:encoded><![CDATA[<p>In WordPress, almost plugins that I have used, do not include the <strong>index.html</strong> or <strong>index.php</strong> file inside its directory. As default, up to WordPress version 2.8.4, there is no protection to prevent or to avoid directory listing the first time you access your website after you install your WordPress. Thus, you or even your visitor can type such as http://www.yourdomain.com/wp-content/plugins/akismet/ then, voila&#8230; you or they can see the directory list which has the files inside that /akismet/ sub directory. You should take care about this early. Otherwise, if your visitor know about the weakness of your plugins that you currently use, they can exploit the bugs and hack your website easily. To avoid this happened, there are three methods that you can do how to avoid the directory list in your WordPress. <span id="more-261"></span></p>
<ol>
<li>The first method, you can create a blank file with name <strong>index.html</strong> and then put this file to each of your plugin sub directory. With this method, each time your visitor type such that address above, then they will see a white blank page. This method is not efficient, since you have to put this index.html file to all of your plugin sub directory. Also, you have to be careful before you copy this file to all of your plugins directory. Because, if one of your plugins sub directory has the index.html or index.php file, then you can make a new problem since the existing index.html or index.php file is the part of that plugin&#8217;s script.
</li>
<p></p>
<li>The second method, similarly with the first method above, you can create a file with name <strong>index.html</strong> and then copy the following code to this file:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
  &lt;head&gt;
    &lt;title&gt;This is your website title&lt;/title&gt;
    &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;&gt;
    &lt;meta content='2;url=http://www.yourdomain.com' http-equiv='Refresh'&gt;
  &lt;/head&gt;
  &lt;body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;&gt;
  &lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p>Afterwards, put this file to all of your plugins sub directory. By using this method, each time your visitor trying to view your plugin sub directory, then they will be redirected to your website home page in two seconds. You can change how long your visitor will wait before being redirected to the home page, by changing the <strong>2</strong> value after <strong>meta content</strong> tag above. This method also has the weakness, since you have to put this file to all of your plugins sub directory, and you have to be careful for the reason as I mentioned at the first method above about the existing index.html or index.php file in your plugins sub directory.
</li>
<li>The third method, is by using or optimizing (if already exist) the <strong>.htaccess</strong> file in your root website directory. Simply put this code at the top of your .htaccess file:

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="html" style="font-family:monospace;"># Avoid directory list
Options -Indexes</pre></td></tr></table></div>

<p>This method is the simpliest way of all three methods that we are talking about. Why? Because you only need to handle once from the .htaccess file. Afterwards, all of your sub directories under your root will be protected automatically. So, you don&#8217;t have to handle in each of your plugin sub directory anymore.
</li>
</ol>
<p>The first and the second methods above are necessary if you want to handle with different ways for each of your plugin when your visitor trying to view your directory list. For example, you want to display the certain message for plugin A that different for plugin B, and so on, before they got redirecting automatically using the second method. </p>
<p><a class="a2a_dd a2a_target addtoany_share_save" href="http://www.addtoany.com/share_save#url=http%3A%2F%2Fwww.openscriptsolution.com%2F2009%2F09%2F10%2Fthree-methods-to-avoid-directory-listing-in-wordpress%2F&amp;title=Three%20Methods%20to%20Avoid%20Directory-Listing%20in%20WordPress" id="wpa2a_8"><img src="http://www.openscriptsolution.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://www.openscriptsolution.com/2009/09/10/three-methods-to-avoid-directory-listing-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
