Make sure that a privilege is always defined even if it is 0
[spider.git] / perl / DXProt.pm
index 50765e14a54be2b5f1912d7e82619db0c1002cf0..5133d9bcd12a0810ed28cd0cf916a1f525ff3e3a 100644 (file)
@@ -96,8 +96,8 @@ sub start
        # remember type of connection
        $self->{consort} = $line;
        $self->{outbound} = $sort eq 'O';
-       $self->{priv} = $user->priv;
-       $self->{lang} = $user->lang;
+       $self->{priv} = $user->priv || 1;     # other clusters can always be 'normal' users
+       $self->{lang} = $user->lang || 'en';
        $self->{isolate} = $user->{isolate};
        $self->{consort} = $line;       # save the connection type
        $self->{here} = 1;
@@ -271,6 +271,15 @@ sub normal
                                                } else {
                                                        route(undef, $to, pc34($main::mycall, $to, $cmd));
                                                }
+                                               if ($to ne $field[7]) {
+                                                       $to = $field[7];
+                                                       $node = DXCluster->get_exact($to);
+                                                       if ($node && $node->dxchan && $node->dxchan->is_clx) {
+                                                               route(undef, $to, pc84($main::mycall, $to, $main::mycall, $cmd));
+                                                       } else {
+                                                               route(undef, $to, pc34($main::mycall, $to, $cmd));
+                                                       }
+                                               }
                                                $user->lastoper($main::systime);
                                                $user->put;
                                        }