浏览代码

Improved local backend handling.

pallo 25 年之前
父节点
当前提交
5ec219c764
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      functions/addressbook.php

+ 6 - 0
functions/addressbook.php

@@ -62,6 +62,7 @@
       var $backends    = array();
       var $numbackends = 0;
       var $error       = "";
+      var $localbackend = 0;
 
       // Constructor function.
       function AddressBook() {
@@ -98,6 +99,11 @@
        
 	 $newback->bnum = $this->numbackends;
 	 $this->backends[$this->numbackends] = $newback;
+
+	 // Store ID of first local backend added
+	 if($this->localbackend == 0 && $newback->btype == "local")
+	    $this->localbackend = $this->numbackends;
+
 	 return $this->numbackends;
       }