Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
accountmanager
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sucs
accountmanager
Commits
ee9a2a62
Commit
ee9a2a62
authored
6 years ago
by
Imran Hussain
Browse files
Options
Downloads
Patches
Plain Diff
Add some colour :)
parent
34b23bc4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sucsam.py
+9
-4
9 additions, 4 deletions
sucsam.py
with
9 additions
and
4 deletions
sucsam.py
+
9
−
4
View file @
ee9a2a62
...
...
@@ -10,6 +10,7 @@ import codecs
import
smtplib
from
email.mime.multipart
import
MIMEMultipart
from
email.mime.text
import
MIMEText
import
ldap
def
correctPaidUntilStr
():
#same logic as suapi stuff
...
...
@@ -220,8 +221,12 @@ def deleteMenu(deleteArray):
deleteArray
.
remove
(
user
)
print
(
str
(
user
)
+
"
won
'
t be deleted.
"
)
else
:
deleteArray
.
append
(
user
)
print
(
str
(
user
)
+
"
will be deleted.
"
)
try
:
pwd
.
getpwnam
(
user
)
deleteArray
.
append
(
user
)
print
(
str
(
user
)
+
"
will be deleted.
"
)
except
KeyError
:
print
(
"
\x1b
[1;31mInvalid user.
\x1b
[0m
"
)
deleteMenu
(
deleteArray
)
elif
(
option
==
"
3
"
):
for
student
in
studentsBad
:
...
...
@@ -256,7 +261,7 @@ def deleteAccounts():
### MAIN ###
if
(
os
.
geteuid
()
==
0
):
print
(
"
Don
'
t run this as root!
"
)
print
(
"
\x1b
[1;31m
Don
'
t run this as root!
\x1b
[0m
"
)
sys
.
exit
(
1
)
# get some date/time info ready
...
...
@@ -297,5 +302,5 @@ hons = cur.fetchall()
cur
.
close
()
print
(
"
Welcome to the SUCS Account Manager!
"
)
print
(
"
\x1b
[33m
Welcome to the SUCS Account Manager!
\x1b
[0m
"
)
mainMenu
()
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment