diff --git a/src/www/htdocs/wap_login.rpy b/src/www/htdocs/wap_login.rpy deleted file mode 100644 index fc80d7ca..00000000 --- a/src/www/htdocs/wap_login.rpy +++ /dev/null @@ -1,66 +0,0 @@ -# -*- coding: iso-8859-1 -*- -# vim:autoindent:tabstop=4:softtabstop=4:shiftwidth=4:expandtab:filetype=python: -# ----------------------------------------------------------------------- -# Wap interface login form. -# ----------------------------------------------------------------------- -# $Id$ -# -# Notes: -# Todo: -# -# ----------------------------------------------------------------------- -# Freevo - A Home Theater PC framework -# Copyright (C) 2003 Krister Lagerstrom, et al. -# Please see the file freevo/Docs/CREDITS for a complete list of authors. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MER- -# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# ----------------------------------------------------------------------- - -from www.wap_types import WapResource, FreevoWapResource - -class WLoginResource(FreevoWapResource): - - def _render(self, request): - - fv = WapResource() - form = request.args - - user = fv.formValue(form, 'user') - passw = fv.formValue(form, 'passw') - action = fv.formValue(form, 'action') - - fv.printHeader() - - fv.res += ' \n' - fv.res += '

Freevo Wap Login

\n' - - if action <> "submit": - - fv.res += '

User :
\n' - fv.res += ' Passw :

\n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += '
\n' - - fv.printFooter() - - return String( fv.res ) - -resource = WLoginResource() diff --git a/src/www/htdocs/wap_rec.rpy b/src/www/htdocs/wap_rec.rpy deleted file mode 100644 index 7fdd6260..00000000 --- a/src/www/htdocs/wap_rec.rpy +++ /dev/null @@ -1,133 +0,0 @@ -# -*- coding: iso-8859-1 -*- -# vim:autoindent:tabstop=4:softtabstop=4:shiftwidth=4:expandtab:filetype=python: -# ----------------------------------------------------------------------- -# Wap shedule recording page. -# ----------------------------------------------------------------------- -# $Id$ -# -# Notes: -# Todo: -# -# ----------------------------------------------------------------------- -# Freevo - A Home Theater PC framework -# Copyright (C) 2003 Krister Lagerstrom, et al. -# Please see the file freevo/Docs/CREDITS for a complete list of authors. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MER- -# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# ----------------------------------------------------------------------- - -import sys, time - -import tv.epg_xmltv -import tv.epg_types -from www.wap_types import WapResource, FreevoWapResource -from www.web_types import RecordClientResource - -class WRecResource(FreevoWapResource): - def __init__(self): - self.recordclient = RecordClientResource() - - - def _render(self, request): - """ Render the page """ - fv = WapResource() - form = request.args - fv.session = request.getSession() - fv.validate(request) - start = fv.formValue(form, 'start') - stop = fv.formValue(form, 'stop') - startdate = fv.formValue(form, 'date') - stopdate = startdate - channel = fv.formValue(form, 'channel') - action = fv.formValue(form, 'action') - errormsg = '' - - if fv.session.validated <> 'yes': - errormsg = 'not validated' - - fv.printHeader() - - # look for action to do an add - if action: - if action == 'add': - starttime = time.mktime(time.strptime(str(startdate)+' '+str(start)+':00', '%d/%m/%y %H:%M:%S')) - stoptime = time.mktime(time.strptime(str(startdate)+' '+str(stop)+':00', '%d/%m/%y %H:%M:%S')) - if stoptime < starttime: - stoptime = stoptime + 86400 - prog = tv.epg_types.TvProgram() - prog.channel_id = channel - prog.title = "Wap Recorded" - prog.start = starttime - prog.stop = stoptime - self.recordclient().scheduleRecordingNow(prog) - fv.res += ' \n' - fv.res += '

Rec. Sheduled
\n' - fv.res += ' Date : %s
\n' % startdate - fv.res += ' Start : %s
\n' % start - fv.res += ' Stop : %s
\n' % stop - fv.res += ' Chan.: %s

\n' % channel - fv.res += '
\n' - - else: - - if errormsg == 'not validated': - fv.res += ' \n' - fv.res += '

Please login!
\n' - fv.res += ' Go to login\n' - fv.res += ' \n' - fv.res += '

\n' - fv.res += '
\n' - else: - guide = tv.epg_xmltv.get_guide() - - fv.res += ' \n' - fv.res += ' \n' - fv.res += '

Freevo WAP Sheduler

\n' - - server_available = self.recordclient().pingNow() - if not server_available: - fv.res += '

'+_('ERROR')+': '+self.recordclient().recordserverdown+'

\n' - else: - fv.res += '

Record Server online!

\n' - - fv.res += '
\n' - fv.res += ' \n' - fv.res += '

Date:
\n' % time.strftime("%d/%m/%y", time.localtime(time.time())) - fv.res += ' Start Time:
\n' % time.strftime("%H:%M", time.localtime(time.time())) - fv.res += ' Stop Time:
\n' % time.strftime("%H:%M", time.localtime(time.time() + 3600)) - fv.res += ' Channel:

\n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += ' \n' - fv.res += '
\n' - - fv.printFooter() - - return String( fv.res ) - -resource = WRecResource() diff --git a/src/www/wap_types.py b/src/www/wap_types.py deleted file mode 100644 index 92badbf7..00000000 --- a/src/www/wap_types.py +++ /dev/null @@ -1,85 +0,0 @@ -# -*- coding: iso-8859-1 -*- -# ----------------------------------------------------------------------- -# wap_types.py - Classes useful for the wap interface. -# ----------------------------------------------------------------------- -# $Id$ -# -# Notes: -# Todo: -# -# ----------------------------------------------------------------------- -# Freevo - A Home Theater PC framework -# Copyright (C) 2003 Krister Lagerstrom, et al. -# Please see the file freevo/Docs/CREDITS for a complete list of authors. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of MER- -# CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -# -# ----------------------------------------------------------------------- - - -import os, sys, time - -import config - -from twisted.web.resource import Resource - -TRUE = 1 -FALSE = 0 - -class FreevoWapResource(Resource): - - def render(self, request): - request.setHeader('Content-Type', 'text/vnd.wap.wml') - return self._render(request) - -class WapResource: - - def __init__(self): - self.res = '' - - def formValue(self, form=None, key=None): - if not form or not key: - return None - - try: - val = form[key][0] - except: - val = None - - return val - - def printHeader(self): - self.res += '\n' - self.res += '\n' - self.res += '\n' - - def printFooter(self): - self.res += '\n ' - - def validate(self, request): - session = request.getSession() - form = request.args - - username = self.formValue(form, 'u') - password = self.formValue(form, 'p') - - if not username : - session.validated="no" - else: - realpass = config.WWW_USERS.get(username) - if password == realpass: - session.validated="yes" - else: - session.validated="no"