accBody = """You are logged in as guest. You may want to <A href="../youraccount.py/login">login</A> as a regular user <BR><BR>
"""
bask=aler="""The <strong class=headline>guest</strong> users need to <A href="../youraccount.py/login">register</A> first"""
sear="No queries found"
else:
user = data[0]
accBody ="""You are logged in as %s. You may want to a) <A href="../youraccount.py/logout">logout</A>; b) edit your <A href="../youraccount.py/set">email address or password</a>.<BR><BR>
"""%user
out =""
out +=template_account("Your Account",accBody)
#your baskets
out +=template_account("Your Baskets",bask)
out +=template_account("Your Alert Searches",aler)
out +=template_account("Your Searches",sear)
out +=template_account("Your Submissions",
"""You can consult the list of <a href="%s/yoursubmissions.py">your submissions</a>
and inquire about their status.""" % weburl)
out +=template_account("Your Approvals",
"""You can consult the list of <a href="%s/yourapprovals.py">your approvals</a>
with the documents you approved or refereed.""" % weburl)
out +=template_account("Your Administrative Activities", perform_youradminactivities(uid))
return out
# template_account() : it is a template for print each of the options from the user's account
<tr><td align=right><strong>New password:</strong></td><td align=left><input type="password" size="25" name="password" value="%s"><br><small><span class=quicknote>Note:</span> The password phrase may contain punctuation, spaces, etc.</small></td><td><input type="hidden" name="action" value="edit"></td></tr>
<tr><td align=center colspan=3><code class=blocknote><input class="formbutton" type="submit" value="Set new values"></code> </td></tr>
</table>
</form>
</body>
"""%(email,password)
return text
## perform_ask(): ask for the user's email and password, for login into the system
def perform_ask(referer=''):
text = """
<p>If you already have an account, please log in by choosing the <strong class=headline>login
</strong> button below. <br>If you don't own an account yet, please enter the values of your preference and choose the <strong class=headline>register</strong> button.
<p><strong>Note:</strong> 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.
</form>
""" % (cgi.escape(referer), cdsname)
return text
# perform_logout: display the message of not longer authorized,
def perform_logout(req):
out =""
out+="""
You are no longer recognized. If you wish you can <A href="./login">login here</A>.
"""
return out
#def perform_lost: ask the user for his email, in order to send him the lost password
def perform_lost():
out =""
out +="""
<body>
<big><strong class=headline>Lost your password?</strong></big>