MidCOM svn: r12857 - in trunk/midcom: midcom.admin.user midgard.admin.asgard

bergie midcom-commits at lists.midgard-project.org
Wed Oct 17 15:30:34 CEST 2007


Author: bergie
Date: Wed Oct 17 15:30:33 2007
New Revision: 12857
URL: http://trac.midgard-project.org/software/changeset/12857

Log:
Bulletproofing


Modified:
   trunk/midcom/midcom.admin.user/plugin.php
   trunk/midcom/midgard.admin.asgard/reflector_tree.php

Modified: trunk/midcom/midcom.admin.user/plugin.php
==============================================================================
--- trunk/midcom/midcom.admin.user/plugin.php	(original)
+++ trunk/midcom/midcom.admin.user/plugin.php	Wed Oct 17 15:30:33 2007
@@ -98,6 +98,17 @@
                 'variable_args' => 1,
             ),
             /**
+             * List folders group has privileges to
+             * 
+             * Match /user-editor/group/folders/<guid>/
+             */
+            'group_folders' => array
+            (
+                'handler' => array ('midcom_admin_user_handler_group_permissions', 'folders'),
+                'fixed_args' => array ('group', 'folders'),
+                'variable_args' => 1,
+            ),
+            /**
     		 * Create new user
     		 *
     		 * Match /create/

Modified: trunk/midcom/midgard.admin.asgard/reflector_tree.php
==============================================================================
--- trunk/midcom/midgard.admin.asgard/reflector_tree.php	(original)
+++ trunk/midcom/midgard.admin.asgard/reflector_tree.php	Wed Oct 17 15:30:33 2007
@@ -454,7 +454,7 @@
      *
      * @access private
      */
-    function &_child_objects_type_qb(&$schema_type, &$for_object, &$deleted)
+    function _child_objects_type_qb(&$schema_type, &$for_object, &$deleted)
     {
         debug_push_class(__CLASS__, __FUNCTION__);
         if ($deleted)
@@ -522,6 +522,11 @@
         {
             $uptype = $ref->get_midgard_type($upfield);
             $uptarget = $ref->get_link_target($upfield);
+            if (!isset($for_object->$uptarget))
+            {
+                $qb->end_group();
+                return false;
+            }
             switch ($uptype)
             {
                 case MGD_TYPE_STRING:
@@ -535,6 +540,7 @@
                 default:
                     debug_add("Do not know how to handle upfield '{$upfield}' has type {$uptype}", MIDCOM_LOG_ERROR);
                     debug_pop();
+                    $qb->end_group();
                     return false;
             }
         }
@@ -551,11 +557,12 @@
                     break;
                 case MGD_TYPE_INT:
                 case MGD_TYPE_UINT:
-                    $qb->add_constraint($parentfield, '=', (int)$for_object->$parenttarget);
+                        $qb->add_constraint($parentfield, '=', (int)$for_object->$parenttarget);
                     break;
                 default:
                     debug_add("Do not know how to handle parentfield '{$parentfield}' has type {$parenttype}", MIDCOM_LOG_ERROR);
                     debug_pop();
+                    $qb->end_group();
                     return false;
             }
         }


More information about the midcom-commits mailing list