canEdit()) { if (isset($_POST["user_$name"])) { $user->setConf($name, $_POST["user_$name"]); } } $current_setting = $user->getConf($name); global $mm; $t = $mm->template(); $t->inputText("user_$name", $label, $hint, $current_setting, !$user->canEdit()); } function inputArray($user, $name, $arr) { global $mm; $t = $mm->template(); if (isset($_POST[$name]) && is_array($_POST[$name])) { $user->setConfArray($name, $_POST[$name]); } $defaults = $user->getConfArray($name); foreach ($arr as $value => $label) { $t->inputBool($name, $value, $label, in_array($value, $defaults), !$user->canEdit()); } } function inputNewPassword($user, $name, $label) { @$password1 = $_POST[$name ]; @$password2 = $_POST[$name.'_verify']; // Check the verify box, not main box, so that we don't get tripped by // browsers annoyingly autocompleting the password. $is_set = ($password2 != ''); global $mm; $t = $mm->template(); if ($is_set) { $matches = ( $password1 == $password2 ); if ($matches) { $user->setPassword($password1); $t->inputP('Password successfully updated.'); } else { $t->inputP("Passwords don't match.", true); } } $t->inputNewPassword($name, $label); }