Merge branch 'master' into production

This commit is contained in:
Nabin Hait 2012-12-17 11:39:40 +05:30
commit f072cbdb47
2 changed files with 4 additions and 0 deletions

View file

@ -967,6 +967,7 @@ _f.Frm.prototype.amend_doc = function() {
}
_f.Frm.prototype.disable_save = function() {
// IMPORTANT: this function should be called in refresh event
cur_frm.save_disabled = true;
cur_frm.page_layout.footer.hide_save();
cur_frm.frm_head.appframe.buttons.Save.toggle(false);

View file

@ -138,6 +138,9 @@ def reset_password():
from webnotes.utils import random_string
user = webnotes.form_dict.get('user', '')
if user in ["demo@erpnext.com", "Administrator"]:
webnotes.msgprint("Not allowed", raise_exception=1)
if webnotes.conn.sql("""select name from tabProfile where name=%s""", user):
new_password = random_string(8)
webnotes.conn.sql("""update `__Auth` set password=password(%s)