page_name = current_page_name().lower() macros_list = ["macros_settings", "create_macros", "edit_macros", "plugin_details", "plugins", "macros_source"] main_list = ['main', 'workspace', 'application', 'widget'] settings_list = ['settings', 'users_and_groups', 'plugins', 'remote_scheme',] logs_list = ['logs'] if page_name in main_list: self.menu_main.classname += " m-active" elif page_name in settings_list: self.menu_settings.classname += " m-active" elif page_name in page_name: self.menu_logs.classname += " m-active" else: self.menu_settings.classname += " m-active" if not License().confirmed: response.redirect("/license.vdom") # get back url back_url = get_logout_back_url() user = ProAdmin.current_user() if not user: response.redirect( '/login?back_url=%s' % back_url ) self.cont_login.text_login.value = user.name if not ProAdmin.application().rules( user, 'a' ): self.menu_settings.visible = '0' #self.menu_macros.visible = '0'
def wrapper(*args, **kwargs): from class_license import License if not License().confirmed: write_error(*error_code['errNoLicense']) else: return method()
def __init__(self): Exception.__init__(self, 'Password must be not empty') 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])
def wrapper(*args, **kwargs): from class_license import License if not License().confirmed: redirect(license_url) else: return method()