Ejemplo n.º 1
0
    def post( self ):
        unique = str(uuid.uuid4())

        user_email = self.get_argument( "user_email" )
        user_nickname = self.get_argument( "user_nickname" )
        user_password = self.get_argument( "user_password" )

        # add this user to the database.
        user = User()
        user.email = self.get_argument("user_email")
        user.name = self.get_argument("user_nickname")
        user.password = self.get_argument("user_password")
        user.confirmUUID = unique

        uiuc = self.get_root_group()

        repo = UserRepository()
        repo.persist(user)
        user = repo.get_user_by_email(user_email)
        repo.add_user_to_group(user, uiuc)
        repo.close()

        ## Send a verification email to the user
        m = CukeMail()
        m.send_verification(unique, user.email)

        self.redirect( "/" )
Ejemplo n.º 2
0
    def _perform_request(self, user, attr, value):
        """Perform the update request. For simple (read: single attribute
        updates the 'name' is the attribute and the 'value' is a list of len 1
        containing the value. This isn't the case for multi-attribute edits."""

        value = value[0].decode("utf-8")
        setattr(user, attr, value)

        unique = str(uuid.uuid4())
        user.confirmed = False
        user.confirmUUID = unique

        self._persist_user(user)

        ## Send a verification email to the user
        m = CukeMail()
        m.send_verification(unique, user.email)
        self.clear_cookie(self.cookie_name)
Ejemplo n.º 3
0
    def _perform_request(self, user, name, values):
        meeting_time  = values[u"meeting_time"]
        meeting_message = values[u"meeting_message"]
        group_id = values[u"group_id"]
        curr_user = self.get_current_user()

        ur = UserRepository()
        users = ur.get_members_of_group(group_id)        
        ur.close()

        gr = GroupRepository()
        group = gr.fetch(group_id)
        gr.close()

        cm = CukeMail()
        cm.subject(group.name + " meeting @ " + meeting_time)
        cm.message(meeting_message)
        cm.send([user.email for user in users])

        self._persist_user(curr_user)