Create method for authentication.

If username and password are set in the configuration file then it will
create the authentication configuration for the web server.  The password
is stored in plain text on the server.  When the string is sent back to
the server it is encrypted as md5.

diff --git a/strmr/webserv.py b/strmr/webserv.py
index 651b0e6..6b35259 100644
--- a/strmr/webserv.py
+++ b/strmr/webserv.py
@@ -22,7 +22,7 @@ def startserv(config):
 	# merge the app configuration file with the dictionary one that
 	# was created
 	app.merge(conf)
-
+	cherrypy.config.update(checkusers(config))
 	# create the configuration for the web server
 	cherrypy.config.update(conf)
 	cherrypy.config.update('data/cherrypy.config')
@@ -35,4 +35,15 @@ def startserv(config):
 		cherrypy.engine.console_control_handler.subscribe()
 	cherrypy.engine.start()
 	cherrypy.engine.block()
-	#cherrypy.quickstart(root=app, config='data/cherrypy.config')
\ No newline at end of file
+	#cherrypy.quickstart(root=app, config='data/cherrypy.config')
+
+def checkusers(config):
+	auth = {}
+	if(config.username and config.password):
+		users = {config.username:config.password}
+		checkpassword = cherrypy.lib.auth_basic.checkpassword_dict(users)
+		auth = {'tools.auth_basic.on': True,
+				'tools.auth_basic.realm':"STRMR",
+				'tools.auth_basic.checkpassword': checkpassword
+				}
+	return(auth)
\ No newline at end of file