Commit a4cee3c3 authored by Kasalehlia's avatar Kasalehlia

Allow spaces in node names

parent 9a1ec83f
......@@ -6,7 +6,7 @@ import re
import subprocess
cgitb.enable()
NAME_PATTERN = '^[a-zA-Z0-9-_\.]+$'
NAME_PATTERN = '^[a-zA-Z0-9-_\. ]+$'
CODE_PATTERN = '^[a-zA-Z0-9]{64}$'
KEY_DIR='/home/kasalehlia/keys/'
......
......@@ -16,7 +16,7 @@ cgitb.enable()
KEY_DIR='/home/kasalehlia/keys/'
CONTACT_FILE='/home/kasalehlia/contacts.txt'
KEY_PATTERN = r'# ([a-zA-Z0-9-_\.]+) ?#? ?([\S ]+)?\r?\n([0-9a-f]{64})$';
KEY_PATTERN = r'# ([a-zA-Z0-9-_\. ]+) ?#? ?([\S ]+)?\r?\n([0-9a-f]{64})$';
#KEY_PATTERN = r'# ([\w.- ]+) ?#? ?([\S ]+)?\r?\n([0-9a-f]{64})$';
EMAIL_FROM = 'keys@freifunk-bs.de'
EMAIL_TO = 'ffbs-admin@stratum0.org'
......@@ -59,7 +59,7 @@ try:
f.write('{},{},{},{}\n'.format(time.time(),key,name,contact))
#s = smtplib.SMTP('localhost')
if 'NOMAIL' not in name:
msg = MIMEText(EMAIL_TEXT.format(name=name, key=key, code=code, quote=random.choice(QUOTES)[:-1]),'plain','utf-8')
msg = MIMEText(EMAIL_TEXT.format(name=name.replace(' ', '%20'), key=key, code=code, quote=random.choice(QUOTES)[:-1]),'plain','utf-8')
msg['From'] = EMAIL_FROM
msg['To'] = EMAIL_TO
msg['Subject'] = 'Key approval request for %s' % name
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment