Skip to content

Commit

Permalink
#293 regexp tweaks
Browse files Browse the repository at this point in the history
Former-commit-id: a6dfc81af4846def3db110a909a80685ccb2b1d9
  • Loading branch information
pliablepixels committed Aug 10, 2016
1 parent 668e6b0 commit f690e6d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 19 deletions.
35 changes: 20 additions & 15 deletions www/js/DataModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,31 @@ angular.module('zmApp.controllers')
//--------------------------------------------------------------------------
// uses fileLogger to write logs to file for later investigation
//--------------------------------------------------------------------------

// separate out a debug so we don't do this if comparison for normal logs
function zmDebug(val) {
if (loginData.enableDebug && loginData.enableLogs)
{
if (val!== undefined)
{
var regex1 = /"password":".*?"/g;
var regex2 = /&pass=.*?(?=["&]|$)/g;

//console.log ("VAL IS " + val);
val = val.replace(regex1, "<password removed>");
val = val.replace(regex2, "<password removed>");
}
$fileLogger.debug(val);
}
}

function zmLog(val, logtype) {
if (loginData.enableLogs)
{
if (val!== undefined)
{
var regex1 = /"password":".*?"/g;
var regex2 = /&pass=.*?&/g;
var regex2 = /&pass=.*?(?=["&]|$)/g;

//console.log ("VAL IS " + val);
val = val.replace(regex1, "<password removed>");
Expand Down Expand Up @@ -183,20 +201,7 @@ angular.module('zmApp.controllers')

}

// separate out a debug so we don't do this if comparison for normal logs
function zmDebug(val) {
if (loginData.enableDebug && loginData.enableLogs)
{
if (val!== undefined)
{
var regex = /"password":".*?"/g;

//console.log ("VAL IS " + val);
val = val.replace(regex, "<password removed>");
}
$fileLogger.debug(val);
}
}


//credit: https://gist.github.com/alexey-bass/1115557
function versionCompare(left, right) {
Expand Down
8 changes: 4 additions & 4 deletions www/js/WizardCtrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
}
})
.success(function (data, status, headers) {
console.log("LOOKING FOR " + zm.loginScreenString);
console.log("DATA RECEIVED " + JSON.stringify(data));
//console.log("LOOKING FOR " + zm.loginScreenString);
//console.log("DATA RECEIVED " + JSON.stringify(data));
if (data.indexOf(zm.loginScreenString) == -1) {

$scope.wizard.loginURL = $scope.wizard.fqportal;
Expand Down Expand Up @@ -79,7 +79,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
var d = $q.defer();
$http.get($scope.wizard.apiURL + "/monitors.json")
.then(function (success) {
console.log("getfirst monitor success: " + JSON.stringify(success));
// console.log("getfirst monitor success: " + JSON.stringify(success));
if (success.data.monitors.length > 0) {
var foundMid = -1;
for (var i = 0; i < success.data.monitors.length; i++) {
Expand Down Expand Up @@ -416,7 +416,7 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$
var b = "";
if ($scope.wizard.useauth && $scope.wizard.usebasicauth) {
b = $scope.wizard.basicuser + ":" + $scope.wizard.basicpassword + "@";
console.log("B=" + b);
//console.log("B=" + b);
}
var u = c.scheme + "://" + b + c.host;
if (c.port) u += ":" + c.port;
Expand Down

0 comments on commit f690e6d

Please sign in to comment.