Plugin Directory

Changeset 1581581


Ignore:
Timestamp:
01/25/2017 12:10:26 AM (9 years ago)
Author:
osexcel
Message:

6.6.0

  • Added new OEM
  • Improved UI for all scanner sections
  • Fixed Firewall Scanner bug when variable is an nested array
  • Updated software update url to github url
  • Fixed virus scanner bug for whitelisted files
  • Plesk Panel support
  • Update PHP Mailer to latest version 5.2.22
Location:
ose-firewall/trunk
Files:
18 added
42 edited

Legend:

Unmodified
Added
Removed
  • ose-firewall/trunk/assets/config/define.php

    r1425230 r1581581  
    3131define('CENT_AI', false);
    3232define('TEST_ENV', false);
     33define('CENTRORA_SUPOORT',"Please contact Centrora Support team to address this issues at : [email protected]");
     34define("API_SERVER","https://www.centrora.com/accountApi/");
     35
    3336require_once(dirname(__FILE__).ODS.'uri.php');
    3437if (class_exists('JConfig') || class_exists('SConfig') || (defined('OSE_SUITE') && OSE_SUITE == true))
  • ose-firewall/trunk/assets/config/joomla.php

    r1442785 r1581581  
    2626if (!defined('OSE_FRAMEWORK') && !defined('OSEFWDIR') && !defined('_JEXEC'))
    2727{
    28     die('Direct Access Not Allowed');
     28    die('Direct Access Not Allowed');
    2929}
    3030
     
    3737
    3838if (class_exists('SConfig')) {
    39     define('OSE_FWURL',OURI::root().'components/com_ose_firewall/');
    40     if(!defined('JOOMLA15'))
    41     {
    42         define('JOOMLA15',false);
    43     }
    44     $conf = new SConfig ();
    45     if (!empty($conf->assets_url)) {
    46         define('OSE_BANPAGE_ADMIN', $conf->assets_url.'administrator/components/com_ose_firewall/');
    47     }
    48     else {
    49         define('OSE_BANPAGE_ADMIN', str_replace('administrator/', '', OURI::root() ). 'administrator/components/com_ose_firewall/');
    50     }
    51     define('CENTRORABACKUP_FOLDER', OSE_ABSPATH.ODS.'media'.ODS.'CentroraBackup');
    52     define('CENTRORABACKUP_ZIPFILE', OSE_ABSPATH.ODS.'media'.ODS.'CentroraBackup'.ODS.'Backup.zip');
     39    define('OSE_FWURL',OURI::root().'components/com_ose_firewall/');
     40    if(!defined('JOOMLA15'))
     41    {
     42
     43        define('JOOMLA15',false);
     44    }
     45    if(!defined('JOOMLA25'))
     46    {
     47        define('JOOMLA25',true);
     48    }
     49    if(!defined('JOOMLA3'))
     50    {
     51        define('JOOMLA3',false);
     52    }
     53
     54    $conf = new SConfig ();
     55    if (!empty($conf->assets_url)) {
     56        define('OSE_BANPAGE_ADMIN', $conf->assets_url.'administrator/components/com_ose_firewall/');
     57    }
     58    else {
     59        define('OSE_BANPAGE_ADMIN', str_replace('administrator/', '', OURI::root() ). 'administrator/components/com_ose_firewall/');
     60    }
     61    define('CENTRORABACKUP_FOLDER', OSE_ABSPATH.ODS.'media'.ODS.'CentroraBackup');
     62    define('CENTRORABACKUP_ZIPFILE', OSE_ABSPATH.ODS.'media'.ODS.'CentroraBackup'.ODS.'Backup.zip');
    5363}
    5464else {
    55     if (class_exists ('JURI')) {
    56         define('OSE_FWURL',JURI::root().'administrator/components/com_ose_firewall/');
    57     }
    58     else {
    59         define('OSE_FWURL',OURI::root().'components/com_ose_firewall/');
    60     }
    61     if (class_exists('JVersion')) {
    62         $version = new JVersion();
    63         $version = substr($version->getShortVersion(),0,3);
    64         if(!defined('JOOMLA15'))
    65         {
    66             $value = ($version >= '1.5' && $version < '1.6')?true:false;
    67             define('JOOMLA15',$value);
    68         }
    69     }
    70     else {
    71         define('JOOMLA15',false);
    72     }
    73     define('OSE_BANPAGE_ADMIN', str_replace('administrator/', '', OURI::root() ). 'administrator/components/com_ose_firewall');
    74     define('CENTRORABACKUP_FOLDER', JPATH_SITE.ODS.'media'.ODS.'CentroraBackup');
    75     define('CENTRORABACKUP_ZIPFILE', JPATH_SITE.ODS.'media'.ODS.'CentroraBackup'.ODS.'Backup.zip');
     65    if (class_exists ('JURI')) {
     66        define('OSE_FWURL',JURI::root().'administrator/components/com_ose_firewall/');
     67    }
     68    else {
     69        define('OSE_FWURL',OURI::root().'components/com_ose_firewall/');
     70    }
     71    if (class_exists('JVersion')) {
     72        $version = new JVersion();
     73        $version = substr($version->getShortVersion(),0,3);
     74        if($version >='2.0' && $version <'3.0')
     75        {
     76            define('JOOMLA25',true);
     77        }else if($version >= '3.0')
     78        {
     79            define('JOOMLA3',true);
     80        }
     81        if(!defined('JOOMLA15'))
     82        {
     83            $value = ($version >= '1.5' && $version < '1.6')?true:false;
     84            define('JOOMLA15',$value);
     85        }
     86    }
     87    else {
     88        define('JOOMLA15',false);
     89    }
     90    define('OSE_BANPAGE_ADMIN', str_replace('administrator/', '', OURI::root() ). 'administrator/components/com_ose_firewall');
     91    define('CENTRORABACKUP_FOLDER', JPATH_SITE.ODS.'media'.ODS.'CentroraBackup');
     92    define('CENTRORABACKUP_ZIPFILE', JPATH_SITE.ODS.'media'.ODS.'CentroraBackup'.ODS.'Backup.zip');
    7693}
    7794define('OSE_BANPAGE_URL', OSE_BANPAGE_ADMIN . ODS . 'public');
     
    88105define('OSE_WPURL',rtrim(OURI::base(), '/') );
    89106define('OSE_ADMINURL', OSE_WPURL.'/index.php?option=com_ose_firewall');
    90 define('OSE_FWRECONTROLLERS' , OSEFWDIR . 'classes' .ODS. 'App' . ODS . 'Controller' . ODS . 'remoteControllers'); 
     107define('OSE_FWRECONTROLLERS' , OSEFWDIR . 'classes' .ODS. 'App' . ODS . 'Controller' . ODS . 'remoteControllers');
    91108define('OSE_FWCONTROLLERS', OSEFWDIR . 'protected' . ODS . 'controllers');
    92109define('OSE_FWMODEL', OSEFWDIR . 'classes' . ODS.'App' . ODS . 'Model');
    93 define('OSE_FWFRAMEWORK', OSEFWDIR . ODS . 'classes' . ODS.'Library'); 
     110define('OSE_FWFRAMEWORK', OSEFWDIR . ODS . 'classes' . ODS.'Library');
    94111define('OSE_FWPUBLIC', OSEFWDIR . ODS . 'public');
    95112define('OSE_FWPUBLICURL', OSE_FWURL . 'public');
     
    120137define('OSE_FWDATA', OSEFWDIR . 'protected' . ODS.'data');
    121138
     139define('OSE_ADVANCEDRULES_TEMPFILE',CENTRORABACKUP_FOLDER.ODS."advancedrulestemp.php");
     140define('OSE_ADVANCEDRULES_RULESFILE',CENTRORABACKUP_FOLDER.ODS."2a9rKzWuOFWao.inc");
     141define('OSE_WEBLOGFOLDER',CENTRORABACKUP_FOLDER.ODS.'Weblog');
     142define('OSE_WEBLOG_BACKUPFOLDER',CENTRORABACKUP_FOLDER.ODS.'WeblogBackup');
     143define('OSE_WEBLOG_ZIP_PATH',OSE_WEBLOG_BACKUPFOLDER.ODS.'weblog.tar.gz');
     144define('OSE_WEBLOG_ZIP_DESTINATIONPATH',CENTRORABACKUP_FOLDER.ODS.'Weblog');
     145define('OSE_BRUTEFORCE_ATTEMPTS',CENTRORABACKUP_FOLDER.ODS.'bruteforceattempts.php');
     146define('OSE_VIRUSPATTERN_FILE',OSE_FWDATA . ODS . "vsscanPath" . ODS . "pattern.php");
     147define('OSE_WHITELIST_STRINGFILE',CENTRORABACKUP_FOLDER.ODS.'whiteliststring.php');
     148define('OSE_WHITELIST_VARIABLESFILE',CENTRORABACKUP_FOLDER.ODS.'whitelistvariables.php');
     149define('OSE_FWSCANNERV7_ERRORLOG',OSE_WEBLOGFOLDER.ODS.'errorlog.php');
     150define('OSE_CSV_EXPORTFILES', OSE_CONTENTFOLDER.ODS."csv");
     151define('EXPORT_DOWNLOAD_URL_FWS7', '?option=com_ose_firewall&view=ipmanagement&task=downloadCSV&action=downloadCSV&controller=IpManagement&filename=');
     152define('OSE_WEBLOG_TEMP_FOLDER',OSE_WEBLOGFOLDER.ODS.'logBackup');
     153define('OSE_CLASSICBACKUP_DBTABLESLIST',CENTRORABACKUP_FOLDER.'dbtableslist.php');
    122154
    123155?>
  • ose-firewall/trunk/assets/views/cfscan.php

    r1387925 r1581581  
    1010    ?>
    1111    <div id="oseappcontainer">
    12         <div class="container">
     12        <div class="container wrapbody">
    1313            <?php
    1414            $this->model->showLogo();
    15             $this->model->showHeader();
     15            //            $this->model->showHeader();
    1616            ?>
    1717            <div class="row">
     
    1919                    <div class="panel panel-primary plain ">
    2020                        <!-- Start .panel -->
    21                         <div class="panel-heading">
    22 
    23                         </div>
    24                         <div class="panel-body">
     21                        <div class="panel-body wrap-container">
     22                            <div class="row row-set">
     23                                <div class="col-sm-12 p-l-r-0"style="padding-right: 17px;">
     24                                    <div id="c-tag" style="height: 110px;">
     25                                        <div class="col-sm-12" style="padding-left: 0px;">
     26                                <span class="tag-title">Core Directories Scanner<span>
     27                                        </div>
     28                                        <p class="tag-content">Core directories Scanner is a neat and quick detector, it scans the core directories of your website and detects suspicious files. Please notice that this scanner only applies to joomla and wordpress.</p>
     29                                    </div>
     30                                </div>
     31                            </div>
     32
    2533                            <div class="row">
    26                                 <div id="scan-window" class="col-md-12">
    27                                     <div id='scan_progress' class="alert alert-info fade in">
    28                                         <div class="bg-primary alert-icon">
    29                                             <i class="glyphicon glyphicon-info-sign s24"></i>
    30                                         </div>
     34                                <div id="scan-window" class="col-md-12" style="padding-right: 16px; padding-left: 20px;">
     35                                    <div id='scan_progress' class="alert alert-info fade in" style="padding-top:20px;">
    3136                                        <strong>Status: </strong> <span id="p4text"></span>
    32 
    33                                         <div id='summary' class='col-md-12'>&nbsp;</div>
    34                                         <div id='modified' class='col-md-12'>&nbsp;</div>
    35                                         <div id='suspicious' class='col-md-12'>&nbsp;</div>
    36                                         <div id='missing' class='col-md-12'>&nbsp;</div>
    37                                     </div>
    38                                 </div>
    39                             </div>
    40                             <div class="row">
     37                                        <div class="col-sm-12" style="margin-top: 0px; padding:40px 15px 20px 0px; color: white;">
     38                                            <div id='modified' class='col-md-4' style="padding-left: 0px;">&nbsp;</div>
     39                                            <div id='suspicious' class='col-md-4' style="padding-left: 0px;">&nbsp;</div>
     40                                            <div id='missing' class='col-md-4' style="padding-left: 0px;">&nbsp;</div>
     41                                            <!--                                           <div id='summary' class='col-md-3'>&nbsp;</div>-->
     42                                        </div>
     43                                    </div>
     44                                </div>
     45                            </div>
     46                            <div class="row col-sm-12" style="padding-right: 20px;">
    4147                                <div id="scanbuttons">
    4248                                    <?php if (class_exists('SConfig')) { ?>
     
    4652                                        </button>
    4753                                    <?php } else { ?>
    48                                         <button id="cfscan" onclick="cfscan()" class='centrora-btn'><i
     54                                        <button id="cfscan" onclick="cfscan()" class='btn-new result-btn-set'><i
    4955                                                id="ic-change" class="glyphicon glyphicon-search text-primary"></i> <?php oLang::_('START_NEW_SCAN') ?>
    5056                                        </button>
     
    5864                                </div>
    5965                            </div>
     66                            <?php
     67                            $oem = new CentroraOEM();
     68                            $oemCustomer = $oem->hasOEMCustomer();
     69                            if(!empty($oemCustomer['data']['customer_id'])) {
     70                                echo $oem->getCallToActionAndFooter();
     71                            }else {?>
     72                                <?php  echo $this->model->getCallToActionAndFooter(); }?>
     73                        </div>
    6074                        </div>
    6175                    </div>
     
    7387    ?>
    7488    <div id="oseappcontainer">
    75         <div class="container">
     89        <div class="container wrapbody">
    7690            <?php
    7791            $this->model->showLogo();
    7892            ?>
    79             <div id="sub-header" class="row"
    80                  style="background:url('<?php echo 'http://www.googledrive.com/host/0B4Hl9YHknTZ4X2sxNTEzNTBJUlE/sub_hd_bg.png' ?>') top center;  min-height:500px;">
    81                 <div class="col-md-6" id="unsub-left">
    82                     <?php $this->model->showSubHeader(); ?>
    83                     <?php echo $this->model->getBriefDescription(); ?>
     93
     94            <div class="row">
     95                <div class="col-md-12">
     96                    <div class="panel panel-primary plain ">
     97                        <!-- Start .panel -->
     98                        <div class="panel-body wrap-container">
     99                            <!--                                           start subscription popup-->
     100
     101                            <!--                                            end subscription popup-->
     102                            <div class="row row-set">
     103                                <div class="col-sm-12 p-l-r-0"style="padding-right: 17px;">
     104                                    <div id="c-tag" style="height: 110px;">
     105                                        <div class="col-sm-12" style="padding-left: 0px;">
     106                                <span class="tag-title">Core Directories Scanner<span>
     107                                        </div>
     108                                        <p class="tag-content">Core directories Scanner is a neat and quick detector, it scans the core directories of your website and detects suspicious files. Please notice that this scanner only applies to joomla and wordpress.</p>
     109                                    </div>
     110                                </div>
     111                            </div>
     112
     113                            <div class="row">
     114                                <div id="scan-window" class="col-md-12" style="padding-right: 16px; padding-left: 20px;">
     115                                    <div id='scan_progress' class="alert alert-info fade in" style="padding-top:20px;">
     116                                        <strong>Status: </strong> <span id="p4text"></span>
     117                                        <div class="col-sm-12" style="margin-top: 0px; padding:40px 15px 20px 0px; color: white;">
     118                                            <div class="col-md-4"style="padding-left: 0px;">
     119                                                <div id='modified'>&nbsp;</div>
     120                                                <div class="btn-new btn-checkfilepath col-sm-7">Check file full path</div>
     121                                            </div>
     122                                            <div class="col-md-4" style="padding-left: 0px;">
     123                                                <div id='suspicious'>&nbsp;</div>
     124                                                <div class="btn-new btn-checkfilepath col-sm-7">Check file full path</div>
     125                                            </div>
     126                                            <div class="col-md-4" style="padding-left: 0px;">
     127                                                <div id='missing' class='col-md-4' style="padding-left: 0px;">&nbsp;</div>
     128                                            </div>
     129                                            <!--                                           <div id='summary' class='col-md-3'>&nbsp;</div>-->
     130                                        </div>
     131                                    </div>
     132                                </div>
     133                            </div>
     134                            <div class="row col-sm-12" style="padding-right: 20px;">
     135                                <div id="scanbuttons">
     136                                    <?php if (class_exists('SConfig')) { ?>
     137                                        <button data-target="#scanModal" data-toggle="modal" id="customscan"
     138                                                class='btn btn-sm mr5 mb10'><i
     139                                                class="glyphicon glyphicon-screenshot text-primary"></i> <?php oLang::_('START_NEW_SCAN') ?>
     140                                        </button>
     141                                    <?php } else { ?>
     142                                        <button id="cfscan" onclick="cfscan()" class='btn-new result-btn-set'><i
     143                                                id="ic-change" class="glyphicon glyphicon-search text-primary"></i> <?php oLang::_('START_NEW_SCAN') ?>
     144                                        </button>
     145                                    <?php }
     146                                    if ($_GET['centrora'] == 1) { ?>
     147                                        <button id="catchVirusMD5" onclick="catchVirusMD5()"
     148                                                class='btn btn-sm mr5 mb10'><i
     149                                                class="glyphicon glyphicon-search text-primary"></i> <?php oLang::_('CATCH_VIRUS_MD5') ?>
     150                                        </button>
     151                                    <?php } ?>
     152                                </div>
     153                            </div>
     154                            <div class="row row-set">
     155                                <div class="col-sm-12" style="margin-top:30px; padding-left: 0px; padding-right: 20px;">
     156                                    <a href="http://www.centrora.com/developers/" target="_blank"><div class="call-to-action">
     157                                            <div class="call-to-action-txt">
     158                                                <img width="35" height="35" alt="C_puma" src="http://googledrive.com/host/0BzcQR8G4BGjUX0ZzTzBvUVNEb00"> &nbsp;
     159                                                Leave the Time-Consuming Anti-Hacking and Malware Scanning to the Automate Centrora Security Solutions <sup>Now</sup></div>
     160                                        </div></a>
     161                                </div>
     162                            </div>
     163                            <div class="row">
     164                                <div id="footer" class="col-sm-12">
     165                                    <div>Centrora 2016 a portfolio of Luxur Group PTY LTD,  All rights reserved.</div>
     166                                </div>
     167                            </div>
     168                        </div>
     169                    </div>
    84170                </div>
    85                 <div class="col-md-6" id="unsub-right">
    86                     <a href="https://www.centrora.com/malware-removal" id="leavetous">leave the work to us now</a>
    87                 </div>
    88             </div>
    89             <div class="row">
    90                 <div id="unsub-lower">
    91                     <?php
    92                     include_once dirname(__FILE__) . '/calltoaction.php';
    93                     ?>
    94                 </div>
    95             </div>
     171
     172            </div>
     173
     174
    96175        </div>
    97176    </div>
  • ose-firewall/trunk/assets/views/dashboard.php

    r1425230 r1581581  
    88?>
    99<div>
    10     <input type="hidden" id="guideStatus" value = "<?php echo $guideStatus; ?>" />
     10    <input type="hidden" id="guideStatus" value = "<?php echo $guideStatus; ?>" />
    1111</div>
    12     <div id="oseappcontainer">
    13         <div class="container">
    14             <?php
    15             $this->model->showLogo();
    16             $this->model->showHeader();
    17             ?>
    18             <div class="row">
    19                 <div class="<?php
    20                 $numCol = ($hasOEMCustomer == false) ? 12 : 12;
    21                 echo 'col-md-' . $numCol;
    22                 ?>">
    23                     <div class="col-md-3">
    24                         <div class="panel panel-success">
    25                             <!--                            <div class="panel-heading">Panel heading without title</div>-->
    26                             <div class="panel-body" id="dashmenu" style="min-height: 300px;">
    27                                 <a href="javascript:void(0)" id="btn_country"
    28                                    class="col-md-12"><?php oLang::_('OVERVIEW_COUNTRY_MAP_BTN'); ?></a>
    29                                 <a href="javascript:void(0)" id="btn_traffic"
    30                                    class="col-md-12"><?php oLang::_('OVERVIEW_TRAFFICS_BTN'); ?></a>
    31                                 <a href="javascript:void(0)" id="btn_recentscan"
    32                                    class="col-md-12"><?php oLang::_('RECENT_SCANNING_RESULT_BTN'); ?></a>
    33                                 <a href="javascript:void(0)" id="btn_recenthack"
    34                                    class="col-md-12"><?php oLang::_('RECENT_HACKING_INFO_BTN'); ?></a>
    35                                 <a href="javascript:void(0)" id="btn_backup"
    36                                    class="col-md-12"><?php oLang::_('RECENT_BACKUP_BTN'); ?></a>
    37                             </div>
    38                             <div id="dashboardStyle">
    39                                 Style:<br>
    40                                 <select id="style" value="dynamic">
    41                                     <option value="dynamic" selected="<?php $dynamic_default; ?>">dynamic</option>
    42                                     <option value="classic">classic</option>
    43                                 </select>
    44                                 <button id="guide-btn">Guide</button>
    45                             </div>
    46                         </div>
    47                     </div>
    48                     <div class="col-md-9" id="overview_country" style="display: block;">
    49                         <div class="bs-component">
    50                             <div class="panel panel-teal">
    51                                 <div class="panel-heading">
    52                                     <h3 class="panel-title"
    53                                         id="map-title"><?php oLang::_('OVERVIEW_COUNTRY_MAP'); ?></h3>
     12<div id="oseappcontainer">
     13    <div class="container wrapbody">
     14        <?php
     15        $this->model->showLogo();
     16        //            $this->model->showHeader();
     17        ?>
     18        <div class="row" id="dashboard">
     19            <div class="<?php
     20            $numCol = ($hasOEMCustomer == false) ? 12 : 12;
     21            echo 'col-md-' . $numCol;
     22            ?>">
     23                <div class="col-sm-12 wrap-container"  style="padding:40px 35px;">
     24                    <div class="col-sm-12" style="background:white; opacity: 0.7;">
     25                        <div class="col-md-3">
     26                            <div class="panel panel-success">
     27                                <!--                            <div class="panel-heading">Panel heading without title</div>-->
     28                                <div class="panel-body" id="dashmenu" style="min-height: 300px; margin-left:-45px; ">
     29                                    <a href="javascript:void(0)" id="btn_country"
     30                                       class="col-md-12"><?php oLang::_('OVERVIEW_COUNTRY_MAP_BTN'); ?></a>
     31                                    <a href="javascript:void(0)" id="btn_traffic"
     32                                       class="col-md-12"><?php oLang::_('OVERVIEW_TRAFFICS_BTN'); ?></a>
     33                                    <a href="javascript:void(0)" id="btn_recentscan"
     34                                       class="col-md-12"><?php oLang::_('RECENT_SCANNING_RESULT_BTN'); ?></a>
     35                                    <a href="javascript:void(0)" id="btn_recenthack"
     36                                       class="col-md-12"><?php oLang::_('RECENT_HACKING_INFO_BTN'); ?></a>
     37                                    <a href="javascript:void(0)" id="btn_backup"
     38                                       class="col-md-12"><?php oLang::_('RECENT_BACKUP_BTN'); ?></a>
    5439                                </div>
    55                                 <div class="panel-body">
    56                                     <div id="world-map"></div>
     40                                <div id="dashboardStyle">
     41                                    Style:<br>
     42                                    <select id="style" value="dynamic">
     43                                        <option value="dynamic" selected="<?php $dynamic_default; ?>">dynamic</option>
     44                                        <option value="classic">classic</option>
     45                                    </select>
     46                                    <button id="guide-btn">Guide</button>
    5747                                </div>
    5848                            </div>
    5949                        </div>
    60                     </div>
    61                     <div class="col-md-9" id="overview_traffic" style="display: none;">
    62                         <div class="bs-component">
    63                             <div class="panel panel-teal">
    64                                 <div class="panel-heading">
    65                                     <h3 class="panel-title"><?php oLang::_('OVERVIEW_TRAFFICS'); ?></h3>
    66                                 </div>
    67                                 <div class="panel-body">
    68                                     <div id="traffic-overview" style="width: 100%; height:290px;"></div>
     50                        <div class="col-md-9" id="overview_country" style="display: block;">
     51                            <div class="bs-component">
     52                                <div class="panel panel-teal">
     53                                    <div class="panel-heading">
     54                                        <h3 class="panel-title"
     55                                            id="map-title"><?php oLang::_('OVERVIEW_COUNTRY_MAP'); ?></h3>
     56                                    </div>
     57                                    <div class="panel-body">
     58                                        <div id="world-map"></div>
     59                                    </div>
    6960                                </div>
    7061                            </div>
    7162                        </div>
    72                     </div>
     63                        <div class="col-md-9" id="overview_traffic" style="display: none;">
     64                            <div class="bs-component">
     65                                <div class="panel panel-teal">
     66                                    <div class="panel-heading">
     67                                        <h3 class="panel-title"><?php oLang::_('OVERVIEW_TRAFFICS'); ?></h3>
     68                                    </div>
     69                                    <div class="panel-body">
     70                                        <div id="traffic-overview" style="width: 100%; height:290px;"></div>
     71                                    </div>
     72                                </div>
     73                            </div>
     74                        </div>
    7375
    74                     <div class="col-md-9" id="recent_scan" style="display: none;">
    75                         <div class="bs-component">
    76                             <div class="panel panel-teal">
    77                                 <div class="panel-heading">
    78                                     <h3 class="panel-title"><a
    79                                             href="<?php $this->model->getPageUrl('scanResult'); ?>"><?php oLang::_('RECENT_SCANNING_RESULT'); ?></a>
    80                                     </h3>
     76                        <div class="col-md-9" id="recent_scan" style="display: none;">
     77                            <div class="bs-component">
     78                                <div class="panel panel-teal">
     79                                    <div class="panel-heading">
     80                                        <h3 class="panel-title"><a
     81                                                href="<?php $this->model->getPageUrl('scanResult'); ?>"><?php oLang::_('RECENT_SCANNING_RESULT'); ?></a>
     82                                        </h3>
     83                                    </div>
     84                                    <div class="panel-body">
     85                                        <div class='col-md-8'>Last Scanned:
     86                                            <strong id='lastScanned' class="text-warning"></strong>
     87                                        </div>
     88                                        <div class='col-md-8'>File Scanned:
     89                                            <strong id='numScanned' class="text-warning"></strong>
     90                                        </div>
     91                                        <div class='col-md-8'>Virus Found:
     92                                            <strong id='numinfected' class="text-danger"></strong>
     93                                        </div>
     94                                    </div>
    8195                                </div>
    82                                 <div class="panel-body">
    83                                     <div class='col-md-8'>Last Scanned:
    84                                         <strong id='lastScanned' class="text-warning"></strong>
     96                            </div>
     97                        </div>
     98
     99                        <div id="ipmange-speech-bubble" class="col-md-9" style="display: none;">
     100                            <div class="bs-component">
     101                                <div class="panel panel-teal">
     102                                    <div class="panel-heading">
     103                                        <h3 class="panel-title"><a
     104                                                href="<?php $this->model->getPageUrl('ipmanage'); ?>"><?php oLang::_('RECENT_HACKING_INFO'); ?></a>
     105                                        </h3>
    85106                                    </div>
    86                                     <div class='col-md-8'>File Scanned:
    87                                         <strong id='numScanned' class="text-warning"></strong>
     107                                    <div class="panel-body">
     108                                        <table class="table display" id="IPsTable">
     109                                            <thead>
     110                                            <tr>
     111                                                <th><?php oLang::_('O_DATE'); ?></th>
     112                                                <th><?php oLang::_('O_START_IP'); ?></th>
     113                                                <th><?php oLang::_('O_RISK_SCORE'); ?></th>
     114                                                <th><?php oLang::_('O_STATUS'); ?></th>
     115                                            </tr>
     116                                            </thead>
     117                                        </table>
    88118                                    </div>
    89                                     <div class='col-md-8'>Virus Found:
    90                                         <strong id='numinfected' class="text-danger"></strong>
     119                                </div>
     120                            </div>
     121                        </div>
     122                        <div class="col-md-9" id="recent_backup" style="display: none;">
     123                            <div class="bs-component">
     124                                <div class="panel panel-teal">
     125                                    <div class="panel-heading">
     126                                        <h3 class="panel-title"><a
     127                                                href="<?php $this->model->getPageUrl('backup'); ?>"><?php oLang::_('RECENT_BACKUP'); ?></a>
     128                                        </h3>
     129                                    </div>
     130                                    <div class="panel-body">
     131                                        <table class="table display" id="backupTable">
     132                                            <thead>
     133                                            <tr>
     134                                                <th><?php oLang::_('O_BACKUPFILE_ID'); ?></th>
     135                                                <th><?php oLang::_('O_BACKUPFILE_DATE'); ?></th>
     136                                                <th><?php oLang::_('O_BACKUPFILE_NAME'); ?></th>
     137                                                <th><?php oLang::_('O_BACKUPFILE_TYPE'); ?></th>
     138                                            </tr>
     139                                            </thead>
     140                                        </table>
    91141                                    </div>
    92142                                </div>
     
    95145                    </div>
    96146
    97                     <div id="ipmange-speech-bubble" class="col-md-9" style="display: none;">
    98                         <div class="bs-component">
    99                             <div class="panel panel-teal">
    100                                 <div class="panel-heading">
    101                                     <h3 class="panel-title"><a
    102                                             href="<?php $this->model->getPageUrl('ipmanage'); ?>"><?php oLang::_('RECENT_HACKING_INFO'); ?></a>
    103                                     </h3>
    104                                 </div>
    105                                 <div class="panel-body">
    106                                     <table class="table display" id="IPsTable">
    107                                         <thead>
    108                                         <tr>
    109                                             <th><?php oLang::_('O_DATE'); ?></th>
    110                                             <th><?php oLang::_('O_START_IP'); ?></th>
    111                                             <th><?php oLang::_('O_RISK_SCORE'); ?></th>
    112                                             <th><?php oLang::_('O_STATUS'); ?></th>
    113                                         </tr>
    114                                         </thead>
    115                                     </table>
    116                                 </div>
    117                             </div>
    118                         </div>
    119                     </div>
    120                     <div class="col-md-9" id="recent_backup" style="display: none;">
    121                         <div class="bs-component">
    122                             <div class="panel panel-teal">
    123                                 <div class="panel-heading">
    124                                     <h3 class="panel-title"><a
    125                                             href="<?php $this->model->getPageUrl('backup'); ?>"><?php oLang::_('RECENT_BACKUP'); ?></a>
    126                                     </h3>
    127                                 </div>
    128                                 <div class="panel-body">
    129                                     <table class="table display" id="backupTable">
    130                                         <thead>
    131                                         <tr>
    132                                             <th><?php oLang::_('O_BACKUPFILE_ID'); ?></th>
    133                                             <th><?php oLang::_('O_BACKUPFILE_DATE'); ?></th>
    134                                             <th><?php oLang::_('O_BACKUPFILE_NAME'); ?></th>
    135                                             <th><?php oLang::_('O_BACKUPFILE_TYPE'); ?></th>
    136                                         </tr>
    137                                         </thead>
    138                                     </table>
    139                                 </div>
    140                             </div>
    141                         </div>
    142                     </div>
     147<!--                    <div class="col-sm-12" style="padding:0px; margin-top:24px;">-->
     148<!--                        <a href="http://www.centrora.com/developers/" target="_blank"><div class="call-to-action">-->
     149<!--                                <div class="call-to-action-txt">-->
     150<!--                                    <img width="35" height="35" alt="C_puma" src="http://googledrive.com/host/0BzcQR8G4BGjUX0ZzTzBvUVNEb00"> &nbsp;-->
     151<!--                                    Leave the Time-Consuming Anti-Hacking and Malware Scanning to the Automate Centrora Security Solutions <sup>Now</sup></div>-->
     152<!--                            </div></a>-->
     153<!--                    </div>-->
     154<!---->
     155<!--                    <div class="row">-->
     156<!--                        <div id="footer" class="col-sm-12">-->
     157<!--                            <div>Centrora 2016 a portfolio of Luxur Group PTY LTD,  All rights reserved.</div>-->
     158<!--                        </div>-->
     159<!--                    </div>-->
     160
     161
     162                    <?php
     163                    $oem = new CentroraOEM();
     164                    $oemCustomer = $oem->hasOEMCustomer();
     165                    if(!empty($oemCustomer['data']['customer_id'])) {
     166                        echo $oem->getCallToActionAndFooter();
     167                    }else {?>
     168                        <?php  echo $this->model->getCallToActionAndFooter(); }?>
     169                </div>
     170
    143171                </div>
    144172            </div>
    145173        </div>
    146174    </div>
    147     <div id='fb-root'></div>
     175</div>
     176</div>
     177<div id='fb-root'></div>
    148178
    149179
  • ose-firewall/trunk/assets/views/fpscan.php

    r1387925 r1581581  
    66?>
    77<div id="oseappcontainer">
    8     <div class="container">
     8    <div class="container wrapbody">
    99        <?php
    1010        $this->model->showLogo();
    11         $this->model->showHeader();
     11        //        $this->model->showHeader();
    1212        ?>
    1313
     
    1616                <div class="panel panel-primary plain ">
    1717                    <!-- Start .panel -->
    18                     <div class="panel-heading">
    19 
    20                     </div>
    21                     <div class="panel-body">
     18
     19                    <div class="panel-body wrap-container">
     20                        <div class="row row-set">
     21                            <div class="col-sm-3 p-l-r-0">
     22                                <div id="c-tag" style="height:170px;">
     23                                    <div class="col-sm-12" style="padding-left: 0px; line-height: 20px;">
     24                                <span class="tag-title">File Permissions Scanner<span>
     25                                    </div>
     26                                    <p class="tag-content">File Permissions Scanner can detect files with insecure file permission. You can set base file/folder permissions, the scanner will scan for files and folders that have higher permissions than given base permissions.</p>
     27                                </div>
     28                            </div>
     29                            <div class="col-sm-4">
     30                                <div class="vs-line-1" style="padding-top: 28px;">
     31                                    <div class="vs-line-1-number">
     32                                        <span class="scan-file-number" style="font-weight: 300; font-size: 18px;">Base file permission</span>
     33                                    </div>
     34                                    <div class="vs-line-1-title" style="padding-top: 0px;">
     35                                        <input title="default file permission is 0644" type="text" name="filePerm" placeholder="0644" id="filePerm" pattern="^[0-7]{3}$">
     36                                    </div>
     37                                </div>
     38                            </div>
     39                            <div class="col-sm-4">
     40                                <div class="vs-line-1" style="padding-top: 28px;">
     41                                    <div class="vs-line-1-number">
     42                                        <span  class="scan-file-number"  style="font-weight: 300; font-size: 18px;">Base folder permission</span>
     43                                    </div>
     44                                    <div class="vs-line-1-title" style="padding-top: 0px;">
     45                                        <input title="default folder permission is 0755" type="text" name="folderPerm"
     46                                               placeholder="0755"
     47                                               id="folderPerm" pattern="^[0-7]{3}$">
     48                                    </div>
     49                                </div>
     50                            </div>
     51                        </div>
     52
     53                        <div class="row row-set" style="padding-right: 20px;">
     54                            <div id="scan-date"></div>
     55                        </div>
     56
    2257                        <div class="row">
    23                             <div id="scan-window" class="col-md-12">
     58                            <div id="scan-window" class="col-md-12" style=" padding:0px 20px;">
    2459                                <div id='scan_progress' class="alert alert-info fade in">
    2560                                    <div class="row">
    26                                         <!--                                        <div class="col-md-1">-->
    27                                         <!--                                            <div class="bg-primary alert-icon">-->
    28                                         <!--                                                <i class="glyphicon glyphicon-info-sign s24"></i>-->
    29                                         <!--                                            </div>-->
    30                                         <!--                                        </div>-->
     61
    3162                                        <div class="col-md-11">
    3263                                            <div id="status_content" class="col-md-12" style="display: none;">
     
    4475                                                </div>
    4576                                                <div id="last_batch" class='col-md-12'>Last Batch:
    46                                                     <strong id='last_file' class="text-success"></strong>
     77                                                    <strong id='last_file' class="text-white" style="color:white;"></strong>
    4778                                                </div>
    4879                                                <div class='col-md-12'>Files Scanned:
    49                                                     <strong id='total_number' class="text-warning"></strong>
     80                                                    <strong id='total_number' class="text-white"></strong>
    5081                                                </div>
    5182                                                <div class='col-md-12'>Insecure permission Files:
    52                                                     <a href="#scanresult"><strong id='vs_num' class="text-danger"></strong></a>
     83                                                    <a href="#scanresult"><strong id='vs_num' class="text-white"></strong></a>
    5384                                                </div>
    5485                                                <div id="surfcalltoaction"
     
    6495                                        </div>
    6596                                    </div>
    66                                     <div class="pull-right">
    67                                         <i class="fa fa-clock-o"></i>Last Scan:
    68                                         <strong id="scan-date" class="text-success"></strong>
    69                                     </div>
    70                                 </div>
    71                             </div>
    72                         </div>
    73                         <div class="row col-md-12">
    74                             <div class="col-sm-3 col-md-offset-3">
    75                                 <label for="filePerm"
    76                                        class="control-label"><?php oLang::_('O_BASE_FILEPERM'); ?></label>
    77                                 <input title="default file permission is 0644" type="text" name="filePerm"
    78                                        placeholder="0644" id="filePerm" pattern="^[0-7]{3}$">
    79                             </div>
    80 
    81                             <div class="col-sm-3">
    82                                 <label for="folderPerm"
    83                                        class="control-label"><?php oLang::_('O_BASE_FOLDERPERM'); ?></label>
    84                                 <input title="default folder permission is 0755" type="text" name="folderPerm"
    85                                        placeholder="0755"
    86                                        id="folderPerm" pattern="^[0-7]{3}$">
    87                             </div>
     97
     98                                </div>
     99                            </div>
     100                        </div>
     101                        <div class="row col-md-12" style="padding-right: 20px;">
    88102                            <div id="scanbuttons">
    89                                 <button id="sfsstop" class='centrora-btn' style="display: none">
     103                                <button id="sfsstop" class='btn-new result-btn-set' style="display: none">
    90104                                    <i id="ic-change"
    91105                                       class="glyphicon glyphicon-stop color-red"></i> <?php oLang::_('STOP_VIRUSSCAN') ?>
    92106                                </button>
    93                                 <button id="sfsstart" class='centrora-btn'>
     107                                <button id="sfsstart" class='btn-new result-btn-set'>
    94108                                    <i id="ic-change"
    95109                                       class="glyphicon glyphicon-play color-white"></i> <?php oLang::_('START_NEW_SCAN') ?>
     
    97111                                <button data-target="#scanPathModal" data-toggle="modal" id="setscanpath"
    98112                                        title="<?php oLang::_('SETSCANPATH') ?>"
    99                                         class='centrora-btn'>
     113                                        class='btn-new result-btn-set'>
    100114                                    <i id="ic-change" class="glyphicon glyphicon-folder-close text-primary"></i>
    101115                                    Set Scan Path
    102116                                </button>
    103                                 <button class="centrora-btn" type="button"
     117                                <button class="btn-new result-btn-set" type="button"
    104118                                        onClick="location.href='<?php $this->model->getPageUrl('permconfig'); ?>'"><i
    105119                                        id="ic-change"
     
    108122                            </div>
    109123                        </div>
    110                         <div class="col-md-12" id="scan-result" class="row" style="display: none;">
    111                             <strong class="alert-danger">Insecure permission Files Detected!</strong>
     124                        <div class="col-md-12" id="scan-result" class="row" style="display: none; color:white;">
     125                            <strong class="alert-white" style="background: none;">Insecure permission Files Detected!</strong>
    112126                            <strong class="col-md-12">
    113127                                <div class='col-md-8'>Path</div>
     
    116130                            <div id="scan-result-panel"></div>
    117131                        </div>
     132                        <?php
     133                        $oem = new CentroraOEM();
     134                        $oemCustomer = $oem->hasOEMCustomer();
     135                        if(!empty($oemCustomer['data']['customer_id'])) {
     136                            echo $oem->getCallToActionAndFooter();
     137                        }else {?>
     138                            <?php  echo $this->model->getCallToActionAndFooter(); }?>
     139                    </div>
    118140                    </div>
    119141                </div>
  • ose-firewall/trunk/assets/views/gitbackup.php

    r1436160 r1581581  
    164164                        <!-- Panels Ends -->
    165165                        <!-- Panels Ends -->
    166                         <div class="row row-set">
    167                                         <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px; margin-top: 15px;">
    168                                             <a href="http://www.centrora.com/developers/" target="_blank"><div class="call-to-action">
    169                                                     <div class="call-to-action-txt">
    170                                                         <img width="35" height="35" alt="C_puma" src="http://googledrive.com/host/0BzcQR8G4BGjUX0ZzTzBvUVNEb00"> &nbsp;
    171                                                         Schedule your scanning and update with Centrora Premium <sup>Now</sup></div>
    172                                                 </div></a>
    173                                         </div>
    174                                     </div>
    175                                     <div class="row">
    176                                         <div id="footer" class="col-sm-12">
    177                                             <div>Centrora 2016 a portfolio of Luxur Group PTY LTD,  All rights reserved.</div>
    178                                         </div>
    179                                     </div>
     166                        <?php
     167                        $oem = new CentroraOEM();
     168                        $oemCustomer = $oem->hasOEMCustomer();
     169                        if(!empty($oemCustomer['data']['customer_id'])) {
     170                            echo $oem->getCallToActionAndFooter();
     171                        }else {?>
     172                            <?php  echo $this->model->getCallToActionAndFooter(); }?>
    180173                    </div>
    181174                </div>
     
    441434                </div>
    442435                </div>
    443                         <div class="row row-set">
    444                         <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px; margin-top: 15px;">
    445                             <a href="http://www.centrora.com/developers/" target="_blank"><div class="call-to-action">
    446                                     <div class="call-to-action-txt">
    447                                         <img width="35" height="35" alt="C_puma" src="http://googledrive.com/host/0BzcQR8G4BGjUX0ZzTzBvUVNEb00"> &nbsp;
    448                                         Schedule your scanning and update with Centrora Premium <sup>Now</sup></div>
    449                                 </div></a>
    450                         </div>
    451                     </div>
    452                 <div class="row" style="margin-bottom: 15px;">
    453                     <div id="footer" class="col-sm-12">
    454                         <div>Centrora 2016 a portfolio of Luxur Group PTY LTD,  All rights reserved.</div>
    455                     </div>
    456                 </div>
     436                            <?php
     437                            $oem = new CentroraOEM();
     438                            $oemCustomer = $oem->hasOEMCustomer();
     439                            if(!empty($oemCustomer['data']['customer_id'])) {
     440                                echo $oem->getCallToActionAndFooter();
     441                            }else {?>
     442                                <?php  echo $this->model->getCallToActionAndFooter(); }?>
    457443                            </div>
    458444                            </div>
  • ose-firewall/trunk/assets/views/mfscan.php

    r1387925 r1581581  
    1010?>
    1111<div id="oseappcontainer">
    12     <div class="container">
     12    <div class="container wrapbody">
    1313        <?php $this->model->showLogo();
    14         $this->model->showHeader(); ?>
     14        //    $this->model->showHeader(); ?>
    1515        <div class="row">
    1616            <div class="col-md-12">
    1717                <div class="panel panel-primary plain ">
    1818                    <!-- Start .panel -->
    19                     <div class="panel-heading">
    2019
    21                     </div>
    22                     <div class="panel-body">
     20                    <div class="panel-body wrap-container">
     21                        <div class="row row-set">
     22                            <div class="col-sm-3 p-l-r-0">
     23                                <div id="c-tag">
     24                                    <div class="col-sm-12" style="padding-left: 0px;">
     25                                <span class="tag-title">Modified Files Scanner<span>
     26                                    </div>
     27                                    <p class="tag-content">The Modified Files Scanner can detect modified files within a certain time period and files which are symbolic links.</p>
     28                                </div>
     29                            </div>
     30                            <div class="col-sm-3">
     31                                <div class="vs-line-1" style="padding-top: 28px;">
     32                                    <div class="vs-line-1-number">
     33                                        <span class="scan-file-number" style="font-weight: 300; font-size: 18px;">Set Start Date</span>
     34                                    </div>
     35                                    <div class="vs-line-1-title" style="padding-top: 0px;"><input id='datepicker1' type='text' name="startdate"/></div>
     36                                </div>
     37                            </div>
     38                            <div class="col-sm-3">
     39                                <div class="vs-line-1" style="padding-top: 28px;">
     40                                    <div class="vs-line-1-number">
     41                                        <span  class="scan-file-number"  style="font-weight: 300; font-size: 18px;">Set End Date</span>
     42                                    </div>
     43                                    <div class="vs-line-1-title" style="padding-top: 0px;"><input id='datepicker2' type='text' name="enddate"/></div>
     44                                </div>
     45                            </div>
     46                            <div class="col-sm-3">
     47                                <div class="vs-line-1">
     48                                    <div class="vs-line-1-title"> <i id="mod-scanner-ssl" class="cursor-pointer fa  fa-square-o"><input type='checkbox' id="symlink"/></i></div>
     49                                    <div class="vs-line-1-number">
     50                                        Scan Symbolic link
     51                                    </div>
     52                                </div>
     53                            </div>
     54                        </div>
     55                        <div class="row row-set" style="padding-right: 20px;">
     56                            <div id="scan-date"></div>
     57                        </div>
     58
     59
     60
     61
     62
     63
    2364                        <div class="row">
    2465                            <!--Scan Status-->
    25                             <div id="scan-window" class="col-md-12">
     66                            <div id="scan-window" class="col-md-12" style="padding:0px 20px;">
    2667                                <div id='scan_progress' class="alert alert-info fade in">
    2768                                    <div class="row">
    28                                         <div class="col-md-1">
    29                                             <div class="bg-primary alert-icon">
    30                                                 <i class="glyphicon glyphicon-info-sign s24"></i>
    31                                             </div>
    32                                         </div>
    33                                         <div class="col-md-8">
     69                                        <div class="col-md-12">
    3470                                            <div id="status_content" class="col-md-12" style="display: none;">
    3571                                                <div id='status' class='col-md-12'>
    3672                                                    <strong>Status </strong>
    37 
    38                                                     <div class="progress progress-striped active">
     73                                                    <div class="progress progress-striped active" style="width: 100%; margin-left:0px;">
    3974                                                        <div id="vs_progress" class="progress-bar" role="progressbar"
    4075                                                             aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"
     
    4580                                                </div>
    4681                                                <div id="last_batch" class='col-md-12'>Last Batch:
    47                                                     <strong id='last_file' class="text-success"></strong>
     82                                                    <strong id='last_file' class="text-white" style="color:white;"></strong>
    4883                                                </div>
    4984                                                <div class='col-md-12'># Scanned:
    50                                                     <strong id='total_number' class="text-warning"></strong>
     85                                                    <strong id='total_number' class="text-white"></strong>
    5186                                                </div>
    5287                                                <div class='col-md-12'># Modified Files:
    53                                                     <a href="#scanresult"><strong id='vs_num' class="text-danger"></strong></a>
     88                                                    <a href="#scanresult"><strong id='vs_num' class="text-white"></strong></a>
    5489                                                </div>
    5590                                                <div id="surfcalltoaction"
     
    6196                                            </div>
    6297                                            <div id="scanpathtext" class='col-md-12' style="display: none;">Scan Path:
    63                                                 <label class="text-primary" id="selectedfile"></label>
     98                                                <label class="text-white" id="selectedfile"></label>
    6499                                            </div>
    65100                                        </div>
    66                                     </div>
    67                                     <div class="pull-right">
    68                                         <i class="fa fa-clock-o"></i>Last Scan:
    69                                         <strong id="scan-date" class="text-success"></strong>
    70101                                    </div>
    71102                                </div>
    72103                            </div>
    73104                        </div>
    74                        
     105
    75106                        <div class="row">
    76                             <div class="col-md-3">
    77                                 <label for="datepicker1"><?php oLang::_('SETSTARTDATE'); ?></label>
    78                                 <input id='datepicker1' type='text' name="startdate"/>
    79                             </div>
    80                             <div class="col-md-3">
    81                                 <label for="datepicker2"><?php oLang::_('SETENDDATE'); ?></label>
    82                                 <input id='datepicker2' type='text' name="enddate"/>
    83                             </div>
    84 
    85                             <div class="col-md-2">
    86                                 <label for="symlink"><?php oLang::_('SYMLINK'); ?></label>
    87                                 (<i class="im im-redo2 text-warning"></i>)
    88                                 <input type='checkbox' id="symlink"/>
    89                             </div>
    90 
    91                             <div id="scanbuttons">
    92                                 <button id="sfsstop" class='btn btn-sm mr5 mb10' style="display: none;">
     107                            <div id="scanbuttons" class="col-sm-12" style="padding:0px 20px; margin-top:5px;">
     108                                <button id="sfsstop" class='btn-new result-btn-set' style="display: none;">
    93109                                    <i class="glyphicon glyphicon-stop color-red"></i> <?php oLang::_('STOP_VIRUSSCAN') ?>
    94110                                </button>
    95                                 <button id="sfsstart" class='centrora-btn'>
     111                                <button id="sfsstart" class='btn-new result-btn-set'>
    96112                                    <i id="ic-change" class="glyphicon glyphicon-play color-green"></i> <?php oLang::_('START_NEW_SCAN') ?>
    97113                                </button>
    98114                                <button data-target="#scanPathModal" data-toggle="modal" id="setscanpath"
    99115                                        title="<?php oLang::_('SETSCANPATH') ?>"
    100                                         class='pull-right btn btn-config btn-sm mr5'>
    101                                     <i class="glyphicon glyphicon-folder-close text-primary"></i>
     116                                        class='pull-right btn-new result-btn-set'>
     117                                    <i class="glyphicon glyphicon-folder-close text-primary"></i>  Set Scan Path
    102118                                </button>
    103119                            </div>
    104120                        </div>
    105                          <div class="row">
    106                             <div id="mfiles-results">
    107                             <?php
    108                                 $filePath = OSE_FWDATA . ODS . "vsscanPath" . ODS . "mfList.inc";
    109                                 if (file_exists($filePath)) {
    110                                     oseFirewall::loadFiles();
    111                                     $data = str_replace("\n", '<br/>',oseFile::read($filePath));
    112                                     echo $data;
    113                                 }
    114                             ?>
    115                             </div>
     121                        <div class="row">
     122                            <div id="mfiles-results">
     123                                <?php
     124                                $filePath = OSE_FWDATA . ODS . "vsscanPath" . ODS . "mfList.inc";
     125                                if (file_exists($filePath)) {
     126                                    oseFirewall::loadFiles();
     127                                    $data = str_replace("\n", '<br/>',oseFile::read($filePath));
     128                                    echo $data;
     129                                }
     130                                ?>
     131                            </div>
    116132                        </div>
    117133                        <div class="col-md-12" id="scan-result" class="row" style="display: none;">
     
    124140                            <div id="scan-result-panel"></div>
    125141                        </div>
     142                        <?php
     143                        $oem = new CentroraOEM();
     144                        $oemCustomer = $oem->hasOEMCustomer();
     145                        if(!empty($oemCustomer['data']['customer_id'])) {
     146                            echo $oem->getCallToActionAndFooter();
     147                        }else {?>
     148                            <?php  echo $this->model->getCallToActionAndFooter(); }?>
     149                    </div>
    126150                    </div>
    127151                </div>
    128152            </div>
     153
    129154            <!--Scan Path Modal-->
    130155            <div class="modal fade" id="scanPathModal" tabindex="-1" role="dialog" aria-hidden="true">
     
    154179                                <div class="form-group">
    155180                                    <div>
    156                                         <button type="button" class="btn btn-sm" id='save-button'><i class="glyphicon glyphicon-save text-success"></i> Set Path
     181                                        <button type="button" class="btn-new result-btn-set" id='save-button'><i class="glyphicon glyphicon-save text-white"></i> Set Path
    157182                                        </button>
    158183                                    </div>
  • ose-firewall/trunk/assets/views/oem/236/login.php

    r1387925 r1581581  
    77    <div class="container">
    88    <?php
    9     $this->model->showLogo ();
    10     $this->model->showHeader();
     9    $oem = new CentroraOEM();
     10    $oemCustomer = $oem->hasOEMCustomer();
     11    if(!empty($oemCustomer['data']['customer_id'])) {
     12        $this->model->showLogo ();
     13        echo $oem->showLoginHeader();
     14    }else {
     15        $this->model->showLogo ();
     16        $this->model->showHeader();
     17    }
    1118    ?>
    1219    <div class="row">
  • ose-firewall/trunk/assets/views/oem/547/login.php

    r1387925 r1581581  
    77    <div class="container">
    88    <?php
    9     $this->model->showLogo ();
    10     $this->model->showHeader();
     9    $oem = new CentroraOEM();
     10    $oemCustomer = $oem->hasOEMCustomer();
     11    if(!empty($oemCustomer['data']['customer_id'])) {
     12        $this->model->showLogo ();
     13        echo $oem->showLoginHeader();
     14    }else {
     15        $this->model->showLogo ();
     16        $this->model->showHeader();
     17    }
    1118    ?>
    1219    <div class="row">
  • ose-firewall/trunk/assets/views/oem/981/login.php

    r1387925 r1581581  
    77    <div class="container">
    88    <?php
    9     $this->model->showLogo ();
    10     $this->model->showHeader();
     9    $oem = new CentroraOEM();
     10    $oemCustomer = $oem->hasOEMCustomer();
     11    if(!empty($oemCustomer['data']['customer_id'])) {
     12        $this->model->showLogo ();
     13        echo $oem->showLoginHeader();
     14    }else {
     15        $this->model->showLogo ();
     16        $this->model->showHeader();
     17    }
    1118    ?>
    1219    <div class="row">
  • ose-firewall/trunk/assets/views/scanreport.php

    r1436160 r1581581  
    137137                                    </table>
    138138                                    </div>
    139                                     <div class="row row-set">
    140                                         <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px; margin-top: 15px;">
    141                                             <a href="http://www.centrora.com/developers/" target="_blank"><div class="call-to-action">
    142                                                     <div class="call-to-action-txt">
    143                                                         <img width="35" height="35" alt="C_puma" src="http://googledrive.com/host/0BzcQR8G4BGjUX0ZzTzBvUVNEb00"> &nbsp;
    144                                                         Schedule your scanning and update with Centrora Premium <sup>Now</sup></div>
    145                                                 </div></a>
    146                                         </div>
    147                                     </div>
    148                                     <div class="row">
    149                                         <div id="footer" class="col-sm-12">
    150                                             <div>Centrora 2016 a portfolio of Luxur Group PTY LTD,  All rights reserved.</div>
    151                                         </div>
    152                                     </div>
     139
     140                                    <?php
     141                                    $oem = new CentroraOEM();
     142                                    $oemCustomer = $oem->hasOEMCustomer();
     143                                    if(!empty($oemCustomer['data']['customer_id'])) {
     144                                        echo $oem->getCallToActionAndFooter();
     145                                    }else {?>
     146                                        <?php  echo $this->model->getCallToActionAndFooter(); }?>
    153147                                </div>
    154148                            </div>
     
    301295                        </table>
    302296                    </div>
    303                     <div class="row row-set">
    304                         <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px; margin-top: 15px;">
    305                             <a href="http://www.centrora.com/developers/" target="_blank"><div class="call-to-action">
    306                                     <div class="call-to-action-txt">
    307                                         <img width="35" height="35" alt="C_puma" src="http://googledrive.com/host/0BzcQR8G4BGjUX0ZzTzBvUVNEb00"> &nbsp;
    308                                         Schedule your scanning and update with Centrora Premium <sup>Now</sup></div>
    309                                 </div></a>
    310                         </div>
    311                     </div>
    312                 <div class="row" style="margin-bottom: 15px;">
    313                     <div id="footer" class="col-sm-12">
    314                         <div>Centrora 2016 a portfolio of Luxur Group PTY LTD,  All rights reserved.</div>
    315                     </div>
    316                 </div>
     297
     298
     299
     300                    <?php
     301                    $oem = new CentroraOEM();
     302                    $oemCustomer = $oem->hasOEMCustomer();
     303                    if(!empty($oemCustomer['data']['customer_id'])) {
     304                        echo $oem->getCallToActionAndFooter();
     305                    }else {?>
     306                        <?php  echo $this->model->getCallToActionAndFooter(); }?>
     307                </div>
     308
     309
    317310            </div>
    318311
  • ose-firewall/trunk/assets/views/surfscan.php

    r1425230 r1581581  
    1010$msg = $this->model->checkMD5DBUpToDate();
    1111?>
    12     <div id="oseappcontainer">
    13         <div class="container">
    14             <?php $this->model->showLogo(); $this->model->showHeader(); ?>
    15             <div class="row">
    16                 <div class="col-md-12">
    17                     <div class="panel panel-primary plain ">
    18                         <!-- Start .panel -->
    19                         <div class="panel-heading">
     12<div id="oseappcontainer">
     13    <div class="container wrapbody">
     14        <?php $this->model->showLogo();
     15        //  $this->model->showHeader();
     16        ?>
     17        <div class="row">
     18            <div class="col-md-12">
     19                <div class="panel panel-primary plain ">
     20                    <!-- Start .panel -->
    2021
    21                         </div>
    22                         <div class="panel-body">
    23                             <div class="row">
    24                                 <div id="time-bar"><?php echo $msg['msg'] ?></div>
    25                                 <!--Scan Status-->
    26                                 <div id="scan-window" class="col-md-12">
    27                                     <button id = "updateMD5Sig" title="Update MD5 Signatures" type="button" class="pull-right btn btn-config btn-sm mr5">
    28                                         <i class="glyphicon glyphicon-refresh color-blue"></i>
    29                                     </button>
    30                                     <div id='scan_progress' class="alert alert-info fade in">
    31                                         <div class="row">
    32                                             <div class="col-md-1">
    33                                                 <div class="bg-primary alert-icon">
    34                                                     <i class="glyphicon glyphicon-info-sign s24"></i>
    35                                                 </div>
    36                                             </div>
    37                                             <div class="col-md-8">
    38                                                 <div id = "status_content" class="col-md-12" style="display: none;" >
    39                                                     <div id='status' class='col-md-12'>
    40                                                         <strong>Status </strong>
    41                                                         <div class="progress progress-striped active">
    42                                                             <div id="vs_progress" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
    43                                                                 <span id="p4text" ></span>
    44                                                             </div>
    45                                                         </div>
    46                                                     </div>
    47                                                     <div id = "last_batch" class='col-md-12'>Last Batch:
    48                                                         <strong id='last_file' class="text-success"></strong>
    49                                                     </div>
    50                                                     <div class='col-md-12'># Scanned:
    51                                                         <strong id='total_number' class="text-warning"></strong>
    52                                                     </div>
    53                                                     <div class='col-md-12'># Virus Files:
    54                                                         <a href="#scanresult"><strong id='vs_num' class="text-danger"></strong></a>
    55                                                     </div>
    56                                                     <div id="surfcalltoaction" class='alert alert-dismissable alert-danger col-md-12' style="display: none;">
    57     <!--                                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>-->
    58                                                         <?php oLang::_('SURF_SCAN_CALL_TOACTION') ?>
    59                                                     </div>
    60                                                 </div>
    61                                                 <div id = "scanpathtext" class='col-md-12' style="display: none;">Scan Path:
    62                                                     <label class="text-primary" id="selectedfile"></label>
    63                                                 </div>
    64                                             </div>
    65                                         </div>
    66                                         <div class="pull-right">
    67                                             <i class="fa fa-clock-o"></i>Last Scan:
    68                                             <strong id="scan-date" class="text-success"></strong>
    69                                         </div>
     22                    <div class="panel-body wrap-container">
     23                        <div class="row row-set">
     24                            <div class="col-sm-3 p-l-r-0">
     25                                <div id="c-tag">
     26                                    <div class="col-sm-12" style="padding-left: 0px;">
     27                                <span class="tag-title">MD5 Hash Scanner<span>
     28                                    </div>
     29                                    <p class="tag-content">MD5 Hash Scanner checks for all known viruses and malware. It is recommended that if nothing is detected you use the Dynamic Scanner</p>
     30                                </div>
     31                            </div>
     32                            <div class="col-sm-6">
     33                                <div class="vs-line-1">
     34                                    <div class="vs-line-1-number" style="padding-top: 40px;">
     35                                        <span id = "hashstatus"  class="scan-file-number" style="font-size: 16px; font-weight: 300;"><?php echo $msg['msg'] ?></span>
    7036                                    </div>
    7137                                </div>
    7238                            </div>
    73                             <div class="row">
    74                                 <div id="scanbuttons">
    75                                     <button id="sfsstop" class='centrora-btn' style="display: none;">
    76                                         <i id="ic-change" class="glyphicon glyphicon-stop color-red"></i> <?php oLang::_('STOP_VIRUSSCAN') ?>
    77                                     </button>
    78                                     <button id="sfsstart" class='centrora-btn'>
    79                                         <i id="ic-change" class="glyphicon glyphicon-play color-green"></i> <?php oLang::_('START_NEW_SCAN') ?>
    80                                     </button>
    81                                     <button data-target="#scanPathModal" data-toggle="modal" id="setscanpath" title ="<?php oLang::_('SETSCANPATH') ?>"
    82                                             class='pull-right centrora-btn'>
    83                                         <i id="ic-change" class="glyphicon glyphicon-folder-close text-primary"></i>
    84                                         Set Scan Path
    85                                     </button>
     39
     40                            <div class="col-sm-3">
     41                                <div class="vs-line-1" style="padding:0px 45px 0px 0px;">
     42                                    <div class="vs-line-1-title"> <i id="updateMD5Sig" class="fa fa-refresh md5-icon-refresh"></i>
     43                                        <br><span style="opacity:0.7;">Click to update your MD5 Virus signature</span>
     44                                    </div>
    8645                                </div>
    8746                            </div>
    88                             <div class="col-md-12" id ="scan-result" class="row" style="display: none;">
    89                                 <strong class="alert-danger">Virus Files Detected!</strong>
    90                                 <div id="scan-result-panel"></div>
     47                        </div>
     48
     49
     50                        <div class="row row-set" style="padding-right: 20px;">
     51                            <div id="scan-date"></div>
     52                        </div>
     53
     54                        <div class="row">
     55                            <!--Scan Status-->
     56                            <div id="scan-window" class="col-md-12" style="padding:0px 20px;">
     57                                <div id='scan_progress' class="alert alert-info fade in">
     58                                    <div class="row">
     59                                        <div class="col-md-12">
     60                                            <div id = "status_content" class="col-md-12" style="display: none;" >
     61                                                <div id='status' class='col-md-12'>
     62                                                    <strong>Status </strong>
     63                                                    <div class="progress progress-striped active" style="width: 100%; margin-left:0px;">
     64                                                        <div id="vs_progress" class="progress-bar" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
     65                                                            <span id="p4text" ></span>
     66                                                        </div>
     67                                                    </div>
     68                                                </div>
     69                                                <div id = "last_batch" class='col-md-12'>Last Batch:
     70                                                    <strong id='last_file' class="text-white" style="color:white; padding-left:0px !important;"></strong>
     71                                                </div>
     72                                                <div class='col-md-12'># Scanned:
     73                                                    <strong id='total_number' class="text-white"></strong>
     74                                                </div>
     75                                                <div class='col-md-12'># Virus Files:
     76                                                    <a href="#scanresult"><strong id='vs_num' class="text-white"></strong></a>
     77                                                </div>
     78                                                <div id="surfcalltoaction" class='alert alert-dismissable alert-danger col-md-12' style="display: none;">
     79                                                    <!--                                                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>-->
     80                                                    <?php oLang::_('SURF_SCAN_CALL_TOACTION') ?>
     81                                                </div>
     82                                            </div>
     83                                            <div id = "scanpathtext" class='col-md-12' style="display: none;">Scan Path:
     84                                                <label class="text-white" id="selectedfile"></label>
     85                                            </div>
     86                                        </div>
     87                                    </div>
     88
     89                                </div>
    9190                            </div>
    9291                        </div>
     92                        <div class="row col-sm-12" style="padding-right: 20px;">
     93                            <div id="scanbuttons">
     94                                <button id="sfsstart" class='btn-new result-btn-set'>
     95                                    <i id="ic-change" class="glyphicon glyphicon-play color-green"></i> <?php oLang::_('START_NEW_SCAN') ?>
     96                                </button>
     97                                <button id="sfsstop" class='btn-new result-btn-set' style="display: none;">
     98                                    <i id="ic-change" class="glyphicon glyphicon-stop color-red"></i> <?php oLang::_('STOP_VIRUSSCAN') ?>
     99                                </button>
     100                                <button data-target="#scanPathModal" data-toggle="modal" id="setscanpath" title ="<?php oLang::_('SETSCANPATH') ?>"
     101                                        class='pull-right btn-new result-btn-set'>
     102                                    <i id="ic-change" class="glyphicon glyphicon-folder-close text-primary"></i>
     103                                    Set Scan Path
     104                                </button>
     105                            </div>
     106                        </div>
     107
     108                        <?php
     109                        $oem = new CentroraOEM();
     110                        $oemCustomer = $oem->hasOEMCustomer();
     111                        if(!empty($oemCustomer['data']['customer_id'])) {
     112                            echo $oem->getCallToActionAndFooter();
     113                        }else {?>
     114                            <?php  echo $this->model->getCallToActionAndFooter(); }?>
     115                        </div>
     116
     117
     118                        <div class="col-md-12" id ="scan-result" class="row" style="display: none;">
     119                            <strong class="alert-danger">Virus Files Detected!</strong>
     120                            <div id="scan-result-panel"></div>
     121                        </div>
    93122                    </div>
    94                     <!--Scan Path Modal-->
    95                     <div class="modal fade" id="scanPathModal" tabindex="-1" role="dialog" aria-hidden="true">
    96                         <div class="modal-dialog">
    97                             <div class="modal-content">
    98                                 <div class="modal-header">
    99                                     <button type="button" class="close" data-dismiss="modal">
    100                                         <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
    101                                     </button>
    102                                     <h4 class="modal-title" id="myModalLabel2"><?php oLang::_('SCANPATH'); ?></h4>
    103                                 </div>
    104                                 <div class="modal-body" style="height:400px">
    105                                     <label style="vertical-align: top;"><?php oLang::_('FILETREENAVIGATOR'); ?></label>
    106                                     <div class="panel-body" id="FileTreeDisplay"></div>
    107                                 </div>
    108                                 <div class="modal-footer">
    109                                     <div class="panel-body">
    110                                         <div class="form-group">
    111                                             <label for="scanPath" class="col-sm-1 control-label"><?php oLang::_('PATH');?></label>
    112                                             <div class="col-sm-11">
    113                                                 <input type="text" name="scanPath" id="selected_file" class="form-control">
    114                                             </div>
     123                </div>
     124                <!--Scan Path Modal-->
     125                <div class="modal fade" id="scanPathModal" tabindex="-1" role="dialog" aria-hidden="true">
     126                    <div class="modal-dialog">
     127                        <div class="modal-content">
     128                            <div class="modal-header">
     129                                <button type="button" class="close" data-dismiss="modal">
     130                                    <span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
     131                                </button>
     132                                <h4 class="modal-title" id="myModalLabel2"><?php oLang::_('SCANPATH'); ?></h4>
     133                            </div>
     134                            <div class="modal-body" style="height:400px">
     135                                <label style="vertical-align: top;"><?php oLang::_('FILETREENAVIGATOR'); ?></label>
     136                                <div class="panel-body" id="FileTreeDisplay"></div>
     137                            </div>
     138                            <div class="modal-footer">
     139                                <div class="panel-body">
     140                                    <div class="form-group">
     141                                        <label for="scanPath" class="col-sm-1 control-label"><?php oLang::_('PATH');?></label>
     142                                        <div class="col-sm-11">
     143                                            <input type="text" name="scanPath" id="selected_file" class="form-control">
    115144                                        </div>
    116                                         <div class="form-group">
    117                                             <div>
    118                                                 <button type="button" class="btn btn-sm" id='save-button'><i class="glyphicon glyphicon-save text-success"></i> <?php oLang::_('SET');?></button>
    119                                             </div>
     145                                    </div>
     146                                    <div class="form-group">
     147                                        <div>
     148                                            <button type="button" class="btn-new result-btn-set" id='save-button'><i class="glyphicon glyphicon-save text-white"></i> <?php oLang::_('SET');?></button>
    120149                                        </div>
    121150                                    </div>
     
    128157        </div>
    129158    </div>
     159</div>
  • ose-firewall/trunk/assets/views/template/vls/template-vls-scanstatus.php

    r1387925 r1581581  
    6464            </div>
    6565        </div>
    66         <div class="pull-right">
    67             <i class="fa fa-clock-o"></i>Last Scan:
    68             <strong id="scan-date" class="text-success"></strong>
    69         </div>
     66<!--        <div class="pull-right">-->
     67<!--            <i class="fa fa-clock-o"></i>Last Scan:-->
     68<!--            <strong id="scan-date" class="text-success"></strong>-->
     69<!--        </div>-->
    7070    </div>
    7171</div>
  • ose-firewall/trunk/assets/views/vlscan.php

    r1387925 r1581581  
    44?>
    55<div id="oseappcontainer">
    6     <div class="container">
     6    <div class="container wrapbody">
    77        <?php
    88        $this->model->showLogo();
    9         $this->model->showHeader();
     9        //       $this->model->showHeader();
    1010        ?>
    1111        <div class="row">
     
    1313                <div class="panel panel-primary plain ">
    1414                    <!-- Start .panel -->
    15                     <div class="panel-body">
    16                         <div class="row config-buttons pull-right">
    17                             <div class="col-md-12">
     15                    <div class="panel-body wrap-container">
     16                        <div class="row row-set"  data-bind="with:vl_data">
     17                            <div data-bind="foreach: {data: $data, as: 'vls'}">
     18                                <div class="col-sm-3 p-l-r-0">
     19                                    <div id="c-tag">
     20                                        <div class="col-sm-12" style="padding-left: 0px;">
     21                                <span class="tag-title">Vulnerabilities Scanner<span>
     22                                        </div>
     23                                        <p class="tag-content">
     24                                            Vulnerabilities Scanner is a powerful vulnerability detector. It scans through your website and detects any real vulnerabilities. Credits to WPScan Vulnerability.
     25                                        </p>
     26                                    </div>
     27                                </div>
     28                                <div class="col-sm-3">
     29                                    <div class="vs-line-1">
     30                                        <a href="#sectionWP" data-toggle="tab">
     31                                            <div class="cursor-pointer vs-line-1-title"> <i class="fa fa-<?php echo OSE_CMS=='joomla'? 'joomla' : 'wordpress' ?>"></i></div>
     32                                            <div class="vs-line-1-number">
     33                                                <?php echo OSE_CMS=='joomla'? 'Joomla' : 'Wordpress' ?>: &nbsp;&nbsp; <span class="scan-file-number" data-bind="filteLength: vls.content.CMS.vulnerabilities"></span>
     34                                            </div>
     35                                        </a>
     36                                    </div>
     37                                </div>
     38                                <div class="col-sm-3">
     39                                    <a data-toggle="tab" href="#sectionPlu">
     40                                        <div class="vs-line-1">
     41                                            <div class="cursor-pointer vs-line-1-title"> <i class="fa fa-wrench"></i></div>
     42                                            <div class="vs-line-1-number">
     43                                                Plugins: &nbsp;&nbsp;<span data-bind="with:vls.content.plugin">
     44                                <span class='scan-file-number' data-bind="filteLength:vls.content.plugin"></span>
     45                            </span>
     46                                            </div>
     47                                        </div>
     48                                    </a>
     49                                </div>
     50                                <div class="col-sm-3">
     51                                    <div class="vs-line-1">
     52                                        <a data-toggle="tab" href="#sectionThm">
     53                                            <div class="cursor-pointer vs-line-1-title"> <i class="fa fa-puzzle-piece"></i></div>
     54                                            <div class="vs-line-1-number">
     55                                                Themes: &nbsp;&nbsp;<span data-bind="with:vls.content.theme">
     56                                <span class='scan-file-number' data-bind="filteLength:vls.content.theme"></span>
     57                            </span>
     58                                            </div>
     59                                        </a>
     60                                    </div>
     61                                </div>
    1862                            </div>
    1963                        </div>
     64                        <div class="row row-set" style="padding-right: 20px;">
     65                            <div id="scan-date"></div>
     66                            <div>
     67                                <?php require_once('template/vls/template-vls-records.php') ?>
     68                            </div>
     69                        </div>
     70
     71
     72
     73
     74
    2075                        <div class="row">
    2176                            <?php require_once('template/vls/template-vls-scanstatus.php') ?>
    2277                        </div>
    2378
    24                         <div class="row">
     79                        <div class="col-sm-12" style="padding-right: 20px;">
    2580                            <div id="scanbuttons">
    26                                 <button id="vlstop" class='centrora-btn'><i id="ic-change"
    27                                         class="glyphicon glyphicon-stop color-red"></i> <?php oLang::_('STOP_VIRUSSCAN') ?>
     81                                <button id="vlscan" class='btn-new result-btn-set'><i id="ic-change"
     82                                                                                      class="glyphicon glyphicon-play color-green"></i> <?php oLang::_('START_NEW_SCAN') ?>
    2883                                </button>
    29                                 <button id="vlscan" class='centrora-btn'><i id="ic-change"
    30                                         class="glyphicon glyphicon-play color-green"></i> <?php oLang::_('START_NEW_SCAN') ?>
     84                                <button id="vlstop" class='btn-new result-btn-set'><i id="ic-change"
     85                                                                                      class="glyphicon glyphicon-stop color-red"></i> <?php oLang::_('STOP_VIRUSSCAN') ?>
    3186                                </button>
    3287                            </div>
    3388                        </div>
    34                         <?php require_once('template/vls/template-vls-records.php') ?>
     89                        <?php
     90                        $oem = new CentroraOEM();
     91                        $oemCustomer = $oem->hasOEMCustomer();
     92                        if(!empty($oemCustomer['data']['customer_id'])) {
     93                            echo $oem->getCallToActionAndFooter();
     94                        }else {?>
     95                            <?php  echo $this->model->getCallToActionAndFooter(); }?>
     96                    </div>
     97
    3598                    </div>
    3699
  • ose-firewall/trunk/assets/views/vsscan.php

    r1417654 r1581581  
    1111?>
    1212    <div id="oseappcontainer">
    13         <div class="container wrapbody">
     13        <div class="container wrapbody" id="vsscan-page">
    1414            <?php
    1515            $this->model->showLogo();
     
    2121                    <div class="panel panel-primary plain ">
    2222                        <!-- Start .panel -->
    23 
    2423                        <div class="panel-body wrap-container">
    2524                              <div class="row row-set">
     
    207206                                </div>
    208207                            </div>
    209                             <div class="row row-set" style="margin-top:14px;">
    210                                 <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px;">
    211                                  <a href="http://www.centrora.com/developers/" target="_blank"><div class="call-to-action">
    212                                     <div class="call-to-action-txt">
    213                                     <img width="35" height="35" alt="C_puma" src="http://googledrive.com/host/0BzcQR8G4BGjUX0ZzTzBvUVNEb00"> &nbsp;
    214                                     Schedule your scanning and update with Centrora Premium <sup>Now</sup></div>
    215                                 </div></a>
    216                                 </div>
    217                                 <div class="col-sm-3">
    218                                 <div id="bg-scan" class="vs-bg-dark col-sm-12" data-target="#bgModel" data-toggle="modal" style="display: none">
    219                                 Background Scanning
    220                                 </div>
    221                                 </div>
    222                             </div>
    223                             <div class="row">
    224                             <div id="footer" class="col-sm-12">
    225                             <div>Centrora 2016 a portfolio of Luxur Group PTY LTD,  All rights reserved.</div>
    226                             </div>
    227                             </div>
     208
     209                            <?php
     210                            $oem = new CentroraOEM();
     211                            $oemCustomer = $oem->hasOEMCustomer();
     212                            if(!empty($oemCustomer['data']['customer_id'])) {
     213                                echo $oem->getCallToActionAndFooter();
     214                            }else {?>
     215                            <?php  echo $this->model->getCallToActionAndFooter(); }?>
    228216                            </div>
    229217
     
    460448
    461449    <?php
    462     $this->model->showFooterJs();
     450 $this->model->showFooterJs();
    463451?>
  • ose-firewall/trunk/classes/App/Controller/SurfscanController.php

    r1425230 r1581581  
    5454    public  function action_updateMD5DB()
    5555    {
    56         $booleanresult = $this->model->updateMD5DB ( );
    57         if ($booleanresult) {
    58             $this->model->aJaxReturn(true, 'SUCCESS', $this->model->getLang("SURF_SCAN_SIG_UPDATED"));
    59         } else {
    60             $this->model->aJaxReturn(false, 'FAIL', $this->model->getLang("SURF_SCAN_SIG_UPDATED"));
    61         }
     56        $result = $this->model->updateMD5DB ( );
     57        $this->model->returnJSON($result);
     58
    6259    }
    6360
  • ose-firewall/trunk/classes/App/Model/BaseModel.php

    r1425230 r1581581  
    2626if (!defined('OSE_FRAMEWORK') && !defined('OSEFWDIR') && !defined('_JEXEC'))
    2727{
    28     die('Direct Access Not Allowed');
     28    die('Direct Access Not Allowed');
    2929}
    3030class BaseModel  {
    31     protected $db = null;
    32     protected $cent_nounce = "";
    33     protected $qatest = false;
    34     public function __construct() {
    35        
    36     }
    37     public function getCHeader() {}
    38     public function getCDescription() {}
    39     public function showLogo () {
    40         oseFirewall :: showLogo();
    41     }
    42     protected function loadDatabase () {
    43         $this->db = oseFirewall::getDBO();
    44     }
    45     protected function loadCoreLibrary () {
    46         require_once (OSE_FWFRAMEWORK.ODS.'oseFirewallWordpress.php');
    47     }
    48     protected function loadLibrary () {
    49         $this->loadFirewallStat () ;
    50         oseFirewall::callLibClass('ipmanager', 'ipmanager');
    51     }
    52     protected function loadFirewallStat () {
    53         if (OSE_CMS == 'joomla')
    54         {
    55             oseFirewall::callLibClass('firewallstat', 'firewallstatJoomla');
    56         }
    57         else
    58         {
    59             oseFirewall::callLibClass('firewallstat', 'firewallstatWordpress');
    60         }
    61     }
    62     public function showSubTitle(){
    63         echo "We are always here to help";
    64     }
    65 
    66     protected function loadJSLauguage ($cs, $baseUrl) {
     31    protected $db = null;
     32    protected $cent_nounce = "";
     33    protected $qatest = false;
     34    public function __construct() {
     35
     36    }
     37    public function getCHeader() {}
     38    public function getCDescription() {}
     39    public function showLogo () {
     40        oseFirewall :: showLogo();
     41    }
     42    protected function loadDatabase () {
     43        $this->db = oseFirewall::getDBO();
     44    }
     45    protected function loadCoreLibrary () {
     46        require_once (OSE_FWFRAMEWORK.ODS.'oseFirewallWordpress.php');
     47    }
     48    protected function loadLibrary () {
     49        $this->loadFirewallStat () ;
     50        oseFirewall::callLibClass('ipmanager', 'ipmanager');
     51    }
     52    protected function loadFirewallStat () {
     53        if (OSE_CMS == 'joomla')
     54        {
     55            oseFirewall::callLibClass('firewallstat', 'firewallstatJoomla');
     56        }
     57        else
     58        {
     59            oseFirewall::callLibClass('firewallstat', 'firewallstatWordpress');
     60        }
     61    }
     62    public function showSubTitle(){
     63        echo "We are always here to help";
     64    }
     65
     66    protected function loadJSLauguage ($cs, $baseUrl) {
    6767        $lang = oseFirewallBase::getLocaleString();
    68         $cs->registerScriptFile($baseUrl . '/public/messages/'.$lang.'.js', CClientScript::POS_HEAD);
    69     }
    70     public function getNounce () {
    71         echo '<input type="hidden" id="centnounce" value ="'.oseFirewall::loadNounce().'" />';
    72     }
    73     public function showHeader () {
    74         $html = '<div class="bs-callout bs-callout-info fade in">';
     68        $cs->registerScriptFile($baseUrl . '/public/messages/'.$lang.'.js', CClientScript::POS_HEAD);
     69    }
     70    public function getNounce () {
     71        echo '<input type="hidden" id="centnounce" value ="'.oseFirewall::loadNounce().'" />';
     72    }
     73    public function showHeader () {
     74        $html = '<div class="bs-callout bs-callout-info fade in">';
    7575//      $html .='<span class="icon-separator">
    7676//                    <i class="glyphicon glyphicon-bullhorn"></i>
    7777//                </span>';
    78         $html .= '<span class="icon-separator">
     78        $html .= '<span class="icon-separator">
    7979
    8080                </span>';
    81         $html .= '<div class="header-wrapper">
     81        $html .= '<div class="header-wrapper">
    8282                    '.$this->getCHeader().'<small>'.$this->getCDescription ().'</small>
    8383                </div>';
    84         $html .= '</div>';
    85         echo $html;
    86     }
    87 
    88     public function showSubHeader()
    89     {
    90         $html = '<div class="sub-header">';
    91         $html .= '<div><img id="sub-icon" src="' . OSE_FWURL . '/public/images/premium/sub_icon.png"></div>';
    92 
    93         $html .= '<div class="header-wrapper">
     84        $html .= '</div>';
     85        echo $html;
     86    }
     87
     88    public function showSubHeader()
     89    {
     90        $html = '<div class="sub-header">';
     91        $html .= '<div><img id="sub-icon" src="' . OSE_FWURL . '/public/images/premium/sub_icon.png"></div>';
     92
     93        $html .= '<div class="header-wrapper">
    9494
    9595                    ' . $this->getCHeader() . '<small>' . $this->getCDescription() . '</small>
    9696                </div>';
    97         $html .= '</div>';
    98         echo $html;
    99     }
    100     public function throwAjaxReturn ($result, $status, $msg, $continue) {
    101         oseAjax :: aJaxReturn($result, $status, $msg, $continue);
    102     }
    103     public function throwAjaxRecursive ($result, $status, $msg, $continue, $step) {
    104         oseAjax :: throwAjaxRecursive($result, $status, $msg, $continue, $step);
    105     }
    106     protected function transMessage ($success, $msg)
    107     {
    108         $style = ($success==true)?'ajax-success':'ajax-failed';
    109         return '<div class="'.$style.'" >'.$msg.'</div>';
    110     }
    111     protected function addPages($url, $action) {
    112         $query = 'SELECT `id`, `visits` FROM `#__osefirewall_pages` WHERE `page_url` = ' . $this->db->quoteValue($url);
    113         $this->db->setQuery($query);
    114         $results = $this->db->loadObject();
    115         if (empty ($results)) {
    116             $varValues = array (
    117                 'page_url' => $url,
    118                 'action' => $action,
    119                 'visits' => 1
    120             );
    121             $id = $this->db->addData('insert', '#__osefirewall_pages', null, null, $varValues);
    122         } else {
    123             $varValues = array (
    124                 'visits' => $results->visits + 1
    125             );
    126             $this->db->addData('update', '#__osefirewall_pages', 'id', $results->id, $varValues);
    127             $id = $results->id;
    128         }
    129         return $id;
    130     }
    131     protected function addReferer($referer=null) {
    132         $query = 'SELECT `id` FROM `#__osefirewall_referers` WHERE `referer_url` = ' . $this->db->quoteValue($referer);
    133         $this->db->setQuery($query);
    134         $results = $this->db->loadObject();
    135         if (empty ($results)) {
    136             $varValues = array (
    137                 'referer_url' => $referer
    138             );
    139             $id = $this->db->addData('insert', '#__osefirewall_referers', null, null, $varValues);
    140         } else {
    141             $id = $results->id;
    142         }
    143         return $id;
    144     }
    145     public function isDBReady(){
    146         $return = array ();
    147         $return['ready'] = oseFirewall :: isDBReady();
    148         $return['type'] = 'base';
    149         return $return['ready'];
    150     }
    151     public function returnJSON($results) {
    152         if ($this->qatest == true) {
    153             return $results;
    154         }
    155         else {
    156             oseAjax::returnJSON($results);
    157         }
    158     }
    159     public function loadRequest () {
    160         oseFirewall::loadRequest ();
    161         $this->qatest = oRequest :: getInt('qatest', false);
    162     }
    163     public function getVar ($var, $default) {
    164         $this->loadRequest ();
    165         return oRequest :: getVar($var, $default);
    166     }
    167     public function getInt ($var, $default=0) {
    168         $this->loadRequest ();
    169         return oRequest :: getInt($var, $default);
    170     }
    171     public function getLang ($var) {
    172         return oLang::_get($var);
    173     }
    174     public function aJaxReturn($result, $status, $msg, $continue = false, $id = null) {
    175         oseAjax::aJaxReturn($result, $status, $msg, $continue = false, $id = null);
    176     }
    177     public function getFirewallIpManager () {
    178         $this->loadDatabase();
    179         return new oseFirewallIpManager($this->db);
    180     }
    181     protected function loadJSON () {
    182         if (!class_exists('oseJSON')) {
    183             oseFirewall::loadJSON();
    184         }
    185     }
    186     public function JSON_encode ($var) {
    187         $this->loadJSON ();
    188         return oseJSON::encode($var);
    189     }
    190     public function JSON_decode ($var) {
    191         $this->loadJSON ();
    192         return oseJSON::decode($var);
    193     }
    194     public function showSelectionRequired () {
    195         $this->aJaxReturn(false, 'ERROR', $this->getLang("PLEASE_SELECT_ITEMS"), false);
    196     }
    197     public function fileClean ($path) {
    198         oseFirewall::loadFiles ();
    199         return oseFile::clean ($path);
    200     }
    201     protected function loadAllAssets () {
    202         // JS
    203         if (OSE_CMS =='joomla')
    204         {
    205             if (JOOMLA15 == true) {
    206                 oseFirewall::loadJSFile ('CentroraJquery', 'jquery-1.11.1.min.js', false);
    207                 oseFirewall::loadJSFile ('CentroraBootStrapJS', 'bootstrap.min.js', false);
    208                
    209             }
    210             else {
    211                 $version = new JVersion();
    212                 if ($version->getShortVersion()<3 || $version->getShortVersion()>'5')
    213                 {   
    214                     oseFirewall::loadJSFile ('CentroraJquery', 'jquery-1.11.1.min.js', false);
    215                     oseFirewall::loadJSFile ('CentroraBootStrapJS', 'bootstrap.min.js', false);
    216                 }
    217                 else
    218                 {
    219                     JHtml::_('bootstrap.framework');
    220                 }
    221             }
    222             oseFirewall::loadJSFile ('CentroraJquery', 'joomla.js', false);
    223         }   
    224         else
    225         {
     97        $html .= '</div>';
     98        echo $html;
     99    }
     100    public function throwAjaxReturn ($result, $status, $msg, $continue) {
     101        oseAjax :: aJaxReturn($result, $status, $msg, $continue);
     102    }
     103    public function throwAjaxRecursive ($result, $status, $msg, $continue, $step) {
     104        oseAjax :: throwAjaxRecursive($result, $status, $msg, $continue, $step);
     105    }
     106    protected function transMessage ($success, $msg)
     107    {
     108        $style = ($success==true)?'ajax-success':'ajax-failed';
     109        return '<div class="'.$style.'" >'.$msg.'</div>';
     110    }
     111    protected function addPages($url, $action) {
     112        $query = 'SELECT `id`, `visits` FROM `#__osefirewall_pages` WHERE `page_url` = ' . $this->db->quoteValue($url);
     113        $this->db->setQuery($query);
     114        $results = $this->db->loadObject();
     115        if (empty ($results)) {
     116            $varValues = array (
     117                'page_url' => $url,
     118                'action' => $action,
     119                'visits' => 1
     120            );
     121            $id = $this->db->addData('insert', '#__osefirewall_pages', null, null, $varValues);
     122        } else {
     123            $varValues = array (
     124                'visits' => $results->visits + 1
     125            );
     126            $this->db->addData('update', '#__osefirewall_pages', 'id', $results->id, $varValues);
     127            $id = $results->id;
     128        }
     129        return $id;
     130    }
     131    protected function addReferer($referer=null) {
     132        $query = 'SELECT `id` FROM `#__osefirewall_referers` WHERE `referer_url` = ' . $this->db->quoteValue($referer);
     133        $this->db->setQuery($query);
     134        $results = $this->db->loadObject();
     135        if (empty ($results)) {
     136            $varValues = array (
     137                'referer_url' => $referer
     138            );
     139            $id = $this->db->addData('insert', '#__osefirewall_referers', null, null, $varValues);
     140        } else {
     141            $id = $results->id;
     142        }
     143        return $id;
     144    }
     145    public function isDBReady(){
     146        $return = array ();
     147        $return['ready'] = oseFirewall :: isDBReady();
     148        $return['type'] = 'base';
     149        return $return['ready'];
     150    }
     151    public function returnJSON($results) {
     152        if ($this->qatest == true) {
     153            return $results;
     154        }
     155        else {
     156            oseAjax::returnJSON($results);
     157        }
     158    }
     159    public function loadRequest () {
     160        oseFirewall::loadRequest ();
     161        $this->qatest = oRequest :: getInt('qatest', false);
     162    }
     163    public function getVar ($var, $default) {
     164        $this->loadRequest ();
     165        return oRequest :: getVar($var, $default);
     166    }
     167    public function getInt ($var, $default=0) {
     168        $this->loadRequest ();
     169        return oRequest :: getInt($var, $default);
     170    }
     171    public function getLang ($var) {
     172        return oLang::_get($var);
     173    }
     174    public function aJaxReturn($result, $status, $msg, $continue = false, $id = null) {
     175        oseAjax::aJaxReturn($result, $status, $msg, $continue = false, $id = null);
     176    }
     177    public function getFirewallIpManager () {
     178        $this->loadDatabase();
     179        return new oseFirewallIpManager($this->db);
     180    }
     181    protected function loadJSON () {
     182        if (!class_exists('oseJSON')) {
     183            oseFirewall::loadJSON();
     184        }
     185    }
     186    public function JSON_encode ($var) {
     187        $this->loadJSON ();
     188        return oseJSON::encode($var);
     189    }
     190    public function JSON_decode ($var) {
     191        $this->loadJSON ();
     192        return oseJSON::decode($var);
     193    }
     194    public function showSelectionRequired () {
     195        $this->aJaxReturn(false, 'ERROR', $this->getLang("PLEASE_SELECT_ITEMS"), false);
     196    }
     197    public function fileClean ($path) {
     198        oseFirewall::loadFiles ();
     199        return oseFile::clean ($path);
     200    }
     201    protected function loadAllAssets () {
     202        // JS
     203        if (OSE_CMS =='joomla')
     204        {
     205            if (JOOMLA15 == true) {
     206                oseFirewall::loadJSFile ('CentroraJquery', 'jquery-1.11.1.min.js', false);
     207                oseFirewall::loadJSFile ('CentroraBootStrapJS', 'bootstrap.min.js', false);
     208
     209            }
     210            else {
     211                $version = new JVersion();
     212                if ($version->getShortVersion()<3 || $version->getShortVersion()>'5')
     213                {
     214                    oseFirewall::loadJSFile ('CentroraJquery', 'jquery-1.11.1.min.js', false);
     215                    oseFirewall::loadJSFile ('CentroraBootStrapJS', 'bootstrap.min.js', false);
     216                }
     217                else
     218                {
     219                    JHtml::_('bootstrap.framework');
     220                }
     221            }
     222            oseFirewall::loadJSFile ('CentroraJquery', 'joomla.js', false);
     223        }
     224        else
     225        {
    226226            oseFirewall::loadJSFile('CentroraWPJquery', 'wordpress.js', false);
    227             oseFirewall::loadJSFile ('CentroraBootStrapJS', 'bootstrap.min.js', false);
    228         }
     227            oseFirewall::loadJSFile ('CentroraBootStrapJS', 'bootstrap.min.js', false);
     228        }
    229229//        oseFirewall::loadJSFile ('CentroraDropboxJS', 'dropins.js', false);
    230230        oseFirewall::loadJSFile('CentroraJueryUI', 'jquery-ui.min.js', false);
    231231        oseFirewall::loadJSFile('CentroraDataTableJS', 'jquery.dataTables.min.js', false);
    232         oseFirewall::loadJSFile ('CentroraMaskInput','plugins/maskedinput/jquery.maskedinput.js', false);
    233         oseFirewall::loadJSFile ('CentroraMaskIP','plugins/maskedinput/jquery.input-ip-address-control-1.0.min.js', false);
    234         oseFirewall::loadJSFile ('CentroraBootbox', 'plugins/bootbox/bootbox.js', false);
    235         oseFirewall::loadJSFile ('CentroraForm', 'plugins/form/jquery.form.min.js', false);
     232        oseFirewall::loadJSFile ('CentroraMaskInput','plugins/maskedinput/jquery.maskedinput.js', false);
     233        oseFirewall::loadJSFile ('CentroraMaskIP','plugins/maskedinput/jquery.input-ip-address-control-1.0.min.js', false);
     234        oseFirewall::loadJSFile ('CentroraBootbox', 'plugins/bootbox/bootbox.js', false);
     235        oseFirewall::loadJSFile ('CentroraForm', 'plugins/form/jquery.form.min.js', false);
    236236
    237237        //oseFirewall::loadJSFile ('CentroraModernizr', 'modernizr.custom.js', false);
    238         oseFirewall::loadJSFile ('CentroraJResponse', 'jRespond.min.js', false);
    239         oseFirewall::loadJSFile ('CentroraSlimscroll', 'plugins/slimscroll/jquery.slimscroll.min.js', false);
    240         oseFirewall::loadJSFile ('CentroraSlimscrolHor', 'plugins/slimscroll/jquery.slimscroll.horizontal.min.js', false);
    241         oseFirewall::loadJSFile ('CentroraAppstart', 'jquery.appStart.js', false);
     238        oseFirewall::loadJSFile ('CentroraJResponse', 'jRespond.min.js', false);
     239        oseFirewall::loadJSFile ('CentroraSlimscroll', 'plugins/slimscroll/jquery.slimscroll.min.js', false);
     240        oseFirewall::loadJSFile ('CentroraSlimscrolHor', 'plugins/slimscroll/jquery.slimscroll.horizontal.min.js', false);
     241        oseFirewall::loadJSFile ('CentroraAppstart', 'jquery.appStart.js', false);
    242242        oseFirewall::loadJSFile('CentroraInputMask', 'plugins/inputmask/jquery.mask.js', false);
    243243        oseFirewall::loadJSFile('CentroraTipsy', 'plugins/tipsy/jquery.tipsy.js', false);
     
    254254            oseFirewall::loadJSFile('CentroraColors', 'colors.js', false);
    255255        };
    256         oseFirewall::loadJSFile ('CentroraApp', 'app.js', false);
     256        oseFirewall::loadJSFile ('CentroraApp', 'app.js', false);
    257257        $lang = oseFirewallBase::getLocaleString();
    258         oseFirewall::loadLanguageJSFile ('CentroraLanguage', ''.$lang.'.js', false);
    259         // CSS
    260         oseFirewall::loadCSSFile ('CentroraDataTable', 'jquery.dataTables.min.css', false);
     258        oseFirewall::loadLanguageJSFile ('CentroraLanguage', ''.$lang.'.js', false);
     259        // CSS
     260        oseFirewall::loadCSSFile ('CentroraDataTable', 'jquery.dataTables.min.css', false);
    261261        oseFirewall::loadCSSFile ('CentroraJueryUIcss', 'jquery-ui.css', false);
    262262
    263263        // oseFirewall::loadCSSFile ('CentroraDatePicker', 'datepicker.css', false);
    264264        oseFirewall::loadCSSFile ('CentroraBootStrap', 'bootstrap.css', false);
    265         oseFirewall::loadCSSFile ('CentroraWaitme', 'waitme.less.css', false);
    266         oseFirewall::loadCSSFile ('CentroraIcons', 'icons.css', false);
    267         oseFirewall::loadCSSFile ('CentroraBootStrapLess', 'main.css', false);
    268 
    269         oseFirewall::loadCSSFile ('CentroraFontAwesomeMin', 'font-awesome.min.css', false);
    270         //load style css
    271         $style = $this->getConfiguration('style');
    272         if (!empty($style['data']) && $style['data']['style'] == 'classic') {
     265        oseFirewall::loadCSSFile ('CentroraWaitme', 'waitme.less.css', false);
     266        oseFirewall::loadCSSFile ('CentroraIcons', 'icons.css', false);
     267        oseFirewall::loadCSSFile ('CentroraBootStrapLess', 'main.css', false);
     268
     269        oseFirewall::loadCSSFile ('CentroraFontAwesomeMin', 'font-awesome.min.css', false);
     270        //load style css
     271        $style = $this->getConfiguration('style');
     272        if (!empty($style['data']) && $style['data']['style'] == 'classic') {
    273273            oseFirewall::loadCSSFile('CentroraV4Style', 'dynamic.css', false);
    274274        } else {
     
    276276
    277277        }
    278         oseFirewall::loadCSSURL ('CentroraV4Font','https://fonts.googleapis.com/css?family=Open+Sans%3A400italic%2C400%2C600%2C700%7CRoboto+Slab%3A400%2C300%2C700');
     278        oseFirewall::loadCSSURL ('CentroraV4Font','https://fonts.googleapis.com/css?family=Open+Sans%3A400italic%2C400%2C600%2C700%7CRoboto+Slab%3A400%2C300%2C700');
    279279        oseFirewall::loadCSSFile('CentroraTipsyCss', 'tipsy.css', false);
    280280        if (class_exists('JConfig') || class_exists('SConfig'))
    281281        {
    282             oseFirewall::loadCSSFile ('CentroraJFix', 'jfix.css', false);
     282            oseFirewall::loadCSSFile ('CentroraJFix', 'jfix.css', false);
    283283        }
    284284        $this->getOEMCss();
    285     }
    286     protected function getOEMCss () {
    287         oseFirewall::callLibClass('oem', 'oem');
    288         $oem = new CentroraOEM();
    289         $oem->loadCSS ();
    290     }
    291     protected function getEmptyReturn () {
    292         $return  = array();
    293         $return['data']['id'] = 0;
    294         $return['data']['name'] = 'N/A';
    295         $return['recordsTotal'] = 0;
    296         $return['recordsFiltered']=0;
    297         return $return;
    298     }
    299     public function getConfiguration($type)
    300     {
    301         $this->loadFirewallStat () ;
    302         $oseFirewallStat = new oseFirewallStat();
    303         $results = $oseFirewallStat->getConfiguration($type);
    304         return $results;
    305     }
    306     public function isConfigurationDBReady($data)
    307     {
    308         require_once(OSE_FWFRAMEWORK.ODS.'oseFirewallBase.php');
    309         if(isset($data['blockCountry'] ) && $data['blockCountry'] == 1)
    310         {
    311             if(oseFirewallBase :: isCountryBlockConfigDBReady() == false)
    312             {
    313                 oseAjax::aJaxReturn(false, 'ERROR', oLang::_get('CONFIG_SAVECOUNTRYBLOCK_FAILE'), false);
    314             }
    315         }
    316         if(isset($data['adVsPatterns'] ) && $data['adVsPatterns'] == 1){
    317             if(oseFirewallBase :: isAdvancePatternConfigDBReady() == false)
    318             {
    319                 oseAjax::aJaxReturn(false, 'ERROR', oLang::_get('CONFIG_ADPATTERNS_FAILE'), false);
    320             }
    321         }
    322         if(isset($data['adRules'] ) && $data['adRules'] == 1)
    323         {
    324             if(oseFirewallBase :: isAdvanceSettingConfigDBReady() == false)
    325             {
    326                 oseAjax::aJaxReturn(false, 'ERROR', oLang::_get('CONFIG_ADRULES_FAILE'), false);
    327             }
    328         }
    329     }
     285    }
     286    protected function getOEMCss () {
     287        oseFirewall::callLibClass('oem', 'oem');
     288        $oem = new CentroraOEM();
     289        $oem->loadCSS ();
     290    }
     291    protected function getEmptyReturn () {
     292        $return  = array();
     293        $return['data']['id'] = 0;
     294        $return['data']['name'] = 'N/A';
     295        $return['recordsTotal'] = 0;
     296        $return['recordsFiltered']=0;
     297        return $return;
     298    }
     299    public function getConfiguration($type)
     300    {
     301        $this->loadFirewallStat () ;
     302        $oseFirewallStat = new oseFirewallStat();
     303        $results = $oseFirewallStat->getConfiguration($type);
     304        return $results;
     305    }
     306    public function isConfigurationDBReady($data)
     307    {
     308        require_once(OSE_FWFRAMEWORK.ODS.'oseFirewallBase.php');
     309        if(isset($data['blockCountry'] ) && $data['blockCountry'] == 1)
     310        {
     311            if(oseFirewallBase :: isCountryBlockConfigDBReady() == false)
     312            {
     313                oseAjax::aJaxReturn(false, 'ERROR', oLang::_get('CONFIG_SAVECOUNTRYBLOCK_FAILE'), false);
     314            }
     315        }
     316        if(isset($data['adVsPatterns'] ) && $data['adVsPatterns'] == 1){
     317            if(oseFirewallBase :: isAdvancePatternConfigDBReady() == false)
     318            {
     319                oseAjax::aJaxReturn(false, 'ERROR', oLang::_get('CONFIG_ADPATTERNS_FAILE'), false);
     320            }
     321        }
     322        if(isset($data['adRules'] ) && $data['adRules'] == 1)
     323        {
     324            if(oseFirewallBase :: isAdvanceSettingConfigDBReady() == false)
     325            {
     326                oseAjax::aJaxReturn(false, 'ERROR', oLang::_get('CONFIG_ADRULES_FAILE'), false);
     327            }
     328        }
     329    }
    330330
    331331    public function showGoogleSecret()
    332332    {
    333333        require_once(OSE_FWFRAMEWORK . ODS . 'googleAuthenticator' . ODS . 'class_gauthenticator.php');
    334         $gauthenticator = new CentroraGoogleAuthenticator();
     334        $gauthenticator = new CentroraGoogleAuthenticator();
    335335        $googleAuth = oseFirewall::getConfiguration('admin');
    336336
     
    348348        return $result;
    349349    }
    350     public function saveConfiguration($type, $data)
    351     {
    352         $this->loadFirewallStat () ;
    353         $this->isConfigurationDBReady($data);
    354         $oseFirewallStat = new oseFirewallStat();
    355         $result = $oseFirewallStat->saveConfiguration($type, $data);
    356         $this -> confAjaxReturn ($result);
    357     }
     350    public function saveConfiguration($type, $data)
     351    {
     352        $this->loadFirewallStat () ;
     353        $this->isConfigurationDBReady($data);
     354        $oseFirewallStat = new oseFirewallStat();
     355        $result = $oseFirewallStat->saveConfiguration($type, $data);
     356        $this -> confAjaxReturn ($result);
     357    }
    358358
    359359    public function saveConfigurationNoExit($type, $data)
     
    365365        return $result;
    366366    }
    367     public function confAjaxReturn ($result)
    368     {
    369         if ($result==true)
    370         {
    371             oseAjax::aJaxReturn(true, 'SUCCESS', oLang::_get('CONFIG_SAVE_SUCCESS'), true);
    372         }
    373         else
    374         {
    375             oseAjax::aJaxReturn(false, 'ERROR', oLang::_get('CONFIG_SAVE_FAILED'), false);
    376         }
    377     }
    378     public function loadFiles () {
    379         oseFirewall::loadFiles ();
    380     }
    381     public function getToken () {
    382         $panel = new panel ();
    383         $tokens = $panel->getToken();
    384         print_r($tokens);
    385     }
    386     public function showFooterJs() {
    387         oseFirewall::loadJSFile ('CentroraUpdate', 'update.js', false);
    388     }
    389     protected function getProductType () {
    390         if (class_exists('SConfig'))
    391         {
    392             $product = 'st';
    393         }
    394         else
    395         {
    396             $product = 'pl';
    397         }
    398         return $product;
    399     }
     367    public function confAjaxReturn ($result)
     368    {
     369        if ($result==true)
     370        {
     371            oseAjax::aJaxReturn(true, 'SUCCESS', oLang::_get('CONFIG_SAVE_SUCCESS'), true);
     372        }
     373        else
     374        {
     375            oseAjax::aJaxReturn(false, 'ERROR', oLang::_get('CONFIG_SAVE_FAILED'), false);
     376        }
     377    }
     378    public function loadFiles () {
     379        oseFirewall::loadFiles ();
     380    }
     381    public function getToken () {
     382        $panel = new panel ();
     383        $tokens = $panel->getToken();
     384        print_r($tokens);
     385    }
     386    public function showFooterJs() {
     387        oseFirewall::loadJSFile ('CentroraUpdate', 'update.js', false);
     388    }
     389    protected function getProductType () {
     390        if (class_exists('SConfig'))
     391        {
     392            $product = 'st';
     393        }
     394        else
     395        {
     396            $product = 'pl';
     397        }
     398        return $product;
     399    }
    400400
    401401    public function oempasscode()
     
    423423    {
    424424        if (class_exists('SConfig')){
    425             if (is_readable('/home/centrora'))
    426             {
    427                 $rootpath = dirname('/home/centrora');
    428             }
    429             elseif (is_readable(dirname(OSE_ABSPATH)))
    430             {
    431                 $rootpath = dirname(dirname(OSE_ABSPATH));
    432             }
    433             else {
    434                 $rootpath = dirname(OSE_ABSPATH );
    435             }
     425            if (is_readable('/home/centrora'))
     426            {
     427                $rootpath = dirname('/home/centrora');
     428            }
     429            elseif (is_readable('/var/www/vhosts/default'))
     430            {
     431                $rootpath = dirname('/var/www/vhosts/default');
     432            }
     433            elseif (is_readable(dirname(OSE_ABSPATH)))
     434            {
     435                $rootpath = dirname(dirname(OSE_ABSPATH));
     436            }
     437            else {
     438                $rootpath = dirname(OSE_ABSPATH );
     439            }
    436440        }else {
    437441            $rootpath = OSE_ABSPATH;
     
    443447    }
    444448
    445     public function getPageUrl($page)
    446     {
    447         $url = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
    448         $query = $_SERVER['QUERY_STRING'];
    449         if (OSE_CMS == "wordpress") {
    450             switch ($page) {
    451                 case 'ipmanage':
    452                     $replace = "page=ose_fw_manageips";
    453                     echo str_replace($query, $replace, $url);
    454                     break;
    455                 case 'scanResult':
    456                     $replace = "page=ose_fw_scanreport";
    457                     echo str_replace($query, $replace, $url);
    458                     break;
    459                 case 'backup':
    460                     $replace = "page=ose_fw_backup";
    461                     echo str_replace($query, $replace, $url);
    462                     break;
    463                 case 'permconfig':
    464                     $replace = "page=ose_fw_permconfig";
    465                     echo str_replace($query, $replace, $url);
    466                     break;
    467             }
    468         } else {
    469             $joomla = "view=dashboard";
    470             switch ($page) {
    471                 case 'ipmanage':
    472                     $replace = "view=manageips";
    473                     echo str_replace($joomla, $replace, $url);
    474                     break;
    475                 case 'scanResult':
    476                     $replace = "view=vsreport";
    477                     echo str_replace($joomla, $replace, $url);
    478                     break;
    479                 case 'backup':
    480                     $replace = "view=backup";
    481                     echo str_replace($joomla, $replace, $url);
    482                     break;
    483                 case 'permconfig':
    484                     $replace = "view=permconfig";
    485                     $joomla = "view=fpscan";
    486                     echo str_replace($joomla, $replace, $url);
    487                     break;
    488             }
    489         }
    490     }
    491 
    492     public function getImgUrl($imageName)
    493     {
    494         return OSE_FWURL . '/public/images/' . $imageName;
    495     }
     449    public function getPageUrl($page)
     450    {
     451        $url = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
     452        $query = $_SERVER['QUERY_STRING'];
     453        if (OSE_CMS == "wordpress") {
     454            switch ($page) {
     455                case 'ipmanage':
     456                    $replace = "page=ose_fw_manageips";
     457                    echo str_replace($query, $replace, $url);
     458                    break;
     459                case 'scanResult':
     460                    $replace = "page=ose_fw_scanreport";
     461                    echo str_replace($query, $replace, $url);
     462                    break;
     463                case 'backup':
     464                    $replace = "page=ose_fw_backup";
     465                    echo str_replace($query, $replace, $url);
     466                    break;
     467                case 'permconfig':
     468                    $replace = "page=ose_fw_permconfig";
     469                    echo str_replace($query, $replace, $url);
     470                    break;
     471            }
     472        } else {
     473            $joomla = "view=dashboard";
     474            switch ($page) {
     475                case 'ipmanage':
     476                    $replace = "view=manageips";
     477                    echo str_replace($joomla, $replace, $url);
     478                    break;
     479                case 'scanResult':
     480                    $replace = "view=vsreport";
     481                    echo str_replace($joomla, $replace, $url);
     482                    break;
     483                case 'backup':
     484                    $replace = "view=backup";
     485                    echo str_replace($joomla, $replace, $url);
     486                    break;
     487                case 'permconfig':
     488                    $replace = "view=permconfig";
     489                    $joomla = "view=fpscan";
     490                    echo str_replace($joomla, $replace, $url);
     491                    break;
     492            }
     493        }
     494    }
     495
     496    public function getImgUrl($imageName)
     497    {
     498        return OSE_FWURL . '/public/images/' . $imageName;
     499    }
     500
     501    public function getCallToActionAndFooter()
     502    {
     503        return '<div class="row row-set" style="margin-top:14px;">
     504                                <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px;">
     505                                 <a href="http://www.centrora.com/developers/" target="_blank"><div class="call-to-action">
     506                                    <div class="call-to-action-txt">
     507                                    <img width="35" height="35" alt="C_puma" src="'.OSE_FWPUBLICURL.'/images/C_puma.png"> &nbsp;
     508                                    Schedule your scanning and update with Centrora Premium <sup>Now</sup></div>
     509                                </div></a>
     510                                </div>
     511                                <div class="col-sm-3">
     512                                <div id="bg-scan" class="vs-bg-dark col-sm-12" data-target="#bgModel" data-toggle="modal" style="display: none">
     513                                Background Scanning
     514                                </div>
     515                                </div>
     516                            </div>
     517                            <div class="row">
     518                            <div id="footer" class="col-sm-12">
     519                            <div>Centrora '.date('Y').' a portfolio of Luxur Group PTY LTD,  All rights reserved.</div>
     520                            </div>
     521                            </div>';
     522    }
    496523}
  • ose-firewall/trunk/classes/Library/fwscanner/fwscannerad.php

    r1446915 r1581581  
    157157                                    $attackContent = $value;
    158158                                    $attackVar = ($index == 'GET') ? "get." . $key : "post." . $key;
    159                                     if (is_array($attackContent)) {
    160                                         $attackContent = implode("|", $attackContent);
    161                                     }
    162                                     preg_match_all("/" . $option['filter'] . "/ims", $attackContent, $matched);
    163                                     if (!empty($matched[0])) {
    164                                         $tmpResult = $this->composeResult($option['impact'], $matched[0], $option['id'], $option['attacktype'], $attackVar, 'ad');
    165                                         $tmpResults[] = $tmpResult;
    166                                         $impact += $option['impact'];
    167                                     }
     159                                    if(!empty($attackContent)) {
     160                                        if (is_array($attackContent)) {
     161                                            $attackContent1 = $this->array_flatten($attackContent);
     162                                            $attackContent = implode("|", $attackContent1);
     163                                        }
     164                                        preg_match_all("/" . $option['filter'] . "/ims", $attackContent, $matched);
     165                                        if (!empty($matched[0])) {
     166                                            $tmpResult = $this->composeResult($option['impact'], $matched[0], $option['id'], $option['attacktype'], $attackVar, 'ad');
     167                                            $tmpResults[] = $tmpResult;
     168                                            $impact += $option['impact'];
     169                                        }
     170                                    }
    168171                                }
    169172                            }
     
    311314        }
    312315    }
     316
     317    public function array_flatten($array) {
     318        if (!is_array($array)) {
     319            return FALSE;
     320        }
     321        $result = array();
     322        foreach ($array as $key => $value) {
     323            if (is_array($value)) {
     324                $result = array_merge($result, $this->array_flatten($value));
     325            }
     326            else {
     327                $result[$key] = $value;
     328            }
     329        }
     330        return $result;
     331    }
    313332}
  • ose-firewall/trunk/classes/Library/oem/218.php

    r1387925 r1581581  
    103103        return '<li><a href="http://www.webandwire.de" title="Home">Quick links:&nbsp;&nbsp;&nbsp;<i class="glyphicon glyphicon-home"></i> <span class="hidden-xs hidden-sm hidden-md">'.OSE_WORDPRESS_FIREWALL_SHORT.'</span> </a></li>';
    104104    }
     105
     106    public function getCalltoAction()
     107    {
     108        return '<div class="row row-set" style="margin-top:14px;">
     109                                <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px;">
     110                                 <a href="https://webandwire.de/" target="_blank"><div class="call-to-action">
     111                                    <div class="call-to-action-txt">
     112                                    <img width="35" height="35" alt="C_puma" src="'.OSE_FWPUBLICURL.'css/oem/'.$this->customer_id.'/imgs/logo-header.png"> &nbsp;
     113                                    Schedule your scanning and update with WEBandWIRE PagePROTECT <sup>Now</sup></div>
     114                                </div></a>
     115                                </div>
     116                                <div class="col-sm-3">
     117                                <div id="bg-scan" class="vs-bg-dark col-sm-12" data-target="#bgModel" data-toggle="modal" style="display: none">
     118                                Background Scanning
     119                                </div>
     120                                </div>
     121                            </div>';
     122    }
     123
     124    public function getCallToActionAndFooter()
     125    {
     126        return '<div class="row row-set" style="margin-top:14px;">
     127                                <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px;">
     128                                 <a href="https://webandwire.de/" target="_blank"><div class="call-to-action">
     129                                    <div class="call-to-action-txt">
     130                                    <img width="35" height="35" alt="C_puma" src="'.OSE_FWPUBLICURL.'css/oem/'.$this->customer_id.'/imgs/logo-header.png"> &nbsp;
     131                                    Schedule your scanning and update with WEBandWIRE PagePROTECT <sup>Now</sup></div>
     132                                </div></a>
     133                                </div>
     134                                <div class="col-sm-3">
     135                                <div id="bg-scan" class="vs-bg-dark col-sm-12" data-target="#bgModel" data-toggle="modal" style="display: none">
     136                                Background Scanning
     137                                </div>
     138                                </div>
     139                            </div>
     140           <div class="row">
     141              <div id="footer" class="col-sm-12">
     142              <p class="pull-center">
     143                WEBandWIRE PagePROTECT is a portfolio of WEBandWIRE Internet- und EDV-Dienstleistungen. &copy;  <?php echo date("Y"); ?> <a
     144                    href="https://webandwire.de/" target="_blank">WEBandWIRE PagePROTECT</a>. All Rights Reserved. <br /> Credits
     145                to: <a href="http://www.centrora.com" target="_blank">Centrora Security!&#0174;</a>
     146              </p>
     147            </div>
     148          </div>';
     149    }
     150
     151    public function showLoginHeader()
     152    {
     153        $html = '<div class="bs-callout bs-callout-info fade in">';
     154        $html .= '<span class="icon-separator">
     155
     156                </span>';
     157        $html .= '<div class="header-wrapper">
     158                    WEBandWIRE PagePROTECT Member Login<small> You can login here with your WEBandWIRE PagePROTECT Account to activate your premium services</small>
     159                </div>';
     160        $html .= '</div>';
     161        echo $html;
     162    }
    105163}
  • ose-firewall/trunk/classes/Library/oem/236.php

    r1387925 r1581581  
    7676        return '<li><a href="http://gabemedia.dk" title="Home">Quick links:&nbsp;&nbsp;&nbsp;<i class="glyphicon glyphicon-home"></i> <span class="hidden-xs hidden-sm hidden-md">'.OSE_WORDPRESS_FIREWALL_SHORT.'</span> </a></li>';
    7777    }
     78
     79    public function getCallToActionAndFooter()
     80    {
     81        return '<div class="row row-set" style="margin-top:14px;">
     82                                <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px;">
     83                                 <a href="http://gabemedia.dk/" target="_blank"><div class="call-to-action">
     84                                    <div class="call-to-action-txt">
     85                                    <img width="35" height="35" alt="C_puma" src="'.OSE_FWPUBLICURL.'css/oem/'.$this->customer_id.'/imgs/logo-header.png"> &nbsp;
     86                                    Schedule your scanning and update with  Gabemedia Security <sup>Now</sup></div>
     87                                </div></a>
     88                                </div>
     89                                <div class="col-sm-3">
     90                                <div id="bg-scan" class="vs-bg-dark col-sm-12" data-target="#bgModel" data-toggle="modal" style="display: none">
     91                                Background Scanning
     92                                </div>
     93                                </div>
     94                            </div>
     95           <div class="row">
     96              <div id="footer" class="col-sm-12">
     97              <p class="pull-center">
     98                 Gabemedia Security is a portfolio of Gabemedia. &copy;  <?php echo date("Y"); ?> <a
     99                    href="http://gabemedia.dk/" target="_blank">Gabemedia</a>. All Rights Reserved. <br /> Credits
     100                to: <a href="http://www.centrora.com" target="_blank">Centrora Security!&#0174;</a>
     101              </p>
     102            </div>
     103          </div>';
     104    }
     105
     106    public function showLoginHeader()
     107    {
     108        $html = '<div class="bs-callout bs-callout-info fade in">';
     109        $html .= '<span class="icon-separator">
     110
     111                </span>';
     112        $html .= '<div class="header-wrapper">
     113                   Gabemedia Member Login<small> You can login here with your Gabemedia Account to activate your premium services</small>
     114                </div>';
     115        $html .= '</div>';
     116        echo $html;
     117    }
    78118}
  • ose-firewall/trunk/classes/Library/oem/547.php

    r1388930 r1581581  
    4343    }
    4444    public function addLogo () {
    45             return '<div class="logo"><img src="'.OSE_FWPUBLICURL.'css/oem/'.$this->customer_id.'/imgs/logo-header.png" alt ="Premium eSecurity"/></div>';
     45            return '<div class="logo"><img src="'.OSE_FWPUBLICURL.'/css/oem/'.$this->customer_id.'/imgs/logo-header.png" alt ="Premium eSecurity"/></div>';
    4646    }
    4747    public function defineVendorName () {
     
    6262        return '<li><a href="http://www.premium.bh/" title="Home">Quick links:&nbsp;&nbsp;&nbsp;<i class="glyphicon glyphicon-home"></i> <span class="hidden-xs hidden-sm hidden-md">'.OSE_WORDPRESS_FIREWALL_SHORT.'</span> </a></li>';
    6363    }
     64
     65    public function getCallToActionAndFooter()
     66    {
     67        return '<div class="row row-set" style="margin-top:14px;">
     68                                <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px;">
     69                                 <a href="http://www.premium.bh/" target="_blank"><div class="call-to-action">
     70                                    <div class="call-to-action-txt">
     71                                    <img width="35" height="35" alt="C_puma" src="'.OSE_FWPUBLICURL.'css/oem/'.$this->customer_id.'/imgs/logo-header.png"> &nbsp;
     72                                    Schedule your scanning and update with Premium eSecurity <sup>Now</sup></div>
     73                                </div></a>
     74                                </div>
     75                                <div class="col-sm-3">
     76                                <div id="bg-scan" class="vs-bg-dark col-sm-12" data-target="#bgModel" data-toggle="modal" style="display: none">
     77                                Background Scanning
     78                                </div>
     79                                </div>
     80                            </div>
     81           <div class="row">
     82              <div id="footer" class="col-sm-12">
     83              <p class="pull-center">
     84                Premium eSecurity is a portfolio of Premium eSecurity. &copy;  <?php echo date("Y"); ?> <a
     85                    href="http://www.premium.bh/" target="_blank">Premium eSecurity</a>. All Rights Reserved. <br /> Credits
     86                to: <a href="http://www.centrora.com" target="_blank">Centrora Security!&#0174;</a>
     87              </p>
     88            </div>
     89          </div>';
     90    }
     91
     92    public function showLoginHeader()
     93    {
     94        $html = '<div class="bs-callout bs-callout-info fade in">';
     95        $html .= '<span class="icon-separator">
     96
     97                </span>';
     98        $html .= '<div class="header-wrapper">
     99                    Premium eSecurity Member Login<small> You can login here with your Premium eSecurity Account to activate your premium services</small>
     100                </div>';
     101        $html .= '</div>';
     102        echo $html;
     103    }
    64104}
  • ose-firewall/trunk/classes/Library/oem/981.php

    r1388930 r1581581  
    6363        return '<li><a href="http://www.ellipticalinfinity.com/" title="Home">Quick links:&nbsp;&nbsp;&nbsp;<i class="glyphicon glyphicon-home"></i> <span class="hidden-xs hidden-sm hidden-md">'.OSE_WORDPRESS_FIREWALL_SHORT.'</span> </a></li>';
    6464    }
     65    public function getCallToActionAndFooter()
     66    {
     67        return '<div class="row row-set" style="margin-top:14px;">
     68                                <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px;">
     69                                 <a href="http://www.ellipticalinfinity.com/" target="_blank"><div class="call-to-action">
     70                                    <div class="call-to-action-txt">
     71                                    <img width="35" height="35" alt="C_puma" src="'.OSE_FWPUBLICURL.'css/oem/'.$this->customer_id.'/imgs/logo-header.png"> &nbsp;
     72                                    Schedule your scanning and update with Elliptical Infinity <sup>Now</sup></div>
     73                                </div></a>
     74                                </div>
     75                                <div class="col-sm-3">
     76                                <div id="bg-scan" class="vs-bg-dark col-sm-12" data-target="#bgModel" data-toggle="modal" style="display: none">
     77                                Background Scanning
     78                                </div>
     79                                </div>
     80                            </div>
     81           <div class="row">
     82              <div id="footer" class="col-sm-12">
     83              <p class="pull-center">
     84                Elliptical Infinity Security is a portfolio of Elliptical Infinity. &copy;  <?php echo date("Y"); ?> <a
     85                    href="http://www.ellipticalinfinity.com/" target="_blank">Elliptical Infinity</a>. All Rights Reserved. <br /> Credits
     86                to: <a href="http://www.centrora.com" target="_blank">Centrora Security!&#0174;</a>
     87              </p>
     88            </div>
     89          </div>';
     90    }
     91
     92    public function showLoginHeader()
     93    {
     94        $html = '<div class="bs-callout bs-callout-info fade in">';
     95        $html .= '<span class="icon-separator">
     96
     97                </span>';
     98        $html .= '<div class="header-wrapper">
     99                    Elliptical Infinity Member Login<small> You can login here with your Elliptical Infinity Account to activate your premium services</small>
     100                </div>';
     101        $html .= '</div>';
     102        echo $html;
     103    }
    65104}
  • ose-firewall/trunk/classes/Library/oem/999.php

    r1387925 r1581581  
    4343    }
    4444    public function addLogo () {
    45         return '<div class="logo"><img src="'.OSE_FWPUBLICURL.'css/oem/'.$this->customer_id.'/imgs/logo-header.png" width="90px" alt ="ME Security"/></div>'.$this->showOEMName ();
     45        return '<div class="logo"><img src="'.OSE_FWPUBLICURL.'/css/oem/'.$this->customer_id.'/imgs/logo-header.png" width="90px" alt ="ME Security"/></div>'.$this->showOEMName ();
    4646    }
    4747    public function defineVendorName () {
     
    5959        return true;
    6060    }
     61
     62    public function getCallToActionAndFooter()
     63    {
     64        return '<div class="row row-set" style="margin-top:14px;">
     65                                <div class="col-sm-12" style="padding-left: 0px; padding-right: 20px;">
     66                                 <a href="http://www.marketingentourage.com.au/" target="_blank"><div class="call-to-action">
     67                                    <div class="call-to-action-txt">
     68                                    <img width="35" height="35" alt="C_puma" src="'.OSE_FWPUBLICURL.'css/oem/'.$this->customer_id.'/imgs/5s.png"> &nbsp;
     69                                    Schedule your scanning and update with ME Security <sup>Now</sup></div>
     70                                </div></a>
     71                                </div>
     72                                <div class="col-sm-3">
     73                                <div id="bg-scan" class="vs-bg-dark col-sm-12" data-target="#bgModel" data-toggle="modal" style="display: none">
     74                                Background Scanning
     75                                </div>
     76                                </div>
     77                            </div>
     78           <div class="row">
     79              <div id="footer" class="col-sm-12">
     80              <p class="pull-center">
     81                ME Security is a portfolio of ME Security. &copy;  <?php echo date("Y"); ?> <a
     82                    href="http://www.marketingentourage.com.au/" target="_blank">ME Security</a>. All Rights Reserved. <br /> Credits
     83                to: <a href="http://www.centrora.com" target="_blank">Centrora Security!&#0174;</a>
     84              </p>
     85            </div>
     86          </div>';
     87    }
     88
     89    public function showLoginHeader()
     90    {
     91        $html = '<div class="bs-callout bs-callout-info fade in">';
     92        $html .= '<span class="icon-separator">
     93
     94                </span>';
     95        $html .= '<div class="header-wrapper">
     96                    ME Security Member Login<small> You can login here with yourME Security Account to activate your premium services</small>
     97                </div>';
     98        $html .= '</div>';
     99        echo $html;
     100    }
    61101}
  • ose-firewall/trunk/classes/Library/oem/oem.php

    r1442785 r1581581  
    112112        return $this->newInstance->addLogo();
    113113    }
     114    public function getCallToActionAndFooter () {
     115        return $this->newInstance->getCallToActionAndFooter();
     116    }
    114117    public function showOEMName () {
    115118        if (!empty($this->newInstance))
     
    164167        return $results;
    165168    }
    166     public function loadCSS () {
    167         $config = $this->getConfiguration('oem');
    168         if (!empty($config['data']['customer_id'])) {
    169             oseFirewall::loadCSSFile ('OEMCss', 'oem/'.$config['data']['customer_id'].'/custom.css', false);
    170         }
    171         else if (self::isOEMDataExists() )
    172         {
    173             $customer_id = self::getCustomerIDFromFile ();
    174             oseFirewall::loadCSSFile ('OEMCss', 'oem/'.$customer_id.'/custom.css', false);
    175         }
    176     }
     169    public function loadCSS () {
     170        $config = $this->getConfiguration('oem');
     171        if (!empty($config['data']['customer_id'])) {
     172            if(OSE_CMS == "joomla" && $config['data']['customer_id'] ==1480)
     173            {
     174                oseFirewall::loadCSSFile ('OEMCss', 'oem/'.$config['data']['customer_id'].'/customJoomla.css', false);
     175            }else {
     176                oseFirewall::loadCSSFile ('OEMCss', 'oem/'.$config['data']['customer_id'].'/custom.css', false);
     177            }
     178        }
     179        else if (self::isOEMDataExists() ) {
     180            $customer_id = self::getCustomerIDFromFile();
     181            if (OSE_CMS == "joomla" && $customer_id == 1480) {
     182                oseFirewall::loadCSSFile('OEMCss', 'oem/' . $customer_id . '/customJoomla.css', false);
     183            } else {
     184                oseFirewall::loadCSSFile('OEMCss', 'oem/' . $customer_id . '/custom.css', false);
     185            }
     186        }
     187    }
    177188
    178189    public function loadJS()
     
    249260        }
    250261    }
     262
     263    public function showLoginHeader () {
     264        return $this->newInstance->showLoginHeader();
     265    }
     266
     267    public function getOEMServicesName()
     268    {
     269
     270    }
    251271}
  • ose-firewall/trunk/classes/Library/oseFirewallBase.php

    r1487677 r1581581  
    10201020            return str_replace(array('"', "'", '<', '>'), "", $var);
    10211021    }
     1022    public static function prepareErrorMessage($message)
     1023    {
     1024        $result['status'] = 0;
     1025        $result['info'] = $message;
     1026        return $result;
     1027    }
     1028    public static function prepareSuccessMessage($message)
     1029    {
     1030        $result['status'] = 1;
     1031        $result['info'] = $message;
     1032        return $result;
     1033    }
     1034    public static function prepareCustomMessage($status,$message1,$message2)
     1035    {
     1036        $result['status'] = $status;
     1037        $result['info'] = $message1;
     1038        $result['info2'] = $message2;
     1039        return $result;
     1040    }
    10221041}
  • ose-firewall/trunk/classes/Library/oseFirewallJoomla.php

    r1409422 r1581581  
    375375        $serverversion = self::getServerVersion();
    376376        $isOutdated = (self::getVersionCompare($serverversion) > 0)?true:false;
    377         $head .='<div id ="versions" class="col-lg-6"> <div class ="'.(($isOutdated==true)?'version-outdated':'version-updated').'"><i class="glyphicon glyphicon-'.(($isOutdated==true)?'remove':'ok').'"></i>  '.self::getVersion ().'</div>';
     377        $head .='<div id ="versions"> <div class ="'.(($isOutdated==true)?'version-outdated':'version-updated').'"><i class="glyphicon glyphicon-'.(($isOutdated==true)?'remove':'ok').'"></i>  '.self::getVersion ().'</div>';
    378378        $urls = $oemShowNews? self::getDashboardURLs() : null;
    379379        oseFirewall::loadJSFile ('CentroraUpdateApp', 'VersionAutoUpdate.js', false);
  • ose-firewall/trunk/classes/Library/panel/panel.php

    r1496143 r1581581  
    348348
    349349    private function getUpdateCheck () {
    350         $url = "https://www.centrora.com/accountApi/version/getLastestVersion";
     350        $url = "https://www.centrora.com/accountApi/version/getLastestVersion?version=7";
    351351        $ch = curl_init();
    352352        curl_setopt($ch, CURLOPT_URL, $url);
     
    399399        // Get a database connector
    400400        $db = JFactory::getDbo();
     401        $zipFileName = "master.zip";
    401402        if (class_exists('SConfig') && !class_exists('JConfig')) {
    402             $zipFileName = "pkg_centrora_suite.zip";
    403         }
     403            $url = "https://github.com/Centrora/centrora-suite-update/archive/master.zip";
     404        }
    404405        else {
    405406            if (JOOMLA15 == true) {
    406                 $zipFileName = "com_centrora_j15.zip";
     407                $url = "https://github.com/Centrora/centrora-joomla15/archive/master.zip";
    407408            }
    408409            else {
    409                 $zipFileName = "pkg_centrora.zip";
     410                $url = "https://github.com/Centrora/centrora-joomla/archive/master.zip";
    410411            }
    411412        }
    412         $url = "https://www.centrora.com/software/".$zipFileName;
    413413        // Define Temp Folder;
    414414        $config     = JFactory::getConfig();
  • ose-firewall/trunk/classes/Library/vsscanner/fpscanner.php

    r1401965 r1581581  
    143143        foreach ($scanList['scanlist'] as $key => $path) {
    144144            if (is_dir($path)) {
    145                 if (intval(substr(sprintf('%o', fileperms($path)), -4)) > $baseFolderPerm) {
     145                if (intval(substr(sprintf('%o', fileperms($path)), -4)) != $baseFolderPerm) {
    146146                    $vsFileList [] = "<br/><div class='col-md-8'><i class='im im-folder-open text-primary'> </i>$path</div>"
    147147                        ."<div class='col-md-1'>".substr(sprintf('%o', fileperms($path)), -4)."</div>";
     
    149149                }
    150150            } elseif (is_file($path)) {
    151                 if (intval(substr(sprintf('%o', fileperms($path)), -4)) > $baseFilePerm) {
     151                if (intval(substr(sprintf('%o', fileperms($path)), -4)) != $baseFilePerm) {
    152152                    $vsFileList [] = "<div class='col-md-8'><i class='im im-file9 text-warning'> </i>$path</div>"
    153153                        ."<div class='col-md-1'>".substr(sprintf('%o', fileperms($path)), -4)."</div>";
  • ose-firewall/trunk/classes/Library/vsscanner/surfscanner.php

    r1496143 r1581581  
    2828}
    2929oseFirewall::callLibClass('vsscanner', 'vsscanner');
    30 
    3130class surfScanner
    3231{
     
    8281    {
    8382        $data = array();
    84         $url = 'https://www.centrora.com/accountApi/Maldetect/checkLastMD5Update';
     83        $url = API_SERVER.'Maldetect/checkLastMD5Update';
    8584        $serverresult = oseJSON::decode( $this->getJsonData($url), true );
    8685        $query = 'SELECT MAX(inserted_on) as inserted_on  FROM '. $this->db->quoteTable($this->vshashtable);
     
    102101    public function updateMD5DB()
    103102    {
    104         $url = 'https://www.centrora.com/accountApi/Maldetect/getUpdateMD5Data';
    105         $resultlist = oseJSON::decode( $this->getJsonData($url), true );
     103        $url = API_SERVER.'Maldetect/getUpdateMD5Data';
     104        $jsonData = $this->getJsonData($url);
     105        if(empty($jsonData))
     106        {
     107            //server returned null
     108            return oseFirewallBase::prepareErrorMessage("Server returned empty hash table \n".CONTACT_SUPPORT);
     109        }
     110        $resultlist = oseJSON::decode($jsonData, true);
    106111        $this->deleteMD5DBData();
    107         $this->insertMD5DBData($resultlist);
    108         return true;
     112        $insertResult = $this->insertMD5DBData($resultlist);
     113        if($insertResult)
     114        {
     115            $displayMessage = "MD5 Hash is up to date. Last Updated On : ".date('Y-m-d H:i:s');
     116            return oseFirewallBase::prepareCustomMessage(1,SURF_SCAN_SIG_UPDATED,$displayMessage);
     117        }else {
     118            return oseFirewallBase::prepareErrorMessage("There was some problem in updating the MD5 Hash database" . "\n".CONTACT_SUPPORT);
     119        }
     120
    109121    }
    110122
     
    293305        curl_setopt($ch, CURLOPT_URL, $url);
    294306        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    295         curl_setopt($ch, CURLOPT_TIMEOUT, 5);
     307        curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    296308        $json_data = curl_exec($ch);
    297309        curl_close($ch);
  • ose-firewall/trunk/classes/Library/vsscanner/vsscanner.php

    r1460069 r1581581  
    340340            $this->clearTable();
    341341            $this->cleanMalwareData ();
     342            $this->clearPathFiles();
     343            $this->clearPattern();
    342344            $_SESSION['completed'] = 0;
    343345            $_SESSION['start_time'] = time();
     
    361363        return $result;
    362364    }
     365
     366    protected function clearPathFiles()
     367    {
     368        $files = scandir(OSE_FWDATA . ODS . "vsscanPath" . ODS);
     369        if (count($files) > 3) {
     370            foreach ($files as $file) {
     371                if (substr($file,0,4)=="path") {
     372                    unlink(OSE_FWDATA . ODS . "vsscanPath" . ODS.$file);
     373                }
     374            }
     375        }
     376    }
     377
    363378    protected function scanFiles () {
    364379//      ini_set("display_errors", "off");
     
    595610        }
    596611        $i=0;
    597         while (!empty($this->vsInfo)) {
    598             $this->last_scanned = stripslashes(array_pop($this->vsInfo));
    599             if(oseFile::exists($this->last_scanned)==false) {
    600                 continue;
    601             }
    602             if (filesize($this->last_scanned)>2048000)
    603             {
    604                 continue;
    605             }
    606             else
    607             {
    608                 $this->scanFile($this->last_scanned, $pattern);
    609             }
    610             // In order to allow the scanner to continue without touching the same files again
    611             if ($remote == true && $i == 5) {
    612                 $i=0;
    613                 $this->createBatchFile ($process, $this->vsInfo) ;
    614             }
    615             $i++;
    616         }
     612        while (!empty($this->vsInfo)) {
     613            $needle = "com_ose_firewall/protected/data";
     614            $this->last_scanned = stripslashes(array_pop($this->vsInfo));
     615            if(strpos($this->last_scanned,$needle) == false) {
     616                if (oseFile::exists($this->last_scanned) == false) {
     617                    continue;
     618                }
     619                if (filesize($this->last_scanned) > 2048000) {
     620                    continue;
     621                } else {
     622                    $this->scanFile($this->last_scanned, $pattern);
     623                }
     624                // In order to allow the scanner to continue without touching the same files again
     625                if ($remote == true && $i == 5) {
     626                    $i = 0;
     627                    $this->createBatchFile($process, $this->vsInfo);
     628                }
     629                $i++;
     630            }
     631        }
    617632        return $this->returnCompleteMsg($this->last_scanned, $process, $size, $lastfileno, $remote);
    618 
    619633    }
    620634
  • ose-firewall/trunk/ose_firewall_badge.php

    r1563627 r1581581  
    44   Description: Plugin For Showing Centrora Security Badge
    55   Author: Centrora Security
    6    Version: 6.5.16
     6   Version: 6.6.0
    77*/ 
    88//include(dirname(__FILE__).'/includes/oseBadgeWidget.php');
  • ose-firewall/trunk/ose_wordpress_firewall.php

    r1563627 r1581581  
    55Description: Centrora Security (previously OSE Firewall) - A WordPress Security Firewall plugin created by Centrora. Protect your WordPress site by identify any malicious codes, spam, virus, SQL injection, and security vulnerabilities.
    66Author: Centrora (Previously ProWeb)
    7 Version: 6.5.16
     7Version: 6.6.0
    88Author URI: http://www.centrora.com/
    99*/
     
    2020                    width: 800px;'>Centrora requires PHP 5.3.0, please contact your hosting company to update your PHP version. It will take them 5 seconds to do so.</div>");
    2121}
    22 
    2322if (function_exists("ini_set")) {
    24     ini_set("display_errors", "off");
     23    ini_set("display_errors", "on");
    2524}
    2625// Basic configuration;
  • ose-firewall/trunk/public/css/dynamic.css

    r1417654 r1581581  
    1717
    1818#logo-labels {
    19     background: url(../images/logo4.png) no-repeat 20px 40px #2c88c5;
    2019    box-shadow: 0 4px 0 #18a689;
    2120    padding: 20px 10px;
     
    7473.logo-labels ul li a:active {
    7574    float: left;
    76     background: url(../gfx/label-icons.gif) no-repeat left top;
    7775    padding: 0 0 0 19px;
    7876    color: #FFFFFF;
     
    8381.logo-labels ul li.usermessage a, .logo-labels ul li.usermessage a:link,
    8482.logo-labels ul li.usermessage a:visited, .logo-labels ul li.usermessage a:active {
    85     background: url(../gfx/label-icons.gif) no-repeat left -22px;
    8683}
    8784
    8885.logo-labels ul li.logout a, .logo-labels ul li.logout a:link,
    8986.logo-labels ul li.logout a:visited, .logo-labels ul li.logout a:active {
    90     background: url(../gfx/label-icons.gif) no-repeat left -44px;
    9187}
    9288
    9389.logo-labels ul li span {
    9490    float: left;
    95     background: url(../gfx/label.gif) no-repeat right top;
    9691    padding: 0 8px 0 6px;
    9792    overflow: hidden;
     
    10196
    10297.logo-labels ul li:hover span {
    103     background: url(../gfx/label.gif) no-repeat right -22px;
    10498}
    10599
     
    126120.menu-search .search input {
    127121    float: left;
    128     background: url(../gfx/search-input.gif) no-repeat left top transparent;
    129122    border: 0;
    130123    outline: none;
     
    144137.menu-search .search button {
    145138    float: left;
    146     background: url(../gfx/search-button.gif) no-repeat left top transparent;
    147139    border: none;
    148140    outline: none;
     
    691683    /*more info refer to bootstrap css file line 5556*/
    692684}
    693 }
     685
    694686#logo-labels a {
    695687    text-decoration: none;
     
    722714
    723715/*.active img {*/
    724     /*margin-left: 14px;*/
    725     /*width: 45px;*/
     716/*margin-left: 14px;*/
     717/*width: 45px;*/
    726718/*}*/
    727719
     
    885877    /*content: "\2014";*/
    886878    position: absolute;
     879    cursor: pointer;
    887880}
    888881
     
    18271820
    18281821
    1829 
    1830 
    18311822#dashmenu {
    18321823    width: 200px;
  • ose-firewall/trunk/public/css/main.css

    r1436160 r1581581  
    50005000  color: #fff !important;
    50015001}
     5002
     5003.md5-icon-refresh:hover {
     5004  text-shadow: 1px 1px 1px #343434;
     5005  animation-name: spin;
     5006  animation-duration: 20s;
     5007  animation-iteration-count: infinite;
     5008  animation-timing-function: linear;
     5009}
     5010
     5011#scan-date{
     5012  clear:both;
     5013  background-color: #3c3c48;
     5014  color:white;
     5015  text-align: center;
     5016  font-size: 12px;
     5017  box-shadow: 1px 2px 1px -1px #333333;
     5018  position: relative;
     5019  z-index: 100;
     5020}
     5021
     5022#symlink{
     5023  display: none;
     5024}
     5025
     5026#mfiles-results {
     5027  color: #fff;
     5028}
     5029
     5030#folderPerm{
     5031  color: #000;
     5032}
     5033
     5034#filePerm{
     5035  color: #000;
     5036}
  • ose-firewall/trunk/public/js/fpscan.js

    r1387925 r1581581  
    4646                    $( this ).dialog( "close" );
    4747                    var val = '0' + document.fmode.u.value + document.fmode.g.value + document.fmode.w.value;
    48                     $ (inputfield).val(val);
     48                    $(inputfield).val(val);
    4949                },
    5050                Cancel: function() {
     
    122122                        moment(ko.unwrap(data.scanDate)).startOf('second').from(ko.unwrap(data.serverNow))
    123123                    ).attr("title", moment(ko.unwrap(data.scanDate)).format('llll'));
     124                    $('#scan-date').prepend('Last Scan: ');
    124125                }
    125126            }
  • ose-firewall/trunk/public/js/mfscan.js

    r1387925 r1581581  
    2020            showLoading(O_TERMINATE_SCAN);
    2121            location.reload();
     22        }
     23    });
     24
     25    $('#mod-scanner-ssl').click(function(){
     26        if($('#mod-scanner-ssl').hasClass('fa-square-o')){
     27            $('#mod-scanner-ssl').removeClass('fa-square-o');
     28            $('#mod-scanner-ssl').addClass('fa-check-square-o');
     29            $('#mod-scanner-ssl').css('margin-right','-7px');
     30            $('#symlink').prop('checked', true);
     31        }
     32        else{
     33            $('#mod-scanner-ssl').removeClass('fa-check-square-o');
     34            $('#mod-scanner-ssl').addClass('fa-square-o');
     35            $('#mod-scanner-ssl').css('margin-right','0px');
     36            $('#symlink').prop('checked', false);
    2237        }
    2338    });
     
    120135                        moment(ko.unwrap(data.scanDate)).startOf('second').from(ko.unwrap(data.serverNow))
    121136                    ).attr("title", moment(ko.unwrap(data.scanDate)).format('llll'));
     137                    $('#scan-date').prepend('Last Scan: ');
    122138                }
    123139            }
  • ose-firewall/trunk/public/js/surfscan.js

    r1387925 r1581581  
    9393                        moment(ko.unwrap(data.scanDate)).startOf('second').from(ko.unwrap(data.serverNow))
    9494                    ).attr("title", moment(ko.unwrap(data.scanDate)).format('llll'));
     95                    $('#scan-date').prepend('Last Scan: ');
    9596                }
    9697            }
     
    149150                        runupdateMD5Sig('updateMD5DB');
    150151                    } else {
     152                        hideLoading();
    151153                        showMD5Dialogue(data)
    152154                    }
     155                    }else if(action == 'updateMD5DB')
     156                    {
     157                        hideLoading();
     158                        if(data.status == 1)
     159                        {
     160                            $("#hashstatus").html(data.info2);
     161                            showDialogue(data.info,O_UPDATE_DIALOG_HEADING,O_CLOSE);
     162                        }else {
     163                            showDialogue(data.info,O_ERROR,O_CLOSE);
     164                        }
    153165                }
    154                 hideLoading();
    155166            }
    156167        });
     
    159170
    160171function showMD5Dialogue(data) {
     172
    161173    bootbox.dialog({
    162174        message: data.result,
  • ose-firewall/trunk/readme.txt

    r1563627 r1581581  
    55Tags: wordpress security, admin, anti-spam, comments, anti-hack, anti-virus, firewall, plugin, virus cleaning, google, phishing, malware, google drive, google drive backup, dropbox, dropbox backup, one drive, one drive backup, virus scanner, malware scanning, malware removal, backup, wordpress backup
    66Requires at least: 3.7
    7 Tested up to: 4.5.2
    8 Stable tag: 6.5.16
     7Tested up to: 4.7.1
     8Stable tag: 6.6.0
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    164164
    165165== Changelog ==
     166= 6.6.0 =
     167* Added new OEM
     168* Improved UI for all scanner sections
     169* Fixed Firewall Scanner bug when variable is an nested array
     170* Updated software update url to github url
     171* Fixed virus scanner bug for whitelisted files
     172* Plesk Panel support
     173* Update PHP Mailer to latest version
    166174
    167175= 6.5.16 =
  • ose-firewall/trunk/vendor/oseframework/emails/phpmailer/phpmailer.php

    r1387925 r1581581  
    2626if (!defined('OSE_FRAMEWORK') && !defined('OSE_ADMINPATH') && !defined('_JEXEC'))
    2727{
    28     die('Direct Access Not Allowed');
     28    die('Direct Access Not Allowed');
    2929}
    3030
     
    9898     * @var string
    9999     */
    100     public $Version = '5.2.14';
     100    public $Version = '5.2.22';
    101101
    102102    /**
     
    268268     * An ID to be used in the Message-ID header.
    269269     * If empty, a unique id will be generated.
     270     * You can set your own, but it must be in the format "<id@domain>",
     271     * as defined in RFC5322 section 3.6.4 or it will be ignored.
     272     * @see https://tools.ietf.org/html/rfc5322#section-3.6.4
    270273     * @var string
    271274     */
     
    352355    /**
    353356     * SMTP auth type.
    354      * Options are LOGIN (default), PLAIN, NTLM, CRAM-MD5
     357     * Options are CRAM-MD5, LOGIN, PLAIN, NTLM, XOAUTH2, attempted in that order if not specified
    355358     * @var string
    356359     */
     
    419422     * Whether to split multiple to addresses into multiple messages
    420423     * or send them all in one message.
     424     * Only supported in `mail` and `sendmail` transports, not in SMTP.
    421425     * @var boolean
    422426     */
     
    461465    /**
    462466     * DKIM Identity.
    463      * Usually the email address used as the source of the email
     467     * Usually the email address used as the source of the email.
    464468     * @var string
    465469     */
     
    485489     */
    486490    public $DKIM_private = '';
     491
     492    /**
     493     * DKIM private key string.
     494     * If set, takes precedence over `$DKIM_private`.
     495     * @var string
     496     */
     497    public $DKIM_private_string = '';
    487498
    488499    /**
     
    514525
    515526    /**
     527     * Which validator to use by default when validating email addresses.
     528     * May be a callable to inject your own validator, but there are several built-in validators.
     529     * @see PHPMailer::validateAddress()
     530     * @var string|callable
     531     * @static
     532     */
     533    public static $validator = 'auto';
     534
     535    /**
    516536     * An instance of the SMTP sender class.
    517537     * @var SMTP
     
    701721     * @param boolean $exceptions Should we throw external exceptions?
    702722     */
    703     public function __construct($exceptions = false)
    704     {
    705         $this->exceptions = (boolean)$exceptions;
     723    public function __construct($exceptions = null)
     724    {
     725        if ($exceptions !== null) {
     726            $this->exceptions = (boolean)$exceptions;
     727        }
    706728    }
    707729
     
    712734    {
    713735        //Close any open SMTP connection nicely
    714         if ($this->Mailer == 'smtp') {
    715             $this->smtpClose();
    716         }
     736        $this->smtpClose();
    717737    }
    718738
     
    738758            $subject = $this->encodeHeader($this->secureHeader($subject));
    739759        }
    740         if (ini_get('safe_mode') || !($this->UseSendmailOptions)) {
     760
     761        //Can't use additional_parameters in safe_mode, calling mail() with null params breaks
     762        //@link http://php.net/manual/en/function.mail.php
     763        if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) {
    741764            $result = @mail($to, $subject, $body, $header);
    742765        } else {
     
    745768        return $result;
    746769    }
    747 
    748770    /**
    749771     * Output debugging info via user-defined method.
     
    771793                //Cleans up output a bit for a better looking, HTML-safe output
    772794                echo htmlentities(
    773                     preg_replace('/[\r\n]+/', '', $str),
    774                     ENT_QUOTES,
    775                     'UTF-8'
    776                 )
    777                 . "<br>\n";
     795                        preg_replace('/[\r\n]+/', '', $str),
     796                        ENT_QUOTES,
     797                        'UTF-8'
     798                    )
     799                    . "<br>\n";
    778800                break;
    779801            case 'echo':
    780802            default:
    781803                //Normalize line breaks
    782                 $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
     804                $str = preg_replace('/\r\n?/ms', "\n", $str);
    783805                echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
    784                     "\n",
    785                     "\n                   \t                  ",
    786                     trim($str)
    787                 ) . "\n";
     806                        "\n",
     807                        "\n                   \t                  ",
     808                        trim($str)
     809                    ) . "\n";
    788810        }
    789811    }
     
    10941116     * Check that a string looks like an email address.
    10951117     * @param string $address The email address to check
    1096      * @param string $patternselect A selector for the validation pattern to use :
     1118     * @param string|callable $patternselect A selector for the validation pattern to use :
    10971119     * * `auto` Pick best pattern automatically;
    10981120     * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14;
     
    11011123     * * `html5` Use the pattern given by the HTML5 spec for 'email' type form input elements.
    11021124     * * `noregex` Don't use a regex: super fast, really dumb.
     1125     * Alternatively you may pass in a callable to inject your own validator, for example:
     1126     * PHPMailer::validateAddress('[email protected]', function($address) {
     1127     *     return (strpos($address, '@') !== false);
     1128     * });
     1129     * You can also set the PHPMailer::$validator static to a callable, allowing built-in methods to use your validator.
    11031130     * @return boolean
    11041131     * @static
    11051132     * @access public
    11061133     */
    1107     public static function validateAddress($address, $patternselect = 'auto')
    1108     {
     1134    public static function validateAddress($address, $patternselect = null)
     1135    {
     1136        if (is_null($patternselect)) {
     1137            $patternselect = self::$validator;
     1138        }
     1139        if (is_callable($patternselect)) {
     1140            return call_user_func($patternselect, $address);
     1141        }
    11091142        //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321
    11101143        if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) {
     
    12231256                $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet);
    12241257                if (($punycode = defined('INTL_IDNA_VARIANT_UTS46') ?
    1225                     idn_to_ascii($domain) :
    1226                     idn_to_ascii($domain)) !== false) {
     1258                        idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) :
     1259                        idn_to_ascii($domain)) !== false) {
    12271260                    return substr($address, 0, $pos) . $punycode;
    12281261                }
     
    13281361            // Sign with DKIM if enabled
    13291362            if (!empty($this->DKIM_domain)
    1330                 && !empty($this->DKIM_private)
    13311363                && !empty($this->DKIM_selector)
    1332                 && file_exists($this->DKIM_private)) {
     1364                && (!empty($this->DKIM_private_string)
     1365                    || (!empty($this->DKIM_private) && file_exists($this->DKIM_private))
     1366                )
     1367            ) {
    13331368                $header_dkim = $this->DKIM_Add(
    13341369                    $this->MIMEHeader . $this->mailHeader,
     
    13961431    protected function sendmailSend($header, $body)
    13971432    {
    1398         if ($this->Sender != '') {
     1433        // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
     1434        if (!empty($this->Sender) and self::isShellSafe($this->Sender)) {
    13991435            if ($this->Mailer == 'qmail') {
    1400                 $sendmail = sprintf('%s -f%s', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
     1436                $sendmailFmt = '%s -f%s';
    14011437            } else {
    1402                 $sendmail = sprintf('%s -oi -f%s -t', escapeshellcmd($this->Sendmail), escapeshellarg($this->Sender));
     1438                $sendmailFmt = '%s -oi -f%s -t';
    14031439            }
    14041440        } else {
    14051441            if ($this->Mailer == 'qmail') {
    1406                 $sendmail = sprintf('%s', escapeshellcmd($this->Sendmail));
     1442                $sendmailFmt = '%s';
    14071443            } else {
    1408                 $sendmail = sprintf('%s -oi -t', escapeshellcmd($this->Sendmail));
    1409             }
    1410         }
     1444                $sendmailFmt = '%s -oi -t';
     1445            }
     1446        }
     1447
     1448        // TODO: If possible, this should be changed to escapeshellarg.  Needs thorough testing.
     1449        $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender);
     1450
    14111451        if ($this->SingleTo) {
    14121452            foreach ($this->SingleToArray as $toAddr) {
     
    14551495
    14561496    /**
     1497     * Fix CVE-2016-10033 and CVE-2016-10045 by disallowing potentially unsafe shell characters.
     1498     *
     1499     * Note that escapeshellarg and escapeshellcmd are inadequate for our purposes, especially on Windows.
     1500     * @param string $string The string to be validated
     1501     * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report
     1502     * @access protected
     1503     * @return boolean
     1504     */
     1505    protected static function isShellSafe($string)
     1506    {
     1507        // Future-proof
     1508        if (escapeshellcmd($string) !== $string
     1509            or !in_array(escapeshellarg($string), array("'$string'", "\"$string\""))
     1510        ) {
     1511            return false;
     1512        }
     1513
     1514        $length = strlen($string);
     1515
     1516        for ($i = 0; $i < $length; $i++) {
     1517            $c = $string[$i];
     1518
     1519            // All other characters have a special meaning in at least one common shell, including = and +.
     1520            // Full stop (.) has a special meaning in cmd.exe, but its impact should be negligible here.
     1521            // Note that this does permit non-Latin alphanumeric characters based on the current locale.
     1522            if (!ctype_alnum($c) && strpos('@_-.', $c) === false) {
     1523                return false;
     1524            }
     1525        }
     1526
     1527        return true;
     1528    }
     1529
     1530    /**
    14571531     * Send mail using the PHP mail() function.
    14581532     * @param string $header The message headers
     
    14711545        $to = implode(', ', $toArr);
    14721546
    1473         if (empty($this->Sender)) {
    1474             $params = ' ';
    1475         } else {
    1476             $params = sprintf('-f%s', $this->Sender);
    1477         }
    1478         if ($this->Sender != '' and !ini_get('safe_mode')) {
     1547        $params = null;
     1548        //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver
     1549        if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
     1550            // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped.
     1551            if (self::isShellSafe($this->Sender)) {
     1552                $params = sprintf('-f%s', $this->Sender);
     1553            }
     1554        }
     1555        if (!empty($this->Sender) and !ini_get('safe_mode') and $this->validateAddress($this->Sender)) {
    14791556            $old_from = ini_get('sendmail_from');
    14801557            ini_set('sendmail_from', $this->Sender);
    14811558        }
    14821559        $result = false;
    1483         if ($this->SingleTo && count($toArr) > 1) {
     1560        if ($this->SingleTo and count($toArr) > 1) {
    14841561            foreach ($toArr as $toAddr) {
    14851562                $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params);
     
    15301607            throw new cPHPMailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL);
    15311608        }
    1532         if ('' == $this->Sender) {
     1609        if (!empty($this->Sender) and $this->validateAddress($this->Sender)) {
     1610            $smtp_from = $this->Sender;
     1611        } else {
    15331612            $smtp_from = $this->From;
    1534         } else {
    1535             $smtp_from = $this->Sender;
    15361613        }
    15371614        if (!$this->smtp->mail($smtp_from)) {
     
    15871664     * @return boolean
    15881665     */
    1589     public function smtpConnect($options = array())
     1666    public function smtpConnect($options = null)
    15901667    {
    15911668        if (is_null($this->smtp)) {
    15921669            $this->smtp = $this->getSMTPInstance();
     1670        }
     1671
     1672        //If no options are provided, use whatever is set in the instance
     1673        if (is_null($options)) {
     1674            $options = $this->SMTPOptions;
    15931675        }
    15941676
     
    16621744                            throw new cPHPMailerException($this->lang('connect_host'));
    16631745                        }
    1664                         // We must resend HELO after tls negotiation
     1746                        // We must resend EHLO after TLS negotiation
    16651747                        $this->smtp->hello($hello);
    16661748                    }
     
    17011783    public function smtpClose()
    17021784    {
    1703         if ($this->smtp !== null) {
     1785        if (is_a($this->smtp, 'SMTP')) {
    17041786            if ($this->smtp->connected()) {
    17051787                $this->smtp->quit();
     
    17201802    public function setLanguage($langcode = 'en', $lang_path = '')
    17211803    {
     1804        // Backwards compatibility for renamed language codes
     1805        $renamed_langcodes = array(
     1806            'br' => 'pt_br',
     1807            'cz' => 'cs',
     1808            'dk' => 'da',
     1809            'no' => 'nb',
     1810            'se' => 'sv',
     1811        );
     1812
     1813        if (isset($renamed_langcodes[$langcode])) {
     1814            $langcode = $renamed_langcodes[$langcode];
     1815        }
     1816
    17221817        // Define full set of translatable strings in English
    17231818        $PHPMAILER_LANG = array(
     
    17451840            // Calculate an absolute path so it can work if CWD is not here
    17461841            $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR;
     1842        }
     1843        //Validate $langcode
     1844        if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) {
     1845            $langcode = 'en';
    17471846        }
    17481847        $foundlang = true;
     
    20392138        }
    20402139
     2140        // Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4
     2141        // https://tools.ietf.org/html/rfc5322#section-3.6.4
    20412142        if ('' != $this->MessageID and preg_match('/^<.*@.*>$/', $this->MessageID)) {
    20422143            $this->lastMessageID = $this->MessageID;
     
    21452246
    21462247    /**
     2248     * Create unique ID
     2249     * @return string
     2250     */
     2251    protected function generateId() {
     2252        return md5(uniqid(time()));
     2253    }
     2254
     2255    /**
    21472256     * Assemble the message body.
    21482257     * Returns an empty string on failure.
     
    21552264        $body = '';
    21562265        //Create unique IDs and preset boundaries
    2157         $this->uniqueid = md5(uniqid(time()));
     2266        $this->uniqueid = $this->generateId();
    21582267        $this->boundary[1] = 'b1_' . $this->uniqueid;
    21592268        $this->boundary[2] = 'b2_' . $this->uniqueid;
     
    21712280        if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) {
    21722281            $bodyEncoding = '7bit';
     2282            //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
    21732283            $bodyCharSet = 'us-ascii';
    21742284        }
    21752285        //If lines are too long, and we're not already using an encoding that will shorten them,
    2176         //change to quoted-printable transfer encoding
     2286        //change to quoted-printable transfer encoding for the body part only
    21772287        if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) {
    2178             $this->Encoding = 'quoted-printable';
    21792288            $bodyEncoding = 'quoted-printable';
    21802289        }
     
    21852294        if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) {
    21862295            $altBodyEncoding = '7bit';
     2296            //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit
    21872297            $altBodyCharSet = 'us-ascii';
    21882298        }
    21892299        //If lines are too long, and we're not already using an encoding that will shorten them,
    2190         //change to quoted-printable transfer encoding
     2300        //change to quoted-printable transfer encoding for the alt body part only
    21912301        if ('base64' != $altBodyEncoding and self::hasLineLongerThanMax($this->AltBody)) {
    21922302            $altBodyEncoding = 'quoted-printable';
     
    22922402                break;
    22932403            default:
    2294                 // catch case 'plain' and case ''
    2295                 $body .= $this->encodeString($this->Body, $bodyEncoding);
     2404                // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types
     2405                //Reset the `Encoding` property in case we changed it for line length reasons
     2406                $this->Encoding = $bodyEncoding;
     2407                $body .= $this->encodeString($this->Body, $this->Encoding);
    22962408                break;
    22972409        }
     
    23992511    /**
    24002512     * Set the message type.
    2401      * cPHPMailer only supports some preset message types,
    2402      * not arbitrary MIME structures.
     2513     * cPHPMailer only supports some preset message types, not arbitrary MIME structures.
    24032514     * @access protected
    24042515     * @return void
     
    24182529        $this->message_type = implode('_', $type);
    24192530        if ($this->message_type == '') {
     2531            //The 'plain' message_type refers to the message having a single body element, not that it is plain-text
    24202532            $this->message_type = 'plain';
    24212533        }
     
    24472559    /**
    24482560     * Add an attachment from a path on the filesystem.
     2561     * Never use a user-supplied path to a file!
    24492562     * Returns false if the file could not be found or read.
    24502563     * @param string $path Path to the attachment.
     
    27332846            case 'comment':
    27342847                $matchcount = preg_match_all('/[()"]/', $str, $matches);
    2735                 // Intentional fall-through
     2848            // Intentional fall-through
    27362849            case 'text':
    27372850            default:
     
    29043017                // RFC 2047 section 5.2
    29053018                $pattern = '\(\)"';
    2906                 // intentional fall-through
    2907                 // for this reason we build the $pattern without including delimiters and []
     3019            // intentional fall-through
     3020            // for this reason we build the $pattern without including delimiters and []
    29083021            case 'text':
    29093022            default:
     
    29723085     * This is used in HTML messages that embed the images
    29733086     * the HTML refers to using the $cid value.
     3087     * Never use a user-supplied path to a file!
    29743088     * @param string $path Path to the attachment.
    29753089     * @param string $cid Content ID of the attachment; Use this to reference
     
    32843398        return ($this->error_count > 0);
    32853399    }
    3286    
    3287     public function useSMTP ($smtpauth, $smtphost, $smtpuser, $smtppass, $smtpsecure, $smtpport) {
    3288         $this->Host          = $smtphost;
    3289         $this->Port          = $smtpport;
    3290         $this->SMTPSecure    = $smtpsecure;
    3291         $this->SMTPAuth      = $smtpauth;
    3292         $this->Username      = $smtpuser;
    3293         $this->Password      = $smtppass;
    3294         $this->IsSMTP() ;
    3295     }
    32963400
    32973401    /**
     
    33423446
    33433447    /**
    3344      * Create a message from an HTML string.
    3345      * Automatically makes modifications for inline images and backgrounds
    3346      * and creates a plain-text version by converting the HTML.
    3347      * Overwrites any existing values in $this->Body and $this->AltBody
     3448     * Create a message body from an HTML string.
     3449     * Automatically inlines images and creates a plain-text version by converting the HTML,
     3450     * overwriting any existing values in Body and AltBody.
     3451     * Do not source $message content from user input!
     3452     * $basedir is prepended when handling relative URLs, e.g. <img src="/images/a.png"> and must not be empty
     3453     * will look for an image file in $basedir/images/a.png and convert it to inline.
     3454     * If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email)
     3455     * If you don't want to apply these transformations to your HTML, just set Body and AltBody directly.
    33483456     * @access public
    33493457     * @param string $message HTML message string
    3350      * @param string $basedir baseline directory for path
     3458     * @param string $basedir Absolute path to a base directory to prepend to relative paths to images
    33513459     * @param boolean|callable $advanced Whether to use the internal HTML to text converter
    33523460     *    or your own custom converter @see cPHPMailer::html2text()
    3353      * @return string $message
     3461     * @return string $message The transformed message Body
    33543462     */
    33553463    public function msgHTML($message, $basedir = '', $advanced = false)
     
    33573465        preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images);
    33583466        if (array_key_exists(2, $images)) {
     3467            if (strlen($basedir) > 1 && substr($basedir, -1) != '/') {
     3468                // Ensure $basedir has a trailing /
     3469                $basedir .= '/';
     3470            }
    33593471            foreach ($images[2] as $imgindex => $url) {
    33603472                // Convert data URIs into embedded images
     
    33663478                        $data = rawurldecode($data);
    33673479                    }
    3368                     $cid = md5($url) . '@cPHPMailer.0'; // RFC2392 S 2
     3480                    $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
    33693481                    if ($this->addStringEmbeddedImage($data, $cid, 'embed' . $imgindex, 'base64', $match[1])) {
    33703482                        $message = str_replace(
     
    33743486                        );
    33753487                    }
    3376                 } elseif (substr($url, 0, 4) !== 'cid:' && !preg_match('#^[A-z]+://#', $url)) {
    3377                     // Do not change urls for absolute images (thanks to corvuscorax)
     3488                    continue;
     3489                }
     3490                if (
     3491                    // Only process relative URLs if a basedir is provided (i.e. no absolute local paths)
     3492                    !empty($basedir)
     3493                    // Ignore URLs containing parent dir traversal (..)
     3494                    && (strpos($url, '..') === false)
    33783495                    // Do not change urls that are already inline images
     3496                    && substr($url, 0, 4) !== 'cid:'
     3497                    // Do not change absolute URLs, including anonymous protocol
     3498                    && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url)
     3499                ) {
    33793500                    $filename = basename($url);
    33803501                    $directory = dirname($url);
     
    33823503                        $directory = '';
    33833504                    }
    3384                     $cid = md5($url) . '@cPHPMailer.0'; // RFC2392 S 2
    3385                     if (strlen($basedir) > 1 && substr($basedir, -1) != '/') {
    3386                         $basedir .= '/';
    3387                     }
     3505                    $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2
    33883506                    if (strlen($directory) > 1 && substr($directory, -1) != '/') {
    33893507                        $directory .= '/';
     
    34213539     * This is used by msgHTML().
    34223540     * Note - older versions of this function used a bundled advanced converter
    3423      * which was been removed for license reasons in #232
     3541     * which was been removed for license reasons in #232.
    34243542     * Example usage:
    34253543     * <code>
     
    37203838     * @access public
    37213839     * @param string $signHeader
    3722      * @throws cPHPMailerException
    3723      * @return string
     3840     * @throws cphpmailerException
     3841     * @return string The DKIM signature value
    37243842     */
    37253843    public function DKIM_Sign($signHeader)
     
    37313849            return '';
    37323850        }
    3733         $privKeyStr = file_get_contents($this->DKIM_private);
    3734         if ($this->DKIM_passphrase != '') {
     3851        $privKeyStr = !empty($this->DKIM_private_string) ? $this->DKIM_private_string : file_get_contents($this->DKIM_private);
     3852        if ('' != $this->DKIM_passphrase) {
    37353853            $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase);
    37363854        } else {
    3737             $privKey = $privKeyStr;
    3738         }
    3739         if (openssl_sign($signHeader, $signature, $privKey)) {
    3740             return base64_encode($signature);
    3741         }
     3855            $privKey = openssl_pkey_get_private($privKeyStr);
     3856        }
     3857        //Workaround for missing digest algorithms in old PHP & OpenSSL versions
     3858        //@link http://stackoverflow.com/a/11117338/333340
     3859        if (version_compare(PHP_VERSION, '5.3.0') >= 0 and
     3860            in_array('sha256WithRSAEncryption', openssl_get_md_methods(true))) {
     3861            if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) {
     3862                openssl_pkey_free($privKey);
     3863                return base64_encode($signature);
     3864            }
     3865        } else {
     3866            $pinfo = openssl_pkey_get_details($privKey);
     3867            $hash = hash('sha256', $signHeader);
     3868            //'Magic' constant for SHA256 from RFC3447
     3869            //@link https://tools.ietf.org/html/rfc3447#page-43
     3870            $t = '3031300d060960864801650304020105000420' . $hash;
     3871            $pslen = $pinfo['bits'] / 8 - (strlen($t) / 2 + 3);
     3872            $eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t);
     3873
     3874            if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) {
     3875                openssl_pkey_free($privKey);
     3876                return base64_encode($signature);
     3877            }
     3878        }
     3879        openssl_pkey_free($privKey);
    37423880        return '';
    37433881    }
     
    37563894            list($heading, $value) = explode(':', $line, 2);
    37573895            $heading = strtolower($heading);
    3758             $value = preg_replace('/\s+/', ' ', $value); // Compress useless spaces
     3896            $value = preg_replace('/\s{2,}/', ' ', $value); // Compress useless spaces
    37593897            $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value
    37603898        }
     
    37943932    public function DKIM_Add($headers_line, $subject, $body)
    37953933    {
    3796         $DKIMsignatureType = 'rsa-sha1'; // Signature & hash algorithms
     3934        $DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms
    37973935        $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body
    37983936        $DKIMquery = 'dns/txt'; // Query method
     
    38023940        $from_header = '';
    38033941        $to_header = '';
     3942        $date_header = '';
    38043943        $current = '';
    38053944        foreach ($headers as $header) {
     
    38103949                $to_header = $header;
    38113950                $current = 'to_header';
     3951            } elseif (strpos($header, 'Date:') === 0) {
     3952                $date_header = $header;
     3953                $current = 'date_header';
    38123954            } else {
    38133955                if (!empty($$current) && strpos($header, ' =?') === 0) {
     
    38203962        $from = str_replace('|', '=7C', $this->DKIM_QP($from_header));
    38213963        $to = str_replace('|', '=7C', $this->DKIM_QP($to_header));
     3964        $date = str_replace('|', '=7C', $this->DKIM_QP($date_header));
    38223965        $subject = str_replace(
    38233966            '|',
     
    38273970        $body = $this->DKIM_BodyC($body);
    38283971        $DKIMlen = strlen($body); // Length of body
    3829         $DKIMb64 = base64_encode(pack('H*', sha1($body))); // Base64 of packed binary SHA-1 hash of body
     3972        $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body
    38303973        if ('' == $this->DKIM_identity) {
    38313974            $ident = '';
     
    38403983            ";\r\n" .
    38413984            "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" .
    3842             "\th=From:To:Subject;\r\n" .
     3985            "\th=From:To:Date:Subject;\r\n" .
    38433986            "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" .
    38443987            "\tz=$from\r\n" .
    38453988            "\t|$to\r\n" .
     3989            "\t|$date\r\n" .
    38463990            "\t|$subject;\r\n" .
    38473991            "\tbh=" . $DKIMb64 . ";\r\n" .
     
    38503994            $from_header . "\r\n" .
    38513995            $to_header . "\r\n" .
     3996            $date_header . "\r\n" .
    38523997            $subject_header . "\r\n" .
    38533998            $dkimhdrs
  • ose-firewall/trunk/vendor/oseframework/emails/phpmailer/pop3.php

    r1387925 r1581581  
    6464     * @access public
    6565     */
    66     public $Version = '5.2.14';
     66    public $Version = '5.2.22';
    6767
    6868    /**
  • ose-firewall/trunk/vendor/oseframework/emails/phpmailer/smtp.php

    r1387925 r1581581  
    6060     * @var string
    6161     */
    62     const VERSION = '5.2.14';
     62    const VERSION = '5.2.22';
    6363
    6464    /**
     
    111111     * @see SMTP::VERSION
    112112     */
    113     public $Version = '5.2.14';
     113    public $Version = '5.2.22';
    114114
    115115    /**
     
    181181
    182182    /**
     183     * @var array patterns to extract smtp transaction id from smtp reply
     184     * Only first capture group will be use, use non-capturing group to deal with it
     185     * Extend this class to override this property to fulfil your needs.
     186     */
     187    protected $smtp_transaction_id_patterns = array(
     188        'exim' => '/[0-9]{3} OK id=(.*)/',
     189        'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/',
     190        'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/'
     191    );
     192
     193    /**
    183194     * The socket for the server connection.
    184195     * @var resource
     
    236247        //Avoid clash with built-in function names
    237248        if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) {
    238             call_user_func($this->Debugoutput, $str, $this->do_debug);
     249            call_user_func($this->Debugoutput, $str, $level);
    239250            return;
    240251        }
     
    247258                //Cleans up output a bit for a better looking, HTML-safe output
    248259                echo htmlentities(
    249                     preg_replace('/[\r\n]+/', '', $str),
    250                     ENT_QUOTES,
    251                     'UTF-8'
    252                 )
    253                 . "<br>\n";
     260                        preg_replace('/[\r\n]+/', '', $str),
     261                        ENT_QUOTES,
     262                        'UTF-8'
     263                    )
     264                    . "<br>\n";
    254265                break;
    255266            case 'echo':
     
    258269                $str = preg_replace('/(\r\n|\r|\n)/ms', "\n", $str);
    259270                echo gmdate('Y-m-d H:i:s') . "\t" . str_replace(
    260                     "\n",
    261                     "\n                   \t                  ",
    262                     trim($str)
    263                 )."\n";
     271                        "\n",
     272                        "\n                   \t                  ",
     273                        trim($str)
     274                    )."\n";
    264275        }
    265276    }
     
    302313        if ($streamok) {
    303314            $socket_context = stream_context_create($options);
    304             //Suppress errors; connection failures are handled at a higher level
    305             $this->smtp_conn = @stream_socket_client(
     315            set_error_handler(array($this, 'errorHandler'));
     316            $this->smtp_conn = stream_socket_client(
    306317                $host . ":" . $port,
    307318                $errno,
     
    311322                $socket_context
    312323            );
     324            restore_error_handler();
    313325        } else {
    314326            //Fall back to fsockopen which should work in more places, but is missing some features
     
    317329                self::DEBUG_CONNECTION
    318330            );
     331            set_error_handler(array($this, 'errorHandler'));
    319332            $this->smtp_conn = fsockopen(
    320333                $host,
     
    324337                $timeout
    325338            );
     339            restore_error_handler();
    326340        }
    327341        // Verify we connected properly
     
    366380            return false;
    367381        }
     382
     383        //Allow the best TLS version(s) we can
     384        $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT;
     385
     386        //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT
     387        //so add them back in manually if we can
     388        if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) {
     389            $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT;
     390            $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT;
     391        }
     392
    368393        // Begin encrypted connection
    369394        if (!stream_socket_enable_crypto(
    370395            $this->smtp_conn,
    371396            true,
    372             STREAM_CRYPTO_METHOD_TLS_CLIENT
     397            $crypto_method
    373398        )) {
    374399            return false;
     
    403428
    404429        if (array_key_exists('EHLO', $this->server_caps)) {
    405         // SMTP extensions are available. Let's try to find a proper authentication method
     430            // SMTP extensions are available. Let's try to find a proper authentication method
    406431
    407432            if (!array_key_exists('AUTH', $this->server_caps)) {
     
    419444
    420445            if (empty($authtype)) {
    421                 foreach (array('LOGIN', 'CRAM-MD5', 'NTLM', 'PLAIN', 'XOAUTH2') as $method) {
     446                foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN', 'NTLM', 'XOAUTH2') as $method) {
    422447                    if (in_array($method, $this->server_caps['AUTH'])) {
    423448                        $authtype = $method;
     
    493518                $ntlm_client = new ntlm_sasl_client_class;
    494519                //Check that functions are available
    495                 if (!$ntlm_client->Initialize($temp)) {
     520                if (!$ntlm_client->initialize($temp)) {
    496521                    $this->setError($temp->error);
    497522                    $this->edebug(
     
    503528                }
    504529                //msg1
    505                 $msg1 = $ntlm_client->TypeMsg1($realm, $workstation); //msg1
     530                $msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1
    506531
    507532                if (!$this->sendCommand(
     
    522547                );
    523548                //msg3
    524                 $msg3 = $ntlm_client->TypeMsg3(
     549                $msg3 = $ntlm_client->typeMsg3(
    525550                    $ntlm_res,
    526551                    $username,
     
    766791    {
    767792        $this->server_caps = array();
    768         $lines = explode("\n", $this->last_reply);
     793        $lines = explode("\n", $this->helo_rply);
    769794
    770795        foreach ($lines as $n => $s) {
     
    12081233        return $this->Timeout;
    12091234    }
     1235
     1236    /**
     1237     * Reports an error number and string.
     1238     * @param integer $errno The error number returned by PHP.
     1239     * @param string $errmsg The error message returned by PHP.
     1240     */
     1241    protected function errorHandler($errno, $errmsg)
     1242    {
     1243        $notice = 'Connection: Failed to connect to server.';
     1244        $this->setError(
     1245            $notice,
     1246            $errno,
     1247            $errmsg
     1248        );
     1249        $this->edebug(
     1250            $notice . ' Error number ' . $errno . '. "Error notice: ' . $errmsg,
     1251            self::DEBUG_CONNECTION
     1252        );
     1253    }
     1254
     1255    /**
     1256     * Will return the ID of the last smtp transaction based on a list of patterns provided
     1257     * in SMTP::$smtp_transaction_id_patterns.
     1258     * If no reply has been received yet, it will return null.
     1259     * If no pattern has been matched, it will return false.
     1260     * @return bool|null|string
     1261     */
     1262    public function getLastTransactionID()
     1263    {
     1264        $reply = $this->getLastReply();
     1265
     1266        if (empty($reply)) {
     1267            return null;
     1268        }
     1269
     1270        foreach($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) {
     1271            if(preg_match($smtp_transaction_id_pattern, $reply, $matches)) {
     1272                return $matches[1];
     1273            }
     1274        }
     1275
     1276        return false;
     1277    }
    12101278}
    1211 ?>
  • ose-firewall/trunk/vendor/oseframework/users/oseUsers.php

    r1417654 r1581581  
    2626if (!defined('OSE_FRAMEWORK') && !defined('OSE_ADMINPATH') && !defined('_JEXEC'))
    2727{
    28     die('Direct Access Not Allowed');
     28    die('Direct Access Not Allowed');
    2929}
    3030class oseUsers
    3131{
    32     private $cms = null;
    33     private $db = null;
    34     private static $cmsStatic = null;
    35     public function __construct($app)
    36     {
    37         $this->app = $app;
    38         $this->setCMS();
    39         $this->setDB();
    40     }
    41     private function setCMS()
    42     {
    43         if (defined('_JEXEC'))
    44         {
    45             $this->cms = 'joomla';
    46         }
    47         else
    48             if (defined('WPLANG') || defined('WPINC'))
    49             {
    50                 $this->cms = 'wordpress';
    51             }
    52     }
    53     private static function setCMSStatic()
    54     {
    55         if (defined('_JEXEC'))
    56         {
    57             self::$cmsStatic = 'joomla';
    58         }
    59         else
    60             if (defined('WPLANG') || defined('WPINC'))
    61             {
    62                 self::$cmsStatic = 'wordpress';
    63             }
    64     }
    65     private function setDB()
    66     {
    67         switch ($this->cms)
    68         {
    69             case 'joomla':
    70                 $this->db = oseJoomla::getDBO();
    71                 break;
    72             case 'wordpress':
    73                 $this->db = oseWordpress::getDBO();
    74                 break;
    75         }
    76     }
    77     public function getAdminUsers()
    78     {
    79         if ($this->cms == 'joomla')
    80         {
    81             $admins = $this->getJoomlaAdmin();
    82         }
    83         else
    84         {
    85             $admins = $this->getWordpressAdmin();
    86         }
    87         return $admins;
    88     }
    89     public function getAllUsers()
    90     {
    91         if ($this->cms == 'joomla')
    92         {
    93             $admins = $this->getJoomlaUsers();
    94         }
    95         else
    96         {
    97             $admins = $this->getWordpressUsers();
    98         }
    99         return $admins;
    100     }
    101     private function getJoomlaAdmin()
    102     {
    103         $groupids = $this->getJoomlaAdminGroups();
    104         $where = array();
    105         $where[] = ' `group_id` IN ('.implode(',', $groupids).') ';
    106         $where = $this->db->implodeWhere($where);
    107         $query = 'SELECT `id`, `name` FROM `#__users` AS user LEFT JOIN `#__user_usergroup_map` as map ON user.id = map.user_id '.$where;
    108         $this->db->setQuery($query);
    109         return $this->db->loadObjectList();
    110     }
    111     private function getWordpressAdmin()
    112     {
    113         $adminids = $this->get_super_admins();
    114         $return = array();
    115         for ($i = 0; $i < COUNT($adminids); $i++)
    116         {
    117             $user = get_user_by('id', $adminids[$i]);
    118             $return[$i]['id'] = $user->ID;
    119             $return[$i]['name'] = $user->display_name;
    120         }
    121         return $return;
    122     }
    123     public function get_super_admins()
    124     {
    125         $query = "SELECT * FROM `#__usermeta` where `meta_value` LIKE '%administrator%'";
    126         $this->db->setQuery($query);
    127         $objList = $this->db->loadObjectList();
    128         $return = array();
    129         foreach ($objList as $obj)
    130         {
    131             if (preg_match("/[wp|\w+]\_*capabilities/", $obj->meta_key))
    132             {
    133                 $return[] = $obj->user_id;
    134             }
    135         }
    136         return $return;
    137     }
    138     private function getWordpressUsers()
    139     {
    140         $where = '';
    141         oseFramework::loadRequest();
    142         $query = oRequest::getVar('query', null);
    143         if (!empty($query))
    144         {
    145             $where = ' WHERE `user_nicename` LIKE "%'.$this->db->quoteValue($query).'%"';
    146         }
    147         $query = "SELECT `ID`, `user_nicename` as `name` FROM `#__users` ".$where;
    148         $this->db->setQuery($query);
    149         return $this->db->loadObjectList();
    150     }
    151     public function getJoomlaAdminGroups()
    152     {
    153         $groups = $this->getJoomlaUserGroupsDB();
    154         $admin_groups = array();
    155         foreach ($groups as $group_id)
    156         {
    157             if (JAccess::checkGroup($group_id, 'core.login.admin'))
    158             {
    159                 $admin_groups[] = $group_id;
    160             }
    161             elseif (JAccess::checkGroup($group_id, 'core.admin'))
    162             {
    163                 $admin_groups[] = $group_id;
    164             }
    165         }
    166         $admin_groups = array_unique($admin_groups);
    167         return $admin_groups;
    168     }
    169     private function getJoomlaUserGroupsDB()
    170     {
    171         $this->db->setQuery("SELECT `id` FROM `#__usergroups`");
    172         $groups = $this->db->loadObjectList();
    173         $return = array();
    174         foreach ($groups as $group)
    175         {
    176             $return[] = $group->id;
    177         }
    178         return $return;
    179     }
    180     public function getJoomlaUserGroups()
    181     {
    182         $user = JFactory::getUser();
    183         $user_groups = JAccess::getGroupsByUser($user->id);
    184         return $user_groups;
    185     }
    186     public function registerUser($userInfo)
    187     {
    188         return wp_insert_user($userInfo);
    189     }
    190     public static function isLoggedin()
    191     {
    192         if (class_exists('oseWordpress'))
    193         {
    194             return is_user_logged_in();
    195         }
    196         else
    197         {
    198             $user = JFactory::getUser();
    199             return ($user->guest == true) ? false : true;
    200         }
    201     }
    202     public static function getUserID()
    203     {
    204         self::setCMSStatic();
    205         if (self::$cmsStatic == 'joomla')
    206         {
    207             $user = JFactory::getUser();
    208             return $user->id;
    209         }
    210         else
    211         {
    212             $current_user = wp_get_current_user();
    213             return $current_user->ID;
    214         }
    215     }
    216     public function isAdmin()
    217     {
    218         self::setCMSStatic();
    219         if (self::$cmsStatic == 'joomla')
    220         {
    221             $current_user = JFactory::getUser();
    222             $adminids = $this->getJoomlaAdminGroups();
    223             $result = false;
    224             foreach ($current_user->groups as $group)
    225             {
    226                 if (in_array($group, $adminids))
    227                 {
    228                     $result = true;
    229                     break;
    230                 }
    231             }
    232             return $result;
    233         }
    234         else
    235         {
    236             if (!function_exists('wp_get_current_user')) {
    237                 $this->loadUserClass ();
    238             }
    239             $current_user = wp_get_current_user();
    240             $adminids = $this->get_super_admins ();
    241             return (in_array($current_user->ID, $adminids));
    242         }
    243     }
    244     protected function loadUserClass () {
    245         require_once(ABSPATH."wp-includes/pluggable.php");
    246         require_once(ABSPATH."wp-includes/functions.php");
    247     }
    248     public static function getUserLogin()
    249     {
    250         self::setCMSStatic();
    251         if (self::$cmsStatic == 'joomla')
    252         {
    253             $current_user = JFactory::getUser();
    254             return $current_user->username;
    255         }
    256         else
    257         {
    258             $current_user = wp_get_current_user();
    259             return $current_user->user_login;
    260         }
    261     }
    262     public static function getUserEmail()
    263     {
    264         self::setCMSStatic();
    265         if (self::$cmsStatic == 'joomla')
    266         {
    267             $current_user = JFactory::getUser();
    268             return $current_user->email;
    269         }
    270         else
    271         {
    272             $current_user = wp_get_current_user();
    273             return $current_user->user_email;
    274         }
    275     }
    276     public static function getUserInfo()
    277     {
    278         self::setCMSStatic();
    279         if (self::$cmsStatic == 'joomla')
    280         {
    281             $current_user = JFactory::getUser();
    282             $result['name']= $current_user->username;
    283             $result['email'] = $current_user->email;
    284             return $result;
    285         }
    286         else
    287         {
    288             if(!function_exists('wp_get_current_user')) {
    289                 include(ABSPATH . "wp-includes/pluggable.php");
    290             }
    291             $current_user = wp_get_current_user();
    292             $result['name']= $current_user->user_login;
    293             $result['email'] = $current_user->user_email;
    294             return $result;
    295         }
     32    private $cms = null;
     33    private $db = null;
     34    private static $cmsStatic = null;
     35    public function __construct($app)
     36    {
     37        $this->app = $app;
     38        $this->setCMS();
     39        $this->setDB();
     40    }
     41    private function setCMS()
     42    {
     43        if (defined('_JEXEC'))
     44        {
     45            $this->cms = 'joomla';
     46        }
     47        else
     48            if (defined('WPLANG') || defined('WPINC'))
     49            {
     50                $this->cms = 'wordpress';
     51            }
     52    }
     53    private static function setCMSStatic()
     54    {
     55        if (defined('_JEXEC'))
     56        {
     57            self::$cmsStatic = 'joomla';
     58        }
     59        else
     60            if (defined('WPLANG') || defined('WPINC'))
     61            {
     62                self::$cmsStatic = 'wordpress';
     63            }
     64    }
     65    private function setDB()
     66    {
     67        switch ($this->cms)
     68        {
     69            case 'joomla':
     70                $this->db = oseJoomla::getDBO();
     71                break;
     72            case 'wordpress':
     73                $this->db = oseWordpress::getDBO();
     74                break;
     75        }
     76    }
     77    public function getAdminUsers()
     78    {
     79        if ($this->cms == 'joomla')
     80        {
     81            $admins = $this->getJoomlaAdmin();
     82        }
     83        else
     84        {
     85            $admins = $this->getWordpressAdmin();
     86        }
     87        return $admins;
     88    }
     89    public function getAllUsers()
     90    {
     91        if ($this->cms == 'joomla')
     92        {
     93            $admins = $this->getJoomlaUsers();
     94        }
     95        else
     96        {
     97            $admins = $this->getWordpressUsers();
     98        }
     99        return $admins;
     100    }
     101    private function getJoomlaAdmin()
     102    {
     103        $groupids = $this->getJoomlaAdminGroups();
     104        $where = array();
     105        $where[] = ' `group_id` IN ('.implode(',', $groupids).') ';
     106        $where = $this->db->implodeWhere($where);
     107        $query = 'SELECT `id`, `name` FROM `#__users` AS user LEFT JOIN `#__user_usergroup_map` as map ON user.id = map.user_id '.$where;
     108        $this->db->setQuery($query);
     109        return $this->db->loadObjectList();
     110    }
     111    private function getWordpressAdmin()
     112    {
     113        $adminids = $this->get_super_admins();
     114        $return = array();
     115        for ($i = 0; $i < COUNT($adminids); $i++)
     116        {
     117            $user = get_user_by('id', $adminids[$i]);
     118            $return[$i]['id'] = $user->ID;
     119            $return[$i]['name'] = $user->display_name;
     120        }
     121        return $return;
     122    }
     123    public function get_super_admins()
     124    {
     125        $query = "SELECT * FROM `#__usermeta` where `meta_value` LIKE '%administrator%'";
     126        $this->db->setQuery($query);
     127        $objList = $this->db->loadObjectList();
     128        $return = array();
     129        foreach ($objList as $obj)
     130        {
     131            if (preg_match("/[wp|\w+]\_*capabilities/", $obj->meta_key))
     132            {
     133                $return[] = $obj->user_id;
     134            }
     135        }
     136        return $return;
     137    }
     138    private function getWordpressUsers()
     139    {
     140        $where = '';
     141        oseFramework::loadRequest();
     142        $query = oRequest::getVar('query', null);
     143        if (!empty($query))
     144        {
     145            $where = ' WHERE `user_nicename` LIKE "%'.$this->db->quoteValue($query).'%"';
     146        }
     147        $query = "SELECT `ID`, `user_nicename` as `name` FROM `#__users` ".$where;
     148        $this->db->setQuery($query);
     149        return $this->db->loadObjectList();
     150    }
     151    public function getJoomlaAdminGroups()
     152    {
     153        $groups = $this->getJoomlaUserGroupsDB();
     154        $admin_groups = array();
     155        foreach ($groups as $group_id)
     156        {
     157            if (JAccess::checkGroup($group_id, 'core.login.admin'))
     158            {
     159                $admin_groups[] = $group_id;
     160            }
     161            elseif (JAccess::checkGroup($group_id, 'core.admin'))
     162            {
     163                $admin_groups[] = $group_id;
     164            }
     165        }
     166        $admin_groups = array_unique($admin_groups);
     167        return $admin_groups;
     168    }
     169    private function getJoomlaUserGroupsDB()
     170    {
     171        $this->db->setQuery("SELECT `id` FROM `#__usergroups`");
     172        $groups = $this->db->loadObjectList();
     173        $return = array();
     174        foreach ($groups as $group)
     175        {
     176            $return[] = $group->id;
     177        }
     178        return $return;
     179    }
     180    public function getJoomlaUserGroups()
     181    {
     182        $user = JFactory::getUser();
     183        $user_groups = JAccess::getGroupsByUser($user->id);
     184        return $user_groups;
     185    }
     186    public function registerUser($userInfo)
     187    {
     188        return wp_insert_user($userInfo);
     189    }
     190    public static function isLoggedin()
     191    {
     192        if (class_exists('oseWordpress'))
     193        {
     194            return is_user_logged_in();
     195        }
     196        else
     197        {
     198            $user = JFactory::getUser();
     199            return ($user->guest == true) ? false : true;
     200        }
     201    }
     202    public static function getUserID()
     203    {
     204        self::setCMSStatic();
     205        if (self::$cmsStatic == 'joomla')
     206        {
     207            $user = JFactory::getUser();
     208            return $user->id;
     209        }
     210        else
     211        {
     212            $current_user = wp_get_current_user();
     213            return $current_user->ID;
     214        }
     215    }
     216    public function isAdmin()
     217    {
     218        self::setCMSStatic();
     219        if (self::$cmsStatic == 'joomla')
     220        {
     221            if (class_exists('pm_Session')) {
     222                // This is to add super admin access to Suite when root account logs in Plesk
     223                $result = pm_Session::getClient()->isAdmin();
     224            }
     225            else {
     226                $current_user = JFactory::getUser();
     227                $adminids = $this->getJoomlaAdminGroups();
     228                $result = false;
     229                foreach ($current_user->groups as $group)
     230                {
     231                    if (in_array($group, $adminids))
     232                    {
     233                        $result = true;
     234                        break;
     235                    }
     236                }
     237            }
     238            return $result;
     239        }
     240        else
     241        {
     242            if (!function_exists('wp_get_current_user')) {
     243                $this->loadUserClass ();
     244            }
     245            $current_user = wp_get_current_user();
     246            $adminids = $this->get_super_admins ();
     247            return (in_array($current_user->ID, $adminids));
     248        }
     249    }
     250    protected function loadUserClass () {
     251        require_once(ABSPATH."wp-includes/pluggable.php");
     252        require_once(ABSPATH."wp-includes/functions.php");
     253    }
     254    public static function getUserLogin()
     255    {
     256        self::setCMSStatic();
     257        if (self::$cmsStatic == 'joomla')
     258        {
     259            $current_user = JFactory::getUser();
     260            return $current_user->username;
     261        }
     262        else
     263        {
     264            $current_user = wp_get_current_user();
     265            return $current_user->user_login;
     266        }
     267    }
     268    public static function getUserEmail()
     269    {
     270        self::setCMSStatic();
     271        if (self::$cmsStatic == 'joomla')
     272        {
     273            $current_user = JFactory::getUser();
     274            return $current_user->email;
     275        }
     276        else
     277        {
     278            $current_user = wp_get_current_user();
     279            return $current_user->user_email;
     280        }
     281    }
     282    public static function getUserInfo()
     283    {
     284        self::setCMSStatic();
     285        if (self::$cmsStatic == 'joomla')
     286        {
     287            $current_user = JFactory::getUser();
     288            $result['name']= $current_user->username;
     289            $result['email'] = $current_user->email;
     290            return $result;
     291        }
     292        else
     293        {
     294            if(!function_exists('wp_get_current_user')) {
     295                include(ABSPATH . "wp-includes/pluggable.php");
     296            }
     297            $current_user = wp_get_current_user();
     298            $result['name']= $current_user->user_login;
     299            $result['email'] = $current_user->user_email;
     300            return $result;
     301        }
    296302
    297     }
     303    }
    298304}
Note: See TracChangeset for help on using the changeset viewer.