visibility: hidden;
position: absolute;
}
+
+.loading {
+ background-color:white;
+ color:black;
+ position:fixed;
+ top:160px;
+ left:50%;
+ width:30%;
+ margin: 0 0 0 -15%;
+ padding:25px 50px;
+ box-shadow: 4px 4px 5px #888;
+ border:1pt solid #30196D;
+ display:none;
+ z-index:100;
+}
// use spin() to get our default spin settings (called presets)
// use spin(true) to get spin's builtin defaults
// you can also call spin_presets() yourself and tweak what you need to, like topmenuvalidation does
- spin: function (presets) {
- var presets = ( presets === undefined ) ? spin_presets() : presets;
- try { this.$element.spin(presets); }
- catch (err) { messages.debug("Cannot turn on spin " + err); }
+ spin: function (message) {
+ if (!message) {
+ message = 'Please be patient, this can take a few seconds.';
+ }
+ $('div.loading').fadeIn('fast');
+ $('div.loading').find('.message').text(message);
+
},
unspin: function() {
- try { this.$element.spin(false); }
- catch (err) { messages.debug("Cannot turn off spin " + err); }
+ $('div.loading').fadeOut('fast');
+
},
/* TEMPLATE */
</a>
</div>
+<style>
+a.sl-platform {
+ text-transform: uppercase;
+}
+
+</style>
+
</div>
return HttpResponseRedirect("/portal/account/")
# XXX TODO: Factorize with portal/registrationview.py
+# XXX TODO: Factorize with portal/registrationview.py
+# XXX TODO: Factorize with portal/joinview.py
elif 'generate' in request.POST:
for account_detail in account_details:
# XXX tmp sfa dependency
from sfa.util.xrn import Xrn
urn = Xrn(hrn, request['type']).get_urn()
-
+
+ # Only hrn is required for Manifold Query
sfa_authority_params = {
- 'hrn' : hrn,
- 'urn' : urn,
- 'type' : request['type'],
+ 'authority_hrn' : hrn,
+ #'authority_urn' : urn,
+ #'type' : request['type'],
#'pi' : None,
- 'enabled' : True
+ #'enabled' : True
}
print "ADD Authority"
sfa_add_authority(wsgi_request, sfa_authority_params)
# Add User to Slice if we have the user_hrn in pendingslice table
user_hrn = request.get('user_hrn', None)
user_hrns = list([user_hrn]) if user_hrn else list()
+
+ user_email = request.get
# XXX We should create a slice with Manifold terminology
slice_params = {
results = execute_query(wsgi_request, query)
if not results:
raise Exception, "Could not create %s. Already exists ?" % slice_params['hrn']
+ ## We do not store the email in pendingslice table. As a result receiver's email is unknown ##
+ ## Need modification in pendingslice table ###
+ #else:
+ # subject = 'Slice created'
+ # msg = 'A manager of your institution has validated your slice request. You can now add resources to the slice and start experimenting.'
+ # send_mail(subject, msg, 'support@onelab.eu',['yasin.upmc@gmail.com'], fail_silently=False)
+
return results
def create_pending_slice(wsgi_request, request, email):
results = execute_query(wsgi_request, query)
if not results:
raise Exception, "Could not create %s. Already exists ?" % sfa_user_params['user_hrn']
+ else:
+ subject = 'User validated'
+ msg = 'A manager of your institution has validated your account. You have now full user access to the portal.'
+ send_mail(subject, msg, 'support@onelab.eu',[request['email']], fail_silently=False)
return results
def ldap_create_user(wsgi_request, request, user_detail):
#prepare user_hrn
split_email = reg_email.split("@")[0]
split_email = split_email.replace(".", "_")
+ # Replace + by _ => more convenient for testing and validate with a real email
+ split_email = split_email.replace("+", "_")
user_hrn = reg_auth + '.' + split_email
UserModel = get_user_model()
errors.append('Email already registered in Manifold. Please provide a new email address.')
# XXX TODO: Factorize with portal/accountview.py
+# XXX TODO: Factorize with portal/registrationview.py
+# XXX TODO: Factorize with portal/joinview.py
# if 'generate' in request.POST['question']:
from Crypto.PublicKey import RSA
private = RSA.generate(1024)
- private_key = json.dumps(private.exportKey())
- public = private.publickey()
- public_key = json.dumps(public.exportKey(format='OpenSSH'))
-
+ private_key = private.exportKey()
+ public_key = private.publickey().exportKey(format='OpenSSH')
# Saving to DB
- account_config = '{"user_public_key":'+ public_key + ', "user_private_key":'+ private_key + ', "user_hrn":"'+ user_hrn + '"}'
auth_type = 'managed'
- public_key = public_key.replace('"', '');
- private_key = private_key.replace('"', '');
if not errors:
reg_password = request.POST['pi_password']
split_email = user_request['email'].split("@")[0]
split_email = split_email.replace(".", "_")
+ # Replace + by _ => more convenient for testing and validate with a real email
+ split_email = split_email.replace("+", "_")
+
split_authority = user_request['authority_hrn'].split(".")[1]
username = split_email + '@' + split_authority
split_authority = user_request['authority_hrn'].split(".")[0]
+ '.' + split_email + str(randint(1,1000000))
# XXX TODO: Factorize with portal/accountview.py
+ # XXX TODO: Factorize with portal/registrationview.py
+ # XXX TODO: Factorize with portal/joinview.py
if 'generate' in wsgi_request.POST['question']:
user_request['auth_type'] = 'managed'
purpose=''
exp_url=''
authority_hrn = None
+ authority_name = None
# Retrieve the list of authorities
authorities_query = Query.get('authority').select('name', 'authority_hrn')
authorities = execute_admin_query(wsgi_request, authorities_query)
if authority['authority_hrn'] == user_authority:
authority_name = authority['name']
+ # Handle the case when we use only hrn and not name
+ if authority_name is None:
+ authority_name = user_authority
#
account_query = Query().get('local:account').select('user_id','platform_id','auth_type','config')
account_details = execute_query(wsgi_request, account_query)
if authority['name'] == wsgi_request.POST.get('org_name', ''):
authority_hrn = authority['authority_hrn']
- # Handle the case when the template uses only hrn and not name
+ # Handle the case when we use only hrn and not name
if authority_hrn is None:
authority_hrn = wsgi_request.POST.get('org_name', '')
a, a:active, a:focus {
outline: 0;
text-decoration:none;
+ color:#201E62;
}
h1 {
margin-right:10px;
}
h2 {
+ margin:0 0 15px 0;
font-size:14pt;
color:#333333;
}
h3 {
+ margin:0 0 5px 0;
font-size:13pt;
color:#201E62;
}
+h4 {
+ margin:0 0 5px 0;
+ font-size:12pt;
+ color:#333333;
+}
input[type=text], input[type=password], input[type=email], input[type=tel], input[type=number], select, option {
min-width:260px;
padding:6px;
color:gray;
font-size:10pt;
}
+.tab-pane {
+ padding-top:15px;
+}
/* buttons */
button.btn, input.btn {
padding:6px 10px;
{% block base_content %}
{% endblock %}
{% endblock container %}
+<div class="loading">
+ <div class="row">
+ <div class="col-xs-11">Loading...</div>
+ <div class="col-xs-1"><img src="{{ STATIC_URL }}/img/loading.gif" /></div>
+ </div>
+ <div class="row">
+ <div class="col-xs-12 message"></div>
+ </div>
+</div>
</body>
</html>