Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
flowspy
Commits
2b16c157
Commit
2b16c157
authored
Feb 03, 2013
by
Leonidas Poulopoulos
Browse files
Minor change in the user activation procedure
parent
3d22b4e6
Changes
3
Hide whitespace changes
Inline
Side-by-side
flowspec/views.py
View file @
2b16c157
...
...
@@ -374,9 +374,14 @@ def user_login(request):
def
user_activation_notify
(
user
):
current_site
=
Site
.
objects
.
get_current
()
peer
=
user
.
get_profile
().
peer
# Email subject *must not* contain newlines
# TechCs will be notified about new users.
# Platform admins will activate the users.
subject
=
render_to_string
(
'registration/activation_email_subject.txt'
,
{
'site'
:
current_site
})
# Email subject *must not* contain newlines
subject
=
''
.
join
(
subject
.
splitlines
())
registration_profile
=
RegistrationProfile
.
objects
.
create_profile
(
user
)
message
=
render_to_string
(
'registration/activation_email.txt'
,
...
...
@@ -384,6 +389,20 @@ def user_activation_notify(user):
'expiration_days'
:
settings
.
ACCOUNT_ACTIVATION_DAYS
,
'site'
:
current_site
,
'user'
:
user
})
if
settings
.
NOTIFY_ADMIN_MAILS
:
admin_mails
=
settings
.
NOTIFY_ADMIN_MAILS
send_new_mail
(
settings
.
EMAIL_SUBJECT_PREFIX
+
subject
,
message
,
settings
.
SERVER_EMAIL
,
admin_mails
,
[])
# Mail to domain techCs plus platform admins (no activation hash sent)
subject
=
render_to_string
(
'registration/activation_email_peer_notify_subject.txt'
,
{
'site'
:
current_site
,
'peer'
:
peer
})
subject
=
''
.
join
(
subject
.
splitlines
())
message
=
render_to_string
(
'registration/activation_email_peer_notify.txt'
,
{
'user'
:
user
,
'peer'
:
peer
})
send_new_mail
(
settings
.
EMAIL_SUBJECT_PREFIX
+
subject
,
message
,
settings
.
SERVER_EMAIL
,
get_peer_techc_mails
(
user
),
[])
...
...
@@ -495,7 +514,6 @@ def get_peer_techc_mails(user):
techmails_list
.
append
(
techmail
.
email
)
if
settings
.
NOTIFY_ADMIN_MAILS
:
additional_mail
=
settings
.
NOTIFY_ADMIN_MAILS
# mail.extend(user_mail)
mail
.
extend
(
additional_mail
)
mail
.
extend
(
techmails_list
)
return
mail
...
...
templates/registration/activation_email_peer_notify.txt
0 → 100644
View file @
2b16c157
Ο/H {{ user.get_full_name }} έκανε αίτηση για νεό λογαριασμό στην υπηρεσία Firewall On Demand
εκ μέρους του ιδρύματος/φορέα: {{peer}}.
Όνομα χρήστη: {{ user.username }}
E-mail: {{ user.email }}
Ο χρήστης θα ενημερωθεί για την ενεργοποίηση του λογαριασμού του μέσω e-mail.
Σε περίπτωση που ο χρήστης δεν ανήκει στο ίδρυμα/φορέα σας ή χρησιμοποιεί την υπηρεσία ενάντια στον
εσωτερικό σας κανονισμό παρακαλούμε επικοινωνήστε άμεσα μαζί μας.
-----------------------------------------------------------------------------
{{ user.get_full_name }} has registered for a new Firewall on Demand account on behalf of your
institution: {{peer}}.
Username: {{user.username}}
E-mail: {{user.email}}
The user will be notified via mail about the account activation
In case this user does not belong to your institution or attempts to use the service without being
compliant to your instututions' regulation please contact us.
templates/registration/activation_email_peer_notify_subject.txt
0 → 100644
View file @
2b16c157
GRNET Firewall on Demand new account registration at {{ site.name }} on behalf of {{peer}}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment