diff options
author | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-03-25 21:25:54 -0400 |
---|---|---|
committer | Frédéric Guillot <fguillot@users.noreply.github.com> | 2014-03-25 21:25:54 -0400 |
commit | 34711f584651205cb6738b49df285d93a35393b5 (patch) | |
tree | f07a05279d36140b3b71313e0ed50e081709558b /core | |
parent | 0d55f5aa35d21b79c5d79f7214c4c9e05b1d2684 (diff) |
Ask the current password before changing a user password
Diffstat (limited to 'core')
-rw-r--r-- | core/helper.php | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/core/helper.php b/core/helper.php index 0eeec4cd..da90bad6 100644 --- a/core/helper.php +++ b/core/helper.php @@ -18,6 +18,11 @@ function is_admin() return $_SESSION['user']['is_admin'] == 1; } +function get_username() +{ + return $_SESSION['user']['username']; +} + function markdown($text) { require_once __DIR__.'/../vendor/Michelf/MarkdownExtra.inc.php'; @@ -206,6 +211,7 @@ function form_textarea($name, $values = array(), array $errors = array(), array $html .= implode(' ', $attributes).'>'; $html .= isset($values->$name) ? escape($values->$name) : isset($values[$name]) ? $values[$name] : ''; $html .= '</textarea>'; + if (in_array('required', $attributes)) $html .= '<span class="form-required">*</span>'; $html .= error_list($errors, $name); return $html; @@ -217,6 +223,7 @@ function form_input($type, $name, $values = array(), array $errors = array(), ar $html = '<input type="'.$type.'" name="'.$name.'" id="form-'.$name.'" '.form_value($values, $name).' class="'.$class.'" '; $html .= implode(' ', $attributes).'/>'; + if (in_array('required', $attributes)) $html .= '<span class="form-required">*</span>'; $html .= error_list($errors, $name); return $html; |