summaryrefslogtreecommitdiff
path: root/src/views/pages/users/include.php
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2011-09-04 21:13:47 -0400
committerLuke Shumaker <LukeShu@sbcglobal.net>2011-09-04 21:13:47 -0400
commitad4a7ff9159c2c64cea98d7189f46fa7d6174fc2 (patch)
tree508f971f1dbc6c6f01207426c675542b55e0333e /src/views/pages/users/include.php
parentf3b3ea69fb46e45bf3598aa7a6bcf62aa80e4703 (diff)
Screw it, I'm tired of trying to break this into individual commits
Diffstat (limited to 'src/views/pages/users/include.php')
-rw-r--r--src/views/pages/users/include.php60
1 files changed, 0 insertions, 60 deletions
diff --git a/src/views/pages/users/include.php b/src/views/pages/users/include.php
deleted file mode 100644
index 6e8c90b..0000000
--- a/src/views/pages/users/include.php
+++ /dev/null
@@ -1,60 +0,0 @@
-<?php global $mm;
-
-require_once('User.class.php');
-
-/**
- * This will take care of possibly updating and displaying a value in the
- * 'users' table.
- */
-function inputText($user, $name, $label, $hint='') {
- if ($user->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);
-}