Plugin Directory

Changeset 1518781


Ignore:
Timestamp:
10/20/2016 06:50:35 PM (9 years ago)
Author:
osexcel
Message:

6.5.13

  • Updated Backup function to check file permissions before performing actual backup
Location:
ose-firewall/trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • ose-firewall/trunk/assets/views/authentication.php

    r1436160 r1518781  
    2222                        <div class="panel-controls-buttons">
    2323                        </div>
     24                       <div class="panel-body row col-xs-12">
     25                           <p class="text-info"> We are upgrading these three cloud modules, please wait until version 7 to use the cloud backup functions.</p>
     26                       </div>
    2427                        <div class="panel-body row col-xs-12">
    2528                            <div class="col-xs-2">
  • ose-firewall/trunk/classes/Library/RemoteLogin/RemoteLogin.php

    r1496143 r1518781  
    340340        $ip = $this->getRealIP();
    341341        // Centrora server IP List;
    342         $iplist = array('158.69.52.171', '49.255.209.82', '108.162.216.190', '158.69.56.254', '175.45.147.116', '149.56.117.155');
     342        $iplist = array('158.69.52.171', '49.255.209.82', '108.162.216.190', '158.69.56.254', '175.45.147.116', '149.56.117.155', '2607:5300:60:81ab::');
    343343        if (in_array($ip, $iplist) == false)
    344344        {
  • ose-firewall/trunk/classes/Library/backup/googledrive/googledrive.php

    r1496143 r1518781  
    1212{
    1313
    14     private $gdrive_client_id = '749526762988-ukf6lkjabt69q2vub3i6iqr979acoitr.apps.googleusercontent.com';
    15 
    16     private $gdrive_client_secret = 'EQP-1pyir-3Bp8et0joSH0RL';
     14    private $gdrive_client_id = '';
     15
     16    private $gdrive_client_secret = '';
    1717
    1818    const GDRIVE_SESS_NAME = 'gdrive_token';
  • ose-firewall/trunk/classes/Library/backup/onedrive/onedrive.php

    r1496143 r1518781  
    55{
    66
    7     const CLIENT_ID = '00000000401562C1';
    8     const CLIENT_SECRET = 'vjF9j1m-acd7EbVmxGybd629dOnuI1Nr';
     7    const CLIENT_ID = '';
     8    const CLIENT_SECRET = '';
    99    const SESSION_ID = '_onedrive_accessToken';
    1010    const SESSION_EXP = '_onedrive_accessToken_expires';
  • ose-firewall/trunk/classes/Library/backup/oseBackup.php

    r1496143 r1518781  
    3232    const REQUEST_TOKEN_METHOD = 'oauth/request_token';
    3333    const API_URL = 'https://api.dropbox.com/1/';
    34     const CONSUMER_KEY = 'ub6h6xc37diailz';
    35     const CONSUMER_SECRET = 'ra0tr51rah59vjf';
     34    const CONSUMER_KEY = '';
     35    const CONSUMER_SECRET = '';
    3636    private
    3737        $dropbox,
     
    398398            if ($backup_type == 1) {
    399399                $backupResult = $this->backupFiles($backup_type, $backup_to, $cloudbackupprefix);
    400                     if ($backupResult == true) {
    401                         $result = $this->insertbkDB($backup_type, $backup_to);
    402                     } else {
    403                         $result = false;
    404                     }
     400                if ($backupResult == true) {
     401                    $result = $this->insertbkDB($backup_type, $backup_to);
     402                } else {
     403                    $result = false;
     404                }
    405405            } else if($backup_type == 2){
    406406                $backupResult = $this->backupDB($backup_type, $backup_to, $cloudbackupprefix);
     
    555555            if(sizeof($files) == 2)
    556556            {
    557                 $filesArray = array_values($files);
     557                $filesArray = array_values($files);
    558558                $file_name = (!empty($filesArray))?self::getDownloadFilename($filesArray[0]):'';
    559559                $zipname = preg_replace('-filesbackup-', '-backup-', $file_name);
     
    588588            $zip->close();
    589589
    590                 /* Figure out the MIME type | Check in array */
     590            /* Figure out the MIME type | Check in array */
    591591//                $mime_type = self::getMimeType($file_extension);
    592592            $mime_type = 'application/zip';
     
    597597            // delete temp file if exists after download
    598598//            if ($checkZipSplitType !== 'none' && is_readable($file)) {
    599                 unlink($zipname);
     599            unlink($zipname);
    600600//            }
    601601            die ();
     
    18731873        return $return;
    18741874    }
    1875    
     1875
    18761876    public function scheduledBackup($cloudbackuptype, $upload, $fileNum)
    18771877    {
     
    19341934            }
    19351935            //if ( ( $this->noMoreUploadFiles() ) || ($cloudbackuptype == 1 ) || ($fileNum == -1) ){
    1936                 $this->sendRequestBak($url);
     1936            $this->sendRequestBak($url);
    19371937            //}
    19381938            $this->db->closeDBO();
     
    20682068        return $cloudbackupprefix;
    20692069    }
     2070
     2071    private function precheck()
     2072    {
     2073        $files = array();
     2074        $scanPath = oseFirewall::getScanPath();
     2075        $objects = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(realpath($scanPath), RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::SELF_FIRST, RecursiveIteratorIterator::CATCH_GET_CHILD);
     2076        foreach ($objects as $path => $dir) {
     2077            if (!is_readable($path)) {
     2078                $files[] = $path;
     2079            }
     2080        }
     2081        if (empty($files)) {
     2082            return true;
     2083        } else {
     2084            return $files;
     2085        }
     2086
     2087    }
    20702088    public function easybackup($cloudbackuptype, $cloudbackupprefix=null)
    20712089    {
    20722090        $statusMsg = null;
     2091        $flag = $this->precheck();
     2092        if (is_array($flag)) {
     2093            $notReadableFileList = '<br>' . implode('<br>', $flag);
     2094            $statusMsg['status'] = 'fail'; //local backup failed
     2095            $statusMsg['errorMsg'] = 'Backup stops as files below are not readable, please use filepermission scanner to fix it before continue' . $notReadableFileList;
     2096            return $statusMsg;
     2097        }
    20732098        $cloudbackupprefix = $this->sanitize($cloudbackupprefix);
    20742099        switch ($cloudbackuptype) {
     
    21902215    {
    21912216        foreach($list as $value)
     2217        {
     2218            //to make sure its only updated once
     2219            if(strpos($value['dbBackupPath'], 'BackupFiles') === false  || strpos($value['dbBackupPath'], 'BackupFiles') === false)
    21922220            {
    2193                 //to make sure its only updated once
    2194                 if(strpos($value['dbBackupPath'], 'BackupFiles') === false  || strpos($value['dbBackupPath'], 'BackupFiles') === false)
    2195                 {
    21962221                if(!empty($value['dbBackupPath']) && empty($value['fileBackupPath']))
    21972222                {
     
    22272252                    else {
    22282253                        return;
    2229                 }
     2254                    }
    22302255                    //inserts the new folder name and appends the backup folder name
    22312256                    rename($sourcepath, $destinationpath);
     
    22422267                }
    22432268            }
    2244             }
     2269        }
    22452270
    22462271    }
     
    22682293    public function prepareSqlPath($list)
    22692294    {
    2270        $temp = $this->getBackupFileName($list);
    2271        $result = $this->prepareDestinationPath($temp);
    2272        return $result;
     2295        $temp = $this->getBackupFileName($list);
     2296        $result = $this->prepareDestinationPath($temp);
     2297        return $result;
    22732298
    22742299    }
  • ose-firewall/trunk/classes/Library/vlscanner/vlscanner.php

    r1496143 r1518781  
    6969        $vulList['totalvls'] = 0;
    7070
    71         $this->saveVulScanList($vulList);
     71        $this->saveVulScanList($this->utf8ize($vulList));
    7272
    7373        $result['status'] =
     
    100100        $result = oseJSON::decode($fileContent, true);
    101101        return $result;
     102    }
     103
     104    private function utf8ize($d)
     105    {
     106        if (is_array($d)) {
     107            foreach ($d as $k => $v) {
     108                $d[$k] = $this->utf8ize($v);
     109            }
     110        } else if (is_string($d)) {
     111            return utf8_encode($d);
     112        }
     113        return $d;
    102114    }
    103115
  • ose-firewall/trunk/ose_firewall_badge.php

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

    r1504184 r1518781  
    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.12
     7Version: 6.5.13
    88Author URI: http://www.centrora.com/
    99*/
  • ose-firewall/trunk/public/js/backup.js

    r1387925 r1518781  
    136136            },
    137137            success: function (data) {
    138                 if (data.data == false) {
     138                if (data.status == 'fail') {
    139139                    hideLoading();
    140                     showDialogue(O_BACKUP_FAIL, O_FAIL, O_OK);
     140                    showDialogue(data.errorMsg, O_FAIL, O_OK);
    141141                }else if (data.conti == 1) {
    142142                    contbackup(data.sourcePath, data.outZipPath, data.serializefile);
     
    11921192    var html = '';
    11931193    html += '<div class="row">' +
    1194                 '<div class="col-md-2">' +
    1195                     '<strong>Files:</strong>' +
    1196                 '</div>' +
    1197                 '<div class="col-md-10">' +
    1198                     '<a  class="text-warning" title="Files">' +
    1199                     '<i class="text-primary glyphicon glyphicon-duplicate"></i></a>&nbsp' +
    1200                     '<a  class="text-warning" title="DataBase">' +
    1201                     '<i class="text-primary glyphicon glyphicon-hdd"></i></a> ' +
    1202                 '</div> ' +
    1203             '</div> ' +
    1204             '<div class="row"> ' +
    1205                 '<div class="col-md-2"><strong>Types:</strong></div> ' +
    1206                 '<div class="col-md-10"> ' +
    1207                     '<div id = "div_schedule_bk_types"><a  class="text-warning fa fa-unlink" title="Local Backup"></a>&nbsp'+dropboxicon + onedriveicon + googledriveicon+'</div> ' +
    1208                 '</div> ' +
    1209             '</div> ' +
    1210             '<div class="row"> ' +
    1211                 '<div class="col-md-2"><strong>Schedule Time:</strong></div> ' +
    1212                 '<div class="col-md-10"> ' +
    1213                     '<div id = "div_schedule_bk_time"></div> ' +
    1214                     '<strong class="color-green" title="'+moment(schedule_bk_time).format('llll')+'">' +
    1215                         '<i class="fa fa-clock-o"></i>&nbsp'+moment(schedule_bk_time).startOf('second').from()+'' +
    1216                     '</strong> ' +
    1217                 '</div> ' +
    1218             '</div>';
     1194        '<div class="col-md-2">' +
     1195        '<strong>Files:</strong>' +
     1196        '</div>' +
     1197        '<div class="col-md-10">' +
     1198        '<a  class="text-warning" title="Files">' +
     1199        '<i class="text-primary glyphicon glyphicon-duplicate"></i></a>&nbsp' +
     1200        '<a  class="text-warning" title="DataBase">' +
     1201        '<i class="text-primary glyphicon glyphicon-hdd"></i></a> ' +
     1202        '</div> ' +
     1203        '</div> ' +
     1204        '<div class="row"> ' +
     1205        '<div class="col-md-2"><strong>Types:</strong></div> ' +
     1206        '<div class="col-md-10"> ' +
     1207        '<div id = "div_schedule_bk_types"><a  class="text-warning fa fa-unlink" title="Local Backup"></a>&nbsp'+dropboxicon + onedriveicon + googledriveicon+'</div> ' +
     1208        '</div> ' +
     1209        '</div> ' +
     1210        '<div class="row"> ' +
     1211        '<div class="col-md-2"><strong>Schedule Time:</strong></div> ' +
     1212        '<div class="col-md-10"> ' +
     1213        '<div id = "div_schedule_bk_time"></div> ' +
     1214        '<strong class="color-green" title="'+moment(schedule_bk_time).format('llll')+'">' +
     1215        '<i class="fa fa-clock-o"></i>&nbsp'+moment(schedule_bk_time).startOf('second').from()+'' +
     1216        '</strong> ' +
     1217        '</div> ' +
     1218        '</div>';
    12191219
    12201220    return html;
     
    12361236{
    12371237    var html = '<div class="backup-long-desc">' +
    1238                     '<div class="row" style="margin-top: 10px;"> ' +
    1239                         '<div class="col-md-offset-9"> ' +
    1240             //     '<button class="btn btn-success" onclick="restore('+data.ID+')">Restore</button>&nbsp' +
    1241                             '<a class="btn btn-primary" href="'+data.downloadUrl+'" >Download</a>&nbsp' +
    1242                         '</div> ' +
    1243                     '</div> ' +
    1244                     '<div class="row backup-item">' +
    1245                         '<div class="col-md-2">' +
    1246                             '<strong>Backup Name:</strong>' +
    1247                         '</div>' +
    1248                         '<div class="col-md-8">' +
    1249                             '<strong class="text-primary">'+data.fileName+'</strong>' +
    1250                         '</div>' +
    1251                     '</div>' +
    1252                     '<div class="row backup-item">' +
    1253                         '<div class="col-md-2">' +
    1254                             '<strong>Backup Time:</strong>' +
    1255                         '</div> ' +
    1256                         '<div class="col-md-8">' +
    1257                             '<i class="fa fa-clock-o"></i>&nbsp<strong>'+moment(data.time).format('MMMM Do YYYY, h:mm:ss a')+'</strong>' +
    1258                         '</div> ' +
    1259                     '</div>' +
    1260                     '<div class="row backup-item">' +
    1261                         '<div class="col-md-2">' +
    1262                             '<strong>Backup Platforms:</strong>' +
    1263                         '</div>' +
    1264                         '<div class="col-md-8">' +
    1265                             '<a  class="text-warning fa fa-unlink" title="Local Backup"></a>&nbsp' +
    1266                              dropboxicon + onedriveicon + googledriveicon +
    1267                         '</div>' +
    1268                     '</div>' +
    1269                     '<div class="row backup-item"> ' +
    1270                         '<div class="col-md-2"> ' +
    1271                             '<strong>Backup Files:</strong>' +
    1272                         '</div>' +
    1273                         '<div class="col-md-8">' +
    1274                             '<a  class="text-warning" title="Files"><i class="text-primary glyphicon glyphicon-duplicate"></i></a>&nbsp<a  class="text-warning" title="DataBase"><i class="text-primary glyphicon glyphicon-hdd"></i></a> ' +
    1275                         '</div> ' +
    1276                     '</div> ' +
    1277             '</div>';
     1238        '<div class="row" style="margin-top: 10px;"> ' +
     1239        '<div class="col-md-offset-9"> ' +
     1240        //     '<button class="btn btn-success" onclick="restore('+data.ID+')">Restore</button>&nbsp' +
     1241        '<a class="btn btn-primary" href="'+data.downloadUrl+'" >Download</a>&nbsp' +
     1242        '</div> ' +
     1243        '</div> ' +
     1244        '<div class="row backup-item">' +
     1245        '<div class="col-md-2">' +
     1246        '<strong>Backup Name:</strong>' +
     1247        '</div>' +
     1248        '<div class="col-md-8">' +
     1249        '<strong class="text-primary">'+data.fileName+'</strong>' +
     1250        '</div>' +
     1251        '</div>' +
     1252        '<div class="row backup-item">' +
     1253        '<div class="col-md-2">' +
     1254        '<strong>Backup Time:</strong>' +
     1255        '</div> ' +
     1256        '<div class="col-md-8">' +
     1257        '<i class="fa fa-clock-o"></i>&nbsp<strong>'+moment(data.time).format('MMMM Do YYYY, h:mm:ss a')+'</strong>' +
     1258        '</div> ' +
     1259        '</div>' +
     1260        '<div class="row backup-item">' +
     1261        '<div class="col-md-2">' +
     1262        '<strong>Backup Platforms:</strong>' +
     1263        '</div>' +
     1264        '<div class="col-md-8">' +
     1265        '<a  class="text-warning fa fa-unlink" title="Local Backup"></a>&nbsp' +
     1266        dropboxicon + onedriveicon + googledriveicon +
     1267        '</div>' +
     1268        '</div>' +
     1269        '<div class="row backup-item"> ' +
     1270        '<div class="col-md-2"> ' +
     1271        '<strong>Backup Files:</strong>' +
     1272        '</div>' +
     1273        '<div class="col-md-8">' +
     1274        '<a  class="text-warning" title="Files"><i class="text-primary glyphicon glyphicon-duplicate"></i></a>&nbsp<a  class="text-warning" title="DataBase"><i class="text-primary glyphicon glyphicon-hdd"></i></a> ' +
     1275        '</div> ' +
     1276        '</div> ' +
     1277        '</div>';
    12781278    return html;
    12791279}
  • ose-firewall/trunk/public/js/scanreport.js

    r1417654 r1518781  
    1111            serverSide: true,
    1212            dom: 'lrtip',
     13            lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]],
    1314            //bFilter: false,
    1415            ajax: {
  • ose-firewall/trunk/readme.txt

    r1504184 r1518781  
    66Requires at least: 3.7
    77Tested up to: 4.5.2
    8 Stable tag: 6.5.12
     8Stable tag: 6.5.13
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    164164
    165165== Changelog ==
     166
     167= 6.5.13 =
     168* Updated Backup function to check file permissions before performing actual backup
    166169
    167170= 6.5.12 =
Note: See TracChangeset for help on using the changeset viewer.