Reg:Warning Msg added, MyAccount: delete,download in progess. Css: common css moved...
authorYasin <mohammed-yasin.rahman@lip6.fr>
Thu, 19 Sep 2013 12:30:30 +0000 (14:30 +0200)
committerYasin <mohammed-yasin.rahman@lip6.fr>
Thu, 19 Sep 2013 12:30:30 +0000 (14:30 +0200)
portal/accountview.py
portal/static/css/account_view_html.css
portal/static/css/onelab.css
portal/templates/account-view.html
portal/templates/registration_view.html

index 5671b51..35b5209 100644 (file)
@@ -132,16 +132,15 @@ def account_process(request):
         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']
@@ -155,12 +154,12 @@ def account_process(request):
             #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)
index dd77998..cd6e478 100644 (file)
@@ -146,14 +146,6 @@ code {
 
 /***** Notifications *****/
 
-.warning {
-       border: 1px solid red;
-       margin: 20px 60px;
-       padding: 10px 20px;
-       color: red;
-       background-color: #f2dbdb;
-       text-align: center;
-}
 .warning2 {
        border: 1px solid red;
        margin: 20px 60px;
index 70418c0..b11396c 100644 (file)
@@ -14,3 +14,13 @@ div.onelab-title{
     background-color: #e0f0f0;
 }
 
+/***** Notifications *****/
+.warning {
+    border: 1px solid red;
+    margin: 20px 60px;
+    padding: 10px 20px;
+    color: red;
+    background-color: #f2dbdb;
+    text-align: center;
+}
+
index 4e97f9d..346c41f 100644 (file)
@@ -1,6 +1,7 @@
 {% 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>
index 7e1c1d7..2589961 100644 (file)
@@ -1,6 +1,6 @@
 {% 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"/>