Example #1
0
    def init(self):
        panel_path = public.get_panel_path()
        if os.getcwd() != panel_path: os.chdir(panel_path)

        g.ua = request.headers.get('User-Agent', '')
        if g.ua:
            ua = g.ua.lower()
            if ua.find('spider') != -1 or g.ua.find('bot') != -1:
                return redirect('https://www.google.com')
        g.version = '6.8.21'
        g.title = public.GetConfigValue('title')
        g.uri = request.path
        g.debug = os.path.exists('data/debug.pl')
        g.pyversion = sys.version_info[0]
        session['version'] = g.version

        if request.method == 'GET':
            if not g.debug:
                g.cdn_url = public.get_cdn_url()
                if not g.cdn_url:
                    g.cdn_url = '/static'
                else:
                    g.cdn_url = '//' + g.cdn_url + '/' + g.version
            else:
                g.cdn_url = '/static'
            session['title'] = g.title

        g.recycle_bin_open = 0
        if os.path.exists("data/recycle_bin.pl"): g.recycle_bin_open = 1

        g.recycle_bin_db_open = 0
        if os.path.exists("data/recycle_bin_db.pl"): g.recycle_bin_db_open = 1
        g.is_aes = False
        self.other_import()
        return None
Example #2
0
    def init(self):
        ua = request.headers.get('User-Agent','')
        if ua:
            ua = ua.lower()
            if ua.find('spider') != -1 or ua.find('bot') != -1:
                return redirect('https://www.google.com')
        g.version = '6.8.12'
        g.title = public.GetConfigValue('title')
        g.uri = request.path
        g.debug = os.path.exists('data/debug.pl')
        g.pyversion = sys.version_info[0]
        session['version'] = g.version

        if request.method == 'GET':
            if not g.debug:
                g.cdn_url = public.get_cdn_url()
                if not g.cdn_url:
                    g.cdn_url = '/static'
                else:
                    g.cdn_url = '//' + g.cdn_url + '/' + g.version
            else:
                g.cdn_url = '/static'
            session['title'] = g.title

        g.is_aes = False
        self.other_import()
        return None
Example #3
0
 def set_cdn_host(self,get):
     try:
         if not 'cdn_url' in get: return True
         plugin_path = 'plugin/static_cdn'
         if not os.path.exists(plugin_path): return True
         cdn_url = public.get_cdn_url()
         if not cdn_url or cdn_url == get.cdn_url: return True
         public.set_cdn_url(get.cdn_url)
     except:
         return False
Example #4
0
    def init(self):
        ua = request.headers.get('User-Agent')
        if ua:
            ua = ua.lower()
            if ua.find('spider') != -1 or ua.find('bot') != -1:
                return redirect('https://www.google.com')
        g.version = '6.6.7'
        g.title = public.GetConfigValue('title')
        g.uri = request.path
        if not os.path.exists('data/debug.pl'):
            g.cdn_url = public.get_cdn_url()
            if not g.cdn_url:
                g.cdn_url = '/static'
            else:
                g.cdn_url = '//' + g.cdn_url + '/' + g.version
        else:
            g.cdn_url = '/static'

        session['version'] = g.version
        session['title'] = g.title
        g.is_aes = False
        return None
Example #5
0
    def init(self):
        ua = request.headers.get('User-Agent', '')
        if ua:
            ua = ua.lower()
            if ua.find('spider') != -1 or ua.find('bot') != -1:
                return redirect('https://www.google.com')
        g.version = '6.8.4'
        g.title = public.GetConfigValue('title')
        g.uri = request.path
        g.debug = os.path.exists('data/debug.pl')
        g.pyversion = sys.version_info[0]
        if not g.debug:
            g.cdn_url = public.get_cdn_url()
            if not g.cdn_url:
                g.cdn_url = '/static'
            else:
                g.cdn_url = '//' + g.cdn_url + '/' + g.version
        else:
            g.cdn_url = '/static'

        session['version'] = g.version
        session['title'] = g.title
        g.is_aes = False

        dirPath = '/www/server/phpmyadmin/pma'
        if os.path.exists(dirPath):
            public.ExecShell("rm -rf {}".format(dirPath))

        dirPath = '/www/server/adminer'
        if os.path.exists(dirPath):
            public.ExecShell("rm -rf {}".format(dirPath))

        dirPath = '/www/server/panel/adminer'
        if os.path.exists(dirPath):
            public.ExecShell("rm -rf {}".format(dirPath))

        return None