private_key = k.as_pem()
private_key = ''.join(private_key.split())
public_key = "ssh-rsa " + public_key
- print "testing"
# Saving to DB
keypair = '{"user_public_key":"'+ public_key + '", "user_private_key":"'+ private_key + '"}'
# keypair = re.sub("\r", "", keypair)
# keypair = re.sub("\n", "\\n", keypair)
# #keypair = keypair.rstrip('\r\n')
# keypair = ''.join(keypair.split())
- user_params = { 'config': keypair}
+ user_params = { 'config': keypair, 'auth_type':'managed'}
manifold_update_account(request,user_params)
- return HttpResponse('Success: New Keypair Generated! %s' % keypair)
+ return HttpResponse('Success: New Keypair Generated!')
elif 'upload_key' in request.POST:
up_file = request.FILES['pubkey']
#file_content = re.sub("\n", "\\n",file_content)
file_content = ''.join(file_content.split())
# update manifold account table
- user_params = { 'config': file_content}
+ user_params = { 'config': file_content, 'auth_type':'user'}
manifold_update_account(request,user_params)
- return HttpResponse('Success: Publickey uploaded! Old records overwritten')
+ return HttpResponse('Success: Publickey uploaded! Please delegate your credentials using SFA: http://trac.myslice.info/wiki/DelegatingCredentials')
else:
return HttpResponse('Please upload a valid RSA public key [.txt or .pub].')
else:
- message = 'You submitted an empty form.'
+ message = 'Under Construction.'
return HttpResponse(message)
{% extends "layout-unfold1.html" %}
{% block head %}
+<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/onelab.css"/>
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/account_view_html.css" />
<script type="text/javascript" src="{{STATIC_URL}}/jquery.validate.js"></script>
<script type="text/javascript" src="{{STATIC_URL}}/my_account.edit_profile.js"></script>
{% extends "layout-unfold1.html" %}
-{% block head %}
+{% block head %}
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/onelab.css" />
<!-- xxx ideally only onelab.css but ... xxx -->
<link rel="stylesheet" type="text/css" href="{{STATIC_URL}}/css/registration.css" />
<p class="hint">Retype the password</p>
</div>
<div class="field">
- <label for="question">My Public Key</label>
+ <label for="question">My Keys</label>
<select name="question" class="required" id="question">
<option value="generate">Generate key pairs for me </option>
<option value="upload">Upload my public key </option>
- </select>
+ </select>
+ <p class="hint">Account Delegation: Automatic (Recommended)</p>
<?php echo $errFile; ?>
</div>
<div class="field" style="display:none;" id="upload_key">
<label for="file">Upload public key</label>
<input type="file" name="user_public_key" class="required" id="user_public_key"/>
- <p class="hint">Upload a valid public key</p>
+ <p class="hint">Account Delegation: Manual (Advanced Users)</p>
+ <p class="warning" id="pkey_del_msg">Once your account is validated, you have to delegate your credentials manually using SFA [Advanced users only]</p>
+
</div>
<div class="field" id="register">
<input class="submit btn" type="submit" name="submit" value="Register"/>