projects
/
squirrelmail.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Reset $msg on each iteration, otherwise a message with eg no subject
[squirrelmail.git]
/
functions
/
abook_local_file.php
diff --git
a/functions/abook_local_file.php
b/functions/abook_local_file.php
index 61b0e0ce1be5aae08cba7f6ef73f2ce5ea05a765..379271009e239bd87bada20dcd9607168eb42692 100644
(file)
--- a/
functions/abook_local_file.php
+++ b/
functions/abook_local_file.php
@@
-3,7
+3,7
@@
/**
* abook_local_file.php
*
/**
* abook_local_file.php
*
- * Copyright (c) 1999-200
3
The SquirrelMail Project Team
+ * Copyright (c) 1999-200
4
The SquirrelMail Project Team
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* Backend for addressbook as a pipe separated file
* Licensed under the GNU GPL. For full terms see the file COPYING.
*
* Backend for addressbook as a pipe separated file
@@
-18,9
+18,15
@@
* NOTE. This class should not be used directly. Use the
* "AddressBook" class instead.
*
* NOTE. This class should not be used directly. Use the
* "AddressBook" class instead.
*
- * $Id$
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage addressbook
*/
*/
+/**
+ * Store the addressbook in a local file
+ * @package squirrelmail
+ */
class abook_local_file extends addressbook_backend {
var $btype = 'local';
var $bname = 'local_file';
class abook_local_file extends addressbook_backend {
var $btype = 'local';
var $bname = 'local_file';
@@
-146,8
+152,8
@@
class abook_local_file extends addressbook_backend {
for($j = 0, $cnt_part=count($rows[$i]) ; $j < $cnt_part ; $j++) {
$rows[$i][$j] = $this->quotevalue($rows[$i][$j]);
}
for($j = 0, $cnt_part=count($rows[$i]) ; $j < $cnt_part ; $j++) {
$rows[$i][$j] = $this->quotevalue($rows[$i][$j]);
}
- $tmpwrite =
@
fwrite($newfh, join('|', $rows[$i]) . "\n");
- if ($tmpwrite ==
-1
) {
+ $tmpwrite =
sq_
fwrite($newfh, join('|', $rows[$i]) . "\n");
+ if ($tmpwrite ==
= FALSE
) {
return $this->set_error($this->filename . '.tmp:' . _("Write failed"));
}
}
return $this->set_error($this->filename . '.tmp:' . _("Write failed"));
}
}
@@
-281,17
+287,19
@@
class abook_local_file extends addressbook_backend {
}
/* Write */
}
/* Write */
- $r = fwrite($this->filehandle, $data);
+ $r =
sq_
fwrite($this->filehandle, $data);
/* Unlock file */
$this->unlock();
/* Unlock file */
$this->unlock();
- /* Test write result and exit if OK */
- if($r > 0) return true;
+ /* Test write result */
+ if($r === FALSE) {
+ /* Fail */
+ $this->set_error(_("Write to addressbook failed"));
+ return FALSE;
+ }
- /* Fail */
- $this->set_error(_("Write to addressbook failed"));
- return false;
+ return TRUE;
}
/* Delete address */
}
/* Delete address */
@@
-384,4
+392,4
@@
class abook_local_file extends addressbook_backend {
}
} /* End of class abook_local_file */
}
} /* End of class abook_local_file */
-?>
\ No newline at end of file
+?>