Changeset 4ece09eb35ce84edccba693ba5b6dbeac35f7684

Show
Ignore:
Timestamp:
03/23/08 16:48:15 (10 months ago)
Author:
KRKeegan <-NOSPAM-kevin@krkeegan.com>
git-committer:
KRKeegan <-NOSPAM-kevin@krkeegan.com> 1206308895 -0700
git-parent:

[f203746c577cb511d4af28c9b223bcf279a8715b]

git-author:
KRKeegan <-NOSPAM-kevin@krkeegan.com> 1206308895 -0700
Message:

Add error message when incorrect MAK is entered

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plugins/admin/admin.py

    r88bbc14 r4ece09e  
    176176                        handle = urllib2.urlopen(r) 
    177177                    except IOError, e: 
    178                         print "Possibly wrong Media Access Key, or IP address for your TiVo." 
    179                         handler.send_response(404) 
     178                        handler.send_response(200) 
    180179                        handler.end_headers() 
     180                        t = Template(file=os.path.join(SCRIPTDIR,'templates', 'redirect.tmpl')) 
     181                        t.container = cname 
     182                        t.time = '20' 
     183                        t.url = '/TiVoConnect?Command=NPL&Container=' + cname 
     184                        t.text = '<h3>Unable to Connect to TiVo.</h3>  <br>pyTivo was unable to connect to the TiVo at ' + tivoIP +\ 
     185                                 '<br>This most likely caused by an incorrect Media Access Key.  Please return to the ToGo page and double check your Media Access Key.' +\ 
     186                                 '<br> The <a href="/TiVoConnect?Command=NPL&Container='+ cname + '"> ToGo</a> page will reload in 20 seconds.' 
     187                        handler.wfile.write(t) 
    181188                        return  
    182189                    tivo_cache[theurl]['thepage'] = handle.read() 
     
    186193                    handle = urllib2.urlopen(r) 
    187194                except IOError, e: 
    188                     print "Possibly wrong Media Access Key, or IP address for your TiVo." 
    189                     handler.send_response(404) 
     195                    handler.send_response(200) 
    190196                    handler.end_headers() 
     197                    t = Template(file=os.path.join(SCRIPTDIR,'templates', 'redirect.tmpl')) 
     198                    t.container = cname 
     199                    t.time = '20' 
     200                    t.url = '/TiVoConnect?Command=NPL&Container=' + cname 
     201                    t.text = '<h3>Unable to Connect to TiVo.</h3>  <br>pyTivo was unable to connect to the TiVo at ' + tivoIP +\ 
     202                             '<br>This most likely caused by an incorrect Media Access Key.  Please return to the ToGo page and double check your Media Access Key.' +\ 
     203                             '<br> The <a href="/TiVoConnect?Command=NPL&Container='+ cname + '"> ToGo</a> page will reload in 20 seconds.' 
     204                    handler.wfile.write(t) 
    191205                    return 
    192206                tivo_cache[theurl] = {}