Joseph White 7 anni fa
parent
commit
329837ba16

+ 1 - 1
client/src/changepassword/autogen-change-password.component.html

@@ -20,7 +20,7 @@
   ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   -->
 
-<ias-dialog class="change-password-dialog">
+<ias-dialog class="autogen-change-password-dialog">
     <div class="ias-dialog-header">
         <div class="ias-title" ng-bind="'Title_RandomPasswords' | translate"></div>
     </div>

+ 23 - 1
client/src/changepassword/autogen-change-password.component.scss

@@ -1,5 +1,27 @@
+/*!
+ * Password Management Servlets (PWM)
+ * http://www.pwm-project.org
+ *
+ * Copyright (c) 2006-2009 Novell, Inc.
+ * Copyright (c) 2009-2017 The PWM Project
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
 ias-dialog {
-  &.change-password-dialog {
+  &.autogen-change-password-dialog {
     table {
       td {
         min-width: 160px;

+ 1 - 1
client/src/changepassword/random-change-password.component.html

@@ -20,7 +20,7 @@
   ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   -->
 
-<ias-dialog class="change-password-dialog">
+<ias-dialog class="random-change-password-dialog">
     <div class="ias-dialog-header">
         <div class="ias-title" ng-bind="('Title_ChangePassword' | translate) + ': ' + $ctrl.personUsername"></div>
     </div>

+ 1 - 1
client/src/changepassword/success-change-password.component.html

@@ -20,7 +20,7 @@
   ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   -->
 
-<ias-dialog class="change-password-dialog">
+<ias-dialog class="success-change-password-dialog">
     <div class="ias-dialog-header">
         <div class="ias-title" ng-bind="('Title_ChangePassword' | translate) + ' - ' + $ctrl.personUsername"></div>
     </div>

+ 42 - 17
client/src/changepassword/type-change-password.component.html

@@ -20,29 +20,54 @@
   ~ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   -->
 
-<ias-dialog class="change-password-dialog">
+<ias-dialog class="type-change-password-dialog">
     <div class="ias-dialog-header">
         <div class="ias-title" ng-bind="('Title_ChangePassword' | translate) + ' - ' + $ctrl.personUsername"></div>
     </div>
     <div class="ias-dialog-body">
         <p ng-bind="$ctrl.message"></p>
 
-
-        <input ng-model="$ctrl.password1" ng-hide="$ctrl.password1Masked" type="text">
-        <input ng-model="$ctrl.password1" ng-show="$ctrl.password1Masked" type="password">
-        <mf-button ng-click="$ctrl.togglePassword1Masked()" ng-if="$ctrl.maskPasswords">
-            {{ 'Button_Show' | translate }}
-        </mf-button>
-        <span>Strength: Very Strong</span>
-
-        <input ng-model="$ctrl.password2" ng-hide="$ctrl.password2Masked" type="text">
-        <input ng-model="$ctrl.password2" ng-show="$ctrl.password2Masked" type="password">
-        <mf-button ng-click="$ctrl.togglePassword2Masked()" ng-if="$ctrl.maskPasswords">
-            {{ 'Button_Show' | translate }}
-        </mf-button>
-        <!--Password list
-        First pw   strength
-        Second pw  checkmark-->
+        <table>
+        <tbody>
+            <tr>
+                <td>
+                    <input ng-model="$ctrl.password1" ng-hide="$ctrl.password1Masked" type="text">
+                    <input ng-model="$ctrl.password1" ng-show="$ctrl.password1Masked" type="password">
+                    <mf-icon-button
+                        icon="password_thin"
+                        id="password-icon1"
+                        ng-attr-title="{{ 'Button_Show' | translate }}"
+                        ng-click="$ctrl.togglePassword1Masked()"
+                        ng-if="$ctrl.maskPasswords"
+                        ng-show="!!$ctrl.password1"></mf-icon-button>
+                </td>
+                <td>
+                    <div ng-if="$ctrl.showStrengthMeter" ng-show="!!$ctrl.password1">
+                        <div>Strength: <span class="strength-label" ng-bind="$ctrl.strength"></span>
+                        </div>
+                        <div style="height:10px; width:80px; background-color:red; border:1px solid black;"></div>
+                    </div>
+                </td>
+            </tr>
+            <tr>
+                <td>
+                    <input ng-model="$ctrl.password2" ng-hide="$ctrl.password2Masked" type="text">
+                    <input ng-model="$ctrl.password2" ng-show="$ctrl.password2Masked" type="password">
+                    <mf-icon-button
+                        icon="password_thin"
+                        id="password-icon2"
+                        ng-attr-title="{{ 'Button_Show' | translate }}"
+                        ng-click="$ctrl.togglePassword2Masked()"
+                        ng-if="$ctrl.maskPasswords"
+                        ng-show="!!$ctrl.password2"></mf-icon-button>
+                </td>
+                <td>
+                    <span>check</span>
+                    <span>X</span>
+                </td>
+            </tr>
+        </tbody>
+        </table>
     </div>
     <div class="ias-actions">
         <mf-button ng-click="$ctrl.chooseTypedPassword()">{{ 'Button_ChangePassword' | translate }}</mf-button>

+ 53 - 0
client/src/changepassword/type-change-password.component.scss

@@ -0,0 +1,53 @@
+/*!
+ * Password Management Servlets (PWM)
+ * http://www.pwm-project.org
+ *
+ * Copyright (c) 2006-2009 Novell, Inc.
+ * Copyright (c) 2009-2017 The PWM Project
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+ias-dialog {
+  &.type-change-password-dialog {
+    .ias-dialog-body {
+      table {
+        input, mf-icon-button {
+          vertical-align: middle
+        }
+
+        input {
+          margin: 7px;
+        }
+
+        mf-icon-button {
+          display: inline-block;
+
+          mf-icon {
+            font-size: 20px;
+          }
+        }
+
+        td {
+          min-width: 250px;
+        }
+
+        .strength-label {
+          font-weight: bold;
+        }
+      }
+    }
+  }
+}

+ 5 - 1
client/src/changepassword/type-change-password.controller.ts

@@ -27,6 +27,8 @@ import {IHelpDeskConfigService} from '../services/helpdesk-config.service';
 import DialogService from '../ux/ias-dialog.service';
 import {IChangePasswordSuccess} from './success-change-password.controller';
 
+require('changepassword/type-change-password.component.scss');
+
 export default class TypeChangePasswordController {
     chosenPassword: string;
     maskPasswords: boolean;
@@ -36,7 +38,8 @@ export default class TypeChangePasswordController {
     password1Masked: boolean;
     password2Masked: boolean;
     passwordSuggestions: string[];
-    // this.HelpDeskService.showStrengthMeter;
+    showStrengthMeter: boolean;
+    strength: string = 'Very Strong';
 
     static $inject = [
         '$q',
@@ -56,6 +59,7 @@ export default class TypeChangePasswordController {
                 private translateFilter: (id: string) => string) {
         this.passwordSuggestions = Array(20).fill('');
         this.message = translateFilter('Display_PasswordPrompt');
+        this.showStrengthMeter = HelpDeskService.showStrengthMeter;
 
         this.configService.maskPasswordsEnabled()
             .then((maskPasswords: boolean) => {

+ 1 - 2
client/src/helpdesk/helpdesk-detail.component.ts

@@ -25,11 +25,10 @@ import {Component} from '../component';
 import {IButtonInfo, IHelpDeskService, ISuccessResponse} from '../services/helpdesk.service';
 import {IScope, ui} from '@types/angular';
 import {IQService, noop} from 'angular';
-import {IActionButtons, IHelpDeskConfigService, PASSWORD_UI_MODES} from '../services/helpdesk-config.service';
+import {IHelpDeskConfigService, PASSWORD_UI_MODES} from '../services/helpdesk-config.service';
 import DialogService from '../ux/ias-dialog.service';
 import {IPeopleService} from '../services/people.service';
 import {IPerson} from '../models/person.model';
-import IasDialogComponent from '../ux/ias-dialog.component';
 import {IChangePasswordSuccess} from '../changepassword/success-change-password.controller';
 
 let autogenChangePasswordTemplateUrl = require('changepassword/autogen-change-password.component.html');

+ 1 - 0
client/src/i18n/translations_en.json

@@ -28,6 +28,7 @@
   "Display_SearchResultsExceeded": "Search results exceeded maximum search size",
   "Display_SearchResultsNone": "No results",
   "Display_SetRandomPasswordPrompt": "Set a new random password for this user?",
+  "Display_StrengthMeter": "Password Strength",
   "Display_TokenDestination": "Token Destination",
   "Field_DateTime": "Date/Time",
   "Field_Display": "Display",

+ 1 - 1
client/src/services/helpdesk-config.service.dev.ts

@@ -53,7 +53,7 @@ export default class HelpDeskConfigService extends ConfigBaseService implements
     }
 
     getPasswordUiMode(): IPromise<string> {
-        return this.$q.resolve(PASSWORD_UI_MODES.TYPE);
+        return this.$q.resolve(PASSWORD_UI_MODES.BOTH);
     }
 
     getTokenSendMethod(): IPromise<string> {

+ 1 - 1
client/src/services/helpdesk.service.dev.ts

@@ -484,6 +484,6 @@ export default class HelpDeskService implements IHelpDeskService {
     }
 
     get showStrengthMeter(): boolean {
-        return false;
+        return true;
     }
 }