if (CFG_ACCESS_CONTROL_LEVEL_ACCOUNTS >= 2 or (CFG_ACCESS_CONTROL_LEVEL_ACCOUNTS <= 1 and webuser.checkemail(email))) and uid2 != -1 and (uid2 == uid or uid2 == 0) and password == password2:
if CFG_EXTERNAL_AUTHENTICATION.has_key(user_prefs['login_method']) or CFG_EXTERNAL_AUTHENTICATION.has_key(user_prefs['login_method']) and CFG_EXTERNAL_AUTHENTICATION[user_prefs['login_method']][0] != None:
Msg = """If you have lost password for your CERN Document Server internal
account, then please enter your email address below and the lost
password will be emailed to you.<br>
Note that if you have been using an external login system (such
as CERN NICE), then we cannot do anything and you have to ask
there. Alternatively, you can ask <a href="mailto:<SUPPORTEMAIL>">
<SUPPORTEMAIL></a> to change your login system from external to internal.<br><br>"""
return page(title="Your Account",
body=Msg,
description="CDS Personalize, Main page",
keywords="CDS, personalize",
uid=uid,
language=ln,
lastupdated=__lastupdated__)
passw = webuser.givePassword(p_email)
if passw == -999:
eMsg = "The entered e-mail address doesn't exist in the database"
return page(title="Your Account",
body=webaccount.perform_emailMessage(eMsg),
description="CDS Personalize, Main page",
keywords="CDS, personalize",
uid=uid,
language=ln,
lastupdated=__lastupdated__)
fromaddr = "From: %s" % supportemail
toaddrs = "To: " + p_email
to = toaddrs + "\n"
sub = "Subject: Credentials for %s\n\n" % cdsname
body = "Here are your user credentials for %s:\n\n" % cdsname
body += " username: %s\n password: %s\n\n" % (p_email, passw)
body += "You can login at %s/youraccount.py/login" % weburl
msg = to + sub + body
server = smtplib.SMTP('localhost')
server.set_debuglevel(1)
try:
server.sendmail(fromaddr, toaddrs, msg)
except smtplib.SMTPRecipientsRefused,e:
eMsg = "The entered email address is incorrect, please check that it is written correctly (e.g. johndoe@example.com)."
return page(title="Incorrect email address",
body=webaccount.perform_emailMessage(eMsg),
description="CDS Personalize, Main page",
keywords="CDS, personalize",
uid=uid,
language=ln,
lastupdated=__lastupdated__)
server.quit()
return page(title="Lost password sent",
body=webaccount.perform_emailSent(p_email),
description="CDS Personalize, Main page",
keywords="CDS, personalize",
uid=uid,
language=ln,
lastupdated=__lastupdated__)
def youradminactivities(req, ln=cdslang):
uid = webuser.getUid(req)
if uid == -1 or CFG_ACCESS_CONTROL_LEVEL_SITE >= 1: