fixes to gateway path

This commit is contained in:
Rushabh Mehta 2011-07-06 10:42:02 +05:30
parent ab49e027a1
commit cac4473fec
3 changed files with 7 additions and 34 deletions

View File

@ -619,13 +619,6 @@ pscript.home_make_status = function() {
if(r.message.system_message)
pscript.show_system_message(wrapper, r.message.system_message);
// trial
if(pscript.is_erpnext_saas && cint(r.message.is_trial) && in_list(user_roles, 'System Manager')) {
pscript.trial_box = $a(div, 'div', 'help_box', {margin:'2px 8px 2px 0px'}, "Your Free Trial expires in " +
r.message.days_to_expiry + " days. When you are satisfied, please <span class='link_type' onclick='pscript.convert_to_paid()'>please click here</span> to convert to a paid account." +
"<br>To get help, view <a href='http://erpnext.blogspot.com/2011/02/getting-started-with-your-erpnext.html' target='_blank'>Getting Started with Your System</a> (opens in a new page)");
}
// render online users
pscript.online_users_obj.render(r.message.online_users);
pscript.online_users = r.message.online_users;
@ -633,16 +626,6 @@ pscript.home_make_status = function() {
);
}
// show system message
// -------------------
pscript.convert_to_paid = function() {
var callback = function(r,rt) {
if(r.exc) { msgprint(r.exc); return; }
$(pscript.trial_box).slideUp();
}
$c_page('home','event_updates','convert_to_paid','',callback)
}
// show system message
// -------------------
pscript.show_system_message = function(wrapper, msg) {

View File

@ -43,14 +43,3 @@ def get_status_details(arg=None):
'is_trial': webnotes.conn.get_global('is_trial'),
'days_to_expiry': (webnotes.conn.get_global('days_to_expiry') or '0')
}
#
# Convert to a paid account
#
def convert_to_paid():
from server_tools.server_tools.gateway_utils import convert_to_paid_gateway
r = convert_to_paid_gateway()
if r['exc']:
webnotes.msgprint(r['exc'])
raise Exception, r['exc']
webnotes.msgprint('Thank you for choosing to convert to a Paid Account!')

View File

@ -2,15 +2,16 @@ import webnotes
from webnotes.utils import load_json, cint, nowdate
#
# change profile (remote)
#
def change_password(arg):
"""
Change password
"""
arg = load_json(arg)
if cint(webnotes.conn.get_value('Control Panel',None,'sync_with_gateway')):
import server_tools.server_tools.gateway_utils
webnotes.msgprint(server_tools.server_tools.gateway_utils.change_password(arg['old_password'], arg['new_password'])['message'])
import server_tools.gateway_utils
webnotes.msgprint(server_tools.gateway_utils.change_password(arg['old_password'], arg['new_password'])['message'])
else:
if not webnotes.conn.sql('select name from tabProfile where name=%s and password=password(%s)', (webnotes.session['user'], arg['old_password'])):
webnotes.msgprint('Old password is not correct', raise_exception=1)