<?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>Random Neural Firings</title>
	<atom:link href="http://www.ryanhansen.name/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ryanhansen.name</link>
	<description>Consider it the Hubble view of my synaptic supernovas</description>
	<lastBuildDate>Wed, 11 Apr 2012 01:44:17 +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>ShadowProtect to the Rescue</title>
		<link>http://www.ryanhansen.name/2012/04/10/shadowprotect-to-the-rescue/</link>
		<comments>http://www.ryanhansen.name/2012/04/10/shadowprotect-to-the-rescue/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 01:39:10 +0000</pubDate>
		<dc:creator>mrhattyhat</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[BDR]]></category>

		<guid isPermaLink="false">http://www.ryanhansen.name/?p=18</guid>
		<description><![CDATA[Thank you for protecting my shadow (and my computers).]]></description>
			<content:encoded><![CDATA[<p><em>Thank you for protecting my shadow (and my computers).</em></p>
<p>At the risk of sounding biased* and even sycophantic, I&#8217;ve had a couple of cool experiences with <a href="http://www.storagecraft.com/" target="_blank">StorageCraft</a>&#8216;s <a href="http://www.shadowprotect.com/" target="_blank"><em>ShadowProtect</em> </a>software over the past few days that I figured I should share.  I&#8217;m not sure why I thought to share except that I guess humans just have this strange, innate desire to tell others about the cool things they do.  And I am, indeed, a human.</p>
<p>First let me set the proper stage.</p>
<p><strong>The Back Story</strong></p>
<p>(NOTE: I tend to be <a href="http://www.ryanhansen.name/2008/04/03/the-battle-to-integrate-external-systems-with-phpbb3/" target="_blank">pretty verbose</a>, so if you&#8217;re not interested in the back story, just skip down to The Point.)</p>
<p>There are 3 desktop computers enjoying ShadowProtection™ at my house.  Two are 32 bit Windows XP machines; the third is a 64 bit Windows 7 machine.  One of the XP machines belongs to my wife, while the other two machines are mine.  The Windows 7 machine is my primary computer, which I use for my work (when at home) and whatever casual computer-based pursuits I engage in, including media production.  I&#8217;m a closet filmmaker(ish), and the more powerful system is required to run all the <a href="http://www.adobe.com/products/creativesuite/mastercollection.html" target="_blank">production software</a> I use.</p>
<p>I&#8217;m also a hobbyist musician and my home office doubles as a bit of a rudimentary recording studio.  Sadly, however, the recording software I use (<a href="http://www.avid.com/US/products/family/Pro-Tools" target="_blank">Pro Tools 8</a>) doesn&#8217;t run stably on 64 bit architecture and I haven&#8217;t been able to bring myself to pull the $500 trigger on the upgrade to 10, which is 64 bit ready.  PT8 is still great for my needs, so $500 is a tough pill to swallow even if it does mean that I have to keep my XP box healthy, if for no other reason than to be my primary sound machine (hey, isn&#8217;t that a band?  Oh wait…that&#8217;s <a href="http://www.youtube.com/watch?v=NNoQ3MGIzXc" target="_blank"><em>Miami</em> Sound Machine</a>).</p>
<p>Being a bit of a geek (though not as much as you might think for a professional software engineer), I also have several servers at my house, rack and all, one of which I use as the backup destination for all of my instances of ShadowProtect.  It&#8217;s a Linux server with Samba shares mounted on each of the desktops.  I run <a href="http://www.storagecraft.com/shadowcontrol-imagemanager.php" target="_blank"><em>ImageManager</em> </a>on my Windows 7 machine monitoring the backup destinations over the network.  I have them all on a pretty conservative backup schedule: weekly full backup with twice-daily incrementals seven days a week.  Nothing to see here.</p>
<p>My XP machine has been with me for a long time.  I can&#8217;t even remember when I built it (I build all my own computers; none of these <a href="http://www.thegoldenpooawards.org/" target="_blank">pre-built monstrosities</a> you buy at <a href="http://www.walmart.com/" target="_blank">Wal-Mart</a> or <a href="http://www.bestbuy.com/" target="_blank">Best Buy</a>).  All things considered, it&#8217;s been a great computer.   Very reliable.  It has been with me through several years of software consulting and contracting, through countless installs, uninstalls, reinstalls, compiles, de-compiles, etc.  Needless to say, after all this time and use, it has not been running at optimal performance for a while.  I&#8217;ve been slowly weaning myself of any dependency on it, copying files off, moving software as much as possible, etc. and last week I finally found myself in a confident enough state to take more extreme measures.  I wanted to blow the whole OS away, reformat and start fresh with pretty much only Pro Tools installed and dedicate the machine to just recording (a great gig for a computer heading into retirement).  Still, I didn&#8217;t want to lose anything, especially some priceless historical document (read &#8220;old journal entry, tax document, photo, etc.&#8221;) that I had forgotten was on that computer.</p>
<p>I should mention here that this machine also was the final resting place of files dating back nearly two decades in some cases, moved from previously retired computers, none of which I had sorted or cleaned up properly.  Hmm…I think I&#8217;m pack-ratting more than I&#8217;ve been willing to admit now that I mention it.  (In my defense, I still do occasionally find myself perusing those old files and digging up some gem that had completely escaped my memory.)</p>
<p>With ShadowProtect in place now, I was finally ready at least to consider the possibility of a full rebuild.</p>
<p>I should have done it sooner.</p>
<p><strong>The Point</strong></p>
<p>I&#8217;ve had ShadowProtect keeping backups of my machines for several months, but I wasn&#8217;t sure I fully trusted it enough to just yank the rug out from under my XP machine with the whole reformat-reinstall rigmarole.  Sure, I could just blow it away and if I found myself having forgotten to copy something important off, just virtual boot one of the backups and get it, but I&#8217;m a bit paranoid about that kind of thing.  So before I pulled the trigger, I wanted to be absolutely certain I had a valid backup.</p>
<p>My first validation was to run the <em>Head-Start Restore</em> (HSR) procedure from ImageManager to build a <a href="http://www.vmware.com/" target="_blank">VMWare</a> Virtual Machine (VMDK) file that I could launch.  The first couple of attempts were <a href="http://i0.kym-cdn.com/photos/images/newsfeed/000/022/287/BILL-GATES-bsod.jpg" target="_blank">blue screen</a> misfires of my own doing, but once I chose the right set of restore options (e.g. restore MBR, restore disk signature, host-independent restore, etc.), I was able to get a valid VMDK that booted up just fine.</p>
<p>Being a VM on my primary computer, though, wasn&#8217;t my ideal, I decided, so I dusted off some old hardware I had kicking around and decided to do the same restore, but from the SP Recovery Environment, directly to the hard drive of this old box.  Again, it worked flawlessly, even on that old hardware, which is slow and a bit painful to use (it&#8217;s not even a SATA hard drive; good ol&#8217; IDE).  On that old hardware, the restore took about 7 hours.  Now I have a physical computer that&#8217;s an exact copy of my XP box as it was before I took any drastic steps.  With that kind of confidence, knowing I can get to those files in any one of a dozen ways now, I was ready to give my XP box a new life as a dedicated Pro Tools recording station.</p>
<p>The rebuild went off with only a minor hitch or two, mostly related to software (including ShadowProtect) that I needed to reinstall on the newly built box, but which I had failed to deactivate on the old install.  No problem, though: I simply booted up the copy box and deactivated.  (Try <em>that</em> with <a href="http://mozy.com/" target="_blank">Mozy</a> or <a href="http://www.carbonite.com/en/" target="_blank">Carbonite</a>!)</p>
<p>At the end of rebuild day, I was feeling very satisfied that the computer was exactly how I wanted it.  All Windows updates installed, all software installed and configured, and it was running clean and smooth, just like new.  The last thing to do was to take a backup of the machine in its current perfect state (well…reasonably close to perfect anyway, as close as Windows gets).  I set up the schedule in ShadowProtect and opted to &#8220;execute now&#8221; and off it went as off I went to bed.</p>
<p>The next morning I remembered that when I was reactivating Pro Tools on the new install the night before, I had noticed that there were some updates that I hadn&#8217;t installed.  I was a bit too hasty to do so, though, because as it turns out, it wreaked all kinds of havoc.</p>
<p><strong>&lt;tangent length=&#8221;brief&#8221;&gt;</strong><br />
See, my version of Pro Tools is a specific edition of the software that requires a specific piece of hardware as an instrument interface.  The hardware, called an <a href="http://www.avid.com/US/products/family/Mbox" target="_blank"><em>MBox</em></a> by Digidesign (now Avid), is a pretty simple USB peripheral desktop device with inputs on the back that support ¼ inch (guitar) and XLR (microphone) cables.  Without the MBox in place, plugged in to the computer, Pro Tools will not run.  My MBox is the original model, nearly 10 years old now (it originally shipped with Pro Tools 6 if that&#8217;s any indication).<br />
<strong>&lt;/tangent&gt;</strong></p>
<p>In installing the update, I had neglected to read the &#8220;fine print&#8221; (which actually wasn&#8217;t so fine; I was just an idiot) that said that the original MBox was no longer supported.  The install worked just fine and it looked like some new cool stuff was going to be installed, but when I tried to run Pro Tools after that, the dreaded &#8220;<em>can&#8217;t find valid hardware</em>&#8221; error kept popping up and killing it.  So I uninstalled the update and tried to reinstall the original 8.0, followed by the one update I had previously installed, 8.0.1.  No luck, and after multiple tries of various uninstalls and reinstalls, it got to where Pro Tools wouldn&#8217;t even launch.  Not a good sign for my nice, clean, newly rebuilt recording computer.</p>
<p>Thankfully, the great <em>Shadow</em> came to my rescue again, rising like a towering evergreen to <em>Protect</em> me (ba dum bum) from the harsh rays of my own idiocy.</p>
<p>An hour later, after another restore from the previous night&#8217;s backup (this time without the HIR option), I was back to clean and fresh and ready to rock.</p>
<p>And all is well with the world.</p>
<p><span style="font-size: 9pt;font-family: arial">*In the interest of full disclosure, I am currently employed as a software engineer for StorageCraft; however, I have had no hand whatsoever in creating or developing ShadowProtect, ImageManager, or any currently released StorageCraft offering.  I&#8217;m a relatively new employee and my work has yet to see the light of day in public (soon enough, though).  So I write this testimonial, as much as possible, as an unbiased user, not as an employee.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryanhansen.name/2012/04/10/shadowprotect-to-the-rescue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Checking back in&#8230;at last.</title>
		<link>http://www.ryanhansen.name/2010/07/27/checking-back-in-at-last/</link>
		<comments>http://www.ryanhansen.name/2010/07/27/checking-back-in-at-last/#comments</comments>
		<pubDate>Tue, 27 Jul 2010 06:34:05 +0000</pubDate>
		<dc:creator>mrhattyhat</dc:creator>
				<category><![CDATA[Hobbies]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.ryanhansen.name/?p=15</guid>
		<description><![CDATA[Well, it&#8217;s only been, what, two years?  I guess I&#8217;ll just claim that I&#8217;m *so* busy that I just can&#8217;t find the time to write blog posts and I don&#8217;t use the Twitter or the Facebooks, so to all my devoted readers who have been waiting with baited breath these last two years&#8230;I&#8217;m back. I&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s only been, what, two years?  I guess I&#8217;ll just claim that I&#8217;m *so* busy that I just can&#8217;t find the time to write blog posts and I don&#8217;t use the Twitter or the Facebooks, so to all my devoted readers who have been waiting with baited breath these last two years&#8230;I&#8217;m back.</p>
<p>I&#8217;ll write more later.  (I know, famous last words, right?)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryanhansen.name/2010/07/27/checking-back-in-at-last/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Tunes</title>
		<link>http://www.ryanhansen.name/2008/05/02/new-tunes/</link>
		<comments>http://www.ryanhansen.name/2008/05/02/new-tunes/#comments</comments>
		<pubDate>Fri, 02 May 2008 15:49:19 +0000</pubDate>
		<dc:creator>mrhattyhat</dc:creator>
				<category><![CDATA[Hobbies]]></category>

		<guid isPermaLink="false">http://www.ryanhansen.name/?p=13</guid>
		<description><![CDATA[The boys and I are working on some new music. These are still very early stage demos, so they&#8217;re pretty rough. What can you expect from original music produced at home? Kyle comes up with most of the musical concepts. He&#8217;s about as prolific a songwriter as I&#8217;ve ever met. So these are his babies. [...]]]></description>
			<content:encoded><![CDATA[<p>The boys and I are working on some new music.  These are still very early stage demos, so they&#8217;re pretty rough.  What can you expect from original music produced at home?</p>
<p>Kyle comes up with most of the musical concepts.  He&#8217;s about as prolific a songwriter as I&#8217;ve ever met.  So these are his babies.  Zach and I just fill in the texture with other musical stylings to go along with Kyle&#8217;s original concepts.</p>
<p>The first tune, This Love, is our latest and probably most complete as far as song structure and direction, though it&#8217;s still far from finished as to production.  That&#8217;s Kyle on the vocals (obviously) and rhythm guitar.  I&#8217;m on the drums and bass.  Zach hasn&#8217;t made an appearance on this tune yet.</p>
<p>Next is our least developed tune, Drop A.  It&#8217;s just an instrumental jam at the moment based on some wild tuning experimentation.  As the title suggests, the low E is dropped all the way to A.  Kyle is on the acoustic rhythm.  Zach on melodic lead guitar exploration.  I&#8217;m on bass.  Drums are actually a loop in this one, but I have a drum line that I&#8217;ll eventually lay down for it.</p>
<p>Finally, Utah High is also pretty near completion as to structure, but far from being production ready.  Hey, it&#8217;s a demo.  Kyle once again on vocals and acoustic rhythm.  Zach&#8217;s on electric rhythm and lead.  I&#8217;m on bass and drums.</p>
<p><a href="http://www.develligent.com/tunes" target="_blank">Enjoy</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryanhansen.name/2008/05/02/new-tunes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Follow That Quantum Particle&#8230;</title>
		<link>http://www.ryanhansen.name/2008/04/18/follow-that-quantum-particle/</link>
		<comments>http://www.ryanhansen.name/2008/04/18/follow-that-quantum-particle/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 16:22:18 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://www.ryanhansen.name/2008/04/18/follow-that-quantum-particle/</guid>
		<description><![CDATA[In our first battle, we were simply trying to understand what needed to happen and where in order to produce a valid authenticated user. Really we didn&#8217;t even get that far; we simply identified how the modular authentication system of phpBB3 is supposed to work. We really didn&#8217;t get into the nitty-gritty of phpBB&#8217;s execution. [...]]]></description>
			<content:encoded><![CDATA[<p>In our <a href="http://www.ryanhansen.name/2008/04/14/the-battle-begins/">first battle</a>, we were simply trying to understand what needed to happen and where in order to produce a valid authenticated user.  Really we didn&#8217;t even get that far; we simply identified how the modular authentication system of phpBB3 is supposed to work.  We really didn&#8217;t get into the nitty-gritty of  phpBB&#8217;s execution.</p>
<p>If we&#8217;re going to try to track our &#8220;quantum particles&#8221; (i.e. execution&#8230;see the <a href="http://www.ryanhansen.name/2008/04/03/the-battle-to-integrate-external-systems-with-phpbb3/">series opener</a> for explanation) through that nebula, the place to start is with the User Control Panel (ucp.php).  That is, after all, where most battles take place, or at least where they begin.</p>
<p>So, from the top&#8230;</p>
<p>The script opens with several definitions and includes that contain more definitions.  We&#8217;re not going to concern ourselves much with those.  Just note that those lines appear in most of the public-facing scripts in phpBB.</p>
<p>In fact, we really don&#8217;t care about anything until we get to the <em>session_begin()</em> function.  I went into some detail about this function in the <a href="http://www.ryanhansen.name/2008/04/14/the-battle-begins/">previous post</a>, so I won&#8217;t go into it again here.  We&#8217;ll get into it later when we get back to the discussion of Overstock&#8217;s unique needs and how I was finally able to meet them.</p>
<p>After the session is opened, phpBB needs to detemine the permissions held by the user.  That&#8217;s done by a call to the <em>$auth-&gt;acl() </em>function, which takes an array of user data as it&#8217;s argument.  The user data array (<em>$user-&gt;data</em>) exists by virtue of the session that was previously opened for the user (<em>$user</em>).  As that user object is constructed, user permissions are either queried from the database for that particular user (if a record exists) or they are queried from a &#8220;guest&#8221; account to allow the user to browse around the forums as a guest as allowed by the forum permissions (set by admin; outside the scope of this discussion).</p>
<p>Now that the session is created and the permissions set, the next thing we care about is <em>$mode</em>.  You may have noticed a few lines up the line that defines the <em>$mode</em> variable by a call to the <em>request_var</em> function.  I&#8217;ve never taken the time to read through this function, but my cursory observation and the obvious implication of the name lead me to deduce that this is phpBB&#8217;s wrapped method of extracting values from other places (such as REQUEST arrays).  In this particular case, the value being extracted comes from the URL string, so it is a GET parameter called <em>mode</em>.  If the user is not logged in, the value of this parameter will be <em>login.</em></p>
<p>So, following through<em> ucp.php</em>, we come to a switch statement that is testing the value of <em>$mode. </em>For now, we only care about the block that executes if the value of <em>$mode </em>is &#8220;login.&#8221;</p>
<p>The original phpBB code checks to see if the user if registered.  If so, the user is redirected to the index page; otherwise, the <em>login_box() </em>function is called, which (you guessed it) renders the phpBB login box.   All well and good under normal circumstances, but in Overstock&#8217;s case, this wasn&#8217;t the desired behavior.  As I mentioned in the <a href="http://www.ryanhansen.name/2008/04/03/the-battle-to-integrate-external-systems-with-phpbb3/">first post</a>, Overstock wanted to bypass the standard phpBB login process and replace it with their own &#8220;universal login&#8221; procedure.  So rather than using the standard phpBB login screen, the desired behavior was for the system to check for an existing universal login session (certain cookie values), and if it existed, automatically log the user into phpBB; otherwise, redirect the user to Overstock&#8217;s univseral login screen, which would then send the user back to the referring page upon successful authentication. Once returned from the universal login, the user needed to be authenticated and logged into phpBB seamlessly.</p>
<p>Sounds simple enough; however there is one further complicating wrinkle that needed to be handled.  In the event that the user had never used the Overstock forums before (i.e. didn&#8217;t have an existing phpBB account), the login procedure needed to create the phpBB account for them.  So, effectively, the user would have two accounts&#8211;one universal login account for Overstock sites, and one phpBB account&#8211;that needed to be seamlessly synchronized.  The phpBB account would be used for phpBB authentication and permissions, but the user&#8217;s experience has to act as though everything is controlled by the universal login account.</p>
<p>So back to the UCP.</p>
<p>To accomplish the desired effects, I took out all of phpBB&#8217;s original login code and replaced it with an<em> if/else</em> procedure that tests for a valid universal login session (ID).  If found, the username and password for the user&#8217;s phpBB account are determined (I&#8217;m keeping the details of this procedure to myself for security reasons).  Finally, it executes the <em>$auth-&gt;login() </em>function, passing in the username and password.  If successful, it redirects to the index page and phpBB functions as normal from there with the user fully logged in.</p>
<p>So there it is.  Mission accomplished&#8230;sort of.  We&#8217;re now able to successfully authenticate a user in phpBB using an external authentication procedure. Of course, that assumes the user already has an existing phpBB account that corresponds to their universal login account.</p>
<p>But what if they don&#8217;t?  How do we iron out that particular wrinkle?</p>
<p>Read on.  We&#8217;re winning battles, but the war is still far from over.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryanhansen.name/2008/04/18/follow-that-quantum-particle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Battle Begins&#8230;</title>
		<link>http://www.ryanhansen.name/2008/04/14/the-battle-begins/</link>
		<comments>http://www.ryanhansen.name/2008/04/14/the-battle-begins/#comments</comments>
		<pubDate>Mon, 14 Apr 2008 18:20:27 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://www.ryanhansen.name/2008/04/14/the-battle-begins/</guid>
		<description><![CDATA[As I mentioned in the introductory post, the first big battle to win against phpBB3 is understanding the execution path that is followed for simple operations like presenting the forum lists, login screens, etc. Without question, the bulk of time and trouble was related to this. Again, credit to Zend for making it possible to [...]]]></description>
			<content:encoded><![CDATA[<p>As I mentioned in the <a href="http://www.ryanhansen.name/2008/04/03/the-battle-to-integrate-external-systems-with-phpbb3/">introductory post</a>, the first big battle to win against phpBB3 is understanding the execution path that is followed for simple operations like presenting the forum lists, login screens, etc.  Without question, the bulk of time and trouble was related to this.</p>
<p>Again, credit to Zend for making it possible to even follow that path, since without it, I would be left to a lot of guessing and just reading of code.</p>
<p>&lt;tangent&gt;Let me just interject at this point that this is one of the most annoying tendencies of Open Source software developers: they make the assumption that since they are complete geeks who would just as soon read code as a good novel, that everyone else in the development world should do the same.  I think this is more arrogance than laziness or misunderstanding in many cases; it&#8217;s their way of saying, &#8220;if you&#8217;re not willing to read every line of code, you&#8217;re not a <em>real</em> developer like <em>I</em> am.&#8221;  I can read code just as well as anyone, but I&#8217;m actually a <em>successful professional</em> developer, so my time is much better spent in worthy pursuits like actually building things and is too valuable to be wasted reading every line of someone else&#8217;s code to try to decode their mental dysfunction so I can understand how and <em>why</em> they have done things the way they have.  Documentation, geeks!&lt;/tangent&gt;</p>
<p>Theoretically, phpBB3 supports a modular authentication model, so by setting a particular value in the database that tells phpBB what module to use, and then writing the functions for that module, you&#8217;re able to integrate your own custom auth code into phpBB3 (I&#8217;m not sure if this was also available in previous versions of phpBB).   In Overstock&#8217;s case, authentication had to be customized, so step number one was to indicate what the name of the authentication module is.  This is done by making an entry into the <em>phpbb_config</em> table (assuming your table prefix is <em>phpbb_</em>).  Normally this would be done through the phpBB admin control panel, but for the sake of really understanding the innards, I&#8217;m going to refer to the actual database table and column(s).</p>
<p>The table <em>phpbb_config </em>has three columns defined:</p>
<ul>
<li><em>config_name</em></li>
<li><em>config_value</em></li>
<li><em>is_dynamic</em></li>
</ul>
<p>This structure is intended to allow for configuration flexibility.  When you identify an authentication module using the admin control panel, a new record is entered into <em>phpbb_config</em> with the values assigned as follows:</p>
<ul>
<li>auth_method</li>
<li>[the name of your auth module]</li>
<li>0</li>
</ul>
<p>Once this is set, when phpBB authentication executes, rather than using one of its own auth modules, it will use the one named in this record.  Sounds simple enough, but there is one important thing to remember:</p>
<p><em><strong>No matter what name you assign to your authentication module, phpBB expects the file name to be prepended with </strong></em><strong>auth_.  </strong></p>
<p>So, for example, if you specify that your authentication module name is <em>custom</em>, phpBB will expect that the authentication functions for your module are defined in a file called <em>auth_custom.php</em> (assuming the extension you&#8217;re using is .php).  So, in order to use your custom functions, you have to create a file called <em>auth_custom.php</em> and store it in the <em>includes/auth</em> directory of your phpBB installation.</p>
<p>Get used to that convention, <em>_custom</em>, because it represents the pattern that will persist throughout the customization effort. (Of course <em>custom</em> is what I&#8217;m using for my examples; you&#8217;ll need to replace that with your authentication module name wherever appropriate).</p>
<p>Now that you have the file in place, you have to create functions that phpBB will recognize.  Once again,  the authentication module comes into play.  To log a user in, phpBB calls its <em>login </em>function, which is a member (method) of the <em>auth</em> class.  The <em>login </em>function is just a wrapper for the login function found in the authentication module being used.  If you follow into the <em>auth </em>class <em>login()</em> function, the first thing that happens (after initializing globals) is it calls in the appropriate authentication module and tries to execute the <em>login_  </em>function for that module.<em> </em>  So for our example, it will look for a function called <em>login_custom() </em>inside of <em>includes/auth/auth_custom.php.  </em>Once execution enters this function, you&#8217;re in complete control and you can pretty much do whatever you want.  Of course, it won&#8217;t likely do you any good unless you excute at least the most fundamental of phpBB&#8217;s login procedures&#8230;i.e. logging in.</p>
<p>To log a user in and take advantange of phpBB&#8217;s session management, you have to pass a valid username and passsword into the login function:</p>
<p><em>$auth-&gt;login($username, $password)</em></p>
<p>This will return an array of results whether it succeeds or fails.  One of the array elements is called <em>status</em>, which is what you&#8217;ll use to determine success.  PhpBB makes extensive use of constants (defined in <em>includes/constants.php</em>), and in the native authentication code, phpBB will compare the <em>status</em> element of the array with the <em>LOGIN_SUCCESS</em> constant value.  If they match, login was successful; otherwise, it failed.  From there flow control is up to you to handle according to your needs.</p>
<p>It should be noted that this whole procedure is started by a call to phpBB&#8217;s <em>session_begin() </em>function.  Open up almost any of phpBB&#8217;s files (i.e. ucp.php) and you&#8217;ll see a call to this function near the top.  In phpBB, the <em>session</em> class actually extends the <em>user</em> class (or maybe it&#8217;s vice-versa&#8230;I forget), which is why you&#8217;ll see this function called as a method of the <em>$user</em> object:</p>
<p><em>$user-&gt;session_begin();</em></p>
<p>If you follow through the<em> session_begin() </em>function (defined in <em>includes/session.php</em>), you&#8217;ll find the code that implements your custom authentication module (as of writing, this code begins on line 270); however, the real code we have to look at first comes before that, on line 231.</p>
<p>At this point in execution, the system enters an <em>if</em> statemement related to the session.  Don&#8217;t ask me what all the different variables being compared actually are or where they are initially defined.  With phpBB&#8217;s extensive use of constants, globals, and it&#8217;s own session management (rather than native PHP sessions), it&#8217;s very difficult to know exactly what is being compared to what and where any of it comes from.  The long and short of it is this, though: if there is a valid session available for this user, enter this block of code; otherwise, it jumps down to line 334 and starts a new session.</p>
<p>With the session either restored or created, execution can now proceed.</p>
<p>We&#8217;re not even close to finished yet, but at least we know where to start.  Battle won.  Chalk one up for the good guys.</p>
<p>Sadly, however, <a href="http://www.ryanhansen.name/2008/04/18/follow-that-quantum-particle/">the war continues&#8230;</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryanhansen.name/2008/04/14/the-battle-begins/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Battle to Integrate External Systems with phpBB3</title>
		<link>http://www.ryanhansen.name/2008/04/03/the-battle-to-integrate-external-systems-with-phpbb3/</link>
		<comments>http://www.ryanhansen.name/2008/04/03/the-battle-to-integrate-external-systems-with-phpbb3/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 22:03:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web 2.0]]></category>

		<guid isPermaLink="false">http://www.ryanhansen.name/2008/04/03/the-battle-to-integrate-external-systems-with-phpbb3/</guid>
		<description><![CDATA[My current consulting gig is with for one of the largest retailers on the web, Overstock.com. The company is aggressively seeking to leverage social media and networking to improve attention and retention to their site&#8211;just like all companies that actually understand where the attention of the masses is at this particular moment in history. I [...]]]></description>
			<content:encoded><![CDATA[<p>My current consulting gig is with for one of the largest retailers on the web, <a href="http://www.overstock.com" target="_blank">Overstock.com</a>. The company is aggressively seeking to leverage social media and networking to improve attention and retention to their site&#8211;just like all companies that actually understand where the attention of the masses is at this particular moment in history.</p>
<p>I was hired to build their social media and community sites and tools (not alone, of course).  In Overstock&#8217;s case, those &#8220;sites and tools&#8221; include blogs, forums, video sharing (a la YouTube), etc.  I&#8217;ve had my fingers in basically all of these sites, but the big beast of late has been the forums.</p>
<p>Here&#8217;s the deal:</p>
<p>Overstock&#8217;s current forum system is built on phpBB2 and is very limited in it&#8217;s capability relative to the rest of the Overstock.com family of sites.  The current project that I&#8217;m on has two primary objectives:</p>
<ol>
<li>Migrate the Overstock forums to phpBB3</li>
<li>Integrate Overstock&#8217;s <em>Unified Login</em> system so that the forums authentication/authorization is based on enrollement in one of Overstock&#8217;s main sites (i.e. auctions, shopping, etc), rather than enrollment in Overstock&#8217;s forums.</li>
</ol>
<p>Obviously the intent is to make the forums feel like a part of the Overstock.com family, rather than a third-party solution that has been crimped onto the corner of the Overstock sites.</p>
<p>So, why blog all this?</p>
<p>Simple: phpBB3&#8242;s code base is a freaking nightmare.  So whether for my own future reference (never know when you&#8217;ll need it), or for some other poor geek that gets saddled with similar objectives, I figured I would document how I finally succeeded in making it all work.  Obviously I&#8217;ll leave the specifics of Overstock&#8217;s unified login system out&#8211;that&#8217;s just ethics and good sense.  But given that phpBB3 is open source (probably would be better referred to as &#8220;<em>Obfuscated Source</em>&#8220;) I am perfectly justified in divulging all I now know about its inner workings.  Sadly, even after many epic battles, I still don&#8217;t understand much of how it all works.  What&#8217;s worse, I think, is that I don&#8217;t understand <em>why</em> phpBB3 is built the way it is.  I figure it&#8217;s for one of two reasons:</p>
<ol>
<li>They have built their latest release on a horrible legacy code base with only enough modification to feel justified in calling it a new version. I could be wrong: they might have built it fresh from the ground up. If so, I&#8217;m even more disgusted by the phpBB development team, because that code is a mess.  I find this hard to swallow, however, because the mere presence and pervasiveness of global variables throughout the code base tells me that the system design was lacking in foresight and flexibility, and was rather built to accomodate features that are making an unaltered journey from phpBB2 to phpBB3.</li>
<li>They have intentionally built on a hellishly cryptic architecture to keep it as proprietary as &#8220;open source&#8221; software is legally allowed to be.  It&#8217;s certain that, once they&#8217;ve seen the code, developers and companies are going to think twice about building &#8220;their own&#8221; bulletin board systems by extending and modifying phpBB.  The smart money would likely decide that they need to either stick with what phpBB offers (few modifications), or build their own system from scratch.</li>
</ol>
<p>Of course, all of this could be completely unfounded.  It could very well be that the code isn&#8217;t that hard to follow&#8230;once you know what to look for and where to look.  But therein lies the biggest beast of all: trying to follow any logical flow through the phpBB3 code.  In my exprience (and taking a page from the Simon Cowell Method of Introducing Similes), it was &#8220;quite like&#8221; tracking the movements of quantum particles at distances increasingly closer to the Planck Length. Every once in a while, with some heavy calculations and a fair amount of predictive luck, your observation might cross paths with the object  you&#8217;re trying to observe; but mostly, the object just bounces seemingly instantaneously from one position to another without warning or trace.</p>
<p>At this point, I have to give props to the people at <a href="http://www.zend.com" target="_blank">Zend</a>. Were it not for Zend Studio (5.5) and their Zend Server Platform&#8217;s remote debugging capability, I&#8217;m certain I would have tossed in the towel weeks ago after determining that it was impossible to follow through the code manually.  I was successful, ultimately, entirely thanks to the ability to step over and into specific parts of the code along the execution path; something that&#8217;s impossible to do in PHP without this Platform tool, as far as I know.</p>
<p><a href="http://www.ryanhansen.name/2008/04/14/the-battle-begins/">Let the battle begin</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryanhansen.name/2008/04/03/the-battle-to-integrate-external-systems-with-phpbb3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Where&#8217;s My Sponsorship, Callaway?</title>
		<link>http://www.ryanhansen.name/2008/03/21/wheres-my-sponsorship/</link>
		<comments>http://www.ryanhansen.name/2008/03/21/wheres-my-sponsorship/#comments</comments>
		<pubDate>Sat, 22 Mar 2008 04:03:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Hobbies]]></category>

		<guid isPermaLink="false">http://www.ryanhansen.name/?p=5</guid>
		<description><![CDATA[I&#8217;m basically the poster child for Callaway. With the exception of my putter, my 5 wood and my hat, everything else I play is Callaway. It started about 4 years ago on my birthday. My wife&#8211;sweet and golf-tolerant angel that she is&#8211;bought me (at my request) Callaway&#8217;s then brand new ERC Fusion driver. It was [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m basically the poster child for Callaway.  With the exception of my putter, my <a href="http://golf.about.com/od/equipmentreviews/a/titleist904f.htm" target="_blank">5 wood</a> and my <a href="http://www.nike.com/index.jhtml#l=nikestore,grid,_pdp,cid-1/gid-137506/pid-137505,_grid,f-10002+12002+4294967020+26003&amp;re=US&amp;co=US&amp;la=EN" target="_blank">hat</a>, everything else I play is Callaway.  It started about 4 years ago on my birthday.  My wife&#8211;sweet and golf-tolerant angel that she is&#8211;bought me (at my request) Callaway&#8217;s then brand new <a href="http://callawaygolfpreowned.com/drivers/drivers-erc-fusion.aspx" target="_blank">ERC Fusion</a> driver.  It was by no means an impulse buy.  I did my homework&#8230;which basically means I hit every driver in the valley to try to find the one that felt right.</p>
<p>After much research and countless balls hit in simulators, I narrowed it down to the Callaway, the Nike 1, and a Titleist (model I&#8217;ve forgotten).  A little more effort eliminated the Titleist, and finally, when I managed to hit about 10 sim shots in a row with the Callaway that were dead straight and long (well&#8230;as much as such results can be trusted in a simulator), the Callaway won. I have never regretted it and thus began my commitment to Callaway golf gear.</p>
<p>I&#8217;ve gotten to a point now where I really don&#8217;t even need to test or compare anymore.  I know Callaway&#8217;s gear will suit my game before I even swing the clubs, as was proven when my wife (isn&#8217;t she the best!?) bought me a full set of <a href="http://callawaygolfpreowned.com/isets/isets-bb-x18.aspx" target="_blank">X-18</a> irons for Christmas two years ago.  I didn&#8217;t even have to compare them to others, and by spring, I knew it was the right choice. I dropped about 5 strokes off my average that summer.</p>
<p>Next came my 56 degree <a href="http://shop.callawaygolf.com/Wedges/X-Tour_Chrome.html" target="_blank">X-Tour Chrome</a> wedge, and finally, after a lot of credit card transactions on the Blue card, I earned enough points to get myself a 52 degree <a href="http://shop.callawaygolf.com/Wedges/X-Tour_Vintage.html" target="_blank">X-Tour Vintage</a> wedge&#8230;excellent pieces of hardware that chipped another 3 or 4 strokes off my game last summer (pun intended, of course).</p>
<p>The final addition was the perfect ball.  After playing many, and liking many, I finally found my magic with Callaway&#8217;s <a href="http://shop.callawaygolf.com/Balls/Callaway_Golf_Balls/HX_Tour.html" target="_blank">HX Tour</a> and <a href="http://shop.callawaygolf.com/Balls/Callaway_Golf_Balls/HX_Tour_56.html" target="_blank">HX Tour 56</a> balls.  They don&#8217;t last very long in my game; I tend to scratch them up pretty good with my wedges.  But they have given me what I never have had in the previous 6 years or so of playing golf: spin control.  They&#8217;re soft enough that even a hack like me with no <em>real</em> spin control can get the kind of spin that will stop the ball on the hardest of greens (as much as can be expected).  Distance has never been a problem for me&#8211;I&#8217;m a pretty big dude&#8211;so for me, feel is key.  Connecting with HX golf balls feels amazing, which is to say it doesn&#8217;t really <em>feel</em> at all.  If I swing right, I can&#8217;t even feel the ball.  That&#8217;s how I like it.  Shave another couple of strokes.</p>
<p>So in a few short years I&#8217;ve gone from a complete hack who didn&#8217;t even dare register a handicap, to a proud 8.</p>
<p>I guess I can&#8217;t say for sure that the equipment is entirely responsible for my improvements; however, I&#8217;ve come to believe that there is one single element in golf that makes a greater difference in lowering your score than any other.  It&#8217;s not the elusive repeatable inside-out swing, it&#8217;s not the putt stroke, it&#8217;s not the short game or the drive.  It&#8217;s simply confidence.  If you can strike the ball with confidence, no matter what shot you&#8217;re trying to make, your chances of success increase by orders of magnitude.  For me, the feel of Callaway clubs gives me that confidence to know that if I do my job, the clubs will do the rest.</p>
<p>Now&#8230;where&#8217;s my sponsoship, Callaway!?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryanhansen.name/2008/03/21/wheres-my-sponsorship/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>You are about to witness&#8230;</title>
		<link>http://www.ryanhansen.name/2007/06/01/you-are-about-to-witness/</link>
		<comments>http://www.ryanhansen.name/2007/06/01/you-are-about-to-witness/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 06:14:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<guid isPermaLink="false">http://www.ryanhansen.name/?p=3</guid>
		<description><![CDATA[The births of stars, the organization of galaxies, the expansion of the universe through space-time&#8230;all in my own head!]]></description>
			<content:encoded><![CDATA[<p>The births of stars, the organization of galaxies, the expansion of the universe through space-time&#8230;all in my own head!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ryanhansen.name/2007/06/01/you-are-about-to-witness/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

