From 3689b5636b2eb76dc1f920a1b0129e71be1a62b7 Mon Sep 17 00:00:00 2001 From: Jason Woofenden Date: Sun, 16 Nov 2008 02:09:35 -0500 Subject: [PATCH] added Switch Login page and link --- index.html | 2 +- index.php | 1 + people.php | 2 +- su.html | 19 +++++++++++++++++++ su.php | 37 +++++++++++++++++++++++++++++++++++++ 5 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 su.html create mode 100644 su.php diff --git a/index.html b/index.html index d623af8..0e16cec 100644 --- a/index.html +++ b/index.html @@ -13,7 +13,7 @@

This page is for giving Jason Woofenden work and figuring out the details of the associated tasks, costs and priorities.

-

Add a taskReport a problem

+

Add a taskReport a problemSwitch login

Tasks needing your attention:

diff --git a/index.php b/index.php index 91c24ee..b156cb7 100644 --- a/index.php +++ b/index.php @@ -51,6 +51,7 @@ function _index_main() { } if(logged_in_as_contractor()) { + tem_show('su_link'); tem_show('needs_attention_header'); task_summary('needs_approval', 'where state=%i order by id desc', TASK_WORKING); task_summary('needs_fixing', 'where (state=%i || state=%i) || (client_id=1 && state<%i) order by id desc', TASK_NEEDS_QUOTE, TASK_BUG, TASK_QUEUED); diff --git a/people.php b/people.php index 1690a4b..9a0f3a4 100644 --- a/people.php +++ b/people.php @@ -70,7 +70,7 @@ function people_display_listing($where = 'order by username limit 100') { } function people_main() { - if(logged_in() != 1) { # FIXME get more sophisticated than first person in database is admin + if(!logged_in_as_contractor()) { $GLOBALS['url'] = this_url(); message('You must be logged in as an administrator to access that function'); return 'login'; diff --git a/su.html b/su.html new file mode 100644 index 0000000..5e46932 --- /dev/null +++ b/su.html @@ -0,0 +1,19 @@ + + + + + people entry + + + + + +

SU to be logged in as someone else

+ + +

log in as ~client_name~

+ + + + + diff --git a/su.php b/su.php new file mode 100644 index 0000000..2c3a3d2 --- /dev/null +++ b/su.php @@ -0,0 +1,37 @@ + -- 1.7.10.4