summaryrefslogtreecommitdiff
path: root/filter_plugins/custom_filters.py
blob: 64054884f9217c85d725a7659f7e9661f161d06c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#/usr/bin/python3

class FilterModule(object):
    def filters(self):
        return {
            'format_userpass_output': self.format_userpass_output
        }

    def format_userpass_output(self, htpasswd_dict, hostname):
        msg = []
        msg.append("##################################################################")
        msg.append("###################  CHANGED USERS - HTPASSWD  ###################")
        for user in htpasswd_dict.keys():
            msg.append(f"{user}: {htpasswd_dict[user]} [LINK: http://{hostname}:80/{user}/index.html]")
        msg.append("##################################################################")
        return '\n'.join(msg)