]> code.citadel.org Git - citadel.git/blobdiff - webcit/useredit.c
Removed the unused second argument from the do_template() macro
[citadel.git] / webcit / useredit.c
index 5eccfdb76ae52e21d16e0647fb71a52f24360676..56b6622f20295f87913fd2751e5a2824c4faa8d1 100644 (file)
@@ -1,5 +1,19 @@
 /*
- * $Id$
+ * Copyright (c) 1996-2011 by the citadel.org team
+ *
+ * This program is open source software.  You can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  */
 
 #include "webcit.h"
@@ -14,7 +28,7 @@
 void select_user_to_edit(const char *preselect)
 {
        output_headers(1, 0, 0, 0, 1, 0);
-       do_template("aide_edituser_select", NULL);
+       do_template("aide_edituser_select");
         end_burst();
 }
 
@@ -272,8 +286,10 @@ HashList *iterate_load_userlist(StrBuf *Target, WCTemplputParams *TP)
 
                while (!Done) {
                        len = StrBuf_ServGetln(Buf);
-                       if ((len == 3) &&
-                           (strcmp(ChrPtr(Buf), "000")==0)) {
+                       if ((len <0) || 
+                           ((len == 3) &&
+                            !strcmp(ChrPtr(Buf), "000")))
+                       {
                                Done = 1;
                                break;
                        }
@@ -391,11 +407,16 @@ int ConditionalFlagINetEmail(StrBuf *Target, WCTemplputParams *TP)
 int ConditionalUserAccess(StrBuf *Target, WCTemplputParams *TP)
 {
        UserListEntry *ul = (UserListEntry*) CTX;
-
-       if (TP->Tokens->Params[3]->Type == TYPE_LONG)
-               return (TP->Tokens->Params[3]->lvalue == ul->AccessLevel);
-       else
+       
+       if (ul == NULL)
                return 0;
+
+       return GetTemplateTokenNumber(Target, 
+                                     TP, 
+                                     3, 
+                                     AxNewU)
+               ==
+               ul->AccessLevel;
 }
 
 /*
@@ -478,7 +499,7 @@ TRYAGAIN:
                        serv_puts("000");
                }
                else 
-                       lprintf(1, "Error while creating user vcard: %s\n", ChrPtr(Buf));
+                       syslog(1, "Error while creating user vcard: %s\n", ChrPtr(Buf));
                goto TRYAGAIN;
        }
        FreeStrBuf(&Buf);