| 1 | ################################################################################ |
1 | ################################################################################ |
| 2 | # WeBWorK Online Homework Delivery System |
2 | # WeBWorK Online Homework Delivery System |
| 3 | # Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/ |
3 | # Copyright © 2000-2006 The WeBWorK Project, http://openwebwork.sf.net/ |
| 4 | # $CVSHeader: webwork-modperl/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm,v 1.78 2006/01/25 23:13:53 sh002i Exp $ |
4 | # $CVSHeader: webwork2/lib/WeBWorK/ContentGenerator/Instructor/UserList.pm,v 1.79 2006/05/07 21:46:43 gage Exp $ |
| 5 | # |
5 | # |
| 6 | # This program is free software; you can redistribute it and/or modify it under |
6 | # This program is free software; you can redistribute it and/or modify it under |
| 7 | # the terms of either: (a) the GNU General Public License as published by the |
7 | # the terms of either: (a) the GNU General Public License as published by the |
| 8 | # Free Software Foundation; either version 2, or (at your option) any later |
8 | # Free Software Foundation; either version 2, or (at your option) any later |
| 9 | # version, or (b) the "Artistic License" which comes with this package. |
9 | # version, or (b) the "Artistic License" which comes with this package. |
| … | |
… | |
| 67 | use strict; |
67 | use strict; |
| 68 | use warnings; |
68 | use warnings; |
| 69 | use CGI qw(); |
69 | use CGI qw(); |
| 70 | use WeBWorK::File::Classlist; |
70 | use WeBWorK::File::Classlist; |
| 71 | use WeBWorK::Utils qw(readFile readDirectory cryptPassword); |
71 | use WeBWorK::Utils qw(readFile readDirectory cryptPassword); |
| 72 | use WeBWorK::Authen qw(checkKey); |
|
|
| 73 | use Apache::Constants qw(:common REDIRECT DONE); #FIXME -- this should be called higher up in the object tree. |
72 | use Apache::Constants qw(:common REDIRECT DONE); #FIXME -- this should be called higher up in the object tree. |
| 74 | use constant HIDE_USERS_THRESHHOLD => 200; |
73 | use constant HIDE_USERS_THRESHHOLD => 200; |
| 75 | use constant EDIT_FORMS => [qw(cancelEdit saveEdit)]; |
74 | use constant EDIT_FORMS => [qw(cancelEdit saveEdit)]; |
| 76 | use constant PASSWORD_FORMS => [qw(cancelPassword savePassword)]; |
75 | use constant PASSWORD_FORMS => [qw(cancelPassword savePassword)]; |
| 77 | use constant VIEW_FORMS => [qw(filter sort edit password import export add delete)]; |
76 | use constant VIEW_FORMS => [qw(filter sort edit password import export add delete)]; |
| … | |
… | |
| 1543 | if ($editMode or $passwordMode) { |
1542 | if ($editMode or $passwordMode) { |
| 1544 | # column not there |
1543 | # column not there |
| 1545 | } else { |
1544 | } else { |
| 1546 | # check to see if a user is currently logged in |
1545 | # check to see if a user is currently logged in |
| 1547 | my $Key = $db->getKey($User->user_id); |
1546 | my $Key = $db->getKey($User->user_id); |
| 1548 | push @tableCells, ($Key and WeBWorK::Authen::check_session($self, $User->user_id, $Key->key, 1)) ? CGI::b("active") : CGI::em("inactive"); |
1547 | my $is_active = ($Key and time <= $Key->timestamp()+$ce->{sessionKeyTimeout}); # cribbed from check_session |
|
|
1548 | push @tableCells, $is_active ? CGI::b("active") : CGI::em("inactive"); |
| 1549 | } |
1549 | } |
| 1550 | |
1550 | |
| 1551 | # change password (only in password mode) |
1551 | # change password (only in password mode) |
| 1552 | if ($passwordMode) { |
1552 | if ($passwordMode) { |
| 1553 | if ($User->user_id eq $user) { |
1553 | if ($User->user_id eq $user) { |