Changeset 1518781
- Timestamp:
- 10/20/2016 06:50:35 PM (9 years ago)
- Location:
- ose-firewall/trunk
- Files:
-
- 11 edited
-
assets/views/authentication.php (modified) (1 diff)
-
classes/Library/RemoteLogin/RemoteLogin.php (modified) (1 diff)
-
classes/Library/backup/googledrive/googledrive.php (modified) (1 diff)
-
classes/Library/backup/onedrive/onedrive.php (modified) (1 diff)
-
classes/Library/backup/oseBackup.php (modified) (12 diffs)
-
classes/Library/vlscanner/vlscanner.php (modified) (2 diffs)
-
ose_firewall_badge.php (modified) (1 diff)
-
ose_wordpress_firewall.php (modified) (1 diff)
-
public/js/backup.js (modified) (3 diffs)
-
public/js/scanreport.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
ose-firewall/trunk/assets/views/authentication.php
r1436160 r1518781 22 22 <div class="panel-controls-buttons"> 23 23 </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> 24 27 <div class="panel-body row col-xs-12"> 25 28 <div class="col-xs-2"> -
ose-firewall/trunk/classes/Library/RemoteLogin/RemoteLogin.php
r1496143 r1518781 340 340 $ip = $this->getRealIP(); 341 341 // 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::'); 343 343 if (in_array($ip, $iplist) == false) 344 344 { -
ose-firewall/trunk/classes/Library/backup/googledrive/googledrive.php
r1496143 r1518781 12 12 { 13 13 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 = ''; 17 17 18 18 const GDRIVE_SESS_NAME = 'gdrive_token'; -
ose-firewall/trunk/classes/Library/backup/onedrive/onedrive.php
r1496143 r1518781 5 5 { 6 6 7 const CLIENT_ID = ' 00000000401562C1';8 const CLIENT_SECRET = ' vjF9j1m-acd7EbVmxGybd629dOnuI1Nr';7 const CLIENT_ID = ''; 8 const CLIENT_SECRET = ''; 9 9 const SESSION_ID = '_onedrive_accessToken'; 10 10 const SESSION_EXP = '_onedrive_accessToken_expires'; -
ose-firewall/trunk/classes/Library/backup/oseBackup.php
r1496143 r1518781 32 32 const REQUEST_TOKEN_METHOD = 'oauth/request_token'; 33 33 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 = ''; 36 36 private 37 37 $dropbox, … … 398 398 if ($backup_type == 1) { 399 399 $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 } 405 405 } else if($backup_type == 2){ 406 406 $backupResult = $this->backupDB($backup_type, $backup_to, $cloudbackupprefix); … … 555 555 if(sizeof($files) == 2) 556 556 { 557 $filesArray = array_values($files);557 $filesArray = array_values($files); 558 558 $file_name = (!empty($filesArray))?self::getDownloadFilename($filesArray[0]):''; 559 559 $zipname = preg_replace('-filesbackup-', '-backup-', $file_name); … … 588 588 $zip->close(); 589 589 590 /* Figure out the MIME type | Check in array */590 /* Figure out the MIME type | Check in array */ 591 591 // $mime_type = self::getMimeType($file_extension); 592 592 $mime_type = 'application/zip'; … … 597 597 // delete temp file if exists after download 598 598 // if ($checkZipSplitType !== 'none' && is_readable($file)) { 599 unlink($zipname);599 unlink($zipname); 600 600 // } 601 601 die (); … … 1873 1873 return $return; 1874 1874 } 1875 1875 1876 1876 public function scheduledBackup($cloudbackuptype, $upload, $fileNum) 1877 1877 { … … 1934 1934 } 1935 1935 //if ( ( $this->noMoreUploadFiles() ) || ($cloudbackuptype == 1 ) || ($fileNum == -1) ){ 1936 $this->sendRequestBak($url);1936 $this->sendRequestBak($url); 1937 1937 //} 1938 1938 $this->db->closeDBO(); … … 2068 2068 return $cloudbackupprefix; 2069 2069 } 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 } 2070 2088 public function easybackup($cloudbackuptype, $cloudbackupprefix=null) 2071 2089 { 2072 2090 $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 } 2073 2098 $cloudbackupprefix = $this->sanitize($cloudbackupprefix); 2074 2099 switch ($cloudbackuptype) { … … 2190 2215 { 2191 2216 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) 2192 2220 { 2193 //to make sure its only updated once2194 if(strpos($value['dbBackupPath'], 'BackupFiles') === false || strpos($value['dbBackupPath'], 'BackupFiles') === false)2195 {2196 2221 if(!empty($value['dbBackupPath']) && empty($value['fileBackupPath'])) 2197 2222 { … … 2227 2252 else { 2228 2253 return; 2229 }2254 } 2230 2255 //inserts the new folder name and appends the backup folder name 2231 2256 rename($sourcepath, $destinationpath); … … 2242 2267 } 2243 2268 } 2244 }2269 } 2245 2270 2246 2271 } … … 2268 2293 public function prepareSqlPath($list) 2269 2294 { 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; 2273 2298 2274 2299 } -
ose-firewall/trunk/classes/Library/vlscanner/vlscanner.php
r1496143 r1518781 69 69 $vulList['totalvls'] = 0; 70 70 71 $this->saveVulScanList($ vulList);71 $this->saveVulScanList($this->utf8ize($vulList)); 72 72 73 73 $result['status'] = … … 100 100 $result = oseJSON::decode($fileContent, true); 101 101 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; 102 114 } 103 115 -
ose-firewall/trunk/ose_firewall_badge.php
r1504184 r1518781 4 4 Description: Plugin For Showing Centrora Security Badge 5 5 Author: Centrora Security 6 Version: 6.5.1 26 Version: 6.5.13 7 7 */ 8 8 //include(dirname(__FILE__).'/includes/oseBadgeWidget.php'); -
ose-firewall/trunk/ose_wordpress_firewall.php
r1504184 r1518781 5 5 Description: 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. 6 6 Author: Centrora (Previously ProWeb) 7 Version: 6.5.1 27 Version: 6.5.13 8 8 Author URI: http://www.centrora.com/ 9 9 */ -
ose-firewall/trunk/public/js/backup.js
r1387925 r1518781 136 136 }, 137 137 success: function (data) { 138 if (data. data == false) {138 if (data.status == 'fail') { 139 139 hideLoading(); 140 showDialogue( O_BACKUP_FAIL, O_FAIL, O_OK);140 showDialogue(data.errorMsg, O_FAIL, O_OK); 141 141 }else if (data.conti == 1) { 142 142 contbackup(data.sourcePath, data.outZipPath, data.serializefile); … … 1192 1192 var html = ''; 1193 1193 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> ' +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> '+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> '+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> ' + 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> '+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> '+moment(schedule_bk_time).startOf('second').from()+'' + 1216 '</strong> ' + 1217 '</div> ' + 1218 '</div>'; 1219 1219 1220 1220 return html; … … 1236 1236 { 1237 1237 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> ' +1241 '<a class="btn btn-primary" href="'+data.downloadUrl+'" >Download</a> ' +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> <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> ' +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> <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> ' + 1241 '<a class="btn btn-primary" href="'+data.downloadUrl+'" >Download</a> ' + 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> <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> ' + 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> <a class="text-warning" title="DataBase"><i class="text-primary glyphicon glyphicon-hdd"></i></a> ' + 1275 '</div> ' + 1276 '</div> ' + 1277 '</div>'; 1278 1278 return html; 1279 1279 } -
ose-firewall/trunk/public/js/scanreport.js
r1417654 r1518781 11 11 serverSide: true, 12 12 dom: 'lrtip', 13 lengthMenu: [[10, 25, 50, -1], [10, 25, 50, "All"]], 13 14 //bFilter: false, 14 15 ajax: { -
ose-firewall/trunk/readme.txt
r1504184 r1518781 6 6 Requires at least: 3.7 7 7 Tested up to: 4.5.2 8 Stable tag: 6.5.1 28 Stable tag: 6.5.13 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 164 164 165 165 == Changelog == 166 167 = 6.5.13 = 168 * Updated Backup function to check file permissions before performing actual backup 166 169 167 170 = 6.5.12 =
Note: See TracChangeset
for help on using the changeset viewer.