summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2016-03-26 17:18:08 -0400
committerMalf Furious <m@lfurio.us>2016-03-27 20:16:32 -0400
commit99ec6644fc93ee4d6bd8569148de6a03d64f69cb (patch)
tree68ac1f1e206d70887a2d445c20b0bb81746c9c71
parent333351cbd18d12520fb0eae44e9805cb3b10e038 (diff)
downloadscrott-99ec6644fc93ee4d6bd8569148de6a03d64f69cb.tar.gz
scrott-99ec6644fc93ee4d6bd8569148de6a03d64f69cb.zip
Add collapsable panel for editing each user's settings to admin setting tab
Also, added relevant initialization code to common model
-rw-r--r--app/model/common.mod.php5
-rw-r--r--app/view/common/setting.modal.view.php62
2 files changed, 67 insertions, 0 deletions
diff --git a/app/model/common.mod.php b/app/model/common.mod.php
index 8d1ea7e..1398598 100644
--- a/app/model/common.mod.php
+++ b/app/model/common.mod.php
@@ -3,6 +3,7 @@
require_once "model/master.mod.php";
require_once "class/form.class.php";
require_once "class/setting.class.php";
+require_once "class/user.class.php";
class CommonModel extends MasterModel
{
@@ -24,6 +25,10 @@ class CommonModel extends MasterModel
if (Setting::allowPublicSignup())
$this->common_settingAdminAllowPublicSignupChecked = "checked";
+
+ /* Admin all-users settings tab */
+ $userTbl = new User();
+ $this->common_settingAllUsers = $userTbl->getAllUsers_orderByAdminByName();
}
/*
diff --git a/app/view/common/setting.modal.view.php b/app/view/common/setting.modal.view.php
index 93a273a..11adc69 100644
--- a/app/view/common/setting.modal.view.php
+++ b/app/view/common/setting.modal.view.php
@@ -181,6 +181,68 @@
</div>
</div>
</div>
+
+ <?php foreach ($mod->common_settingAllUsers as $user) { ?>
+ <div class="panel panel-default">
+ <div class="panel-heading">
+ <h4 class="panel-title">
+ <a href="#common-setting-allusers-<?=$user->guid?>-collapse" data-toggle="collapse" data-parent="#common-setting-allusers" aria-expanded="false">
+ <span class="<?=$user->getGlyphicon()?>"></span> <?=$user->name?> <?=($user->alias != "" ? "(" . $user->alias . ")" : "")?>
+ </a>
+ </h4>
+ </div>
+
+ <div class="panel-collapse collapse" id="common-setting-allusers-<?=$user->guid?>-collapse">
+ <div class="panel-body">
+ <form method="post" action="<?=$mod->ap()?>">
+ <input type="hidden" name="input[action]" value="common-setting-allusers-edituser" />
+ <input type="hidden" name="input[guid]" value="<?=$user->guid?>" />
+
+ <div class="form-group">
+ <label>Username</label>
+ <input type="text" class="form-control" value="<?=$user->name?>" disabled />
+ </div>
+
+ <div class="checkbox">
+ <label data-toggle="collapse" data-target="#input<?=$user->guid?>PasswdCollapse">
+ <input type="checkbox" name="input[setPasswd]" value="1" /> Change Password
+ </label>
+ </div>
+
+ <div class="collapse" id="input<?=$user->guid?>PasswdCollapse">
+ <div class="form-group">
+ <label>New Password</label>
+ <input type="password" name="input[newPasswd]" class="form-control" />
+ </div>
+
+ <div class="form-group">
+ <label>Confirm Password</label>
+ <input type="password" name="input[confPasswd]" class="form-control" />
+ </div>
+ </div>
+
+ <div class="checkbox">
+ <label>
+ <input type="checkbox" name="input[admin]" value="1" <?=($user->admin ? "checked" : "")?>> Administrator
+ </label>
+ </div>
+
+ <div class="form-group">
+ <label>Alias</label>
+ <input type="text" name="input[alias]" class="form-control" maxlength="50" value="<?=$user->alias?>" />
+ </div>
+
+ <div class="form-group">
+ <label>Email</label>
+ <input type="text" name="input[email]" class="form-control" maxlength="50" value="<?=$user->email?>" />
+ </div>
+
+ <button type="submit" class="btn btn-success pull-right">Save</button>
+ </form>
+ </div>
+ </div>
+ </div>
+ <?php } ?>
</div>
</div>
<?php } ?>