ab              Sun Mar 18 23:52:04 2001 EDT

  Modified files:              (Branch: PHP_4_0_5)
    /php4/ext/midgard   .cvsignore article.c attachment.c config.m4 
                        config.m4.session midgard.c php_midgard.h 
                        snippet.c 
  Log:
  Bringing fixed code to stable branch
  
  
Index: php4/ext/midgard/.cvsignore
diff -u php4/ext/midgard/.cvsignore:1.5 php4/ext/midgard/.cvsignore:1.5.2.1
--- php4/ext/midgard/.cvsignore:1.5     Tue Feb 20 03:00:23 2001
+++ php4/ext/midgard/.cvsignore Sun Mar 18 23:52:03 2001
@@ -3,7 +3,6 @@
 *.lo
 *.slo
 *.la
-CVS
 Makefile
 acinclude.m4
 aclocal.m4
Index: php4/ext/midgard/article.c
diff -u php4/ext/midgard/article.c:1.15 php4/ext/midgard/article.c:1.15.2.1
--- php4/ext/midgard/article.c:1.15     Mon Mar 12 02:19:37 2001
+++ php4/ext/midgard/article.c  Sun Mar 18 23:52:03 2001
@@ -1,4 +1,4 @@
-/* $Id: article.c,v 1.15 2001/03/12 10:19:37 davidg Exp $
+/* $Id: article.c,v 1.15.2.1 2001/03/19 07:52:03 ab Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -780,6 +780,7 @@
        zval **url, **calstart, **caldays, **icon, **view, **print;
        zval **extra1, **extra2, **extra3;
        zval **type, **score, **up, *self;
+   long upval;
 
        RETVAL_FALSE;
        CHECK_MGD;
@@ -852,8 +853,11 @@
    if (!mgd_exists_id(mgd_handle(), "topic", "id=$d", (*topic)->value.lval))
                RETURN_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);
 
-   if ((*up)->value.lval != 0 && !mgd_exists_id(mgd_handle(), "article", "id=$d", 
(*up)->value.lval))
-               RETURN_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);
+   if (up) {
+      upval = atol((*up)->value.str.val);
+      if (upval != 0 && !mgd_exists_id(mgd_handle(), "article", "id=$d", upval))
+         RETURN_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);
+   }
 
        if (!istopicowner((*topic)->value.lval)) {
                RETURN_FALSE_BECAUSE(MGD_ERR_ACCESS_DENIED);
Index: php4/ext/midgard/attachment.c
diff -u php4/ext/midgard/attachment.c:1.10 php4/ext/midgard/attachment.c:1.10.2.1
--- php4/ext/midgard/attachment.c:1.10  Sun Mar 11 15:30:36 2001
+++ php4/ext/midgard/attachment.c       Sun Mar 18 23:52:03 2001
@@ -1,4 +1,4 @@
-/* $Id: attachment.c,v 1.10 2001/03/11 23:30:36 davidg Exp $
+/* $Id: attachment.c,v 1.10.2.1 2001/03/19 07:52:03 ab Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -434,6 +434,7 @@
        if (sapi_send_headers() != SUCCESS) {
                mgd_free_pool(pool);
                mgd_release(res);
+      fclose(fp);
 
                RETURN_FALSE_BECAUSE(MGD_ERR_INTERNAL);
        }
@@ -442,6 +443,7 @@
                PHPWRITE(buf, b);
        }
 
+   fclose(fp);
        mgd_free_pool(pool);
        mgd_release(res);
        RETVAL_TRUE;
Index: php4/ext/midgard/config.m4
diff -u php4/ext/midgard/config.m4:1.13 php4/ext/midgard/config.m4:1.13.2.1
--- php4/ext/midgard/config.m4:1.13     Sun Mar 11 15:45:57 2001
+++ php4/ext/midgard/config.m4  Sun Mar 18 23:52:03 2001
@@ -1,4 +1,4 @@
-dnl $Id: config.m4,v 1.13 2001/03/11 23:45:57 davidg Exp $
+dnl $Id: config.m4,v 1.13.2.1 2001/03/19 07:52:03 ab Exp $
 
 dnl  Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 dnl  Copyright (C) 2000 The Midgard Project ry
@@ -66,4 +66,12 @@
   if test "$PHP_MIDGARD_EXPERIMENTAL" != "no"; then
     AC_DEFINE(YOU_WANT_TO_TEST, 1, [ ])
   fi
+  
+  if test "$php_always_shared" = "yes"; then
+    MIDCONFIG_FILE="config.h"
+  else
+    MIDCONFIG_FILE="php_config.h"
+  fi
+  PHP_SUBST_OLD(MIDCONFIG_FILE)
+  AC_OUTPUT(php_midgard.h, [], [])
 fi
Index: php4/ext/midgard/config.m4.session
diff -u php4/ext/midgard/config.m4.session:1.3 
php4/ext/midgard/config.m4.session:1.3.2.1
--- php4/ext/midgard/config.m4.session:1.3      Sun Mar 11 15:45:57 2001
+++ php4/ext/midgard/config.m4.session  Sun Mar 18 23:52:03 2001
@@ -1,4 +1,4 @@
-dnl $Id: config.m4.session,v 1.3 2001/03/11 23:45:57 davidg Exp $
+dnl $Id: config.m4.session,v 1.3.2.1 2001/03/19 07:52:03 ab Exp $
 
 dnl  Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 dnl  Copyright (C) 2000 The Midgard Project ry
@@ -74,4 +74,11 @@
   if test "$PHP_MIDGARD_SESSION" != "no"; then
     AC_DEFINE(HAVE_MIDGARD_SESSION, 1, [ ])
   fi
+  if test "$php_always_shared" = "yes"; then
+    MIDCONFIG_FILE="config.h"
+  else
+    MIDCONFIG_FILE="php_config.h"
+  fi
+  PHP_SUBST_OLD(MIDCONFIG_FILE)
+  AC_OUTPUT(php_midgard.h, [], [])
 fi
Index: php4/ext/midgard/midgard.c
diff -u php4/ext/midgard/midgard.c:1.22 php4/ext/midgard/midgard.c:1.22.2.1
--- php4/ext/midgard/midgard.c:1.22     Sat Mar 10 14:43:10 2001
+++ php4/ext/midgard/midgard.c  Sun Mar 18 23:52:03 2001
@@ -1,4 +1,4 @@
-/* $Id: midgard.c,v 1.22 2001/03/10 22:43:10 emile Exp $
+/* $Id: midgard.c,v 1.22.2.1 2001/03/19 07:52:03 ab Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -390,9 +390,10 @@
        MGDG(rcfg) = (midgard_request_config *)
                        ap_get_module_config(r->request_config, midgard_module);
        if(MGDG(rcfg) == NULL) {
+      /* Midgard is probably not enabled for this host, only log debug info */
                MGD_LOG_START("Cannot get midgard module config")
                MGD_LOG_END()
-               php_error(E_NOTICE, "Cannot get midgard module config");
+
                MGDG(rcfg) = NULL;
                MGDG(dcfg) = NULL;
                return SUCCESS;
@@ -403,6 +404,10 @@
        if(MGDG(dcfg) == NULL) {
                MGD_LOG_START("Cannot get midgard module directory config")
                MGD_LOG_END()
+
+      /* this is an error, since if we can get the module config we should
+         also be able to get this
+      */
                php_error(E_NOTICE, "Cannot get midgard module directory config");
                MGDG(rcfg) = NULL;
                MGDG(dcfg) = NULL;
Index: php4/ext/midgard/php_midgard.h
diff -u php4/ext/midgard/php_midgard.h:1.8 php4/ext/midgard/php_midgard.h:1.8.2.1
--- php4/ext/midgard/php_midgard.h:1.8  Sat Mar 10 14:43:10 2001
+++ php4/ext/midgard/php_midgard.h      Sun Mar 18 23:52:03 2001
@@ -1,4 +1,4 @@
-/* $Id: php_midgard.h,v 1.8 2001/03/10 22:43:10 emile Exp $
+/* $Id: php_midgard.h,v 1.8.2.1 2001/03/19 07:52:03 ab Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -24,11 +24,11 @@
 /* You should tweak config.m4 so this symbol (or some else suitable)
    gets defined.
 */
-#include <php_config.h>
+#include "php.h"
+#include "config.h"
 
 #if HAVE_MIDGARD
 
-#include <php.h>
 #include <midgard/midgard.h>
 #include <midgard/apache.h>
 /* #include <Zend/zend_modules.h> */
Index: php4/ext/midgard/snippet.c
diff -u php4/ext/midgard/snippet.c:1.7 php4/ext/midgard/snippet.c:1.7.2.1
--- php4/ext/midgard/snippet.c:1.7      Sat Mar 10 14:43:10 2001
+++ php4/ext/midgard/snippet.c  Sun Mar 18 23:52:03 2001
@@ -1,4 +1,4 @@
-/* $Id: snippet.c,v 1.7 2001/03/10 22:43:10 emile Exp $
+/* $Id: snippet.c,v 1.7.2.1 2001/03/19 07:52:03 ab Exp $
 Copyright (C) 1999 Jukka Zitting <[EMAIL PROTECTED]>
 Copyright (C) 2000 The Midgard Project ry
 Copyright (C) 2000 Emile Heyns, Aurora SA <[EMAIL PROTECTED]>
@@ -124,9 +124,6 @@
        convert_to_string_ex(code);
        convert_to_string_ex(doc);
        convert_to_string_ex(author);
-
-       if (!mgd_exists_id(mgd_handle(), "person", "id=$d", (*author)->value.lval))
-      RETURN_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);
 
        if (!mgd_exists_id(mgd_handle(), "snippetdir", "id=$d", 
(*snippetdir)->value.lval))
       RETURN_FALSE_BECAUSE(MGD_ERR_NOT_EXISTS);



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to