summaryrefslogtreecommitdiff
path: root/0.2.3/online.pl
blob: 2e8bf8d0edaaeadfb8f55b7286db03f9ff172859 (plain)
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
45
46
47
48
49
50
51
52
#!/usr/bin/perl -w

use CGI;		# CGI-Modul laden
$q = new CGI;

require config;		# config.pm in Dokument laden

print
 $q->header();		# HTTP-Header erzeugen

&secure_checkip($alias);
&start_html("Online","online");
&online($alias,$room);
&list_dir("data/online/rooms/".$room);
print
 $q->div( "$room:" ),
 "<font size=1 color=ffffef face=arial>";
  foreach $online (@dir) {
  if (-f "data/online/rooms/$room/$online") {
   print
      $q->a( { -href=>"main2.pl?var=alias_html&alias=$alias&tmp=$online",
               -target=>"$online" }, "$online"), $q->br;
  }
 }
print
 "</font>",
 $q->end_html;

sub online { # Benutzer in die Onlineliste hinzufügen bzw. erneuern
 my ($alias,$room) = @_;
 &write_file_new("data/online/users/$alias");
  print DATEI time;
 close DATEI;
 if (-e "data/online/rooms/$room") {
 } else {
  mkdir "data/online/rooms/$room", 0777;
 }
 &write_file_new("data/online/rooms/$room/$alias");
  print DATEI time;
 close DATEI;
 &read_file("data/online/prove");	# Räume und Chatter auf Existenz überprüfen
  my $provetime = <DATEI>;
 close DATEI;
 if ($provetime < (time - 30)) {
  &write_file_new("data/online/prove");
   print DATEI time;
  close DATEI;
  &rm_alias("data/online/users");
  &rm_rooms;
 }
}