. require_once('code/wfpl/format.php'); function su_main() { if(!ever_was_contractor()) { $GLOBALS['url'] = this_url(); message('You must be logged in as an administrator to access that function'); return 'login'; } $ret = _su_main(); if($ret) { return $ret; } } function _su_main() { $client_id = format_int($_REQUEST['as']); if($client_id) { session_set('auth_username', $client_id); message('Switched Login'); return './'; } $rows = db_get_rows('people', 'id,name,username', 'order by name'); if($rows) foreach($rows as $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'); } } ?>