Permalink
Browse files

Prettied up user profile page.

  • Loading branch information...
labisso committed Mar 16, 2010
1 parent f886738 commit 85345c5039f18236d9cf2df9d29074c1fbc43f63
@@ -105,16 +105,16 @@ def profile(request):
cert_present = True
if up.certkey:
key_present = True
- if up.query_id or up.query_secret:
+ if up.query_id and up.query_secret:
query_present = True
templateparams = {'message': message,
'user': user,
'cert_present': cert_present,
'key_present': key_present,
- 'query_present': query_present,
- 'query_id': up.query_id,
- 'query_secret': up.query_secret
+ 'access_present': query_present,
+ 'access_key': up.query_id,
+ 'access_secret': up.query_secret
}
return render_to_response('nimbus/profile.html', templateparams)
@@ -238,3 +238,32 @@ p.details {
color:#8f8f8f;
font-size:75%;
}
+
+div#credentials_container {
+ width: 600px;
+}
+
+div.credentials_box {
+ border:1px solid #ccc;
+ margin-bottom: 15px;
+ padding-bottom: 10px;
+
+}
+
+div.credentials_box h4 {
+ margin: 0;
+ padding-left: 4px;
+ background: #eee;
+}
+
+div.credentials_box div.lrow {
+ margin-left: 1em;
+}
+
+.copybox{
+ padding:3px 5px 2px 5px;
+ height:18px;
+ border:1px solid #ccc;
+ font-family:Monaco,"Courier New","DejaVu Sans Mono","Bitstream Vera Sans Mono",monospace;
+ color:#333333;
+}
@@ -30,34 +30,82 @@ <h3>Your account</h3>
<h3>Your credentials</h3>
{% if cert_present or key_present or query_present %}
- <div class="profile">
- {% if cert_present %}
- <div class="lrow">
- <span class="flabel">Certificate:</span>
- <span class="finput"><a href="usercert.pem">retrieve</a></span>
+ <div id="credentials_container">
+ <div class="credentials_box">
+ <h4>X.509 certificate</h4>
+ {% if key_present or cert_present %}
+ <p>
+ X.509 credentials are used with the cloud-client. They have
+ two components: a public certificate and a private key.
+ </p>
+
+ <div class="lrow">
+ <span class="flabel">Certificate</span>
+ {% if cert_present %}
+ <a href="usercert.pem">usercert.pem</a>
+ {% else %}
+ (not available)
+ {% endif %}
+ </div>
+ <div class="lrow">
+ <span class="flabel">Private key</span>
+ {% if key_present %}
+ <a href="userkey.pem">userkey.pem</a>
+ {% else %}
+ (not available)
+ {% endif %}
+ </div>
+
+ <p><strong>
+ For your protection, the private key can only be downloaded once.
+ </strong></p>
+ {% if not key_present %}
+ <p>
+ You do not have a private key available. Most likely, it has already
+ been downloaded. If you did not download it or if you lost it, please
+ contact the administrator immediately.
+ </p>
+ {% else %}
+
+ <p>Instructions</p>
+ <ol>
+ <li>Download these files and place them into
+ <samp>~/.globus/</samp>, in your home directory. You may need
+ to create this directory.
+ </li>
+ <li>
+ Ensure that the private key is not world-readable:
+ <div><samp>chmod 600 ~/.globus/userkey.pem</samp></div>
+ </li>
+ <li>Follow the
+ <a href="http://www.nimbusproject.org/docs/?doc=current/clouds/cloudquickstart.html">
+ cloud client quickstart</a>.</li>
+ </ol>
+ {% endif %}
+
+
+ {% else %}
+ <p>You have no X.509 credentials on file.</p>
+ {% endif %}
</div>
- {% endif %}
- {% if key_present %}
- <div class="lrow">
- <span class="flabel">Key file:</span>
- <span class="finput"><a href="userkey.pem">retrieve</a> </span>
- </div>
- <br>
- <p>
- <b>Warning</b>: The key file download only works once! They key will be deleted when you download it.
- </p>
- <p>
- <b>Warning</b>: The key file will not work without running "chmod 0600" on it after you download.
- </p>
- {% endif %}
- {% if query_present %}
- <div class="lrow">
- <span class="flabel">Query ID:</span>
- <span class="finput">{{ query_id }}</span>
- <span class="flabel">Secret:</span>
- <span class="finput">{{ query_secret }}</span>
+ {% if access_present %}
+ <div class="credentials_box">
+ <h4>Access token</h4>
+ <p>
+ Access tokens are used for the Nimbus EC2 Query API interface.
+ For information on using these tokens, check the
+ <a href="http://www.nimbusproject.org/docs/?doc=current/elclients.html#boto">documentation</a>.
+ </p>
+ <div class="lrow" id="accesskey">
+ <span class="flabel">Key</span>
+ <span class="copybox">{{ access_key }}</span>
+ </div>
+ <div class="lrow" id="accesssecret">
+ <span class="flabel">Secret</span>
+ <span class="copybox">{{ access_secret }}</span>
+ </div>
</div>
{% endif %}

0 comments on commit 85345c5

Please sign in to comment.