!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/5.6.40 

uname -a: Linux cpanel06wh.bkk1.cloud.z.com 2.6.32-954.3.5.lve1.4.80.el6.x86_64 #1 SMP Thu Sep 24
01:42:00 EDT 2020 x86_64
 

uid=851(cp949260) gid=853(cp949260) groups=853(cp949260) 

Safe-mode: OFF (not secure)

/usr/lib/python2.6/site-packages/clcommon/   drwxr-xr-x
Free 201.75 GB of 981.82 GB (20.55%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     clemail.py (1.86 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
# ClEmail - class for generation email messages

import os
import jinja2

# Subject line prefix in template file
SUBJECT_LINE_PREFIX = 'Subject:'


class ClEmail:
    def __init__(self):
        pass

    @staticmethod
    def generate_mail_jinja2(template_dir, templ_filename, templ_data=None, locale_name=None, subject=None):
        """
        Generates email message using jinja2 template engine
        :param template_dir: Base templates directory
        :param templ_filename: Template filename
        :param templ_data: Data to fill template using jinja2
        :param locale_name: Locale
        :param subject: Email subject to use if it not found in template
        :return: Cortege (email_subject, email_body)
        """
        # default locale is en_US
        def_locale = 'en_US'
        locale_name = locale_name or def_locale
        templ_dir = os.path.join(template_dir, locale_name)
        if locale_name != def_locale and not os.path.isfile(os.path.join(templ_dir, templ_filename)):
            templ_dir = os.path.join(template_dir, def_locale)
        template_file = os.path.join(templ_dir, templ_filename)
        # Read template file content
        f_template = open(template_file, "r")
        template_lines = f_template.readlines()
        f_template.close()
        # Search subject string in template content
        if len(template_lines) > 2 and template_lines[0].startswith(SUBJECT_LINE_PREFIX) and template_lines[1] == '\n':
            subject = template_lines[0].replace(SUBJECT_LINE_PREFIX, '').strip()
            # Remove Subject line and separator (empty line) from array
            template_lines.pop(1)
            template_lines.pop(0)
            pass
        # Create dictionary for jinja2 Dict Loader
        template_lines = [l.decode('utf-8') for l in template_lines]
        templ_dict = {templ_filename: ''.join(template_lines)}
        templ_loader = jinja2.DictLoader(templ_dict)
        templ_envir = jinja2.Environment(loader=templ_loader)
        body_message = templ_envir.get_template(templ_filename).render(templ_data)
        return subject, body_message.encode('utf-8')

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0119 ]--