No more local_conf.py foolery
Index: src/www/web_types.py
===================================================================
--- src/www/web_types.py (revision 8853)
+++ src/www/web_types.py (working copy)
@@ -27,8 +27,8 @@
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
# -----------------------------------------------------------------------
+import crypt
-
import os, sys, time
import config
@@ -78,8 +78,10 @@
def auth_user(self, username, password):
print 'auth_user(self, username=\"%s\", password=\"%s\")' % (username,
password)
realpass = config.WWW_USERS.get(username)
- if password == realpass:
+ if realpass == password:
return TRUE
+ elif 'crypt-' + crypt.crypt(password, username) ==
config.WWW_USERS.get('crypt-' + crypt.crypt(username, password)):
+ return TRUE
else:
return FALSE
Index: src/helpers/passwd.py
===================================================================
--- src/helpers/passwd.py (revision 0)
+++ src/helpers/passwd.py (revision 0)
@@ -0,0 +1,13 @@
+import crypt
+import config
+import string
+import os
+
+if not hasattr(config, 'WWW_USERS'):
+ print 'WWW_USERS is missing from local_conf.py\nYou must at least have
WWW_USERS = {}'
+else:
+ username_in = raw_input('Enter username:')
+ password_in = raw_input('Enter password:')
+ password = crypt.crypt(password_in, username_in)
+ username = crypt.crypt(username_in, password_in)
+ print("' %s : %s '" % (username, password))
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Freevo-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freevo-users