Plugin Directory

Changeset 1775810


Ignore:
Timestamp:
11/27/2017 04:01:02 AM (8 years ago)
Author:
osexcel
Message:

7.1.1 Added pagination for the gitbackup page, Minor bug fixes for Git backup, Minor bug fix for the core directory scanner, Bug fixes for the virus scanner

Location:
ose-firewall/trunk
Files:
17 edited

Legend:

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

    r1741247 r1775810  
    171171define("OSE_FILTER_EMAIL_NOTIFI",OSE_WEBLOGFOLDER.ODS."emailNotification.php");
    172172define('OSE_VIRUSPATTERN_FILE_FW7',OSE_WEBLOG_BACKUPFOLDER . ODS . "pattern.php");
     173define('OSE_CHUNKSIZE_FILE',OSE_FWDATA.ODS."chunksize.php");
    173174?>
  • ose-firewall/trunk/assets/config/wordpress.php

    r1730340 r1775810  
    122122define("OSE_FILTER_EMAIL_NOTIFI",OSE_WEBLOGFOLDER.ODS."emailNotification.php");
    123123define('OSE_VIRUSPATTERN_FILE_FW7',OSE_WEBLOG_BACKUPFOLDER . ODS . "pattern.php");
     124define('OSE_CHUNKSIZE_FILE',OSE_FWDATA.ODS."chunksize.php");
    124125?>
  • ose-firewall/trunk/classes/App/Model/CronjobsModel.php

    r1741247 r1775810  
    216216                    if($isremotereposet['status'] ==1)
    217217                    {
     218                        unset($isremotereposet);
    218219                        $isremotereposet = true;
    219220                    }else{
     221                        unset($isremotereposet);
    220222                        $isremotereposet = false;
    221223                    }
    222224                    $repoBare = $gitbackup->checkisRepoBare();
    223225                }
    224                 if($isremotereposet['status']==1 && $repoBare == false)
     226                if($isremotereposet==true && $repoBare == false)
    225227                {
    226228                    $menu .= '<option value="2">Cloud Backup </option>';
     
    241243                    if($isremotereposet['status'] ==1)
    242244                    {
     245                        unset($isremotereposet);
    243246                        $isremotereposet = true;
    244247                    }else{
     248                        unset($isremotereposet);
    245249                        $isremotereposet = false;
    246250                    }
     
    267271                if($isremotereposet['status'] ==1)
    268272                {
     273                    unset($isremotereposet);
    269274                    $isremotereposet = true;
    270275                }else{
     276                    unset($isremotereposet);
    271277                    $isremotereposet = false;
    272278                }
  • ose-firewall/trunk/classes/App/Model/GitbackupModel.php

    r1730340 r1775810  
    7878    {
    7979        $result = $this->gitbackup->getGitLogFromDb();
     80        $result['draw'] = $this->getInt('draw');
    8081        return $result;
    8182    }
  • ose-firewall/trunk/classes/App/Model/GitbackupsuiteModel.php

    r1730897 r1775810  
    7575    {
    7676        $result =  $this->gitbackupsuite->getGitLogfromDB_suite($accountname,$accountpath);
     77        $result['draw'] = $this->getInt('draw');
    7778        return $result;
    7879    }
  • ose-firewall/trunk/classes/Library/gitBackup/GitSetup.php

    r1730340 r1775810  
    240240    public function getGitLogFromDb()
    241241    {
     242        $limit = oRequest::getInt('length', 15);
     243        $start = oRequest::getInt('start', 0);
    242244        $dbReady = oseFirewall::isDBReady();
    243245        if ($dbReady == true) {
     246            if (!empty($limit)) {
     247                $this->getLimitStm($start, $limit);
     248            }
    244249            $db = oseFirewall::getDBO();
    245             $query = "SELECT * FROM `#__osefirewall_gitlog` WHERE 1";
     250            $query = "SELECT * FROM `#__osefirewall_gitlog` WHERE 1 ORDER BY `id` DESC". " " . $this->limitStm;;
    246251            $db->setQuery($query);
    247252            $result = $db->loadResultList();
     
    256261        $array = array();
    257262        if (!empty($result)) {
    258             $tmps = array_reverse($result);
     263            $tmps = ($result);
    259264            foreach ($tmps as $tmp) {
    260265                if (!empty($tmp['commit_id'])) {
     
    284289            $data['data'] = "";
    285290        }
    286         $data['recordsTotal'] = count($result);
    287         $data['recordsFiltered'] = count($result);
     291        $data['recordsTotal'] = $this->getAllLogRecordCount();
     292        $data['recordsFiltered'] = $data['recordsTotal'] ;
    288293        return $data;
     294    }
     295
     296    public function getAllLogRecordCount()
     297    {
     298        // Get total count
     299        $sql = "SELECT * FROM `#__osefirewall_gitlog` WHERE 1 ";
     300        $this->db->setQuery($sql);
     301        $result = $this->db->loadResultList();
     302        return count($result);
     303    }
     304
     305    protected function getLimitStm($start, $limit)
     306    {
     307        if (!empty($limit)) {
     308            $this->limitStm = " LIMIT " . (int)$start . ", " . (int)$limit;
     309        }
    289310    }
    290311
     
    452473    {
    453474        if (isset($_SESSION[$key])) {
    454             if ($_SESSION[$key] != null) {
     475            if ($_SESSION[$key] != null && $_SESSION[$key]!== "undefined") {
    455476                return $_SESSION[$key];
    456477            } else {
  • ose-firewall/trunk/classes/Library/gitBackup/GitSetupsuite.php

    r1730897 r1775810  
    948948    public function getGitLogfromDB_suite($accountname, $accountpath)
    949949    {
     950        $limit = oRequest::getInt('length', 15);
     951        $start = oRequest::getInt('start', 0);
    950952        $accountname = oseFirewallBase::cleanupVar($accountname);
    951953        if (!isset($this->accountDb)) {
    952954            $this->setUpDatabseObject($accountname);
    953955        }
    954         $query = "SELECT * FROM `#__osefirewall_gitlog` WHERE 1";
     956        if (!empty($limit)) {
     957            $this->getLimitStm($start, $limit);
     958        }
     959        $query = "SELECT * FROM `#__osefirewall_gitlog` WHERE 1 ORDER BY `id` DESC". " " . $this->limitStm;;
    955960        $this->accountDb->setQuery($query);
    956961        $result = $this->accountDb->loadResultList();
     
    965970        $array = array();
    966971        if (!empty($result)) {
    967             $tmps = array_reverse($result);
     972            $tmps = ($result);
    968973            foreach ($tmps as $tmp) {
    969974                if (!empty($tmp['commit_id'])) {
     
    993998            $data['data'] = "";
    994999        }
    995         $data['recordsTotal'] = count($result);
    996         $data['recordsFiltered'] = count($result);
     1000        $data['recordsTotal'] = $this->getAllLogRecordCount();
     1001        $data['recordsFiltered'] = $data['recordsTotal'] ;
    9971002        return $data;
    9981003    }
     1004
     1005    public function getAllLogRecordCount()
     1006    {
     1007        // Get total count
     1008        $sql = "SELECT * FROM `#__osefirewall_gitlog` WHERE 1 ";
     1009        $this->accountDb->setQuery($sql);
     1010        $result = $this->accountDb->loadResultList();
     1011        return count($result);
     1012    }
     1013
     1014    protected function getLimitStm($start, $limit)
     1015    {
     1016        if (!empty($limit)) {
     1017            $this->limitStm = " LIMIT " . (int)$start . ", " . (int)$limit;
     1018        }
     1019    }
     1020
     1021
    9991022
    10001023
  • ose-firewall/trunk/classes/Library/vsscanner/cfscanner.php

    r1762549 r1775810  
    409409        foreach ($joomlaDirs as $joomlaDir) {
    410410            if (is_dir($dir . ODS . $joomlaDir) && $joomlaDir == 'libraries') {
    411                 $joomlaVersionFile = $dir . ODS . $joomlaDir . ODS . 'cms/version/version.php';
     411                $joomlaVersionFile = $dir . ODS . $joomlaDir . ODS . 'src/Version.php';
     412                $joomlaVersionFile1 = $dir . ODS . $joomlaDir . ODS . 'cms/version/version.php';
    412413                if (file_exists($joomlaVersionFile)) {
    413414                    $versionContent = file_get_contents($joomlaVersionFile);
     
    417418                    $result['message'] = '<label>Joomla Site</label>';
    418419                    $result['version'] = $joomla_version;
    419                 } else {
    420                     $result['cms'] = false;
    421                 }
    422             }
    423         }
     420                    return $result;
     421                }
     422                if (file_exists($joomlaVersionFile1)) {
     423                    $versionContent = file_get_contents($joomlaVersionFile1);
     424                    preg_match_all("/(RELEASE|DEV_LEVEL) = ('\d+'|'\d.\d+')/", $versionContent, $output_array);
     425                    $joomla_version = str_replace("'", "", $output_array[2][0]) . '.' . str_replace("'", "", $output_array[2][1]);
     426                    $result['cms'] = 'jm';
     427                    $result['message'] = '<label>Joomla Site</label>';
     428                    $result['version'] = $joomla_version;
     429                    return $result;
     430                }
     431            }
     432        }
     433        $result['cms'] = false;
    424434        return $result;
    425435    }
     
    438448                    $result['version'] = $wp_version;
    439449                    return $result;
    440                 } else {
    441                     $result['cms'] = false;
    442                     return $result;
    443                 }
    444             }
    445         }
     450                }
     451            }
     452        }
     453        $result['cms'] = false;
    446454        return $result;
    447455    }
  • ose-firewall/trunk/classes/Library/vsscanner/vsscanner.php

    r1762549 r1775810  
    6161        oseFirewall::loadFiles();
    6262        date_default_timezone_set('Australia/Melbourne');
     63        $this->setDefaultChunkSize();
     64    }
     65
     66    private function setDefaultChunkSize()
     67    {
     68        if(file_exists(OSE_CHUNKSIZE_FILE))
     69        {
     70            $this->chunksize = $this->getChunkSize();
     71        }else{
     72            $this->chunksize = 50 ;
     73        }
    6374    }
    6475    private function setClamd () {
     
    532543        {
    533544            $total = count($files);
     545            $this->setChunkSize($total);
     546            $this->writeChunkSizeValue($this->chunksize);
    534547            // Get the toal number of batches
    535548            $this->size = (($total - $total % $this->chunksize) / $this->chunksize + 1) - 1;
    536549            $this->saveFilesFile($files, $total);
     550        }
     551    }
     552
     553    protected function setChunkSize($nooffiles)
     554    {
     555        $temp_size =  (($nooffiles - $nooffiles % $this->chunksize) / $this->chunksize + 1) - 1;
     556        if($temp_size<=723 && $this->chunksize<=60)
     557        {
     558            return true;
     559        }else{
     560            $this->chunksize++;
     561            if($this->chunksize>60)
     562            {
     563                $this->chunksize = 50;
     564                return true;
     565            }
     566            $this->setChunkSize($nooffiles);
    537567        }
    538568    }
     
    932962            $this->sendEmail($return['totalvs']);
    933963        }
     964        $this->deleteChunksizeFile();
    934965        return $return;
    935966    }
     
    964995                $this->sendEmail($return['totalvs']);
    965996            }
     997            $this->deleteChunksizeFile();
    966998            return $return;
    967999        } elseif ($process == $size) {
     
    9911023                $this->sendEmail($return['totalvs']);
    9921024            }
     1025            $this->deleteChunksizeFile();
    9931026            return $return;
    9941027        }
     
    16551688        }
    16561689    }
     1690
     1691    public function writeChunkSizeValue($value)
     1692    {
     1693        $this->deleteChunksizeFile();
     1694        $contenttoput = "<?php\n" . '$chunksizevalue = ' . var_export($value, true) . ";";
     1695        $result = file_put_contents(OSE_CHUNKSIZE_FILE, $contenttoput);
     1696        return $result;
     1697    }
     1698
     1699    public function getChunkSize()
     1700    {
     1701        $chunksizevalue = 50;
     1702        if(file_exists(OSE_CHUNKSIZE_FILE))
     1703        {
     1704            require (OSE_CHUNKSIZE_FILE);
     1705        }
     1706        return $chunksizevalue;
     1707    }
     1708
     1709    public function deleteChunksizeFile()
     1710    {
     1711        if(file_exists(OSE_CHUNKSIZE_FILE))
     1712        {
     1713            unlink(OSE_CHUNKSIZE_FILE);
     1714        }
     1715
     1716    }
     1717
    16571718}
    16581719?>
  • ose-firewall/trunk/classes/Library/vsscanner/vsscannerpremium.php

    r1730340 r1775810  
    135135                $this->sendEmail($return['totalvs']);
    136136            }
     137            $this->deleteChunksizeFile();
    137138            return $return;
    138139        } elseif ($process == $size) {
     
    163164                $this->sendEmail($return['totalvs']);
    164165            }
     166            $this->deleteChunksizeFile();
    165167            return $return;
    166168        } else {
  • ose-firewall/trunk/ose_firewall_badge.php

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

    r1765585 r1775810  
    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: 7.1.0
     7Version: 7.1.1
    88Author URI: http://www.centrora.com/
    99*/
  • ose-firewall/trunk/public/js/cfscan.js

    r1762549 r1775810  
    397397        $('#cf-sig').text('Checking Core Files version ...');
    398398        $('#icon-refresh').prop('onclick',null).off('click');
     399        $('#cf-div-uptodate').hide();
    399400        $.ajax({
    400401            type: "POST",
  • ose-firewall/trunk/public/js/cronjobs.js

    r1765585 r1775810  
    204204                    //can use the gitbackup cron jobs
    205205                    getBackupTypeMenu();
    206                     hideLoading();
    207206                }else
    208207                {
     
    258257            },
    259258            success: function (data) {
     259                hideLoading();
    260260                if(data.status == 1)
    261261                {
  • ose-firewall/trunk/public/js/gitbackup.js

    r1730340 r1775810  
    1010    var gitBackupDataTable = $('#gitBackupTable').dataTable({
    1111        processing: true,
     12        ordering:  false,
     13        searching: false,
    1214        serverSide: true,
    13         paging: false,
     15        paging: true,
    1416        bFilter: false,
    1517        ajax: {
  • ose-firewall/trunk/public/js/gitbackupsuite.js

    r1730897 r1775810  
    15041504        var gitBackupDataTable = $('#gitBackupTable').dataTable({
    15051505            processing: true,
     1506            ordering:  false,
     1507            searching: false,
    15061508            serverSide: true,
    1507             paging: false,
     1509            paging: true,
    15081510            bFilter: false,
    15091511            ajax: {
  • ose-firewall/trunk/readme.txt

    r1765585 r1775810  
    66Requires at least: 3.7
    77Tested up to: 4.8.2
    8 Stable tag: 7.1.0
     8Stable tag: 7.1.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    170170
    171171== Changelog ==
     172
     173= 7.1.1 =
     174* Added pagination for the Git backup page
     175* Minor bug fixes for Git backup
     176* Minor bug fix for the core directory scanner
     177* Bug fixes for the virus scanner
    172178
    173179= 7.1.0 =
Note: See TracChangeset for help on using the changeset viewer.