* add proper error handling to room netconfig loading
authorWilfried Göesgens <willi@citadel.org>
Sun, 28 Feb 2010 19:29:31 +0000 (19:29 +0000)
committerWilfried Göesgens <willi@citadel.org>
Sun, 28 Feb 2010 19:29:31 +0000 (19:29 +0000)
webcit/roomlist.c

index 72335f5255a957fe799db5166df30b52e54bec56..493375d73223e42378f07c734d786861757dec5c 100644 (file)
@@ -271,6 +271,7 @@ HashList *GetNetConfigHash(StrBuf *Target, WCTemplputParams *TP)
        StrBuf *Content;
        long WantThisOne;
        long PutTo;
+       long State;
        
        WantThisOne = GetTemplateTokenNumber(Target, TP, 5, 0);
        if (WantThisOne == 0)
@@ -283,7 +284,7 @@ HashList *GetNetConfigHash(StrBuf *Target, WCTemplputParams *TP)
        Line = NewStrBuf();
        Token = NewStrBuf();
        StrBuf_ServGetln(Line);
-       if (GetServerStatus(Line, NULL) == 1) 
+       if (GetServerStatus(Line, &State) == 1) 
        {
                const char *Pos = NULL;
                StrBuf_ServGetln(Line);
@@ -304,6 +305,10 @@ HashList *GetNetConfigHash(StrBuf *Target, WCTemplputParams *TP)
                            HFreeStrBuf);
                }
        }
+       else if (State == 550)
+               StrBufAppendBufPlain(WCC->ImportantMsg,
+                                    _("Higher access is required to access this function."), -1, 0);
+
 
        return WCC->CurRoom.IgnetCfgs[WantThisOne];
 }