Browse Source

* Minor bugfixes with addressbooks
* Local addresses now list again when you hit the Addresses button on the
compose.php form.

Tyler Akins 24 năm trước cách đây
mục cha
commit
eade0db4c3
3 tập tin đã thay đổi với 10 bổ sung10 xóa
  1. 3 3
      functions/abook_local_file.php
  2. 1 1
      functions/addressbook.php
  3. 6 6
      src/addrbook_search_html.php

+ 3 - 3
functions/abook_local_file.php

@@ -125,7 +125,7 @@
 
      // Overwrite the file with data from $rows
      // NOTE! Previous locks are broken by this function
-     function overwrite($rows) {
+     function overwrite(&$rows) {
        $newfh = @fopen($this->filename, 'w');
        if(!$newfh)
 	 return $this->set_error("$file: " . _("Open failed"));
@@ -286,7 +286,7 @@
        }
 
        // Write data back
-       if(!$this->overwrite(&$rows)) {
+       if(!$this->overwrite($rows)) {
 	 $this->unlock();
 	 return false;
        }
@@ -330,7 +330,7 @@
        }
 
        // Write data back
-       if(!$this->overwrite(&$rows)) {
+       if(!$this->overwrite($rows)) {
 	 $this->unlock();
 	 return false;
        }

+ 1 - 1
functions/addressbook.php

@@ -112,7 +112,7 @@
 	 $ret = array();
 	 for($i = 1 ; $i <= $this->numbackends ; $i++) {
 	    if(empty($type) || $type == $this->backends[$i]->btype) {
-	       array_push($ret, &$this->backends[$i]);
+	       $ret[] = &$this->backends[$i];
 	    }
 	 }
 	 return $ret;

+ 6 - 6
src/addrbook_search_html.php

@@ -109,7 +109,7 @@
    // --- End functions ---
 
    displayPageHeader($color, 'None');
-
+   
    // Initialize addressbook
    $abook = addressbook_init();
 
@@ -131,7 +131,7 @@
    printf("  <nobr><STRONG>%s</STRONG>\n", _("Search for"));
    addr_insert_hidden();
    if (! isset($addrquery))
-       $addrquery = "";
+       $addrquery = '';
    printf("  <INPUT TYPE=text NAME=addrquery VALUE=\"%s\" SIZE=26>\n",
           htmlspecialchars($addrquery));
 
@@ -166,10 +166,10 @@
    // End search form
 
    // Show personal addressbook
-   if(!isset($addrquery) || !empty($listall)) {
+   if($addrquery == '' || !empty($listall)) {
 
-      if(! isset($backend) || $backend != -1 || !isset($addrquery)) {
-         if(!isset($addrquery)) 
+      if(! isset($backend) || $backend != -1 || $addrquery == '') {
+         if($addrquery == '')
             $backend = $abook->localbackend;
 
          //printf("<H3 ALIGN=center>%s</H3>\n", $abook->backends[$backend]->sname);
@@ -212,7 +212,7 @@
       }
    }
 
-   if (!$addrquery || sizeof($res) == 0) {  
+   if ($addrquery == '' || sizeof($res) == 0) {  
       printf('<center><FORM METHOD=post NAME=k ACTION="compose.php">'."\n", $PHP_SELF);
       addr_insert_hidden();
       printf("<INPUT TYPE=submit VALUE=\"%s\" NAME=return>\n", _("Return"));