示例#1
0
文件: accounts.py 项目: prataprc/zeta
    def forgotpass( self, environ ) :
        """Prompt user for his/her email-id to construct a reset-link
        URLS :
            /accounts/forgotpass?form=request&formname=forgotpass
            /accounts/forgotpass?form=submit&formname=forgotpass
        """
        from zeta.config.environment    import userscomp
        
        c.rclose = h.ZResp()

        c.errormsg = ''
        if c.form == 'submit' and c.formname == 'forgotpass' :
            # Send email to user with resetpassword link.
            emailid = request.POST.get( 'emailid', None )
            user = userscomp.userbyemailid( unicode(emailid) )
            if user :
                digest  = sha1( user.username + user.emailid + user.password 
                              ).hexdigest()
                fullurl = "%s/%s" % ( h.urlroot(environ),
                                      self.url_forresetp(digest, emailid) )
                resetpasswd( config, emailid, fullurl, c.sysentries['sitename'] )
            else :
                c.errormsg = 'Invalid emailid'

        # Generate page
        c.rclose.append( render( '/derived/accounts/forgotpass.html' ))
        return c.rclose
示例#2
0
 def feed( self, environ ) :
     """feed for site"""
     title = 'SiteTimeline'
     link = h.urlroot(environ)
     descr = 'Timeline for Site'
     feed = h.FeedGen( title, link, descr )
     self.tline_controller(
             h.r_sitetline, {}, [], 1, None, None, modelobj=None 
     )
     feedhtml = self.feeds( environ, link, feed, c.logs )
     response.content_type = 'application/atom+xml'
     return feedhtml
示例#3
0
文件: tag.py 项目: prataprc/zeta
    def feeds( self, environ ) :
        """Action for all timeline pages."""
        from zeta.config.environment    import tagcomp

        # Setup context for page generation
        title = 'tags'
        link = h.urlroot(environ)
        descr = 'Timeline for tags'
        feed   = h.FeedGen( title, link, descr )
        self.tline_controller(
            h.r_tagstline, {}, 'tag', 1, None, None, c.tag
        )
        feedhtml = self.feeds( environ, link, feed, c.logs )
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#4
0
文件: userpage.py 项目: prataprc/zeta
    def feeds( self, environ ) :
        """Feed for user timeline
        URLS :
            /u/feed
        """
        from zeta.config.environment import userscomp

        title = 'UsersTimeline'
        link = h.urlroot(environ)
        descr = 'Timeline for all users'
        c.user = None
        feed   = h.FeedGen( title, link, descr )
        self.tline_controller( h.r_userstline, {}, 'user', 1, None, None, c.user )
        feedhtml = self.feeds( environ, link, feed, c.logs )
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#5
0
文件: license.py 项目: prataprc/zeta
    def feed(self, environ, licid=''):
        """Action for all license pages.
        URLS : 
            /license/feed/<licid>
        """
        from zeta.config.environment import liccomp

        title = '%s(%s):timeline' % (c.license.licensename, licid_i)
        link = h.urlroot(environ)
        descr = 'Timeline for license %s' % c.license.licensename
        feed = h.FeedGen(title, link, descr)
        self.tline_controller(h.r_lictimeline, {}, 'license', 1, None, None,
                              c.license)
        feedhtml = self.feeds(environ, link, feed, c.logs)
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#6
0
文件: license.py 项目: prataprc/zeta
    def feeds(self, environ):
        """Feed of activity log for all license pages
        URLS : 
            /license/feed
        """
        from zeta.config.environment import liccomp

        title = 'LicenseTimeline'
        link = h.urlroot(environ)
        descr = 'Timeline for License'
        feed = h.FeedGen(title, link, descr)
        self.tline_controller(h.r_lictimelines, {}, 'license', 1, None, None,
                              c.license)
        feedhtml = self.feeds(environ, link, feed, c.logs)
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#7
0
    def feeds(self, environ, projectname):
        """Aggregate activities under project review or individual review
        URLS :
            /p/{projectname}/r/feed
        """

        title = '%s:review' % projectname
        link = h.urlroot(environ)
        descr = 'Timeline for review, in project %s' % projectname
        c.projsummary = c.project.summary
        feed = h.FeedGen(title, link, descr)
        routeargs = {'projectname': projectname}
        self.tline_controller(h.r_projrevwtlines, routeargs,
                              ['review', 'project'], 1, None, None, c.project)
        feedhtml = self.feeds(environ, link, feed, c.logs)
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#8
0
文件: projects.py 项目: prataprc/zeta
    def feed( self, environ, projectname ) :
        """Aggregate all the activities under the project, and provide them as
        feed
        URLS :
            /p/<projectname>/feed
        """
        from zeta.config.environment    import tlcomp

        # Setup context for page generation
        c.projsummary = c.project.summary
        title = projectname + ':timeline'
        link = h.urlroot(environ)
        descr = 'Timeline for project, %s' % projectname
        c.alllogs = tlcomp.fetchprojlogs( c.project, limit=h.TLCOUNT+1, id=None)
        c.logs = c.alllogs[:100]
        feed = h.FeedGen( title, link, descr )
        feedhtml = self.feeds( environ, link, feed, c.logs )
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#9
0
    def feed(self, environ, projectname, vcsid):
        """Aggregate activities under project vcs or individual vcs
        URLS : 
            /p/{projectname}/s/feed/{vcsid}
        """
        from zeta.config.environment import projcomp, vcscomp

        c.projsummary = c.project.summary
        title = '%s-vcs:%s' % (projectname, c.vcs.name)
        link = h.urlroot(environ)
        descr = 'Timeline for vcs, %s in project %s' % (c.vcs.name,
                                                        projectname)
        feed = h.FeedGen(title, link, descr)
        routeargs = {'projectname': projectname, 'vcsid': vcsid}
        self.tline_controller(h.r_projvcstline, routeargs, 'vcs', 1, None,
                              None, c.vcs)
        feedhtml = self.feeds(environ, link, feed, c.logs)
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#10
0
文件: projwiki.py 项目: prataprc/zeta
    def feeds(self, environ, projectname):
        """Aggregate activities under project wiki or individual wiki
        URLS : 
            /p/{projectname}/wiki/feed
        """
        from zeta.config.environment import projcomp, wikicomp

        # Setup context for page generation
        title = '%s:wikis' % projectname
        link = h.urlroot(environ)
        descr = 'Timeline for wikipages, in project %s' % projectname
        c.projsummary = c.project.summary
        feed = h.FeedGen(title, link, descr)
        routeargs = {'projectname': projectname}
        self.tline_controller(h.r_projwikistline, routeargs,
                              ['wiki', 'project'], 1, None, None, c.project)
        feedhtml = self.feeds(environ, link, feed, c.logs)
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#11
0
文件: userpage.py 项目: prataprc/zeta
    def feed( self, environ, username ) :
        """Feed for user timeline
        URLS :
            /u/feed/{username}
        """
        from zeta.config.environment import userscomp

        title = '%s:timeline' % c.user.username
        link = h.urlroot(environ)
        descr = 'Timeline for user %s' % c.user.username
        c.user = userscomp.get_user( username )
        feed   = h.FeedGen( title, link, descr )
        self.tline_controller( 
            h.r_usertline, { 'username': username },
            'user', 1, None, None, c.user
        )
        feedhtml = self.feeds( environ, link, feed, c.logs )
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#12
0
    def feed(self, environ, projectname, tckid):
        """Activities under project tickets or individual ticket
        URLS :
            /p/{projectname}/t/feed/{tckid}
        """
        from zeta.config.environment import projcomp, tckcomp

        # Setup context for page generation
        title = '%s-ticket:(%s)' % (projectname, tckid)
        link = h.urlroot(environ)
        descr = 'Timeline for ticket %s in project %s' % (tckid, projectname)
        c.projsummary = c.project.summary
        feed = h.FeedGen(title, link, descr)
        routeargs = {'projectname': projectname, 'tckid': tckid}
        self.tline_controller(h.r_projtcktline, routeargs, 'ticket', 1, None,
                              None, c.ticket)
        feedhtml = self.feeds(environ, link, feed, c.logs)
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#13
0
    def feed(self, environ, projectname, revwid=''):
        """Aggregate activities under project review or individual review
        URLS :
            /p/{projectname}/r/feed/{revwid}
        """
        from zeta.config.environment import revcomp

        title = '%s-revw:%s' % (projectname, revwid)
        link = h.urlroot(environ)
        descr = 'Timeline for review, %s in project %s' % (
            c.review.resource_url, projectname)
        c.projsummary = c.project.summary
        c.review = revcomp.get_review(int(revwid)) if revwid else None
        feed = h.FeedGen(title, link, descr)
        routeargs = {'projectname': projectname, 'revwid': revwid}
        self.tline_controller(h.r_projrevwtline, routeargs, 'review', 1, None,
                              None, c.review)
        feedhtml = self.feeds(environ, link, feed, c.logs)
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#14
0
文件: projects.py 项目: prataprc/zeta
    def feedadmin( self, environ, projectname ) :
        """Aggregate all the activities under the project
        URLS :
            /p/<projectname>/feed/admin
        """
        from zeta.config.environment    import projcomp

        # Setup context for page generation
        c.projsummary = c.project.summary
        title = projectname + ':admintimeline'
        link = h.urlroot(environ)
        descr = 'Timeline for project administration, %s' % projectname
        feed = h.FeedGen( title, link, descr )
        routeargs  = { 'projectname' : projectname }
        self.tline_controller(
            h.r_projadmtline, routeargs, 'project', 1, None, None, c.project
        )
        feedhtml = self.feeds( environ, link, feed, c.logs )
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#15
0
文件: projwiki.py 项目: prataprc/zeta
    def feed(self, environ, projectname, wurl):
        """Aggregate activities under project wiki or individual wiki
        URLS :
            /p/{projectname}/wiki/feed/*(wurl)
        """
        from zeta.config.environment import projcomp, wikicomp

        # Setup context for page generation
        title = '%s-wiki:%s' % (projectname, wurl)
        link = h.urlroot(environ)
        descr = 'Timeline for wikipage, %s in project %s' % (wurl, projectname)
        c.projsummary = c.project.summary
        wikiurl = self.url_wikiurl(projectname, wurl)
        c.wiki = wikicomp.get_wiki(unicode(wikiurl))
        routeargs = {'projectname': projectname, 'wurl': wurl}
        feed = h.FeedGen(title, link, descr)
        self.tline_controller(h.r_projwikitline, routeargs, 'wiki', 1, None,
                              None, c.wiki)
        feedhtml = self.feeds(environ, link, feed, c.logs)
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#16
0
    def feeds(self, environ, projectname):
        """Aggregate activities under project vcs or individual vcs
        URLS :
            /p/{projectname}/s/feed
        """
        from zeta.config.environment import projcomp, vcscomp

        host = environ['HTTP_HOST']
        script = environ['SCRIPT_NAME']

        # Setup context for page generation
        c.projsummary = c.project.summary
        title = '%s:vcs' % projectname
        link = h.urlroot(environ)
        descr = 'Timeline for vcs, in project %s' % projectname
        feed = h.FeedGen(title, link, descr)
        routeargs = {'projectname': projectname}
        self.tline_controller(h.r_projvcstlines, routeargs, ['vcs', 'project'],
                              1, None, None, c.project)
        feedhtml = self.feeds(environ, link, feed, c.logs)
        response.content_type = 'application/atom+xml'
        return feedhtml
示例#17
0
    def feed( self, environ ) :
        """feed on attachments.
        URLS :
            /attachment/feeds
        """
        self.tline_controller(
            h.r_attachtimeline, {}, 'attachment',
            1, None, None, modelobj=None
        )
        title = 'AttachTimeline'
        link = h.urlroot(environ)
        descr = 'Timeline for Attachments'

        feed   = h.FeedGen( title, link, descr )
        for l in c.logs :
            summary, lnk, content = h.log2feed( l )
            feed.add_item(
                    summary, '%s%s' % (link,lnk), content,
                    pubdate=l.created_on, unique_id=str(l.id),
                    author_name=l.user.username
            )
        response.content_type = 'application/atom+xml'
        feedhtml = feed.writeString('utf-8')
        return feedhtml