Login: Add settings to style Reset Password (and related) text links, add (disabled) settings to display domain name field.
Theme: Add settings to control login box border size, color, radius and padding.  Explicitly defined placeholder text color/opacity (where possible).
This commit is contained in:
reliberate
2016-04-07 19:35:39 -06:00
parent 64ef4b1ab8
commit a887eab36a
4 changed files with 185 additions and 90 deletions

View File

@@ -79,7 +79,7 @@
//generate reset link
$key = encrypt($_SESSION['login']['password_reset_key']['text'], $result['username'].'|'.$_SESSION['domain_uuid'].'|'.$result['password']);
$reset_link = "https://".$_SESSION['domain_name'].PROJECT_PATH."/login.php?action=define&key=".urlencode($key);
$eml_body = "<a href='".$reset_link."'>".$reset_link."</a>";
$eml_body = "<a href='".$reset_link."' class='login_link'>".$reset_link."</a>";
//send reset link
if (!send_email($email, $text['label-reset_link'], $eml_body)) {
$_SESSION["message_mood"] = 'negative';
@@ -192,7 +192,8 @@
//show the content
echo "<script>";
echo " var speed = 350;";
echo " function toggle_password_reset(hide_id, show_id, focus_id = '') {";
echo " function toggle_password_reset(hide_id, show_id, focus_id) {";
echo " if (focus_id == undefined) { focus_id = ''; }";
echo " $('#'+hide_id).slideToggle(speed, function() {";
echo " $('#'+show_id).slideToggle(speed, function() {";
echo " if (focus_id != '') {";
@@ -212,23 +213,27 @@
echo "<input type='hidden' name='path' value='".$path."'>\n";
echo "<input type='text' class='formfld' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='username' id='username' placeholder=\"".$text['label-username']."\"><br />\n";
echo "<input type='password' class='formfld' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='password' placeholder=\"".$text['label-password']."\"><br />\n";
if ($_SESSION['login']['domain_name.visible']['boolean'] == "true") {
if ($_SESSION['login']['domain_name_visible']['boolean'] == "true") {
if (count($_SESSION['login']['domain_name']) > 0) {
echo "<select style='width: 200px; margin-bottom: 8px;' class='formfld' name='domain_name'>\n";
echo " <option value=''></option>\n";
echo "<select name='domain_name' class='formfld' style='color: #999999; width: 200px; text-align: center; text-align-last: center; margin-bottom: 8px;' onclick=\"this.style.color='#000000';\" onchange=\"this.style.color='#000000';\">\n";
echo " <option value='' disabled selected hidden>".$text['label-domain']."</option>\n";
sort($_SESSION['login']['domain_name']);
foreach ($_SESSION['login']['domain_name'] as &$row) {
echo " <option value='$row'>$row</option>\n";
}
echo "</select>\n";
echo "<br />";
echo "</select><br />\n";
}
else {
echo "<input type='text' class='formfld' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='domain_name' placeholder=\"".$text['label-domain']."\"><br />\n";
echo "<input type='text' name='domain_name' class='formfld' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' placeholder=\"".$text['label-domain']."\"><br />\n";
}
}
echo "<input type='submit' class='btn' style='width: 100px; margin-top: 15px;' value='".$text['button-login']."'>\n";
if ($_SESSION['login']['password_reset_key']['text'] != '' && function_exists('mcrypt_encrypt')) {
echo "<br><br><a class='login_box_link' onclick=\"toggle_password_reset('login_form','request_form','email');\">".$text['label-reset_password']."</a>";
if (
function_exists('mcrypt_encrypt') &&
$_SESSION['login']['password_reset_key']['text'] != '' &&
$_SESSION['email']['smtp_host']['var'] != ''
) {
echo "<br><br><a class='login_link' onclick=\"toggle_password_reset('login_form','request_form','email');\">".$text['label-reset_password']."</a>";
}
echo "</form>";
echo "<script>document.getElementById('username').focus();</script>";
@@ -239,7 +244,7 @@
echo "<input type='hidden' name='action' value='request'>\n";
echo "<input type='text' class='formfld' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='email' id='email' placeholder=\"".$text['label-email_address']."\"><br />\n";
echo "<input type='submit' class='btn' style='width: 100px; margin-top: 15px;' value='".$text['button-reset']."'>\n";
echo "<br><br><a class='login_box_link' onclick=\"toggle_password_reset('request_form','login_form','username');\">".$text['label-cancel']."</a>";
echo "<br><br><a class='login_link' onclick=\"toggle_password_reset('request_form','login_form','username');\">".$text['label-cancel']."</a>";
echo "</form>";
echo "</div>";
@@ -254,7 +259,7 @@
echo "<input type='password' class='formfld' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='password_new' autocomplete='off' placeholder=\"".$text['label-new_password']."\"><br />\n";
echo "<input type='password' class='formfld' style='text-align: center; min-width: 200px; width: 200px; margin-bottom: 8px;' name='password_repeat' autocomplete='off' placeholder=\"".$text['label-repeat_password']."\"><br />\n";
echo "<input type='submit' class='btn' style='width: 100px; margin-top: 15px;' value='".$text['button-save']."'>\n";
echo "<br><br><a class='login_box_link' onclick=\"document.location.href='login.php';\">".$text['label-cancel']."</a>";
echo "<br><br><a class='login_link' onclick=\"document.location.href='login.php';\">".$text['label-cancel']."</a>";
echo "</form>";
echo "<script>document.getElementById('username').focus();</script>";
echo "</span>";