Displays a form for the user to ask for his password sent by email.
Parameters:
- 'ln' *string* - The language to display the interface in
- 'msg' *string* - Explicative message on top of the form.
"""
# load the right message language
_=gettext_set_language(ln)
out="<p>"+_("If you have lost the password for your %(sitename)s%(x_fmt_open)sinternal account%(x_fmt_close)s, then please enter your email address in the following form in order to have a password reset link emailed to you.")%{'x_fmt_open':'<em>','x_fmt_close':'</em>','sitename':CFG_SITE_NAME_INTL[ln]}+"</p>"
out+="<p>"+_("If you have been using the %(x_fmt_open)sCERN login system%(x_fmt_close)s, then you can recover your password through the %(x_url_open)sCERN authentication system%(x_url_close)s.")%{'x_fmt_open':'<em>','x_fmt_close':'</em>','x_url_open':'<a href="https://cern.ch/lightweightregistration/ResetPassword.aspx%s">' \
out+="<p>"+_("Note that if you have been using an external login system, then we cannot do anything and you have to ask there.")+" "
out+=_("Alternatively, you can ask %s to change your login system from external to internal.")%("""<a href="mailto:%(email)s">%(email)s</a>"""%{'email':CFG_SITE_SUPPORT_EMAIL})+"</p>"
- 'ln' *string* - The language to display the interface in
- 'uid' *string* - The user id
- 'guest' *boolean* - If the user is guest
- 'CFG_CERN_SITE' *boolean* - If the site is a CERN site
"""
# load the right message language
_=gettext_set_language(ln)
out="""<p>%(account_offer)s</p>
<blockquote>
<dl>
"""%{
'account_offer':_("%s offers you the possibility to personalize the interface, to set up your own personal library of documents, or to set up an automatic alert query that would run periodically and would notify you of search results by email.")%CFG_SITE_NAME_INTL[ln],
}
ifnotguest:
out+="""
<dt>
<a href="./edit?ln=%(ln)s">%(your_settings)s</a>
</dt>
<dd>%(change_account)s</dd>"""%{
'ln':ln,
'your_settings':_("Your Settings"),
'change_account':_("Set or change your account email address or password. Specify your preferences about the look and feel of the interface.")
'basket_explain':_("With baskets you can define specific collections of items, store interesting records you want to access later or share with others."),
'explain_alerts':_("Subscribe to a search which will be run periodically by our service. The result can be sent to you via Email or stored in one of your baskets."),
'explain_loans':_("Check out book you have on loan, submit borrowing requests, etc. Requires CERN ID."),
'ln':ln,
'CFG_SITE_SECURE_URL':CFG_SITE_SECURE_URL
}
out+="""
</dl>
</blockquote>"""
returnout
deftmpl_warning_guest_user(self,ln,type):
"""
Displays a warning message about the specified type
Parameters:
- 'ln' *string* - The language to display the interface in
- 'type' *string* - The type of data that will get lost in case of guest account (for the moment: 'alerts' or 'baskets')
"""
# load the right message language
_=gettext_set_language(ln)
if(type=='baskets'):
msg=_("You are logged in as a guest user, so your baskets will disappear at the end of the current session.")+' '
elif(type=='alerts'):
msg=_("You are logged in as a guest user, so your alerts will disappear at the end of the current session.")+' '
msg+=_("If you wish you can %(x_url_open)slogin or register here%(x_url_close)s.")%{'x_url_open':'<a href="'+CFG_SITE_SECURE_URL+'/youraccount/login?ln='+ln+'">',
'x_url_close':'</a>'}
return"""<table class="errorbox" summary="">
<tr>
<th class="errorboxheader">%s</th>
</tr>
</table>"""%msg
deftmpl_account_body(self,ln,user):
"""
Displays the body of the actions of the user
Parameters:
- 'ln' *string* - The language to display the interface in
- 'user' *string* - The username (nickname or email)
"""
# load the right message language
_=gettext_set_language(ln)
out=_("You are logged in as %(x_user)s. You may want to a) %(x_url1_open)slogout%(x_url1_close)s; b) edit your %(x_url2_open)saccount settings%(x_url2_close)s.")%\
- 'ln' *string* - The language to display the interface in
- 'referer' *string* - The referer URL - will be redirected upon after login
- 'internal' *boolean* - If we are producing an internal authentication
- 'register_available' *boolean* - If users can register freely in the system
- 'methods' *array* - The available authentication methods
- 'selected_method' *string* - The default authentication method
- 'msg' *string* - The message to print before the form, if needed
"""
# load the right message language
_=gettext_set_language(ln)
out="<div style='float:left'>"
ifmsgis"":
out+="<p>%(please_login)s</p>"%{
'please_login':cgi.escape(_("If you already have an account, please login using the form below."))
}
ifCFG_CERN_SITE:
out+="<p>"+_("If you don't own a CERN account yet, you can register a %(x_url_open)snew CERN lightweight account%(x_url_close)s.")%{'x_url_open':'<a href="https://www.cern.ch/lightweightregistration/RegisterAccount.aspx">','x_url_close':'</a>'}+"</p>"
else:
ifregister_available:
out+="<p>"+_("If you don't own an account yet, please %(x_url_open)sregister%(x_url_close)s an internal account.")%\
out+="<p>"+_("If you don't own an account yet, please contact %s.")%('<a href="mailto:%s">%s</a>'%(cgi.escape(CFG_SITE_SUPPORT_EMAIL,True),cgi.escape(CFG_SITE_SUPPORT_EMAIL)))+"</p>"
'password_contain':_("The password phrase may contain punctuation, spaces, etc."),
'retype':_("Retype Password"),
'register':_("register"),
'explain_acc':_("Please do not use valuable passwords such as your Unix, AFS or NICE passwords with this service. Your email address will stay strictly confidential and will not be disclosed to any third party. It will be used to identify you for personal services of %s. For example, you may set up an automatic alert search that will look for new preprints and will notify you daily of new arrivals by email.")%CFG_SITE_NAME,
}
else:
# level >=2, so users cannot register accounts
out+="<p>"+_("It is not possible to create an account yourself. Contact %s if you want an account.")%('<a href="mailto:%s">%s</a>'%(CFG_SITE_SUPPORT_EMAIL,CFG_SITE_SUPPORT_EMAIL))+"</p>"
@param nb_admin_group: number of groups the user is admin of
@param nb_member_group: number of groups the user is member of
@param total_group: number of groups the user belongs to
@param ln: language
return: html output.
"""
_=gettext_set_language(ln)
out=_("You can consult the list of %(x_url_open)s%(x_nb_total)i groups%(x_url_close)s you are subscribed to (%(x_nb_member)i) or administering (%(x_nb_admin)i).")
message+=_("Warning: The password set for MySQL root user is the same as the default Invenio password. For security purposes, you may want to change the password.")
message+="</font></p>"
#Try and connect to the invenio database with the default invenio password
message+=_("Warning: The password set for the Invenio MySQL user is the same as the shipped default. For security purposes, you may want to change the password.")
message+="</font></p>"
#Check if the admin password is empty
if"warning_empty_admin_password"inwarning_list:
message+="<p><font color=red>"
message+=_("Warning: The password set for the Invenio admin user is currently empty. For security purposes, it is strongly recommended that you add a password.")
message+="</font></p>"
#Check if the admin email has been changed from the default
message+=_("Warning: The email address set for support email is currently set to info@invenio-software.org. It is recommended that you change this to your own address.")
message+="</font></p>"
#Check for a new release
if"note_new_release_available"inwarning_list:
message+="<p><font color=red>"
message+=_("A newer version of Invenio is available for download. You may want to visit ")
message+=_("Cannot download or parse release notes from http://invenio-software.org/repo/invenio/tree/RELEASE-NOTES")
message+="</font></p>"
if"email_auto_generated"inwarning_list:
message+="<p><font color=red>"
message+=_("Your e-mail is auto-generated by the system. Please change your e-mail from <a href='%s/youraccount/edit?ln=%s'>account settings</a>.")%(CFG_SITE_SECURE_URL,ln)