<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.bytemycode.com/rssformat.xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>byteMyCode: Snippet Revisions</title>
		<link>http://www.bytemycode.com</link>
		<description>Revisions for this snippet.</description>
		<pubDate>Fri, 29 Aug 2008 02:48:19 +0000</pubDate>
		<copyright>1998-2008 </copyright>
		<language>en-us</language>
		<image>
		      <link>http://www.bytemycode.com</link>
		      <url>http://www.bytemycode.com/img/rss_title.gif</url>
		      <title>byteMyCode</title>
		</image>

	
	<item>
		<title>PHP/MySQL Authentication Scheme 1</title>
		<link>http://www.bytemycode.com/snippets/snippet/525/1/</link>
		<comments>http://www.bytemycode.com/snippets/snippet/525/comments/</comments>
		<pubDate>Tue, 07 Nov 2006 11:06:35 +0000</pubDate>
		<dc:creator>kahotep</dc:creator>
		<category>mysql, PHP</category>
		<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/525/</guid>
		<description>
			<![CDATA[
				<p>This class is a simple authentication scheme which makes it easy to add authentication to any page by including one class and adding one table to your MySQL database.<br /><br />The following functions are employed by this authentication class:<br /><br /><b>auth()</b><br /><blockquote>this is the default constructor; it automatically checks for the POST vars "username" and "password", it also checks to see if the user passed the GET variable "logout", which would prompt it to set the authentication status to un-authenticated.</blockquote><br /><b>is_authorized()</b><br /><blockquote>Checks the SESSION variable "authorized" and returns true or false depending on that variable.</blockquote><br /><b>mysql_bind()</b><br /><blockquote>This is automatically called by the constructor each time the class is instantiated and $_POST['username'] and $_POST['password'] are present.  It queries the db for a valid username and MD5 encoded password. </blockquote><br /><b>user_create($username,$email,$password) </b><br /><blockquote>Creates a user, if the username is available, and creates an MD5 hash based on username, password and date, to be used in the "activation" of the account.</blockquote><br /><b>user_activation_message($username)</b><br /><blockquote>Sends the custom activation message to the email address for the username specified</blockquote><br /><b>user_activation($activation_hash)</b><br /><blockquote>Checks to see if the activation hash is valid, if it is, the activation_hash variable is set to NULL, thus signifying that the account is active.</blockquote><br /><b>user_password_change($username,$password_old,$password_new)</b><br /><blockquote>Quick and easy way to change the user's password with one function call.</blockquote> <br /><b>user_logout()</b><br /><blockquote>Sets the authorization status in $_SESSION['authorized'] to FALSE</blockquote><br /><b>is_username_available( $username )</b><br /><blockquote>Returns TRUE or FALSE depending on whether or not the username is free.</blockquote></p>
			]]>
		</description>
	</item>

	
	</channel>
</rss>