예제 #1
0
def new_ds_file_comment(web, id):
    is_ok, result = get_episode_if_input_is_ok(web, Episode.link == id,
            exists   = ['author','comment','reply'],
            notempty = ['comment'] )
    if is_ok:
        build_and_save_comment(web, "datenspuren/" + id, result)
        result = None
    else: return direct(web, "/datenspuren/{0}/comment".format(id),
            errors = [result or "Captcha wrong"])
    return result or redirect("/datenspuren/" + id)
예제 #2
0
def new_ds_file_rating(web, id):
    is_ok, result = get_episode_if_input_is_ok(web, Episode.link == id,
            exists = ['score'], notempty = ['score'] )
    if is_ok:
        episode, result = result, None
        try:    score = int(web.input('score'))
        except: score = None
        if score is not None:
            if score in range(1,6):
                Rating(episode = episode.id, score = score).save()
    else: return direct(web, "/datenspuren/{0}/rate".format(id),
            errors = [result or "Captcha wrong"])
    return result or redirect("/datenspuren/" + id)
예제 #3
0
 def innerFunc(web, **kw):
     _get_current_user(web)
     if web.current_user:
         return func(web, **kw)
     else:
         return juno.redirect("/login")
예제 #4
0
 def favicon(web):
     redirect("/static/favicon.ico")
예제 #5
0
 def restart(web):
     RTorrent().restart()
     redirect("/")
예제 #6
0
 def queue_torrent(web, filename):
     RTorrent().queue(filename)
     redirect("/")
예제 #7
0
 def push_torrent(web, filename):
     RTorrent().push(filename)
     redirect("/")
예제 #8
0
 def reload_torrent(web, filename):
     RTorrent().reload(filename)
     redirect("/")
예제 #9
0
 def remove_torrent(web, tid):
     RTorrent().safe_erase_torrent(tid)
     redirect("/")
예제 #10
0
 def resume_torrent(web, tid):
     RTorrent().resume(tid)
     redirect("/")
예제 #11
0
 def pause_torrent(web, tid):
     RTorrent().pause(tid)
     redirect("/")
예제 #12
0
def verify_email_key(web):
    if not model.user.UserConfirmationEmail(web.input('email')).activate(web.input('key')):
        juno.redirect("/signup")
        return False
    return True