<?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>Evolution Systems &#187; codeigniter</title>
	<atom:link href="http://evolution-systems.co.uk/category/matts-blog/web-development/php/codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://evolution-systems.co.uk</link>
	<description>Web Development, Software Development and Linux Consultancy services</description>
	<lastBuildDate>Fri, 08 Aug 2025 09:18:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Codeigniter REST server with Tank auth</title>
		<link>http://evolution-systems.co.uk/2014/04/18/codeigniter-rest-server-with-tank-auth/</link>
		<comments>http://evolution-systems.co.uk/2014/04/18/codeigniter-rest-server-with-tank-auth/#comments</comments>
		<pubDate>Fri, 18 Apr 2014 10:36:07 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/?p=736</guid>
		<description><![CDATA[I&#8217;ve just had the need within codeigniter to integrate basic auth in Phil Sturgeons REST server with the tank auth authentication library. As it turns out it is quite a trivial task. In application/libraries/REST_Controller.php find the following function: And replace it with the following: If you are not auto loading the tank auth library, be sure [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve just had the need within codeigniter to integrate basic auth in <a href="https://github.com/philsturgeon/codeigniter-restserver">Phil Sturgeons REST server</a> with the <a href="http://konyukhov.com/soft/tank_auth/">tank auth authentication library</a>. As it turns out it is quite a trivial task.</p>
<p>In application/libraries/REST_Controller.php find the following function:</p>
<pre class="brush: php; title: ; notranslate">protected function _check_login($username = '', $password = NULL)&lt;/pre&gt;
 {
 if (empty($username))
 {
 return FALSE;
 }

 $auth_source = strtolower($this-&gt;config-&gt;item('auth_source'));

if ($auth_source == 'ldap')
 {
 log_message('debug', 'performing LDAP authentication for $username');
 return $this-&gt;_perform_ldap_auth($username, $password);
 }

$valid_logins = &amp; $this-&gt;config-&gt;item('rest_valid_logins');

if ( ! array_key_exists($username, $valid_logins))
 {
 return FALSE;
 }

// If actually NULL (not empty string) then do not check it
 if ($password !== NULL AND $valid_logins[$username] != $password)
 {
 return FALSE;
 }
 return TRUE;
 }</pre>
<p>And replace it with the following:</p>
<pre class="brush: php; title: ; notranslate">protected function _check_login($username = '', $password = NULL)&lt;/pre&gt;
{
 if (empty($username))
 {
 return FALSE;
 }
 return $this-&gt;tank_auth-&gt;login($username, $password, FALSE, FALSE, TRUE);
 }</pre>
<p>If you are not auto loading the tank auth library, be sure to do that in your constructor as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2014/04/18/codeigniter-rest-server-with-tank-auth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
