Parent Directory
|
Revision Log
initial import
1 #!/usr/bin/perl 2 3 4 #################################################################### 5 # Copyright @ 1995-1999 University of Rochester 6 # All Rights Reserved 7 #################################################################### 8 9 use lib '/ww/webwork/development/'; # mainWeBWorKDirectory; 10 use CGI qw(:standard); 11 use Global; 12 use Auth; 13 use strict; 14 15 16 # begin Timing code 17 use Benchmark; 18 my $beginTime = new Benchmark; 19 # end Timing code 20 21 &CGI::ReadParse; 22 my %inputs =%main::in; 23 24 # get information from CGI inputs (see also below for additional information) 25 26 my $Course = $inputs{'course'}; 27 my $User = $inputs{'user'}; 28 my $Session_key = $inputs{'key'}; 29 30 31 # verify that information has been received 32 unless($Course && $User && $Session_key) { 33 &wwerror("$0","The script did not receive the proper input data.","",""); 34 } 35 36 37 # establish environment for this script 38 39 &Global::getCourseEnvironment($inputs{'course'}); 40 41 my $cgiURL = getWebworkCgiURL; 42 my $databaseDirectory = getCourseDatabaseDirectory; 43 my $scriptDirectory = getWebworkScriptDirectory; 44 45 require "${scriptDirectory}$Global::DBglue_pl"; 46 require "${scriptDirectory}$Global::FILE_pl"; 47 require "${scriptDirectory}$Global::HTMLglue_pl"; 48 require "${scriptDirectory}$Global::SCRtools_pl"; 49 50 # log access 51 &Global::log_info('', query_string); 52 53 54 my $permissionsFile = &Global::getCoursePermissionsFile($inputs{'course'}); 55 my $permissions = &get_permissions($inputs{'user'}, $permissionsFile); 56 my $keyFile = &Global::getCourseKeyFile($inputs{'course'}); 57 58 59 #verify session key 60 &verify_key($inputs{'user'}, $inputs{'key'}, $keyFile, $inputs{'course'}); 61 62 # verify permissions are correct 63 if ($permissions != $Global::instructor_permissions ) { 64 print "permissions = $permissions instructor_permissions = $Global::instructor_permissions\n"; 65 print &html_NO_PERMISSION; 66 exit(0); 67 } 68 69 # print HTML text 70 print &htmlTOP("Avtive Users"); 71 72 ## show active users 73 74 my @activeUsers = get_active_users_from_keysDB($keyFile); 75 @activeUsers = sort @activeUsers; 76 77 my $user; 78 79 80 print"<H2>Current users logged into $Course</H2>\n"; 81 82 foreach $user (@activeUsers) { 83 print "$user <BR>"; 84 } 85 86 87 print "<FORM METHOD=POST ACTION=\"${cgiURL}profLogin.pl\"><P>"; 88 print &sessionKeyInputs(\%inputs); 89 print <<"ENDOFHTML"; 90 <INPUT TYPE=SUBMIT VALUE="Return to Prof Page"> 91 </FORM> 92 ENDOFHTML 93 print &htmlBOTTOM("profShowActiveUsers.pl", \%inputs); 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
| aubreyja at gmail dot com | ViewVC Help |
| Powered by ViewVC 1.0.9 |