diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2011-01-17 00:43:04 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2011-01-17 01:27:10 +0100 |
commit | e665fce31c29f502dc6a21559c4766ab627fb35a (patch) | |
tree | d2dd3506060b9551b32132215280014fdbeb51a8 /source4 | |
parent | 7982f683ee4ae3bb693745c895b1b11586bf32d0 (diff) | |
download | samba-e665fce31c29f502dc6a21559c4766ab627fb35a.tar.gz samba-e665fce31c29f502dc6a21559c4766ab627fb35a.tar.bz2 samba-e665fce31c29f502dc6a21559c4766ab627fb35a.zip |
web_server: Display trivial placeholder page if SWAT could not be found.
Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Mon Jan 17 01:27:10 CET 2011 on sn-devel-104
Diffstat (limited to 'source4')
-rw-r--r-- | source4/scripting/python/samba/web_server/__init__.py | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/source4/scripting/python/samba/web_server/__init__.py b/source4/scripting/python/samba/web_server/__init__.py index b5ac69c96a..da528f42d1 100644 --- a/source4/scripting/python/samba/web_server/__init__.py +++ b/source4/scripting/python/samba/web_server/__init__.py @@ -20,17 +20,30 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -def __call__(environ, start_response): + + +def render_placeholder(environ, start_response): status = '200 OK' response_headers = [('Content-type','text/html')] start_response(status, response_headers) - yield '<table>\n' - for key, value in environ.items(): - if isinstance(value, str): - yield '\t<tr><td><b>%s</b></td><td>%s</td></tr>\n' % (key, value) + yield "<!doctype html>\n" + yield "<html>\n" + yield " <title>The Samba web service</title>\n" + yield "</html>\n" + + yield "<body>\n" + yield "<p>Welcome to this Samba web server.</p>\n" + yield "<p>This page is a simple placeholder. You probably want to install " + yield "SWAT. More information can be found " + yield "<a href='http://wiki.samba.org/index.php/SWAT'>on the wiki</a>.</p>" + yield "</p>\n" + yield "</body>\n" + yield "</html>\n" + + +__call__ = render_placeholder - yield '</table>\n' if __name__ == '__main__': from wsgiref import simple_server |