Source

iredadmin-ose / controllers / utils.py

# Author: Zhang Huangbin <zhb@iredmail.org>

import web


class redirect:
    """Make url ending with or without '/' going to the same class."""
    def GET(self, path):
        raise web.seeother('/' + str(path))


class img:
    def GET(self, encoded_img):
        web.header('Content-Type', 'image/jpeg')
        return encoded_img.decode('base64')


class Expired:
    def GET(self):
        web.header('Content-Type', 'text/html')
        return '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>License expired</title>
    </head>

    <body>
        <p>Your license of iRedAdmin-Pro trial edition expired, please <a href="http://www.iredmail.org/admin_buy.html" target="_blank">purchase a license</a> to continue using iRedAdmin-Pro.</p>
    </body>
</html>
'''
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.