Compare commits

...

1 Commits

Author SHA1 Message Date
Max Erenberg d621456ae4 replace domain and file paths 2021-07-05 02:00:51 +00:00
10 changed files with 39 additions and 27 deletions

View File

@ -9,7 +9,7 @@ class RemoteException(Exception):
return 'Error executing ceoc (%d)\n\n%s' % (self.status, self.stderr)
def run_remote(op, data):
ceoc = '%s/ceoc' % os.environ.get('CEO_LIB_DIR', '/usr/lib/ceod')
ceoc = '%s/ceoc' % os.environ.get('CEO_LIB_DIR', './src')
addmember = subprocess.Popen([ceoc, op], stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = addmember.communicate(data)
status = addmember.wait()

View File

@ -182,7 +182,7 @@ class PassPage(WizardPanel):
self.clear_password()
set_status("Passwords do not match")
return True
elif len(self.state['password']) < 5:
elif len(self.state['password']) < 4:
self.clear_password()
set_status("Password is too short")
return True
@ -216,12 +216,15 @@ class EndPage(WizardPanel):
problem = None
try:
if self.utype == 'member':
members.create_member(
try:
members.create_member(
self.state['userid'],
self.state['password'],
self.state['name'],
self.state['program'],
self.state['email'])
except Exception as err:
pass
members.register(self.state['userid'], self.state['terms'])
mailman_result = members.subscribe_to_mailing_list(self.state['userid'])
@ -229,13 +232,17 @@ class EndPage(WizardPanel):
problem = mailman_result
elif self.utype == 'clubuser':
members.create_member(
try:
members.create_member(
self.state['userid'],
self.state['password'],
self.state['name'],
self.state['program'],
self.state['email'],
club_rep=True)
except Exception as err:
with open('q', 'w') as f:
f.write(str(err) + "\n")
members.register_nonmember(self.state['userid'], self.state['terms'])
elif self.utype == 'club':
members.create_club(self.state['userid'], self.state['name'])
@ -257,6 +264,8 @@ class EndPage(WizardPanel):
self.midtext.set_text("The error was:\n\n%s\n\nThe account may be partially added "
"and you may or may not be able to log in. Or perhaps you are not office staff. "
"If this was not expected please contact systems committee." % problem)
# with open('q', 'w') as f:
# f.write(problem + "\n")
return
else:
set_status("Strombola Delivers")

View File

@ -4,8 +4,8 @@ import ceo.ldapi as ldapi
#Todo: kill ButtonText because no one uses it except one place and we can probably do that better anyway
csclub_uri = "ldap://ldap1.csclub.uwaterloo.ca/ ldap://ldap2.csclub.uwaterloo.ca"
csclub_base = "dc=csclub,dc=uwaterloo,dc=ca"
csclub_uri = "ldap://ldap1.csclub.internal"
csclub_base = "dc=csclub,dc=internal"
def make_menu(items):
items = [ urwid.AttrWrap( ButtonText( cb, data, txt ), 'menu', 'selected') for (txt, cb, data) in items ]
@ -88,7 +88,8 @@ class LdapWordEdit(WordEdit):
try:
self.ldap = ldap.initialize(uri)
self.ldap.simple_bind_s("", "")
except ldap.LDAPError:
except ldap.LDAPError as err:
raise Exception('%s %s %s %s\n%s' % (uri, base, attr, args, err))
return WordEdit.__init__(self, *args)
self.base = base
self.attr = ldapi.escape(attr)

View File

@ -23,18 +23,18 @@ admin_max_id = 19999
### LDAP Options ###
ldap_server_url = "ldaps://ldap-master.csclub.uwaterloo.ca"
ldap_users_base = "ou=People,dc=csclub,dc=uwaterloo,dc=ca"
ldap_groups_base = "ou=Group,dc=csclub,dc=uwaterloo,dc=ca"
ldap_sudo_base = "ou=SUDOers,dc=csclub,dc=uwaterloo,dc=ca"
ldap_server_url = "ldap://ldap-master.csclub.internal"
ldap_users_base = "ou=People,dc=csclub,dc=internal"
ldap_groups_base = "ou=Group,dc=csclub,dc=internal"
ldap_sudo_base = "ou=SUDOers,dc=csclub,dc=internal"
ldap_sasl_mech = "GSSAPI"
ldap_sasl_realm = "CSCLUB.UWATERLOO.CA"
ldap_admin_principal = "ceod/admin@CSCLUB.UWATERLOO.CA"
ldap_sasl_realm = "CSCLUB.INTERNAL"
ldap_admin_principal = "ceod/admin@CSCLUB.INTERNAL"
### Kerberos Options ###
krb5_realm = "CSCLUB.UWATERLOO.CA"
krb5_admin_principal = "ceod/admin@CSCLUB.UWATERLOO.CA"
krb5_realm = "CSCLUB.INTERNAL"
krb5_admin_principal = "ceod/admin@CSCLUB.INTERNAL"
### Spam ###

View File

@ -1,2 +1,2 @@
members_list = csc-general
list_domain = csclub.uwaterloo.ca
list_domain = csclub.internal

2
etc/mysql.cf Normal file
View File

@ -0,0 +1,2 @@
mysql_admin_username = ceod
mysql_admin_password = mysql

View File

@ -1 +1 @@
caffeine mysql mysql 0x03
coffee mysql mysql 0x03

View File

@ -8,8 +8,8 @@ tmp="$(tempfile)"
trap "rm $tmp" 0
exec >"$tmp"
echo "From: Computer Science Club <ceo+expired@csclub.uwaterloo.ca>"
echo "Reply-to: CSClub Exec <exec@csclub.uwaterloo.ca>"
echo "From: Computer Science Club <ceo+expired@csclub.internal>"
echo "Reply-to: CSClub Exec <exec@csclub.internal>"
echo "To: $name <$email>"
echo "Subject: [CSClub] Account Expiration"
echo ""
@ -47,4 +47,4 @@ Regards,
The Computer Science Club"
exec >&- 2>&-
/usr/sbin/sendmail -t -f "ceo@csclub.uwaterloo.ca" < "$tmp"
/usr/sbin/sendmail -t -f "ceo@csclub.internal" < "$tmp"

View File

@ -15,9 +15,9 @@ exec >"$tmp"
authrn="$(getent passwd "$auth" | awk -F: '{ print $5 }' | sed -e 's/,.*//')"
h_from="$prog <ceo+$prog@csclub.uwaterloo.ca>"
h_to="Membership and Accounts <ceo@csclub.uwaterloo.ca>"
h_cc="$authrn <$auth@csclub.uwaterloo.ca>"
h_from="$prog <ceo+$prog@csclub.internal>"
h_to="Membership and Accounts <ceo@csclub.internal>"
h_cc="$authrn <$auth@csclub.internal>"
if [[ "$prog" = addmember || "$prog" == addclubrep ]]; then
user="$CEO_USER" name="$CEO_NAME" dept="$CEO_DEPT" status="$CEO_STATUS"
@ -67,4 +67,4 @@ echo Your Friend,
echo "$prog"
exec >&2
env - /usr/sbin/sendmail -t -f "ceo@csclub.uwaterloo.ca" < "$tmp"
env - /usr/sbin/sendmail -t -f "ceo@csclub.internal" < "$tmp"

View File

@ -13,8 +13,8 @@ tmp="$(tempfile)"
trap "rm $tmp" 0
exec >"$tmp"
h_from="Computer Science Club <exec@csclub.uwaterloo.ca>"
h_to="$CEO_NAME <$CEO_USER@csclub.uwaterloo.ca>"
h_from="Computer Science Club <exec@csclub.internal>"
h_to="$CEO_NAME <$CEO_USER@csclub.internal>"
subj="Welcome to the Computer Science Club"
if test "$prog" = addmember; then
@ -84,4 +84,4 @@ echo
echo "$body" | fmt -s
exec >&2
env - /usr/sbin/sendmail -t -f "exec@csclub.uwaterloo.ca" < "$tmp"
env - /usr/sbin/sendmail -t -f "exec@csclub.internal" < "$tmp"