3 # Copyright (C) 2008 Jason Woofenden
5 # This program is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU Affero General Public License as published by
7 # the Free Software Foundation, either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU Affero General Public License for more details.
15 # You should have received a copy of the GNU Affero General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18 require_once('code/wfpl/format.php');
21 if(!ever_was_contractor()) {
22 $GLOBALS['url'] = this_url();
23 message('You must be logged in as an administrator to access that function');
31 tem_show('main_body');
35 $client_id = format_int($_REQUEST['as']);
37 session_set('auth_username', $client_id);
38 message('Switched Login');
42 $rows = db_get_rows('people', 'id,name,username', 'order by name');
44 if($rows) foreach($rows as $row) {
45 list($id, $name, $username) = $row;
46 tem_set('client_id', $id);
47 tem_set('client_name', $name);
48 tem_set('client_username', $username);