<?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>thekruser.com&#187; hack</title>
	<atom:link href="http://thekruser.com/tag/hack/feed/" rel="self" type="application/rss+xml" />
	<link>http://thekruser.com</link>
	<description>I am now inside your mind!</description>
	<lastBuildDate>Sun, 02 Oct 2011 20:30:51 +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>Multiple Site Admin Permission Solution in WordPress MU&#8230;Kind Of</title>
		<link>http://thekruser.com/2009/12/23/multiple-site-admin-permission-problem-in-wordpress-mu-kind-of/</link>
		<comments>http://thekruser.com/2009/12/23/multiple-site-admin-permission-problem-in-wordpress-mu-kind-of/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 03:12:41 +0000</pubDate>
		<dc:creator>thekruser</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Walkthroughs and How-tos]]></category>
		<category><![CDATA[admin]]></category>
		<category><![CDATA[blog]]></category>
		<category><![CDATA[domain admins]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[security]]></category>
		<category><![CDATA[WordPress MU]]></category>
		<category><![CDATA[WordPress Multi-User]]></category>
		<category><![CDATA[WPMU]]></category>

		<guid isPermaLink="false">http://thekruser.com/?p=469</guid>
		<description><![CDATA[Admission: I am a tech-freak.  My idea of Christmas presents this year? WEB SITES FOR EVERYONE!  Now, I made this decision and just started purchasing domain names.  As an afterthought (I know...great time to think about it), it occurred to me that I am the only web-minded person in the family.  Great! Now everyone has a website that they are going to want help maintaining.  Great planning, kruser!  Then it hit me (again...my timing is impeccable), I have WordPress MU!  Problem solved.  But wait, there's more.  One of the sites was for my niece, a rather web-centric person as well.  I wanted her to have full reign of her own domain instead of being bound to my themes and plugins.  I figured making her an Administrator of her domain would solve this issue.  NOPE!  Well, damn...back to square one!<p><a href="http://thekruser.com/2009/12/23/multiple-site-admin-permission-problem-in-wordpress-mu-kind-of/">Multiple Site Admin Permission Solution in WordPress MU&#8230;Kind Of</a> is a post from: <a href="http://thekruser.com">thekruser.com</a></p>
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthekruser.com%2F2009%2F12%2F23%2Fmultiple-site-admin-permission-problem-in-wordpress-mu-kind-of%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthekruser.com%2F2009%2F12%2F23%2Fmultiple-site-admin-permission-problem-in-wordpress-mu-kind-of%2F&amp;source=thekruser&amp;style=normal&amp;service=bit.ly&amp;service_api=R_fff679fe85bdf2acf834de823561a677&amp;hashtags=admin,blog,domain+admins,hack,plugin,security,WordPress+MU,WordPress+Multi-User,WPMU&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://thekruser.com/files/2009/12/man-computer-question-mark.jpg" title="Now what do I do?"><img src="http://thekruser.com/files/2009/12/man-computer-question-mark-300x300.jpg" alt="Now what do I do?" title="Now what do I do?" width="300" height="300" class="alignleft size-medium wp-image-491" /></a>Admission: I am a tech-freak.  My idea of Christmas presents this year? WEB SITES FOR EVERYONE!  Now, I made this decision and just started purchasing domain names.  As an afterthought (I know&#8230;great time to think about it), it occurred to me that I am the only web-minded person in the family.  Great! Now everyone has a website that they are going to want help maintaining.  Great planning, kruser!  Then it hit me (again&#8230;my timing is impeccable), I have WordPress MU!  Problem solved.  But wait, there&#8217;s more.  One of the sites was for my niece, a rather web-centric person as well.  I wanted her to have full reign of her own domain instead of being bound to my themes and plugins.  I figured making her an Administrator of her domain would solve this issue.  NOPE!  Well, damn&#8230;back to square one!<br />
<b>NOTE:</b> If you are not well versed, or at least adventuresome with your hosting service and database management, just skip this article!<span id="more-469"></span></p>
<h4><u>The Situation</u></h4>
<p>I want to essentially create a role half way between Site Admin and Administrator.  Surprisingly, there is not a way to do this that I can find.  This role should include all menus and options except the &#8216;Users&#8217; and &#8216;Options&#8217; submenus of the &#8216;Site Admin&#8217; menu.  In my opinion, it would be simple to add this functionality to <a title="Toggle Admin Menus" href="http://wpmudev.org/project/Menus" target="_blank">Toggle Admin Menus</a>, but I am not a plugin-writer.  I just need to ensure that I have Site Admin rights to all domains I own, for legal reasons more than anything.  Not that my niece would be a concern, but in the future, when I have multiple domain admins, I want to be able to oversee all backend settings while still giving them the freedom to be an actual admin.  In my opinion, the administrator role defined in WPMU is weak.  Ok&#8230;enough about that.  For clarity, we will use &#8216;domain1.com&#8217; for the main site(s) and &#8216;domain2.com&#8217; for the site you are wanting to assign a different user table for.</p>
<p>I am basically only doing this so that my niece can have the ability to install/update her own plugins and themes which, as anyone with WordPress can attest, is arguably THE most important part of making a site your own.</p>
<h4><u>Step 1</u>. Install the plugin.</h4>
<p>As usual, I consulted my twitter friends for advice.  Answers varied from, &#8220;No idea, bro!&#8221; to &#8220;Just install WPMU on her domain&#8221; and everything in between.  Frustration.  Anger.  Fury.  When all of a sudden, a ray of hope.  <a href="http://twitter.com/wpmuguru" target="_blank" title="@wpmuguru's twitter page">@wpmuguru</a> (of <a href="http://wpmututorials.com/" target="_blank" title="WPMU Tutorials site">wpmututorials.com</a>) replied with a touch of sanity.  Out of left field comes a direction to go in&#8230;<a href="http://wpmututorials.com/simple-multi-site-plugin-e-book/" target="_blank" title="Purchase Simple Multi-Site Plugin">Simple Multi-Site Plugin</a>.  After some reading and emails, I decided to purchase the plugin (actually it is two plugins and two ebooks) and give it a shot.</p>
<p>The difference between <a href="http://wpmututorials.com/simple-multi-site-plugin-e-book/" target="_blank" title="Purchase Simple Multi-Site Plugin">Simple Multi-Site Plugin</a> and <a title="MU Multi-Site" href="http://wpmudev.org/project/Multi-Site-Manager" target="_blank">MU Multi-Site</a>, as I am told, is that <a href="http://wpmututorials.com/simple-multi-site-plugin-e-book/" target="_blank" title="Purchase Simple Multi-Site Plugin">Simple Multi-Site Plugin</a> actually creates new blogs for new domain registration whereas <a title="MU Multi-Site" href="http://wpmudev.org/project/Multi-Site-Manager" target="_blank">MU Multi-Site</a> only simulates it.  While this helped with some of the permissions separation issues, it did not completely solve my problem.</p>
<p>I exported all of my blogs on all of my domains and backed up my database.  I then deleted all of my blogs/domains and installed the new plugin, following the step-by-step instructions included in the ebook.  Next, I re-added all of my domains and imported my blogs.  I then logged in to domain2.com and created a Site Admin, expecting everything to have been worked out.  While most of my issues were now resolved, two remained.</p>
<h4><u>Problem One</u></h4>
<p>The Site Admin for domain2.com still had the ability to delete users from domain1.com.  Not acceptable.  I still had some work to do.  Again, I consulted  the master, <a href="http://twitter.com/wpmuguru" target="_blank" title="@wpmuguru's twitter page">@wpmuguru</a>.  Together, we found a solution (I say together&#8230;really it was just that he told me what to do!).  The issue is that when a user logs in to any of the domains on the WPMU installation, the same user tables are used: <code>wp_users</code> and <code>wp_usermeta</code>.  Now, while the next steps solve problem one, problem two still exists.</p>
<h4><u>NOTE:</u></h4>
<p> The following steps are only advised if you know what you are doing.  DO NOT PROCEDE if you do not.  Neither I, nor thekruser.com or any of its affiliates are responsible for any issues arising from performing the following steps.  You have been warned.</p>
<h4><u>Step 2</u>. Create copies of tables.</h4>
<p>Login to your hosting provider and navigate to phpMyAdmin.  Locate the <code>wp_users</code> and <code>wp_usermeta</code> tables.  You will need to create copies of these tables and name them <code>wp_X_users</code> and <code>wp_X_usermeta</code> where &#8220;X&#8221; is the site ID of the domain2.com.  You can get the site ID from the &#8216;Sites&#8217; submenu under the &#8216;Site Admin&#8217; menu.  Copies can be created in the &#8216;Operations&#8217; tab.  Be sure you select &#8216;Copy structure and data&#8217; when asked.  This will create a complete copy of the tables and all the users defined within it.  If you only copy the structure and not the data, you will not be able to login to domain2.com after completing step 3.</p>
<h4><u>Step 3</u>. Edit wp-config.php.</h4>
<p>Using the editor of your choice, open <code>wp-config.php</code> (located in the root folder of the WPMU installation) and add the following code directly following the opening notes where &#8220;X&#8221; is the same number as used above and &#8220;domain2.com&#8221; is the domain in question (minus the quotation marks, of course).  Make sure the domain name is surrounded by single quotes (&#8216;).</p>
<p style="text-align: left"><code>if( strpos($_SERVER['HTTP_HOST'], 'domain2.com') !== false ) { define('CUSTOM_USER_TABLE', 'wp_X_users'); define('CUSTOM_USER_META_TABLE', 'wp_X_usermeta'); }</code></p>
<p>If you do not insert the above code before any of the existing .php code, it will not work. Found that out the hard way!</p>
<h4><u>Step 4</u>. Test.</h4>
<p>I would not advise skipping this test. Login to domain1.com with the main Site Admin account and create a test user as an administrator.  Log out.  Delete browser history and cookies.  Login to domain2.com with the Site Admin account created in Step 1 and make sure the test user you just created <b>does not</b> appear.  If it does, verify that you have followed the above steps exactly and try it again.  <b>Do not proceed</b> to step 5 until a test user created on domain1.com does not appear on domain2.com&#8217;s user list in the &#8216;Site Admin&#8217; menu.</p>
<h4><u>Step 5</u>. Delete unneeded users.</h4>
<p>You will notice that users listed have all of the sites they have permissions for listed to the right.  By clicking on the links, it will take you the admin page of the specified domain, regardless of the Site Admin account used.  Security problem.  Delete all unneeded users (all except the main Site Admin account and the Site Admin account created in Step 1).  If everything is done correctly up to this point, none of the deletions will effect the user accounts of any of the other blogs. We should now have domain1.com and domain2.com created with separate Site Admins.</p>
<h4><u>Problem 2</u></h4>
<p>Although the above solves the problem of the &#8216;Users&#8217; menu issue, we still have the &#8216;Options&#8217; menu problem.  A Site Admin has the ability to delete all users except the &#8216;admin&#8217; account created at the time of the WPMU installation.  This is a feature of the <a href="http://wpmututorials.com/simple-multi-site-plugin-e-book/" target="_blank" title="Purchase Simple Multi-Site Plugin">Simple Multi-Site Plugin</a>.  This attempts to guarantee that the original Site Admin still has access to domain2.com through the &#8216;admin&#8217; account.  However, the password for the &#8216;admin&#8217; account can be changed in the &#8216;Users&#8217; submenu and by going into the &#8216;Options&#8217; submenu, any Site Admin can remove the accounts from the Site Admin list.  While all other domains are now secure, there is no way to completely ensure that the original Site Admin will continue to have unrestricted access to the backend.  The only thing the original Site Admin can do if their account is deleted from domain2.com, or if their password is changed locking them out, is delete the entire site.  Not a very good solution.</p>
<p>In conclusion, the above is more of a partial hack than a finite solution.  I would imagine that I am not the only person experiencing this problem.  If you have any info to add, or if my directions do seem clear enough, please leave a comment to help everyone.  If you have a solution that does not entail all the above, PLEASE let us all know!!  Thank you for reading.  I hope to hear from you.</p>
<p><a href="http://thekruser.com/2009/12/23/multiple-site-admin-permission-problem-in-wordpress-mu-kind-of/">Multiple Site Admin Permission Solution in WordPress MU&#8230;Kind Of</a> is a post from: <a href="http://thekruser.com">thekruser.com</a></p>

<p class="FacebookLikeButton"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fthekruser.com%2F2009%2F12%2F23%2Fmultiple-site-admin-permission-problem-in-wordpress-mu-kind-of%2F&amp;layout=standard&amp;show_faces=yes&amp;width=450&amp;action=like&amp;colorscheme=light&amp;locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height: 25px"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://thekruser.com/2009/12/23/multiple-site-admin-permission-problem-in-wordpress-mu-kind-of/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get WP-Slimbox2 to Autodetect Additional File Extensions</title>
		<link>http://thekruser.com/2009/11/27/get-wp-slimbox2-to-autodetect-additional-file-extensions/</link>
		<comments>http://thekruser.com/2009/11/27/get-wp-slimbox2-to-autodetect-additional-file-extensions/#comments</comments>
		<pubDate>Fri, 27 Nov 2009 21:33:05 +0000</pubDate>
		<dc:creator>thekruser</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[Walkthroughs and How-tos]]></category>
		<category><![CDATA[bmp]]></category>
		<category><![CDATA[file extensions]]></category>
		<category><![CDATA[gif]]></category>
		<category><![CDATA[hack]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[jpeg]]></category>
		<category><![CDATA[jpg]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[WordPress Info]]></category>
		<category><![CDATA[WP]]></category>
		<category><![CDATA[WP-Slimbox2]]></category>

		<guid isPermaLink="false">http://thekruser.com/?p=166</guid>
		<description><![CDATA[Those of us that use WP-Slimbox2 plugin by Transient Monkey have the simplest Lightbox/Slimbox integration yet. All we have to do is include an image link in the post, and WP-Slimbox2 does the rest.  There is only one problem with it: by default it only autodetects .jpg, .png, and .gif file extensions.  This is fine, if those are the only file extensions you use.  What if you have some .jpeg or .bmp files referenced?  It does not autdetect those extensions.  Luckily, there is a fix.<p><a href="http://thekruser.com/2009/11/27/get-wp-slimbox2-to-autodetect-additional-file-extensions/">Get WP-Slimbox2 to Autodetect Additional File Extensions</a> is a post from: <a href="http://thekruser.com">thekruser.com</a></p>
]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fthekruser.com%2F2009%2F11%2F27%2Fget-wp-slimbox2-to-autodetect-additional-file-extensions%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fthekruser.com%2F2009%2F11%2F27%2Fget-wp-slimbox2-to-autodetect-additional-file-extensions%2F&amp;source=thekruser&amp;style=normal&amp;service=bit.ly&amp;service_api=R_fff679fe85bdf2acf834de823561a677&amp;hashtags=bmp,file+extensions,gif,hack,image,jpeg,jpg,plugin,WordPress+Info,WP,WP-Slimbox2&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><a href="http://wordpress.org"><img class="size-full wp-image-171 alignleft" title="WordPress Logo" src="http://thekruser.com/files/2009/11/wordpress.png" alt="WordPress Logo" width="200" height="200" /></a></p>
<p>Those of us that use <a href="http://wordpress.org/extend/plugins/wp-slimbox2/" target="_blank">WP-Slimbox2 plugin</a> for <a href="http://wordpress.org/" target="_blank">WordPress</a> (by <a href="http://transientmonkey.com/wp-slimbox2" target="_blank">Transient Monkey</a>) have the simplest Lightbox/Slimbox integration yet. All we have to do is include an image link in the post, and WP-Slimbox2 does the rest.  There is only one problem with it: by default it only autodetects .jpg, .png, and .gif file extensions.  This is fine, if those are the only file extensions you use.  What if you have some .jpeg or .bmp files referenced?  It does not autodetect those extensions.  Luckily, there is a fix.<span id="more-166"></span></p>
<p>Open slimbox2_autoload.js.php in your favorite code editor.  It should be located in wp-content/plugins/wp-slimbox2/javascript folder of your <a href="http://wordpress.org/" target="_blank">WordPress</a> installation.  The following code should be located on line 35.</p>
<p><code>return /\.(jpg|png|gif)(\?[\d\w=&amp;amp;]*)?$/i.test(this.href);</code></p>
<p>Add the file extensions you would like WP-Slimbox2 to autodetect inside the parenthesis. Make sure you separate the file extensions with a <a href="http://en.wikipedia.org/wiki/Vertical_bar" target="_blank">pipe</a> (Shift+backslash key on most QWERTY keyboards), also called a vertical bar.  To add .jpeg and .bmp file extensions, your code should look like this:</p>
<p><code>return /\.(jpeg|bmp|jpg|png|gif)(\?[\d\w=&amp;amp;]*)?$/i.test(this.href);</code></p>
<p>Once you have made the necessary additions, be sure to save the file.  WP-Slimbox2 should now autodetect your additional file extensions.</p>
<p>Did this post help you?  Be sure to send it to your friends.  Did I get something wrong?  Please let me know by leaving a comment below.  I would love to hear from you.</p>
<p><a href="http://thekruser.com/2009/11/27/get-wp-slimbox2-to-autodetect-additional-file-extensions/">Get WP-Slimbox2 to Autodetect Additional File Extensions</a> is a post from: <a href="http://thekruser.com">thekruser.com</a></p>

<p class="FacebookLikeButton"><iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fthekruser.com%2F2009%2F11%2F27%2Fget-wp-slimbox2-to-autodetect-additional-file-extensions%2F&amp;layout=standard&amp;show_faces=yes&amp;width=450&amp;action=like&amp;colorscheme=light&amp;locale=en_US" scrolling="no" frameborder="0" allowTransparency="true" style="border:none; overflow:hidden; width:450px; height: 25px"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://thekruser.com/2009/11/27/get-wp-slimbox2-to-autodetect-additional-file-extensions/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Page Caching using disk: enhanced
Database Caching 4/26 queries in 0.485 seconds using disk: basic
Object Caching 680/716 objects using disk: basic

Served from: thekruser.com @ 2012-02-04 05:37:11 -->
