From: Yasin <mohammed-yasin.rahman@lip6.fr> Date: Thu, 18 Sep 2014 14:30:44 +0000 (+0200) Subject: NoCreds: Warning Msg visible in Dashboard X-Git-Tag: myslice-1.2~1^2~27 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=111cef56b76272a20082a32bb0e02d04700f0267;p=unfold.git NoCreds: Warning Msg visible in Dashboard --- diff --git a/portal/homeview.py b/portal/homeview.py index 7af47760..35037876 100644 --- a/portal/homeview.py +++ b/portal/homeview.py @@ -80,13 +80,22 @@ class HomeView (FreeAccessView, ThemeView): account_config = json.loads(account_detail['config']) if 'myslice' in platform_detail['platform']: acc_auth_cred = account_config.get('delegated_authority_credentials','N/A') + acc_user_cred = account_config.get('delegated_user_credential','N/A') # assigning values if acc_auth_cred=={} or acc_auth_cred=='N/A': pi = "is_not_pi" else: pi = "is_pi" - env['pi'] = pi + # check if the user has creds or not + if acc_user_cred == {} or acc_user_cred == 'N/A': + user_cred = 'no_creds' + else: + user_cred = 'has_creds' + + + env['pi'] = pi + env['user_cred'] = user_cred else: env['person'] = None return render_to_response(self.template,env, context_instance=RequestContext(request)) @@ -123,13 +132,22 @@ class HomeView (FreeAccessView, ThemeView): account_config = json.loads(account_detail['config']) if 'myslice' in platform_detail['platform']: acc_auth_cred = account_config.get('delegated_authority_credentials','N/A') + acc_user_cred = account_config.get('delegated_user_credential','N/A') # assigning values if acc_auth_cred=={} or acc_auth_cred=='N/A': pi = "is_not_pi" else: pi = "is_pi" - env['pi'] = pi + # check if the user has creds or not + if acc_user_cred == {} or acc_user_cred == 'N/A': + user_cred = 'no_creds' + else: + user_cred = 'has_creds' + + + env['pi'] = pi + env['user_cred'] = user_cred env['person'] = self.request.user else: env['person'] = None diff --git a/portal/templates/onelab/onelab_account-view.html b/portal/templates/onelab/onelab_account-view.html index f138e3e6..199444a3 100644 --- a/portal/templates/onelab/onelab_account-view.html +++ b/portal/templates/onelab/onelab_account-view.html @@ -7,6 +7,10 @@ Account > <a href="/account">{{ person.email }}</a> </div> </div> + {%if 'no_creds' in user_cred %} + <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p> +{%endif%} + </div> {% if messages %} <ul class="messages"> @@ -194,9 +198,6 @@ <div class="col-md-12"> <h3>Credentials <small>Delegated to Principal Account</small></h3> <table class="table"> - {%if 'no_creds' in user_cred %} - <p><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p> - {%endif%} <caption><b>Delegated User Credential</b></caption> <tr class="odd"> <th>Expiration Date</th> @@ -279,6 +280,7 @@ <p>You may get this message for several reasons.</p> <h3>Account Delegation: Automatic</h3> <ul> + <li>If your account is not yet validated</li> <li>If you press the "Clear Credentials" button</li> <li>If you "Generate a new key pair"</li> <li>If a new slice is added to your account</li> @@ -286,6 +288,7 @@ <p>In all the above mentioned cases, it is sufficient to refresh the page or go back to home page. The portal will regenrate your credentials. In some cases it may take more time than usual. If nothing works, then please logout and login again to the portal.</p> <h3>Account Delegation: Manual</h3> + <p>First of all your account needs to be validated by the manager of your organization.</p> <p>As you have uploaded your own public key, the portal can no longer generate your credentials automatically.</p> <p>In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to <a href="/portal/manual_delegation" target="_blank">delegate your credentials to the portal.</a> diff --git a/portal/templates/onelab/onelab_home-view.html b/portal/templates/onelab/onelab_home-view.html index 89716f7f..b3394d60 100644 --- a/portal/templates/onelab/onelab_home-view.html +++ b/portal/templates/onelab/onelab_home-view.html @@ -6,7 +6,45 @@ {% widget '_widget-news.html' %} </div> --> {% if username %} +<!-- Modal- No credentials --> +<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"> + <div class="modal-dialog"> + <div class="modal-content"> + <div class="modal-header"> + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> + <h4 class="modal-title" id="myModalLabel">No credentials are delegated to the portal</h4> + </div> + <div class="modal-body"> + <p>You may get this message for several reasons.</p> + <h3>Account Delegation: Automatic</h3> + <ul> + <li>If your account is not yet validated</li> + <li>If you press the "Clear Credentials" button</li> + <li>If you "Generate a new key pair"</li> + <li>If a new slice is added to your account</li> + </ul> + <p>In all the above mentioned cases, it is sufficient to refresh the page or go back to home page. The portal will regenrate your credentials. + In some cases it may take more time than usual. If nothing works, then please logout and login again to the portal.</p> + <h3>Account Delegation: Manual</h3> + <p>First of all your account needs to be validated by the manager of your organization.</p> + <p>As you have uploaded your own public key, the portal can no longer generate your credentials automatically.</p> + <p>In order for the portal to contact testbeds on your behalf, so as to list and reserve resources, you will need to + <a href="/portal/manual_delegation" target="_blank">delegate your credentials to the portal.</a> + </p> + <h5>Contact support</h5> + <p>If you don't have the above mentioned cases and still have this message, please <a href="/contact/" target="_blank">contact us</a>.</p> + </div> + <div class="modal-footer"> + <button type="button" class="btn btn-default" data-dismiss="modal">Close</button> + </div> + </div> + </div> +</div> <div class="container dashboard"> + {%if 'no_creds' in user_cred %} + <p class="command"><a href="#" style="color:red" data-toggle="modal" data-target="#myModal">NO CREDENTIALS</a> are delegated to the portal!</p> + {%endif%} + <div class="row"> {%if 'is_pi' in pi %} <div class="col-md-3">