r56112 - /trunk/egroupware/api/src/Mail.php

classic Classic list List threaded Threaded
1 message Options
leithoff leithoff
Reply | Threaded
Open this post in threaded view
|

r56112 - /trunk/egroupware/api/src/Mail.php

Author: leithoff
Date: Tue May 10 17:17:40 2016
New Revision: 56112

URL: http://svn.stylite.de/viewvc/egroupware?rev=56112&view=rev
Log:
fix problem regarding sorting autofolders to the beginning of the foldertree

Modified:
    trunk/egroupware/api/src/Mail.php

Modified: trunk/egroupware/api/src/Mail.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/egroupware/api/src/Mail.php?rev=56112&r1=56111&r2=56112&view=diff
==============================================================================
--- trunk/egroupware/api/src/Mail.php (original)
+++ trunk/egroupware/api/src/Mail.php Tue May 10 17:17:40 2016
@@ -2953,11 +2953,12 @@
  $isAutoFolder=false;
  foreach($autoFoldersTmp as $afk=>$aF)
  {
- //error_log($k.':'.$aF.'->'.$mySpecialUseFolders[$aF]);
+ //error_log(__METHOD__.__LINE__.$k.':'.$aF.'->'.$mySpecialUseFolders[$aF]);
  if($aF && strlen($mySpecialUseFolders[$aF])&&/*strlen($k)>=strlen($mySpecialUseFolders[$aF])&&*/
- ($mySpecialUseFolders[$aF]==$k || substr($k,0,strlen($mySpecialUseFolders[$aF].$delimiter))==$mySpecialUseFolders[$aF].$delimiter))
+ ($mySpecialUseFolders[$aF]==$k || substr($k,0,strlen($mySpecialUseFolders[$aF].$delimiter))==$mySpecialUseFolders[$aF].$delimiter || //k may be child of an autofolder
+ stristr($mySpecialUseFolders[$aF],$k.$delimiter)!==false)) // k is parent of an autofolder
  {
- //error_log($k.'->'.$mySpecialUseFolders[$aF]);
+ //error_log(__METHOD__.__LINE__.$k.'->'.$mySpecialUseFolders[$aF]);
  $isAutoFolder=true;
  $autoFolderObjects[$k]=$f;
  break;
@@ -2979,7 +2980,8 @@
  {
  //error_log($k.':'.$aF.'->'.$mySpecialUseFolders[$aF]);
  if($aF && strlen($mySpecialUseFolders[$aF])&&/*strlen($k)>=strlen($mySpecialUseFolders[$aF])&&*/
- ($mySpecialUseFolders[$aF]==$k || substr($k,0,strlen($mySpecialUseFolders[$aF].$delimiter))==$mySpecialUseFolders[$aF].$delimiter))
+ ($mySpecialUseFolders[$aF]==$k || substr($k,0,strlen($mySpecialUseFolders[$aF].$delimiter))==$mySpecialUseFolders[$aF].$delimiter|| //k may be child of an autofolder
+ stristr($mySpecialUseFolders[$aF],$k.$delimiter)!==false)) // k is parent of an autofolder
  {
  //error_log($k.'->'.$mySpecialUseFolders[$aF]);
  $isAutoFolder=true;
@@ -2997,7 +2999,8 @@
  {
  //error_log($k.':'.$aF.'->'.$mySpecialUseFolders[$aF]);
  if($aF && strlen($mySpecialUseFolders[$aF])&&/*strlen($k)>=strlen($mySpecialUseFolders[$aF])&&*/
- ($mySpecialUseFolders[$aF]==$k || substr($k,0,strlen($mySpecialUseFolders[$aF].$delimiter))==$mySpecialUseFolders[$aF].$delimiter))
+ ($mySpecialUseFolders[$aF]==$k || substr($k,0,strlen($mySpecialUseFolders[$aF].$delimiter))==$mySpecialUseFolders[$aF].$delimiter|| //k may be child of an autofolder
+ stristr($mySpecialUseFolders[$aF],$k.$delimiter)!==false)) // k is parent of an autofolder
  {
  //error_log($k.'->'.$mySpecialUseFolders[$aF]);
  $isAutoFolder=true;
@@ -3025,7 +3028,7 @@
  }
  }
  }
- //error_log(__METHOD__.__LINE__.array2string($autoFoldersTmp));
+ //error_log(__METHOD__.__LINE__.array2string($autoFolderObjects));
  // avoid calling sortByAutoFolder as it is not regarding subfolders
  $autoFolderObjectsTmp = $autoFolderObjects;
  unset($autoFolderObjects);
@@ -3034,7 +3037,9 @@
  {
  foreach($autoFolderObjectsTmp as $k => $f)
  {
- if($aF && ($mySpecialUseFolders[$aF]==$k || substr($k,0,strlen($mySpecialUseFolders[$aF].$delimiter))==$mySpecialUseFolders[$aF].$delimiter))
+ if($aF && ($mySpecialUseFolders[$aF]==$k ||
+ substr($k,0,strlen($mySpecialUseFolders[$aF].$delimiter))==$mySpecialUseFolders[$aF].$delimiter ||
+ stristr($mySpecialUseFolders[$aF],$k.$delimiter)!==false))
  {
  $autoFolderObjects[$k]=$f;
  }


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
eGroupWare-cvs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs