-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.pl
More file actions
executable file
·44 lines (37 loc) · 893 Bytes
/
users.pl
File metadata and controls
executable file
·44 lines (37 loc) · 893 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/perl
=begin nd
Script: users.pl
Description:
Renders the user administration page, and handles all
ajax requests to add and remove pms-admin users (not chat users)
=cut
use strict;
use warnings;
use CGI;
use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
use CGI::Session ( '-ip_match' );
use HTML::Template;
use Pms::Session;
use Pms::MainView;
use Pms::UserView;
my $session = Pms::Session::get();
my $q = CGI->new();
if(!defined $session)
{
my $url = 'login.pl';
if(defined $Pms::Session::lastError){
$url .= "?error=$Pms::Session::lastError";
}
print $q->header(-location=>$url);
}
else
{
my $mod = Pms::UserView->new();
if(!defined $q->url_param('action')){
my $baseView = Pms::MainView->new();
$baseView->render($mod,$q,$session);
}else{
print "Content-type: application/json\n\n";
print $mod->dataRequest($q);
}
}