Chore Account server

Check-in [49aa9fb2df]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Correct return body type
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | master | trunk
Files: files | file ages | folders
SHA3-256:49aa9fb2df0e095f7d923ac02bbaf87c2da0fa74147fa66a17732673ce111726
User & Date: ajv-899-334-8894@vsta.org 2016-11-17 17:22:35
Context
2016-11-21
22:01
Enable restart and proactive registration of services. check-in: ac76f1cf72 user: ajv-899-334-8894@vsta.org tags: master, trunk
2016-11-17
17:22
Correct return body type check-in: 49aa9fb2df user: ajv-899-334-8894@vsta.org tags: master, trunk
17:21
Move to firewall-friendly port numbering (can pass a simple range for all external ports). Point at our SSL cert (thanks, letsencrypt!) check-in: 6a294b69d2 user: ajv-899-334-8894@vsta.org tags: master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to get.py.

36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
..
88
89
90
91
92
93
94
95
        buf += '<form action="/login" method="post">\n'
        buf += ' Account name: <input type="text" name="acct"><br>\n'
        buf += ' Password: <input type="password" name="pw"><br>\n'
        buf += ' <input type="submit" value="Log In">\n'
        buf += "</form>\n"
        buf = self.build_tailer(buf)

        return buf

    # Show portal of services
    def send_portal(self):
        server = self.server
        app = server.approot

        # Shouldn't be here without a cookie
................................................................................

            # Edge case
            if not nservice:
                buf += '<h3>No services are running yet!</h3>'

        buf = self.build_tailer(buf)

        return buf







|







 







|
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
..
88
89
90
91
92
93
94
95
        buf += '<form action="/login" method="post">\n'
        buf += ' Account name: <input type="text" name="acct"><br>\n'
        buf += ' Password: <input type="password" name="pw"><br>\n'
        buf += ' <input type="submit" value="Log In">\n'
        buf += "</form>\n"
        buf = self.build_tailer(buf)

        return self.send_result(buf, "text/html")

    # Show portal of services
    def send_portal(self):
        server = self.server
        app = server.approot

        # Shouldn't be here without a cookie
................................................................................

            # Edge case
            if not nservice:
                buf += '<h3>No services are running yet!</h3>'

        buf = self.build_tailer(buf)

        return self.send_result(buf, "text/html")

Changes to post.py.

43
44
45
46
47
48
49



50
        if acctpw is None:
            return self.failed_login("Account is locked")
        if pw != acctpw:
            return self.failed_login("Invalid user or password")

        # Ok, they're on
        self.new_cookie(user)



        return True,self.send_redir("/?ver=%s" % (tstamp(),))







>
>
>

43
44
45
46
47
48
49
50
51
52
53
        if acctpw is None:
            return self.failed_login("Account is locked")
        if pw != acctpw:
            return self.failed_login("Invalid user or password")

        # Ok, they're on
        self.new_cookie(user)

        # Back to our root (they should be logged on now, and get
        #  a service menu)
        return True,self.send_redir("/?ver=%s" % (tstamp(),))