From ad309f1036d9d85899c3d3199070d92dd96b1710 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 30 Sep 2016 15:42:14 -0700 Subject: provide ability for admin to change account password --- Zotlabs/Module/Admin/Account_edit.php | 64 +++++++++++++++++++++++++++++++++++ view/tpl/admin_account_edit.tpl | 14 ++++++++ view/tpl/admin_accounts.tpl | 4 +-- 3 files changed, 80 insertions(+), 2 deletions(-) create mode 100644 Zotlabs/Module/Admin/Account_edit.php create mode 100644 view/tpl/admin_account_edit.tpl diff --git a/Zotlabs/Module/Admin/Account_edit.php b/Zotlabs/Module/Admin/Account_edit.php new file mode 100644 index 000000000..ddb7e19f4 --- /dev/null +++ b/Zotlabs/Module/Admin/Account_edit.php @@ -0,0 +1,64 @@ + 2) + $account_id = argv(2); + + $x = q("select * from account where account_id = %d limit 1", + intval($account_id) + ); + + if(! $x) { + notice ( t('Account not found.') . EOL); + return ''; + } + + $a = replace_macros(get_markup_template('admin_account_edit.tpl'), [ + '$account' => $x[0], + '$title' => t('Account Edit'), + '$pass1' => [ 'pass1', t('New Password'), ' ','' ], + '$pass2' => [ 'pass2', t('New Password again'), ' ','' ], + '$submit' => t('Submit'), + ] + ); + + return $a; + + + } + + +} \ No newline at end of file diff --git a/view/tpl/admin_account_edit.tpl b/view/tpl/admin_account_edit.tpl new file mode 100644 index 000000000..5e8cb5f47 --- /dev/null +++ b/view/tpl/admin_account_edit.tpl @@ -0,0 +1,14 @@ +

{{$title}}

+ +

{{$account.account_email}}

+ + +
+ + +{{include file="field_password.tpl" field=$pass1}} +{{include file="field_password.tpl" field=$pass2}} + + + +
diff --git a/view/tpl/admin_accounts.tpl b/view/tpl/admin_accounts.tpl index 53f5f1aba..c2a50e3ff 100755 --- a/view/tpl/admin_accounts.tpl +++ b/view/tpl/admin_accounts.tpl @@ -62,9 +62,9 @@ {{$u.account_id}} {{if $u.blocked}} - {{$u.account_email}} + {{$u.account_email}} {{else}} - {{$u.account_email}} + {{$u.account_email}} {{/if}} {{$u.channels}} {{$u.account_created}} -- cgit v1.2.3