]> git.p6c8.net - selfforum.git/commitdiff
fixed several bugs in all committed files, but anyway there's a lot to do further...
authorndparker <>
Sun, 18 Mar 2001 23:23:35 +0000 (23:23 +0000)
committerndparker <>
Sun, 18 Mar 2001 23:23:35 +0000 (23:23 +0000)
selfforum-cgi/shared/Conf/Admin.pm
selfforum-cgi/shared/Encode/Posting.pm
selfforum-cgi/shared/Template/Forum.pm
selfforum-cgi/user/config/fo_admin_default.xml
selfforum-cgi/user/fo_posting.pl

index 0a50ee8fe8a11a085fc88e679e260055da31f0a8..0c3a4698700801359d5b8349baadf046a9c05c86 100644 (file)
@@ -60,8 +60,8 @@ sub read_admin_conf ($) {
                       countMessages => $thread_view -> getAttribute ('countMessages'),
                       sortThreads   => $thread_view -> getAttribute ('sortThreads'),
                       sortMessages  => $thread_view -> getAttribute ('sortMessages'),
-                      showThread    => (($how_name eq 'showAll')?undef:
-                                       (($how_name eq 'showNone')?1:
+                      showThread    => (($how_name eq 'ShowAll')?undef:
+                                       (($how_name eq 'ShowNone')?1:
                                        ($show_how -> getFirstChild -> getData))),
                       showPreview   => $message_view -> getAttribute ('previewON'),
                       showNA        => $flags -> getAttribute ('showNA'),
@@ -83,9 +83,9 @@ sub read_admin_conf ($) {
                            voting     => $messaging -> getAttribute ('callAdminVoting'),
                            archiving  => $messaging -> getAttribute ('callAdminArchiving'),
                            byUser     => $messaging -> getAttribute ('callUserAnswer'),
-                           callByName => [map {$_ -> getFirstChild -> getData} $call_by_user -> getElementsByTagName ('Name', 0)],
-                           callByMail => [map {$_ -> getFirstChild -> getData} $call_by_user -> getElementsByTagName ('Email', 0)],
-                           callByIP   => [map {$_ -> getFirstChild -> getData} $call_by_user -> getElementsByTagName ('IpAddress', 0)]};
+                           callByName => [$call_by_user?map {$_ -> getFirstChild -> getData} $call_by_user -> getElementsByTagName ('Name', 0):()],
+                           callByMail => [$call_by_user?map {$_ -> getFirstChild -> getData} $call_by_user -> getElementsByTagName ('Email', 0):()],
+                           callByIP   => [$call_by_user?map {$_ -> getFirstChild -> getData} $call_by_user -> getElementsByTagName ('IpAddress', 0):()]};
 
       # Instant
       my $instant    = $forum   -> getElementsByTagName ('InstantJob', 0) -> item (0);
index 0140dfba4fdffaf3579a0fde6d9963079875afb2..76463bc936ec1dd40738a2907d65cb1e65ceb350 100644 (file)
@@ -48,7 +48,7 @@ sub encoded_body ($;$) {
 
   # normaler Link
   $posting =~ s{\[link:\s*
-               ((?:ftp://                        # hier beginnt $1
+               ((?:ftp://                          # hier beginnt $1
                |   https?://
                |   about:
                |   view-source:
@@ -59,14 +59,14 @@ sub encoded_body ($;$) {
                |   telnet://
                |   wais://
                |   prospero://
-               |   \.\.?/                        # relativ auf dem server
-               |   /                             # absolut auf dem server
-               |   (?:[a-zA-Z.\d]+)?\??          # im forum
-               )   [^\s<'()\[\]]+                # auf jeden Fall kein \s und kein ] etc.
-               )                                 # hier ist $1 zuende
-               \s*(?:\]|(\s|\(|\)|<br>))         # der Begrenzer (\s, ] oder Zeilenende)
+               |   \.\.?/                          # relativ auf dem server
+               |   /                               # absolut auf dem server
+               |   (?:[a-zA-Z.\d]+)?\??            # im forum
+               )   [^\s<'()\[\]]+                  # auf jeden Fall kein \s und kein ] etc.
+               )                                   # hier ist $1 zuende
+               \s*(?:\]|(\s|&(?!amp;)|\(|\)|<br>)) # der Begrenzer (\s, ] oder Zeilenende)
               }
-              {<a href="$1">$1</a>$2}gix;        # und der Link
+              {<a href="$1">$1</a>$2}gix;          # und der Link
 
   # javascript-links extra
   my $klammer1='\((?:[^)])*\)';
@@ -75,27 +75,27 @@ sub encoded_body ($;$) {
   my $klammer4="\\((?:$klammer3|(?:[^)])*)\\)";
 
   $posting =~ s{\[link:\s*
-               (javascript:                      # hier beginnt $1
+               (javascript:                        # hier beginnt $1
                (?:
-                 $klammer4                       # Klammern bis Verschachtelungstiefe 4 (sollte reichen?)
-               | '[^\'\\]*(?:\\.[^\'\\]*)*'      # mit ' quotierter String, J.F. sei gedankt
-                                                 # im String sind Escapes zugelassen (also auch \')
-                                                 # damit werden (korrekt gesetzte) Javascript-Links moeglich
-               | [^\s<()'\]]+)+                  # auf jeden Fall kein \s und kein ] (ausser im String)
-               )                                 # hier ist $1 zuende
-               \s*(?:\s|\]|(\(|\)|<br>))         # der Begrenzer (\s, ] oder Zeilenende)
+                 $klammer4                         # Klammern bis Verschachtelungstiefe 4 (sollte reichen?)
+               | '[^\'\\]*(?:\\.[^\'\\]*)*'        # mit ' quotierter String, J.F. sei gedankt
+                                                   # im String sind Escapes zugelassen (also auch \')
+                                                   # damit werden (korrekt gesetzte) Javascript-Links moeglich
+               | [^\s<()'\]]+)+                    # auf jeden Fall kein \s und kein ] (ausser im String)
+               )                                   # hier ist $1 zuende
+               \s*(?:\s|\]|(\(|\)|&(?!amp;)|<br>)) # der Begrenzer (\s, ] oder Zeilenende)
               }
-              {<a href="$1">$1</a>$2}gix;        # und der Link
+              {<a href="$1">$1</a>$2}gix;          # und der Link
 
   # images
   $posting =~ s{\[image:\s*
                ((?:https?://
-               |   \.\.?/                        # relativ auf dem server
-               |   /                             # absolut auf dem server
-               |   (?:[a-zA-Z.\d]+)?\??          # im forum
-               )   [^\s<'()\[\]]+                # auf jeden Fall kein \s und kein ] etc.
-               )                                 # hier ist $1 zuende
-               \s*(?:\]|(\s|\(|\)|<br>))         # der Begrenzer (\s, ] oder Zeilenende)
+               |   \.\.?/                          # relativ auf dem server
+               |   /                               # absolut auf dem server
+               |   (?:[a-zA-Z.\d]+)?\??            # im forum
+               )   [^\s<'()\[\]]+                  # auf jeden Fall kein \s und kein ] etc.
+               )                                   # hier ist $1 zuende
+               \s*(?:\]|(\s|\(|\)|&(?!amp;)|<br>)) # der Begrenzer (\s, ] oder Zeilenende)
               }
               {<img src="$1" border=0 alt="">$2}gix; # und das Bild
 
@@ -112,13 +112,13 @@ sub encoded_body ($;$) {
                |   telnet://
                |   wais://
                |   prospero://
-               |   \.\.?/                        # relativ auf dem server
-               |   /                             # absolut auf dem server
-               |   [a-zA-Z\d]+(?:\.html?|/)      # im forum (koennen eh nur threads oder verweise
-                                                 # auf tiefere verzeichnisse sein)
-               )[^\s<'()\]]+                     # auf jeden Fall kein \s und kein ] etc. (s.o.)
-               )                                 # hier ist $1 zuende
-               \s*(?:\]|(\s|\(|\)|<br>))         # der Begrenzer (\s, ] oder Zeilenende)
+               |   \.\.?/                          # relativ auf dem server
+               |   /                               # absolut auf dem server
+               |   [a-zA-Z\d]+(?:\.html?|/)        # im forum (koennen eh nur threads oder verweise
+                                                   # auf tiefere verzeichnisse sein)
+               )[^\s<'()\]]+                       # auf jeden Fall kein \s und kein ] etc. (s.o.)
+               )                                   # hier ist $1 zuende
+               \s*(?:\]|(\s|\(|\)|&(?!amp;)|<br>)) # der Begrenzer (\s, ] oder Zeilenende)
               }
               {<iframe src="$1" width="90%" height="90%"><a href="$1">$1</a></iframe>$2}gix;
 
index ab853ae1b12213aad5d68e0861af6471ac9cafb5..6b29a226b9c7262f3147fbb9c853fc0efb4e62f3 100644 (file)
@@ -47,6 +47,7 @@ sub print_forum_as_HTML ($$$) {
   unless ($stat = lock_file ($mainfile)) {
     if ($stat == 0) {
       violent_unlock_file ($mainfile);
+      print "aha!"
       # ueberlastet
     }
 
index bbdfa57e6b00800194fe458699cc9b0adc245862..cf38cadb5066317653db1d53d48840d8daaa2ee8 100644 (file)
          </Archiving>
   </Severance>
   <Messaging callUserAnswer="0" callAdminThread="0" callAdminNA="1" callAdminHQ="0" callAdminVoting="0" callAdminArchiving="1" callByUser="0">
-         <CallByUser>
+<!--         <CallByUser>
                 <Email>a9105535@unet.univie.ac.at</Email>
                 <Email>selfhtml@teamone.de</Email>
                 <Name>Wowbagger</Name>
                 <IpAddress>123.456.789</IpAddress>
-         </CallByUser>
+         </CallByUser>-->
   </Messaging>
   <InstantJob executeJob="0">
          <Severance executeArchiving="0" executeSeverance="instant">
index 89e0e243c5f4a216c0fef99ac83892b19c1f97aa..91a21a1f5f1124a93e0cf2d9ae77c5168bfece86 100644 (file)
@@ -327,12 +327,16 @@ sub print_error ($;$) {
 ################################
 
 sub fetch_subject () {
-  unless (exists ($dparam{$formdata -> {posterCategory} -> {name}}) and
-          exists ($dparam{$formdata -> {posterSubject} -> {name}})) {
 
+  my %must = map {$_ => 1} @{$formmust -> {exists $dparam{$formdata -> {followUp} -> {name}}?'reply':'new'}};
+
+  if ( ($must{posterCategory} and not exists ($dparam{$formdata -> {posterCategory} -> {name}})) or
+       ($must{posterSubject} and not exists ($dparam{$formdata -> {posterSubject} -> {name}})))
+  {
     my $filename = message_path.'t'.$ftid.'.xml';
 
-    if (lock_file ($filename)) {
+    if (-f $filename and lock_file ($filename))
+    {
       my $xml = new XML::DOM::Parser -> parsefile ($filename);
       violent_unlock_file($filename) unless unlock_file ($filename);
 
@@ -340,7 +344,9 @@ sub fetch_subject () {
       my $header = get_message_header ($mnode);
 
       $dparam{$formdata -> {posterCategory} -> {name}} = $header -> {category};
-      $dparam{$formdata -> {posterSubject} -> {name}} = $header -> {subject};}}
+      $dparam{$formdata -> {posterSubject} -> {name}} = $header -> {subject};
+    }
+  }
 }
 
 ################################

patrick-canterino.de