Skip to content

Commit

Permalink
Group new password inputs
Browse files Browse the repository at this point in the history
Use default size for buttons
Add CSS rules, fix HTML semantics
  • Loading branch information
felixheidecke authored and DeepDiver1975 committed Jul 4, 2018
1 parent 2d4057e commit ef0ce49
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 82 deletions.
21 changes: 15 additions & 6 deletions css/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,23 @@
*/

#password-policy input[type='number'] {
width: 30px;
width: 30px;
}

#password_policy .indented {
margin-left: 24px;
margin-left: 24px;
}

#new_password.password-mismatch,
#confirm_password.password-mismatch {
color: red;
}
#password_policy #confirm_password.password-mismatch,
#password_policy #new_password.password-mismatch {
color: red;
}

#password_policy #submit {
margin: 5px;
width : calc(100% - 10px);
}

#password_policy .margin-add-top {
margin-top: 24px;
}
126 changes: 76 additions & 50 deletions templates/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,68 +28,94 @@

<div class="section" id="password-policy">
<form id="password_policy" method="post">
<h2><?php p($l->t('Password and public link expiration policies'));?></h2>

<br>
<p><?php p($l->t('Minimum password requirements for user accounts and public links:'));?></p>

<h2>
<?php p($l->t('Password and public link expiration policies'));?>
</h2>
<p>
<?php p($l->t('Minimum password requirements for user accounts and public links:'));?>
</p>
<ul>
<li><label><input type="checkbox" name="spv_password_history_checked"
<?php if ($_['spv_password_history_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_password_history_value" min="0" max="255" value="<?php p($_['spv_password_history_value']) ?>"> <?php p($l->t('different than last passwords'));?></label></li>
<li><label><input type="checkbox" name="spv_min_chars_checked"
<?php if ($_['spv_min_chars_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_min_chars_value" min="0" max="255" value="<?php p($_['spv_min_chars_value']) ?>"> <?php p($l->t('minimum characters'));?></label></li>
<li><label><input type="checkbox" name="spv_lowercase_checked"
<?php if ($_['spv_lowercase_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_lowercase_value" min="0" max="255" value="<?php p($_['spv_lowercase_value']) ?>"> <?php p($l->t('lowercase letters'));?></label></li>
<li><label><input type="checkbox" name="spv_uppercase_checked"
<?php if ($_['spv_uppercase_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_uppercase_value" min="0" max="255" value="<?php p($_['spv_uppercase_value']) ?>"> <?php p($l->t('uppercase letters'));?></label></li>
<li><label><input type="checkbox" name="spv_numbers_checked"
<?php if ($_['spv_numbers_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_numbers_value" min="0" max="255" value="<?php p($_['spv_numbers_value']) ?>"> <?php p($l->t('numbers'));?></label></li>
<li><label><input type="checkbox" name="spv_special_chars_checked"
<?php if ($_['spv_special_chars_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_special_chars_value" min="0" max="255" value="<?php p($_['spv_special_chars_value']) ?>"> <?php p($l->t('special characters'));?></label></li>

<li class="indented"><label><input type="checkbox" name="spv_def_special_chars_checked"
<?php if ($_['spv_def_special_chars_checked']): ?> checked="checked"<?php endif; ?>> <?php p($l->t('Define special characters:'));?></label>
<input type="text" name="spv_def_special_chars_value" value="<?php p($_['spv_def_special_chars_value']) ?>"></li>
<li>
<label>
<input type="checkbox" name="spv_password_history_checked" <?php if ($_['spv_password_history_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_password_history_value" min="0" max="255" value="<?php p($_['spv_password_history_value']) ?>"> <?php p($l->t('different than last passwords'));?>
</label>
</li>
<li>
<label>
<input type="checkbox" name="spv_min_chars_checked" <?php if ($_['spv_min_chars_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_min_chars_value" min="0" max="255" value="<?php p($_['spv_min_chars_value']) ?>"> <?php p($l->t('minimum characters'));?>
</label>
</li>
<li>
<label>
<input type="checkbox" name="spv_lowercase_checked" <?php if ($_['spv_lowercase_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_lowercase_value" min="0" max="255" value="<?php p($_['spv_lowercase_value']) ?>"> <?php p($l->t('lowercase letters'));?>
</label>
</li>
<li>
<label>
<input type="checkbox" name="spv_uppercase_checked" <?php if ($_['spv_uppercase_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_uppercase_value" min="0" max="255" value="<?php p($_['spv_uppercase_value']) ?>"> <?php p($l->t('uppercase letters'));?>
</label>
</li>
<li>
<label>
<input type="checkbox" name="spv_numbers_checked" <?php if ($_['spv_numbers_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_numbers_value" min="0" max="255" value="<?php p($_['spv_numbers_value']) ?>"> <?php p($l->t('numbers'));?>
</label>
</li>
<li>
<label>
<input type="checkbox" name="spv_special_chars_checked" <?php if ($_['spv_special_chars_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_special_chars_value" min="0" max="255" value="<?php p($_['spv_special_chars_value']) ?>"> <?php p($l->t('special characters'));?>
</label>
</li>
<li class="indented">
<label>
<input type="checkbox" name="spv_def_special_chars_checked" <?php if ($_['spv_def_special_chars_checked']): ?> checked="checked"<?php endif; ?>> <?php p($l->t('Define special characters:'));?>
</label>
<input type="text" name="spv_def_special_chars_value" value="<?php p($_['spv_def_special_chars_value']) ?>">
</li>
</ul>
<input type="hidden" name="app" value="oca-password-policy" />

<br>
<p><?php p($l->t('User Password policies:'));?></p>

<p class="margin-add-top">
<?php p($l->t('User Password policies:'));?>
</p>
<ul>
<li><label><input type="checkbox" name="spv_user_password_expiration_checked"
<?php if ($_['spv_user_password_expiration_checked']): ?> checked="checked"<?php endif; ?>/>
<li>
<label>
<input type="checkbox" name="spv_user_password_expiration_checked" <?php if ($_['spv_user_password_expiration_checked']): ?> checked="checked"<?php endif; ?>/>
<input type="number" name="spv_user_password_expiration_value" min="0" value="<?php p($_['spv_user_password_expiration_value']) ?>" placeholder="90"/>
<?php p($l->t('days until user password expires'));?></label>
<span><?php p($l->t('days until user password expires'));?></span>
</label>
</li>
<li><label><input type="checkbox" name="spv_user_password_force_change_on_first_login_checked"
<?php if ($_['spv_user_password_force_change_on_first_login_checked']): ?> checked="checked"<?php endif; ?>/>
<?php p($l->t('force change on first login'));?></label>
<li>
<label>
<input type="checkbox" name="spv_user_password_force_change_on_first_login_checked" <?php if ($_['spv_user_password_force_change_on_first_login_checked']): ?> checked="checked"<?php endif; ?>/>
<span><?php p($l->t('force change on first login'));?></span>
</label>
</li>
</ul>
<br>
<p><?php p($l->t('Public link expiration policies:'));?></p>

<p class="margin-add-top">
<?php p($l->t('Public link expiration policies:'));?>
</p>
<ul>
<li><label><input type="checkbox" name="spv_expiration_password_checked"
<?php if ($_['spv_expiration_password_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_expiration_password_value" min="0" max="255" value="<?php p($_['spv_expiration_password_value']) ?>" placeholder="7">
<?php p($l->t('days until link expires if password is set'));?></label>
<li>
<label>
<input type="checkbox" name="spv_expiration_password_checked" <?php if ($_['spv_expiration_password_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_expiration_password_value" min="0" max="255" value="<?php p($_['spv_expiration_password_value']) ?>" placeholder="7">
<span><?php p($l->t('days until link expires if password is set'));?></span>
</label>
</li>
<li><label><input type="checkbox" name="spv_expiration_nopassword_checked"
<?php if ($_['spv_expiration_nopassword_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_expiration_nopassword_value" min="0" max="255" value="<?php p($_['spv_expiration_nopassword_value']) ?>" placeholder="7">
<?php p($l->t('days until link expires if password is not set'));?></label>
<li>
<label>
<input type="checkbox" name="spv_expiration_nopassword_checked" <?php if ($_['spv_expiration_nopassword_checked']): ?> checked="checked"<?php endif; ?>>
<input type="number" name="spv_expiration_nopassword_value" min="0" max="255" value="<?php p($_['spv_expiration_nopassword_value']) ?>" placeholder="7">
<span><?php p($l->t('days until link expires if password is not set'));?></span>
</label>
</li>
</ul>
<br>

<input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" id="requesttoken">
<input type="submit" value="<?php p($l->t('Save'));?>" />
<span class="msg"></span>
Expand Down
46 changes: 20 additions & 26 deletions templates/password.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,31 +32,25 @@

<form id="password_policy" method="post">
<fieldset>
<h1 class="warning"><?php p($l->t('Password changed required'));?></h1>

<?php if (isset($_['error'])) { ?><div id="error" class="warning"><?php p($_['error']) ?></div> <?php } ?>

<p>

<input type="password" id="current_password" name="current_password"
value="" autofocus placeholder="<?php p($l->t('current password'));?>"
/>
<label for="current_password" class="infield"><?php p($l->t('current password'));?></label>

<input type="password" id="new_password" name="new_password"
value="" placeholder="<?php p($l->t('new password'));?>"
/>
<label for="new_password" class="infield"><?php p($l->t('new password'));?></label>

<input type="password" id="confirm_password" name="confirm_password"
value="" placeholder="<?php p($l->t('confirm new password'));?>"
/>
<label for="confirm_password" class="infield"><?php p($l->t('confirm new password'));?></label>

<input type="hidden" name="redirect_url" value="<?php p($_['redirect_url']) ?>" />
<input type="hidden" name="app" value="oca-password-policy" />
<input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" id="requesttoken">
<input type="submit" id="submit" value="<?php p($l->t('Save'));?>" title="<?php p($l->t('Save'));?>"/>
</p>
<h1 class="warning">
<?php p($l->t('Password changed required'));?>
</h1>
<?php if (isset($_['error'])) { ?><div id="error" class="warning"><?php p($_['error']) ?></div> <?php } ?>
<input type="hidden" name="redirect_url" value="<?php p($_['redirect_url']) ?>" />
<input type="hidden" name="app" value="oca-password-policy" />
<input type="hidden" name="requesttoken" value="<?php p($_['requesttoken']) ?>" id="requesttoken">

<label for="current_password" class="infield"><?php p($l->t('current password'));?></label>
<input type="password" id="current_password" name="current_password" value="" autofocus placeholder="<?php p($l->t('current password'));?>"/>

<div class="grouptop">
<label for="new_password" class="infield"><?php p($l->t('new password'));?></label>
<input type="password" id="new_password" name="new_password" value="" placeholder="<?php p($l->t('new password'));?>"/>
</div>
<div class="groupbottom">
<label for="confirm_password" class="infield"><?php p($l->t('confirm new password'));?></label>
<input type="password" id="confirm_password" name="confirm_password" value="" placeholder="<?php p($l->t('confirm new password'));?>"/>
</div>
<button id="submit" type="submit"><?php p($l->t('Save'));?></button>
</fieldset>
</form>

0 comments on commit ef0ce49

Please sign in to comment.