[phpldapadmin] BUG: Multivalue attributes with hundred of values hangs up while modifiying...

Olaf Reitmaier Veracierta <[email protected]> Thu, 13 May 2010 13:39:13 +1930
Newsgroups gmane.comp.ldap.davedap
Message-ID <[email protected]>
Good afternoon,

I have migrated to phpldapadmin 1.2.0.5 the lastest release and I have to
say:

"When adding a new value (memberUid) to a posixGroup with the Default
template the page to confirm the modification (htdocs/update_confirm.php)
hangs up taking up to 30 minutes to draw the page.

Working on code I discover there are many IFs comparison on Old and New
values printing FORs in that file, those IFs are used to highlight the new
or modified values with red color.

After comments those IFs the page draw all the values (about 1000) in only 5
seconds.

HERE IS THE NEW CODE ON htdocs/update_confirm.php:

(CHANGES COMMENTED WITH SLOOOW):

                # Show OLD Values
                echo '<td><span style="white-space: nowrap;">';

                if (! $attribute->getOldValues())
                        printf('<span style="color:
green">[%s]</span>',_('attribute doesnt exist'));

                foreach ($attribute->getOldValues() as $key => $value) {
                        # For multiple values, we'll highlight the changed
ones
                        # SLOOOW: if ((count($attribute->getOldValues()) >
5) && in_array($value,$attribute->getRemovedValues()) && count($attribute-$
                        # SLOOOW:      echo '<span style="color:#880000;
background:#FFFFA0">';

                        $request['page']->draw('OldValue',$attribute,$key);

                        # For multiple values, close the highlighting
                        # SLOOOW:if ((count($attribute->getOldValues()) > 5)
&& in_array($value,$attribute->getRemovedValues()) && count($attribute-$
                        # SLOOOW:      echo '</span>';

                        echo '<br />';
                }

                # Show NEW Values
                echo '<td><span style="white-space: nowrap;">';

                if (! $attribute->getValueCount() ||
$attribute->isForceDelete())
                        printf('<span style="color:
red">[%s]</span>',_('attribute deleted'));

                foreach ($attribute->getValues() as $key => $value) {
                        # For multiple values, we'll highlight the changed
ones
                        # SLOOOW: if ((count($attribute->getValues()) > 5)
&& in_array($value,$attribute->getAddedValues()))
                        # SLOOOW:      echo '<span style="color:#004400;
background:#FFFFA0">';


$request['page']->draw('CurrentValue',$attribute,$key);

                        # For multiple values, close the highlighting
                        # SLOOOW: if ((count($attribute->getValues()) > 5)
&& in_array($value,$attribute->getAddedValues()))
                        # SLOOOW:      echo '</span>';

                        echo '<br />';
                }

                echo '</span></td>';

Let me know if you resolve this with a path on newer versions.

Regards,

-- 
  "You don't know where your shadow will fall",
       Somebody.-
----------------------------------------------------------------
 Olaf Reitmaier Veracierta <[email protected]>
----------------------------------------------------------------
           http://olafrv.googlepages.com
----------------------------------------------------------------

------------------------------------------------------------------------------

______________________________________
phpLDAPadmin development mailing list.
To unsbuscribe: https://lists.sourceforge.net/lists/listinfo/phpldapadmin-devel
http://phpldapadmin.sourceforge.net/