diff options
| author | pliablepixels <pliablepixels@gmail.com> | 2016-06-01 07:04:27 -0400 |
|---|---|---|
| committer | pliablepixels <pliablepixels@gmail.com> | 2016-06-01 07:04:27 -0400 |
| commit | 3e70efa61d1567735b16183c01eaad4aa75fe9b5 (patch) | |
| tree | 3375feed360bb3d14d72befed9db6227d398e7e0 /www | |
| parent | e813ca52c3f5faf59c2979c038d7b946db0d4ef5 (diff) | |
#264 - special characters in passwords should now work
Former-commit-id: c11ef8618a0edfefd56b391838fd568e8caa988c
Diffstat (limited to 'www')
| -rw-r--r-- | www/js/WizardCtrl.js | 77 | ||||
| -rw-r--r-- | www/lang/locale-en.json | 2 | ||||
| -rw-r--r-- | www/templates/wizard.html | 4 |
3 files changed, 54 insertions, 29 deletions
diff --git a/www/js/WizardCtrl.js b/www/js/WizardCtrl.js index aa48e1a5..ec0cd383 100644 --- a/www/js/WizardCtrl.js +++ b/www/js/WizardCtrl.js @@ -221,36 +221,61 @@ angular.module('zmApp.controllers').controller('zmApp.WizardCtrl', ['$scope', '$ if ($scope.wizard.useauth && $scope.wizard.usezmauth) { - tail+= "&user="+$scope.wizard.zmuser+"&pass="+$scope.wizard.zmpassword; - console.log ("****CDING " + tail); + var ck = Math.floor(Math.random() * (50000 - 10000 + 1)) + 10000; + ZMDataModel.getAuthKey(success,ck) + .then (function (success) + { + if (success=="") + { + ZMDataModel.zmLog ("getAuthKey returned null, so going user=&pwd= way"); + tail+= "&user="+$scope.wizard.zmuser+"&pass="+$scope.wizard.zmpassword; + } + else + { + tail+=success; + } + ZMDataModel.zmLog ("auth computed is : " + tail); + proceedwithCgiAfterAuth(urls,tail); + }, + function (error) + { + ZMDataModel.zmLog ("Should never come here, getAuthKey doesn't return error"); + + }); + + + //console.log ("****CDING " + tail); } + function proceedwithCgiAfterAuth(urls,tail) + { - $ionicLoading.show({ - template: $translate.instant('kDiscovering')+"...", - noBackdrop: true, - duration: zm.httpTimeout - }); - - findFirstReachableUrl(urls,tail ) - .then (function (success) { - $ionicLoading.hide(); - ZMDataModel.zmLog ("Valid cgi-bin found with: " + success); - $scope.wizard.streamingURL = success; - $scope.wizard.streamingValidText = "cgi-bin: "+$scope.wizard.streamingURL; - $scope.wizard.streamingColor = "#16a085"; - d.resolve(true); - return d.promise; + $ionicLoading.show({ + template: $translate.instant('kDiscovering')+"...", + noBackdrop: true, + duration: zm.httpTimeout + }); - }, - function (error) { - $ionicLoading.hide(); - console.log ("No cgi-bin found: " + error); - $scope.wizard.streamingValidText = "cgi-bin detection failed"; - $scope.wizard.streamingColor = "#e74c3c"; - d.reject (false); - return (d.promise); - }); + findFirstReachableUrl(urls,tail ) + .then (function (success) { + $ionicLoading.hide(); + ZMDataModel.zmLog ("Valid cgi-bin found with: " + success); + $scope.wizard.streamingURL = success; + $scope.wizard.streamingValidText = "cgi-bin: "+$scope.wizard.streamingURL; + $scope.wizard.streamingColor = "#16a085"; + d.resolve(true); + return d.promise; + + }, + function (error) { + $ionicLoading.hide(); + console.log ("No cgi-bin found: " + error); + $scope.wizard.streamingValidText = "cgi-bin detection failed"; + $scope.wizard.streamingColor = "#e74c3c"; + d.reject (false); + return (d.promise); + }); + } }, function (error){ $ionicLoading.hide(); diff --git a/www/lang/locale-en.json b/www/lang/locale-en.json index f17f9588..80f79178 100644 --- a/www/lang/locale-en.json +++ b/www/lang/locale-en.json @@ -286,7 +286,7 @@ "kWizNextStep1" : "Once auto-detection is over, you could either", "kWizNextStep2" : "Go back to previous steps and re-do", "kWizNextStep3" : "Go to the login screen with these findings auto filled in", - "kWizPasswdNote" : "note: if your password has #?@& in it, the wizard will fail cgi detection. Its best if you temporarily change the password to a simple one, run the wizard and then change it back later", + "kWizPasswdNote" : "note: if your password has #?@& in it, the wizard may fail cgi detection. Its best if you temporarily change the password to a simple one, run the wizard and then change it back later", "kWizPortalAuth" : "Portal Authentication", "kWizPortalText" : "Lets talk about how you have configured authentication If you have enabled authentication, toggle this button", "kWizPortalTip" : "Confused? You can easily find out your portal URL by noting down the url you see on your browser when accessing the ZoneMinder Console.", diff --git a/www/templates/wizard.html b/www/templates/wizard.html index dab46d02..5c222f76 100644 --- a/www/templates/wizard.html +++ b/www/templates/wizard.html @@ -54,7 +54,7 @@ <label class="item item-text-wrap item-input item-floating-label" > <span class="input-label">{{'kPassword' | translate}}</span> <input type="password" ng-model="wizard.zmpassword" placeholder="zm auth password" > - <p >{{'kWizPasswdNote' | translate}}</p> + <!--<p >{{'kWizPasswdNote' | translate}}</p>--> </label> </div> @@ -66,7 +66,7 @@ <label class="item item-input item-text-wrap item-floating-label" ng-show="wizard.usebasicauth"> <span class="input-label">{{'kPassword' | translate}}</span> <input type="password" ng-model="wizard.basicpassword" placeholder="basic auth password" > - <p >{{'kWizPasswdNote' | translate}}</p> + <p>{{'kWizPasswdNote' | translate}}</p> </label> |
