Esempio n. 1
0
    def reject(self, req, form):
        """
        Reject a linkback
        """
        argd = wash_urlargd(form, {'linkbackid': (int, -1)})

        authorization = self.check_authorization_moderatelinkbacks(req, argd)
        if not authorization:
            reject_linkback(argd['linkbackid'], collect_user_info(req))
            return self.display(req, form)
        else:
            return authorization
Esempio n. 2
0
    def reject(self, req, form):
        """
        Reject a linkback
        """
        argd = wash_urlargd(form, {'linkbackid': (int, -1)})

        authorization = self.check_authorization_moderatelinkbacks(req, argd)
        if not authorization:
            reject_linkback(argd['linkbackid'], collect_user_info(req))
            return self.display(req, form)
        else:
            return authorization
Esempio n. 3
0
def perform_moderate_linkback(req, linkbackid, action):
    """
    Moderate linkbacks
    @param linkbackid: linkback id
    @param action: of CFG_WEBLINKBACK_ADMIN_MODERATION_ACTION
    @return CFG_WEBLINKBACK_ACTION_RETURN_CODE
    """
    if action == CFG_WEBLINKBACK_ADMIN_MODERATION_ACTION['APPROVE']:
        approve_linkback(linkbackid, collect_user_info(req))
    elif action == CFG_WEBLINKBACK_ADMIN_MODERATION_ACTION['REJECT']:
        reject_linkback(linkbackid, collect_user_info(req))
    else:
        return CFG_WEBLINKBACK_ACTION_RETURN_CODE['INVALID_ACTION']

    return CFG_WEBLINKBACK_ACTION_RETURN_CODE['OK']
Esempio n. 4
0
def perform_moderate_linkback(req, linkbackid, action):
    """
    Moderate linkbacks
    @param linkbackid: linkback id
    @param action: of CFG_WEBLINKBACK_ADMIN_MODERATION_ACTION
    @return CFG_WEBLINKBACK_ACTION_RETURN_CODE
    """
    if action == CFG_WEBLINKBACK_ADMIN_MODERATION_ACTION['APPROVE']:
        approve_linkback(linkbackid, collect_user_info(req))
    elif action == CFG_WEBLINKBACK_ADMIN_MODERATION_ACTION['REJECT']:
        reject_linkback(linkbackid, collect_user_info(req))
    else:
        return CFG_WEBLINKBACK_ACTION_RETURN_CODE['INVALID_ACTION']

    return CFG_WEBLINKBACK_ACTION_RETURN_CODE['OK']