示例#1
0
def build_pdf(rows):
    "Build PDF"
    pdffile = StringIO()
    doc = BaruwaPDFTemplate(pdffile, topMargin=50, bottomMargin=18)
    import baruwa
    here = os.path.dirname(os.path.dirname(os.path.abspath(baruwa.__file__)))
    logo = os.path.join(here, 'baruwa', 'public', 'imgs', 'logo.png')
    img = Image(logo)
    logobj = [(img, _('Audit Log exported report'))]
    logo_table = Table(logobj, [2.0 * inch, 5.4 * inch])
    logo_table.setStyle(PIE_TABLE)
    parts = [logo_table]
    parts.append(Spacer(1, 20))
    parts.append(Paragraph(_('Audit Logs'), STYLES['Heading1']))
    heading = ((
        Paragraph(_('Date/Time'), STYLES["Heading6"]),
        Paragraph(_('Username'), STYLES["Heading6"]),
        Paragraph(_('Info'), STYLES["Heading6"]),
        Paragraph(_('Hostname'), STYLES["Heading6"]),
        Paragraph(_('Remote IP'), STYLES["Heading6"]),
        Paragraph(_('Action'), STYLES["Heading6"]),
    ))
    rows.insert(0, heading)
    table = Table(rows, [
        1.10 * inch,
        1.23 * inch,
        1.96 * inch,
        1.69 * inch,
        0.95 * inch,
        0.45 * inch,
    ])
    table.setStyle(
        TableStyle([
            ('FONTSIZE', (0, 0), (-1, -1), 8),
            ('FONT', (0, 0), (-1, -1), 'Helvetica'),
            ('FONT', (0, 0), (-1, 0), 'Helvetica-Bold'),
            ('GRID', (0, 0), (-1, -1), 0.15, colors.black),
        ]))
    parts.append(table)
    doc.title = _('Baruwa Audit log export')
    doc.build(parts)
    return pdffile.getvalue()
示例#2
0
def build_pdf(rows):
    "Build PDF"
    pdffile = StringIO()
    doc = BaruwaPDFTemplate(pdffile, topMargin=50, bottomMargin=18)
    import baruwa
    here = os.path.dirname(
                os.path.dirname(os.path.abspath(baruwa.__file__))
            )
    logo = os.path.join(here, 'baruwa', 'public', 'imgs', 'logo.png')
    img = Image(logo)
    logobj = [(img, _('Audit Log exported report'))]
    logo_table = Table(logobj, [2.0 * inch, 5.4 * inch])
    logo_table.setStyle(PIE_TABLE)
    parts = [logo_table]
    parts.append(Spacer(1, 20))
    parts.append(Paragraph(_('Audit Logs'), STYLES['Heading1']))
    heading = ((Paragraph(_('Date/Time'), STYLES["Heading6"]),
            Paragraph(_('Username'), STYLES["Heading6"]),
            Paragraph(_('Info'), STYLES["Heading6"]),
            Paragraph(_('Hostname'), STYLES["Heading6"]),
            Paragraph(_('Remote IP'), STYLES["Heading6"]),
            Paragraph(_('Action'), STYLES["Heading6"]),
            ))
    rows.insert(0, heading)
    table = Table(rows, [1.10 * inch, 1.23 * inch,
                        1.96 * inch, 1.69 * inch,
                        0.95 * inch, 0.45 * inch,])
    table.setStyle(TableStyle([
            ('FONTSIZE', (0, 0), (-1, -1), 8),
            ('FONT', (0, 0), (-1, -1), 'Helvetica'),
            ('FONT', (0, 0), (-1, 0), 'Helvetica-Bold'),
            ('GRID', (0, 0), (-1, -1), 0.15, colors.black),
    ]))
    parts.append(table)
    doc.title = _('Baruwa Audit log export')
    doc.build(parts)
    return pdffile.getvalue()
示例#3
0
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Settings audit messages"

from baruwa.lib.misc import _


ADDACCSIG_MSG = _("Account: %(u)s signature created")
UPDATEACCSIG_MSG = _("Account: %(u)s signature updated")
DELETEACCSIG_MSG = _("Account: %(u)s signature deleted")
ADDDOMSIG_MSG = _("Domain: %(d)s signature created")
UPDATEDOMSIG_MSG = _("Domain: %(d)s signature updated")
DELETEDOMSIG_MSG = _("Domain: %(d)s signature deleted")
HOSTADD_MSG = _("Node: %(n)s created")
HOSTUPDATE_MSG = _("Node: %(n)s updated")
HOSTDELETE_MSG = _("Node: %(n)s deleted")
HOSTSETTING_MSG = _("Scanner %(svr)s setting: %(s)s set to %(a)s")
# SCANNERSETTING_MSG = _("Default Scanner setting: %(s)s set to %(as)s")
DKIMGEN_MSG = _("DKIM keys generated for: %(d)s")
DKIMENABLED_MSG = _("DKIM signing enabled for: %(d)s")
DKIMDISABLED_MSG = _("DKIM signing disabled for: %(d)s")
POLICYADD_MSG = _("Policy: %(u)s of type: %(t)s created")
POLICYUPDATE_MSG = _("Policy: %(u)s of type: %(t)s updated")
示例#4
0
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Accounts audit messages"

from baruwa.lib.misc import _


ADDACCOUNT_MSG = _("User account: %(u)s created")
UPDATEACCOUNT_MSG = _("User account: %(u)s updated")
DELETEACCOUNT_MSG = _("User account: %(u)s deleted")
PASSWORDCHANGE_MSG = _("User account: %(u)s password changed")
ADDRADD_MSG = _("Alias: %(a)s added to account: %(ac)s")
ADDRUPDATE_MSG = _("Email Alias: %(a)s on account: %(ac)s updated")
ADDRDELETE_MSG = _("Email Alias: %(a)s on account: %(ac)s deleted")
ACCOUNTEXPORT_MSG = _("Accounts exported")
ACCOUNTIMPORT_MSG = _("Accounts imported")
ACCOUNTLOGIN_MSG = _("User: %(u)s logged in")

__all__ = [
    'ADDACCOUNT_MSG',
    'UPDATEACCOUNT_MSG',
    'DELETEACCOUNT_MSG',
    'PASSWORDCHANGE_MSG',
示例#5
0
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Settings audit messages"

from baruwa.lib.misc import _

ADDACCSIG_MSG = _("Account: %(u)s signature created")
UPDATEACCSIG_MSG = _("Account: %(u)s signature updated")
DELETEACCSIG_MSG = _("Account: %(u)s signature deleted")
ADDDOMSIG_MSG = _("Domain: %(d)s signature created")
UPDATEDOMSIG_MSG = _("Domain: %(d)s signature updated")
DELETEDOMSIG_MSG = _("Domain: %(d)s signature deleted")
HOSTADD_MSG = _("Node: %(n)s created")
HOSTUPDATE_MSG = _("Node: %(n)s updated")
HOSTDELETE_MSG = _("Node: %(n)s deleted")
HOSTSETTING_MSG = _("Scanner %(svr)s setting: %(s)s set to %(a)s")
# SCANNERSETTING_MSG = _("Default Scanner setting: %(s)s set to %(as)s")
DKIMGEN_MSG = _("DKIM keys generated for: %(d)s")
DKIMENABLED_MSG = _("DKIM signing enabled for: %(d)s")
DKIMDISABLED_MSG = _("DKIM signing disabled for: %(d)s")
POLICYADD_MSG = _("Policy: %(u)s of type: %(t)s created")
POLICYUPDATE_MSG = _("Policy: %(u)s of type: %(t)s updated")
示例#6
0
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Accounts audit messages"

from baruwa.lib.misc import _

QUEUERELEASE_MSG = _("Queued Message-ID: %(m)s released to %(a)s")
QUEUEDELETE_MSG = _("Queued Message-ID: %(m)s deleted from %(q)s queue")
QUEUEPREVIEW_MSG = _("Queued Message-ID: %(m)s preview")
QUEUEDOWNLOAD_MSG = _("Queued Message-ID: %(m)s downloaded attachment %(a)s")
HOSTSTATUS_MSG = _("Node status for: %(n)s viewed")
HOSTSALINT_MSG = _("Node lint status for: %(n)s viewed")
HOSTBAYES_MSG = _("Node bayes stats for: %(n)s viewed")
AUDITLOGEXPORT_MSG = _("Audit log exported")

__all__ = [
    'QUEUERELEASE_MSG',
    'QUEUEDELETE_MSG',
    'QUEUEPREVIEW_MSG',
    'QUEUEDOWNLOAD_MSG',
    'HOSTSTATUS_MSG',
    'HOSTSALINT_MSG',
示例#7
0
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Messages audit messages"

from baruwa.lib.misc import _


MSGRELEASE_MSG = _("Message with id: %(m)s released to %(a)s")
MSGLEARN_MSG = _("Message with id: %(m)s learnt as %(l)s")
MSGDELETE_MSG = _("Message with id: %(m)s deleted from quarantine")
MSGPREVIEW_MSG = _("Message with id: %(m)s previewed")
MSGDOWNLOAD_MSG = _("Message with id: %(m)s attachment %(a)s downloaded")


__all__ = [
    'MSGRELEASE_MSG',
    'MSGLEARN_MSG',
    'MSGDELETE_MSG',
    'MSGPREVIEW_MSG',
    'MSGDOWNLOAD_MSG',
]
示例#8
0
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Accounts audit messages"

from baruwa.lib.misc import _


QUEUERELEASE_MSG = _("Queued Message-ID: %(m)s released to %(a)s")
QUEUEDELETE_MSG = _("Queued Message-ID: %(m)s deleted from %(q)s queue")
QUEUEPREVIEW_MSG = _("Queued Message-ID: %(m)s preview")
QUEUEDOWNLOAD_MSG = _("Queued Message-ID: %(m)s downloaded attachment %(a)s")
HOSTSTATUS_MSG = _("Node status for: %(n)s viewed")
HOSTSALINT_MSG = _("Node lint status for: %(n)s viewed")
HOSTBAYES_MSG = _("Node bayes stats for: %(n)s viewed")
AUDITLOGEXPORT_MSG = _("Audit log exported")


__all__ = [
    'QUEUERELEASE_MSG',
    'QUEUEDELETE_MSG',
    'QUEUEPREVIEW_MSG',
    'QUEUEDOWNLOAD_MSG',
    'HOSTSTATUS_MSG',
示例#9
0
# vim: ai ts=4 sts=4 et sw=4
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2015  Andrew Colin Kissa <*****@*****.**>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Reports audit messages"

from baruwa.lib.misc import _


REPORTVIEW_MSG = _("Report: %(r)s viewed")
REPORTDL_MSG = _("Report: %(r)s downloaded as %(f)s")


__all__ = [
    'REPORTVIEW_MSG',
    'REPORTDL_MSG',
]
示例#10
0
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Messages audit messages"

from baruwa.lib.misc import _

MSGRELEASE_MSG = _("Message with id: %(m)s released to %(a)s")
MSGLEARN_MSG = _("Message with id: %(m)s learnt as %(l)s")
MSGDELETE_MSG = _("Message with id: %(m)s deleted from quarantine")
MSGPREVIEW_MSG = _("Message with id: %(m)s previewed")
MSGDOWNLOAD_MSG = _("Message with id: %(m)s attachment %(a)s downloaded")

__all__ = [
    'MSGRELEASE_MSG',
    'MSGLEARN_MSG',
    'MSGDELETE_MSG',
    'MSGPREVIEW_MSG',
    'MSGDOWNLOAD_MSG',
]
示例#11
0
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Organizations audit messages"

from baruwa.lib.misc import _


ADDORG_MSG = _("Organization: %(o)s added")
UPDATEORG_MSG = _("Organization: %(o)s updated")
DELETEORG_MSG = _("Organization: %(o)s deleted")
IMPORTORG_MSG = _("Organization: %(o)s domains imported")
# EXPORTORG_MSG = _("Organization: %(o)s domains exported")
ADDRELAY_MSG = _("Relay: %(r)s added")
UPDATERELAY_MSG = _("Relay: %(r)s updated")
DELETERELAY_MSG = _("Relay: %(r)s deleted")


__all__ = [
    'ADDORG_MSG',
    'UPDATEORG_MSG',
    'DELETEORG_MSG',
    'IMPORTORG_MSG',
    # 'EXPORTORG_MSG',
示例#12
0
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2015  Andrew Colin Kissa <*****@*****.**>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Lists audit messages"

from baruwa.lib.misc import _

LISTADD_MSG = _("Sender: %(s)s added to %(l)s")
LISTDEL_MSG = _("Sender: %(s)s deleted from %(l)s")

__all__ = [
    'LISTADD_MSG',
    'LISTDEL_MSG',
]
示例#13
0
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2015  Andrew Colin Kissa <*****@*****.**>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Reports audit messages"

from baruwa.lib.misc import _

REPORTVIEW_MSG = _("Report: %(r)s viewed")
REPORTDL_MSG = _("Report: %(r)s downloaded as %(f)s")

__all__ = [
    'REPORTVIEW_MSG',
    'REPORTDL_MSG',
]
示例#14
0
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Organizations audit messages"

from baruwa.lib.misc import _

ADDORG_MSG = _("Organization: %(o)s added")
UPDATEORG_MSG = _("Organization: %(o)s updated")
DELETEORG_MSG = _("Organization: %(o)s deleted")
IMPORTORG_MSG = _("Organization: %(o)s domains imported")
# EXPORTORG_MSG = _("Organization: %(o)s domains exported")
ADDRELAY_MSG = _("Relay: %(r)s added")
UPDATERELAY_MSG = _("Relay: %(r)s updated")
DELETERELAY_MSG = _("Relay: %(r)s deleted")

__all__ = [
    'ADDORG_MSG',
    'UPDATEORG_MSG',
    'DELETEORG_MSG',
    'IMPORTORG_MSG',
    # 'EXPORTORG_MSG',
    'ADDRELAY_MSG',
示例#15
0
文件: lists.py 项目: TetraAsh/baruwa2
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4
# Baruwa - Web 2.0 MailScanner front-end.
# Copyright (C) 2010-2012  Andrew Colin Kissa <*****@*****.**>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Lists audit messages"

from baruwa.lib.misc import _


LISTADD_MSG = _("Sender: %(s)s added to %(l)s")
LISTDEL_MSG = _("Sender: %(s)s deleted from %(l)s")


__all__ = [
    'LISTADD_MSG',
    'LISTDEL_MSG',
]
示例#16
0
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#
"Domains audit messages"

from baruwa.lib.misc import _


ADDDOMAIN_MSG = _("Domain: %(d)s created")
UPDATEDOMAIN_MSG = _("Domain: %(d)s updated")
DELETEDOMAIN_MSG = _("Domain: %(d)s deleted")
ADDDOMALIAS_MSG = _("Domain Alias: %(d)s created")
UPDATEDOMALIAS_MSG = _("Domain Alias: %(d)s updated")
DELETEDOMALIAS_MSG = _("Domain Alias: %(d)s deleted")
EXPORTDOM_MSG = _("Domain: %(d)s accounts exported")
# IMPORTDOM_MSG = _("Domain: %(d)s accounts imported")
ADDDELSVR_MSG = _("Domain: %(d)s Delivery server: %(ds)s added")
UPDATEDELSVR_MSG = _("Domain: %(d)s Delivery server: %(ds)s updated")
DELETEDELSVR_MSG = _("Domain: %(d)s Delivery server: %(ds)s deleted")
ADDAUTHSVR_MSG = _("Domain: %(d)s AUTH server: %(ds)s added")
UPDATEAUTHSVR_MSG = _("Domain: %(d)s AUTH server: %(ds)s updated")
DELETEAUTHSVR_MSG = _("Domain: %(d)s AUTH server: %(ds)s deleted")
AUTHSETTINGS_MSG = _("Domain: %(d)s AUTH settings updated for: %(a)s")