Changing the name of the 'Aide' access level to 'Admin'
[citadel.git] / webcit / marchlist.c
index 63cd84cc4fe098ef62ab191e6d2235371768aa90..990c24fced27a9b72311bf77c9911e6f75a8beda 100644 (file)
@@ -13,7 +13,6 @@ void free_march_list(wcsession *wcf)
                free(wcf->march);
                wcf->march = mptr;
        }
-
 }
 
 
@@ -58,8 +57,6 @@ void remove_march(const StrBuf *aaa)
 char *pop_march(int desired_floor)
 {
        static char TheRoom[128];
-       int TheFloor = 0;
-       int TheOrder = 32767;
        int TheWeight = 0;
        int weight;
        struct march *mptr = NULL;
@@ -81,8 +78,10 @@ char *pop_march(int desired_floor)
                if (weight > TheWeight) {
                        TheWeight = weight;
                        strcpy(TheRoom, mptr->march_name);
+/* TODOO: and now????
                        TheFloor = mptr->march_floor;
                        TheOrder = mptr->march_order;
+*/
                }
        }
        return (TheRoom);
@@ -216,23 +215,39 @@ void ungoto(void)
 
 
 
+void tmplput_ungoto(StrBuf *Target, WCTemplputParams *TP)
+{
+       wcsession *WCC = WC;
+
+       if ((WCC!=NULL) && 
+           (!IsEmptyStr(WCC->ugname)))
+               StrBufAppendBufPlain(Target, WCC->ugname, -1, 0);
+}
+
 void _gotonext(void) {
        slrp_highest();
        gotonext();
 }
 
 
-void dotskip(void) {
-       smart_goto(sbstr("room"));
-}
 
 
+int ConditionalHaveUngoto(StrBuf *Target, WCTemplputParams *TP)
+{
+       wcsession *WCC = WC;
+       
+       return ((WCC!=NULL) && 
+               (!IsEmptyStr(WCC->ugname)) && 
+               (strcasecmp(WCC->ugname, ChrPtr(WCC->CurRoom.name)) == 0));
+}
 
 
 void 
 InitModule_MARCHLIST
 (void)
 {
+       RegisterConditional(HKEY("COND:UNGOTO"), 0, ConditionalHaveUngoto, CTX_NONE);
+       RegisterNamespace("ROOM:UNGOTO", 0, 0, tmplput_ungoto, NULL, CTX_NONE);
 
        WebcitAddUrlHandler(HKEY("gotonext"), "", 0, _gotonext, NEED_URL);
        WebcitAddUrlHandler(HKEY("skip"), "", 0, gotonext, NEED_URL);