<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Bakawan Web Design</title>
	
	<link>http://www.bakawan.com/log</link>
	<description>i'm sorry we forgot easily</description>
	<lastBuildDate>Wed, 17 Mar 2010 08:36:22 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/bakawan/wkTg" /><feedburner:info uri="bakawan/wktg" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-nc-nd/3.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-nc-nd/3.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>bakawan/wkTg</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
		<title>Personal_Reference:Understanding the Wordpress vulnerability</title>
		<link>http://feedproxy.google.com/~r/bakawan/wkTg/~3/HtrMgYzch4I/</link>
		<comments>http://www.bakawan.com/log/personal_referenceunderstanding-the-wordpress-vulnerability/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 08:22:13 +0000</pubDate>
		<dc:creator>uwiuw</dc:creator>
				<category><![CDATA[Diary]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.bakawan.com/log/?p=2835</guid>
		<description><![CDATA[i have read this vulnerability problem in wordpress old version (2.8.3). I still remember i caught in the time, but not really sure what is going on. I don&#8217;t know why or what the reason. People use big word while i still caught in throat over definition and proof of concept. And just like everybody, [...]]]></description>
			<content:encoded><![CDATA[<p>i have read this <a href="http://stackoverflow.com/questions/1267998/understanding-the-wordpress-vulnerability">vulnerability problem</a> in wordpress old version (2.8.3). I still remember i caught in the time, but not really sure what is going on. I don&#8217;t know why or what the reason. People use big word while i still caught in throat over definition and proof of concept. And just like everybody, i got panic, installed the new version, and pray before go to bed.  </p>
<p>By the way, this reference is about wp-login.php in version 2.8.3. </p>
<pre>
function reset_password($key) {
    global $wpdb;

    $key = preg_replace('/[^a-z0-9]/i', '', $key);

    if ( empty( $key ) )
        return new WP_Error('invalid_key', __('Invalid key'));

    $user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users WHERE
user_activation_key = %s", $key));
    if ( empty( $user ) )
        return new WP_Error('invalid_key', __('Invalid key'));
...[snip]....
line 276:
$action = isset($_REQUEST['action']) ? $_REQUEST['action'] : 'login';
$errors = new WP_Error();

if ( isset($_GET['key']) )
    $action = 'resetpass';

// validate action so as to default to the login screen
if ( !in_array($action, array('logout', 'lostpassword', 'retrievepassword',
'resetpass', 'rp', 'register', 'login')) &#038;&#038; false ===
has_filter('login_form_' . $action) )
    $action = 'login';
...[snip]....

line 370:
</pre>
<p>and now in 2.9.1 (i use it as reference), above part code has change into</p>
<pre>
function reset_password($key, $login) {
     global $wpdb;
     $key = preg_replace('/[^a-z0-9]/i', '', $key);
     if ( empty( $key ) || !is_string( $key ) )
          return new WP_Error('invalid_key', __('Invalid key'));
     if ( empty($login) || !is_string($login) )
          return new WP_Error('invalid_key', __('Invalid key'));
     $user = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->users
          WHERE user_activation_key = %s AND user_login = %s", $key, $login));
     if ( empty( $user ) )
          return new WP_Error('invalid_key', __('Invalid key'));

     // Generate something random for a password…
     $new_pass = wp_generate_password();
     do_action('password_reset', $user, $new_pass);

     wp_set_password($new_pass, $user->ID);
     update_usermeta($user->ID, 'default_password_nag', true); 

     //Set up the Password change nag.

     $message = sprintf(__('Username: %s'), $user->user_login) . "rn";
     $message .= sprintf(__('Password: %s'), $new_pass) . "rn";
     $message .= site_url('wp-login.php', 'login') . "rn";

     // The blogname option is escaped with esc_html on the way into
     // the database in sanitize_option
     // we want to reverse this for the plain text arena of emails.

     $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
     $title = sprintf(__('[%s] Your new password'), $blogname);

     $title = apply_filters('password_reset_title', $title);
     $message = apply_filters('password_reset_message', $message, $new_pass);

     if ( $message &#038;&#038; !wp_mail($user->user_email, $title, $message) )
          die('

' . __('The e-mail could not be sent.') . "n" . __('Possible reason:
               your host may have disabled the mail() function…') . '

');

     wp_password_change_notification($user);
     return true;
}

case 'resetpass' :
case 'rp' :
      $errors = reset_password($_GET['key'], $_GET['login']);
      if ( ! is_wp_error($errors) ) {
            wp_redirect('wp-login.php?checkemail=newpass');
            exit();
      }
      wp_redirect('wp-login.php?action=lostpassword&#038;error=invalidkey');
      exit();
      break;
</pre>
<p>Now it able to close this vulnerability. It previous 2.8.3, the person who want to hack the website use </p>
<blockquote><p>http://DOMAIN_NAME.TLD/wp-login.php?action=rp&#038;key[]=</p></blockquote>
<p> and its very clever. But after the version 2.9.3, the reset_password need 2 argument before it work. And it has ability to sanitized both argument. Hmm seem good.</p>
<p>Long time ago, i have done coding login / registration algorithm and its looks similar with 2.8.3 version eventhough it use in lates wordpress version. The website need custom registration page with various hard coded meta field. Some yada yada and It&#8217;s not hidden behind ssl. So, i&#8217;m worry. Maybe i need to contact them if time permit.</p>
<p>Right now, at least, i can understand it why some people said that wordpress is a badly written software. Ah, i really don&#8217;t care how bad wordpress written. For me, it&#8217;s the most something similar to a piece of rainbow. It put food on the table. So i will work on it as long as i can. ;)</p>
<img src="http://feeds.feedburner.com/~r/bakawan/wkTg/~4/HtrMgYzch4I" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bakawan.com/log/personal_referenceunderstanding-the-wordpress-vulnerability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.bakawan.com/log/personal_referenceunderstanding-the-wordpress-vulnerability/</feedburner:origLink></item>
		<item>
		<title>Howto Show Parent Category only in WP Dashboard Panel</title>
		<link>http://feedproxy.google.com/~r/bakawan/wkTg/~3/kVOTlGneN0Q/</link>
		<comments>http://www.bakawan.com/log/howto-show-parent-category-only-in-wp-dashboard-panel/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 12:51:35 +0000</pubDate>
		<dc:creator>uwiuw</dc:creator>
				<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.bakawan.com/log/?p=2826</guid>
		<description><![CDATA[I have able to find a way to mass delete category. But unfortunately i haven&#8217;t able to do it directly. I have to make delete process into two separated way. First i delete the category then forcefully move all it post into default category where the cron job i have set before will delete them [...]]]></description>
			<content:encoded><![CDATA[<p>I have able to find a way to <a href="http://www.bakawan.com/log/confused-by-wordpress-category/">mass delete category</a>. But unfortunately i haven&#8217;t able to do it directly. I have to make delete process into two separated way. First i delete the category then forcefully move all it post into default category where the cron job i have set before will delete them eventually.</p>
<p>By the way, I manage to make the client satisfied with other category-related custom.  I make category panel in dashboard only show parent directory as he request it. So, this will make the panel only show category that he want it. I don&#8217;t know why he need something like this. But <em>see no evil hear no evil, your wish is my command</em>. i do it anyway.</p>
<p>bytheway, anybody who need this, shall put above code in <strong>functions.php</strong></p>
<pre>
add_action('get_terms', 'bk_show_cat_parent_only'); 

function bk_show_cat_parent_only($cat) {
	if (is_admin()) {
		$hasil = array();		

		$default_cat = get_option('default_category');

		foreach ($cat as $cat_object) {
		    if (($cat_object->parent) == 0 &#038;&#038; ($cat_object->term_id) != $default_cat )
			 $hasil = array_merge ($hasil, array ($cat_object));
			 // FIXME : Count the object --> add filter to
			 // 'edit_categories_per_page'
			 // as much as count
 		}

		return $hasil;
	} else {
		return $cat;
	}
}
</pre>
<img src="http://feeds.feedburner.com/~r/bakawan/wkTg/~4/kVOTlGneN0Q" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bakawan.com/log/howto-show-parent-category-only-in-wp-dashboard-panel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.bakawan.com/log/howto-show-parent-category-only-in-wp-dashboard-panel/</feedburner:origLink></item>
		<item>
		<title>After Reading : WP Coder have no Class</title>
		<link>http://feedproxy.google.com/~r/bakawan/wkTg/~3/Zbn6AHNd4Ic/</link>
		<comments>http://www.bakawan.com/log/after-reading-wp-coder-have-no-class/#comments</comments>
		<pubDate>Sun, 14 Mar 2010 18:14:46 +0000</pubDate>
		<dc:creator>uwiuw</dc:creator>
				<category><![CDATA[Diary]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://www.bakawan.com/log/?p=2813</guid>
		<description><![CDATA[I just read Wordpress Coders have no class and in contrary with the provocative title, this article give deep astonishing how wordpress community and way of code is so different with the rest of PHP community. What i meant is&#8230;ah just read this if you read mine.
This article describe how wp coder has culture not [...]]]></description>
			<content:encoded><![CDATA[<p>I just read <a href="http://www.arickmann.co.uk/wordpress-coders-have-no-class/">Wordpress Coders have no class</a> and in contrary with the provocative title, this article give deep astonishing how wordpress community and way of code is so different with the rest of PHP community. What i meant is&#8230;ah just read this if you read mine.</p>
<p>This article describe how wp coder has culture not to use OOP (Object Oriented Programming), a way of code that can be describe as the better way of coding. This has been use in java, C++, and PHP 5. But because of, wp still support any installation on server with PHP 4&#8230;. (the rest of this topic i still struggle to comprehend) </p>
<p>Frankly, before reading this article, i got this low esteem as somebody who learn PHP the wrong way. My friend and ex-coworker, call me, <em>Banci</em> aka <em>Karbit</em> coder &#8211; somebody who learn Wordpress first then try to learn advance PHP. So, most of the time, i follow my coding habit : I don&#8217;t encapsulate my functions in class. i don&#8217;t do fancy dancing. I just solve problem. period.</p>
<p>I do custom to solve problem fast and don&#8217;t really consider any redesign, recustom, or refactor. Most of the time, what i do, is bent wordpress and not utilized it or fork it with light-weight PHP framework like Codeigniter or similar CMS.</p>
<p>This <em>lack of future proof on understanding that shit can pour anytime soon</em> mentality covers by my good habit to put detail description on comment section. Every tiny process will be explain. I also always explain about the argument, the return value, and the debug output if available. And, i seperate my custom in several file to localized its feature. </p>
<p>I believe i follow the right way to make my code easy to understand. But still, i don&#8217;t do class. i&#8217;m a karbit. i understand wp more then PHP. (<del datetime="2010-03-01T06:53:14+00:00">Damm you pepa!</del>). If somebody ask me to read a file, i prefer wp class (such as filereader and streamreader),  rather then php built-in function. I&#8217;m a karbit.</p>
<p>Honestly, i like to read otto (<a href="http://ottodestruct.com/">ottodestruct.com</a>) blog. He&#8217;s one of my wp hero. I learn a lot from reading his plugin. So i got this stupid expression when he said that most of the time OOP in wp plugin is waste of time : </p>
<p><em>The big problem with OOP techniques is that people who have just learned them tend to want to use them everywhere, even where it makes no sense. A WordPress plugin is, generally, a place where it makes absolutely no sense to do so. </em></p>
<p>I know it&#8217;s true. But sometimes it hard to explain this to others. <del datetime="2010-03-01T06:44:37+00:00">Just with pepa, we have a very different style of coding and preference. We do our part the way we like. My part mostly procedural and rarely has class. While Pepa has the opposite. But fuck shit, it work!</del> </p>
<p>UPDATE : Otto has new site about wordpress, <a href="http://ottopress.com/">ottopress.com</a>. It seem his migrate his more technical stuff there. I definitely will come time to time to find some inspiration.</p>
<img src="http://feeds.feedburner.com/~r/bakawan/wkTg/~4/Zbn6AHNd4Ic" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.bakawan.com/log/after-reading-wp-coder-have-no-class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.bakawan.com/log/after-reading-wp-coder-have-no-class/</feedburner:origLink></item>
	<a href="http://webstudiouk.com/unexceptionalgerman.php?doc_id=177"><span style="display: none;">Private</span></a></channel>
</rss><!-- Dynamic page generated in 0.340 seconds. --><!-- Cached page generated by WP-Super-Cache on 2010-03-17 17:52:09 -->
