Fix signatures and deviceExists() implementation of File driver.
authorJan Schneider <jan@horde.org>
Fri, 14 May 2010 14:53:36 +0000 (16:53 +0200)
committerJan Schneider <jan@horde.org>
Fri, 14 May 2010 14:53:36 +0000 (16:53 +0200)
framework/ActiveSync/lib/Horde/ActiveSync/State/Base.php
framework/ActiveSync/lib/Horde/ActiveSync/State/File.php

index 2a2b4bd..dd7c84f 100644 (file)
@@ -569,7 +569,7 @@ abstract class Horde_ActiveSync_State_Base
      *
      * @return boolean
      */
-    abstract public function deviceExists($devId, $user);
+    abstract public function deviceExists($devId, $user = null);
 
     /**
      * Set new device info
index a22e783..98c6c08 100644 (file)
@@ -379,8 +379,11 @@ class Horde_ActiveSync_State_File extends Horde_ActiveSync_State_Base
      *
      * @return boolean
      */
-    public function deviceExists($devId, $user)
+    public function deviceExists($devId, $user = null)
     {
+        if (empty($user)) {
+            return count(glob($this->_stateDir . '/*/info-' . $devId)) > 0;
+        }
         return file_exists($this->_stateDir . '/' . $user . '/info-' . $devId);
     }