def wizard_password_required(): # If the wizard settings are missing, do not required the password if not os.path.exists("@PREFIX@/usr/share/untangle/conf/wizard.js"): return False passwordRequired = get_settings_item("@PREFIX@/usr/share/untangle/conf/wizard.js","passwordRequired") if passwordRequired: return True # If the wizard has not been completed, do not require the password wizardComplete = get_settings_item("@PREFIX@/usr/share/untangle/conf/wizard.js","wizardComplete") if wizardComplete == False: return False return True
def load_capture_settings(req,appid=None): companyName = 'Untangle' oemName = get_settings_item("/usr/share/untangle/conf/oem.js","oemName") if (oemName != None): companyName = oemName brandco = get_app_settings_item('branding-manager','companyName') if (brandco != None): companyName = brandco if (appid == None): captureSettings = get_app_settings('captive-portal') else: captureSettings = get_appid_settings(long(appid)) # add the company name to the app settings dictionary captureSettings['companyName'] = companyName # add some headers to prevent caching any of our stuff req.headers_out.add("Cache-Control", "no-store, no-cache, must-revalidate, post-check=0, pre-check=0") req.headers_out.add("Pragma", "no-cache") req.headers_out.add("Expires", "Sat, 1 Jan 2000 00:00:00 GMT"); return(captureSettings)
def load_capture_settings(req, appid=None): companyName = 'Untangle' oemName = get_settings_item("/usr/share/untangle/conf/oem.js", "oemName") if (oemName != None): companyName = oemName brandco = get_app_settings_item('branding-manager', 'companyName') if (brandco != None): companyName = brandco if (appid == None): captureSettings = get_app_settings('captive-portal') else: captureSettings = get_appid_settings(long(appid)) # add the company name to the app settings dictionary captureSettings['companyName'] = companyName # add some headers to prevent caching any of our stuff req.headers_out.add( "Cache-Control", "no-store, no-cache, must-revalidate, post-check=0, pre-check=0") req.headers_out.add("Pragma", "no-cache") req.headers_out.add("Expires", "Sat, 1 Jan 2000 00:00:00 GMT") return (captureSettings)
def wizard_password_required(): # If the wizard settings are missing, do not required the password if not os.path.exists("@PREFIX@/usr/share/untangle/conf/wizard.js"): return False passwordRequired = get_settings_item( "@PREFIX@/usr/share/untangle/conf/wizard.js", "passwordRequired") if passwordRequired: return True # If the wizard has not been completed, do not require the password wizardComplete = get_settings_item( "@PREFIX@/usr/share/untangle/conf/wizard.js", "wizardComplete") if wizardComplete == False: return False return True
def is_wizard_complete(): if not os.path.exists('/usr/share/untangle/conf/wizard.js'): return False wizardComplete = get_settings_item("/usr/share/untangle/conf/wizard.js","wizardComplete") if wizardComplete != None: return wizardComplete return False
def get_company_name(): company = 'Untangle' oemName = get_settings_item("/usr/share/untangle/conf/oem.js","oemName") if oemName != None: company = oemName brandco = get_node_settings_item('untangle-node-branding','companyName') if (brandco != None): company = brandco if not type(company) is str: company = company.encode("utf-8") return company
def get_company_name(): company = 'Untangle' oemName = get_settings_item("/usr/share/untangle/conf/oem.js", "oemName") if oemName != None: company = oemName brandco = get_node_settings_item('untangle-node-branding', 'companyName') if (brandco != None): company = brandco if not type(company) is str: company = company.encode("utf-8") return company
def get_company_name(): company = 'Untangle' oemName = get_settings_item("@PREFIX@/usr/share/untangle/conf/oem.js","oemName") if oemName != None: company = oemName brandco = get_app_settings_item('branding-manager','companyName') if (brandco != None): company = brandco if not type(company) is str: company = company.encode("utf-8") return company
def get_company_name(): company = 'Untangle' oemName = get_settings_item("@PREFIX@/usr/share/untangle/conf/oem.js", "oemName") if oemName != None: company = oemName brandco = get_app_settings_item('branding-manager', 'companyName') if (brandco != None): company = brandco if not type(company) is str: company = company.encode("utf-8") return company
def load_capture_settings(req, appid=None): captureSettings = None # start with our company name companyName = 'Untangle' # if there is an OEM name configured we use that instead of our company name oemName = get_settings_item("/usr/share/untangle/conf/oem.js", "oemName") if (oemName != None): companyName = oemName # if there is a company name in the branding manager it wins over everything else brandco = get_app_settings_item('branding-manager', 'companyName') if (brandco != None): companyName = brandco try: if (appid == None): captureSettings = get_app_settings('captive-portal') else: captureSettings = get_appid_settings(int(appid)) except Exception as e: req.log_error("handler.py: Exception loading settings: %s" % str(e)) if (captureSettings == None): req.log_error( "handler.py: Unable to load capture settings for appid: %s" % str(appid)) return None if (captureSettings.get('pageType') == None): req.log_error("handler.py: Missing required setting: pageType") return None # add the company name to the app settings dictionary captureSettings['companyName'] = companyName # add some headers to prevent caching any of our stuff req.headers_out.add( "Cache-Control", "no-store, no-cache, must-revalidate, post-check=0, pre-check=0") req.headers_out.add("Pragma", "no-cache") req.headers_out.add("Expires", "Mon, 10 Jan 2000 00:00:00 GMT") req.headers_out.add("Connection", "close") return (captureSettings)
def load_capture_settings(req,appid=None): captureSettings = None # start with our company name companyName = 'Untangle' # if there is an OEM name configured we use that instead of our company name oemName = get_settings_item("/usr/share/untangle/conf/oem.js","oemName") if (oemName != None): companyName = oemName # if there is a company name in the branding manager it wins over everything else brandco = get_app_settings_item('branding-manager','companyName') if (brandco != None): companyName = brandco try: if (appid == None): captureSettings = get_app_settings('captive-portal') else: captureSettings = get_appid_settings(int(appid)) except Exception as e: req.log_error("handler.py: Exception loading settings: %s" % str(e)) if (captureSettings == None): req.log_error("handler.py: Unable to load capture settings for appid: %s" % str(appid)) return None if (captureSettings.get('pageType') == None): req.log_error("handler.py: Missing required setting: pageType") return None # add the company name to the app settings dictionary captureSettings['companyName'] = companyName # add some headers to prevent caching any of our stuff req.headers_out.add("Cache-Control", "no-store, no-cache, must-revalidate, post-check=0, pre-check=0") req.headers_out.add("Pragma", "no-cache") req.headers_out.add("Expires", "Mon, 10 Jan 2000 00:00:00 GMT") req.headers_out.add("Connection", "close") return(captureSettings)