X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=su.php;h=6f26627427ccf934b9aa1edc545f30f63303376d;hb=98110d79b6536290baffd1468f22cb8b046902cd;hp=0c45cf1d43e42c26e47fe8cb5fc11544c4595737;hpb=b2f3faa3e8e647967e17aac9e9be7ffbad8f9716;p=contractor-progress.git diff --git a/su.php b/su.php index 0c45cf1..6f26627 100644 --- a/su.php +++ b/su.php @@ -18,7 +18,8 @@ require_once('code/wfpl/format.php'); function su_main() { - if(!logged_in_as_contractor()) { + # If you log in to the admin account, you can su to a customer account and still have access to su back to admin. That's why we're checking for admin not "contractor" here. + if(!logged_in_as_admin()) { $GLOBALS['url'] = this_url(); message('You must be logged in as an administrator to access that function'); return 'login'; @@ -39,12 +40,13 @@ function _su_main() { return './'; } - $rows = db_get_rows('people', 'id,name'); + $rows = db_get_rows('people', 'id,name,username', 'order by name'); if($rows) foreach($rows as $row) { - list($id, $name) = $row; + list($id, $name, $username) = $row; tem_set('client_id', $id); tem_set('client_name', $name); + tem_set('client_username', $username); tem_show('su_row'); } }