password = request.arguments.get("formpassword", '') confirm = request.arguments.get("formpassword_confirm", "") try: if not password: raise EmptyPasswordError() if password == confirm: user = ProAdmin.application().get_users(email="root") if user: user[0].password = password user[0].save() from class_license import License License().confirmed = "True" if RemoteSettings.get_remote_setting(): RemoteSettings.delete() ProAdmin.unregister_default_scheme() ProAdmin.scheme() ProAdmin.logoff() self.action("goTo", ["/logoff"]) else: self.growl.action( "show", ['Warning', "The passwords you entered did not match."]) except EmptyPasswordError as ex: self.growl.action("show", ['Error', ex.message]) except Exception as ex: self.growl.action("show", ['Error', ex.message])
from vdom_remote_api import VDOMService,VDOMServiceSingleThread from socket import gethostbyname import ProAdmin from md5 import md5 from proadmin_remote_sync import RemoteSyncClient from class_remote_settings import RemoteSettings import localization from SOAPpy.Errors import Error, HTTPError from SOAPpy.Types import faultType lang = localization.get_lang() try: remote = RemoteSettings.get_remote_setting() host = remote.server login = remote.login password = remote.password app_id = '491d4c93-4089-4517-93d3-82326298da44' host_to_check = host.replace("https://", "").replace("http://", "") correct_flag = True connection_to_ip = open_session = proadmin_version = "" try: connection_to_ip = "<p class='success'><span>" + lang["connect_ip_success"] + gethostbyname(host_to_check) + "</span></p>" except: correct_flag = False connection_to_ip = "<p class='failed'><span>" + lang["connect_ip_fail"] + "</span></p>" if correct_flag: try: if isinstance(VDOMService( host, login, md5( password ).hexdigest(), app_id ).open_session(), VDOMServiceSingleThread):
from class_remote_settings import RemoteSettings from vdom_remote_api import VDOMService from md5 import md5 import localization lang = localization.get_lang() try: host = request.shared_variables["host"] login = request.shared_variables["login"] password = request.shared_variables["password"] app_id = '491d4c93-4089-4517-93d3-82326298da44' try: RemoteSettings(login, password, host).save() ProAdmin.logoff() ProAdmin.unregister_default_scheme() ProAdmin.scheme() self.action("goTo", ["/proadmin_management"]) except Exception, ex: error = str(ex.__class__).replace("<", "<") err_txt = "" if "socket.gaierror" in error: err_txt = lang["socket.gaierror"] elif "socket.error" in error: err_txt = lang["socket.error"] elif "faultType" in error or "NameError" in error: err_txt = lang["faultType"]
password = request.arguments["formpassword"] server = request.arguments["formtext_server"] try: from vdom_remote_api import VDOMService from md5 import md5 # connect = VDOMService.connect(server, login, md5( password ).hexdigest(), # "491d4c93-4089-4517-93d3-82326298da44") connect = VDOMService( server, login, md5(password).hexdigest(), "491d4c93-4089-4517-93d3-82326298da44").open_session() RemoteSettings(login, password, server).save() #ProAdmin.scheme().delete() ProAdmin.unregister_default_scheme() ProAdmin.scheme() ProAdmin.logoff() from class_license import License License().confirmed = "True" self.action("goTo", ["/logoff"]) except Exception, ex: error = str(ex.__class__).replace("<", "<") err_txt = "" if "socket.gaierror" in error: