X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=functions%2Fabook_database.php;h=8023f704026e85686c8c1f196b8e213c9453fd52;hp=aad2871354e57df24080e863fcae30d218180d5d;hb=30e9932c6ad14849bab5618fd1ca42d607999325;hpb=76911253eb850bacde3d86c8cb7b4af072e67ebe diff --git a/functions/abook_database.php b/functions/abook_database.php index aad28713..8023f704 100644 --- a/functions/abook_database.php +++ b/functions/abook_database.php @@ -28,10 +28,16 @@ * "AddressBook" class instead. * * $Id$ + * @package squirrelmail */ - + +/** Needs the DB functions */ require_once('DB.php'); - + +/** + * Undocumented class - stores the addressbook in a sql database + * @package squirrelmail + */ class abook_database extends addressbook_backend { var $btype = 'local'; var $bname = 'database'; @@ -68,6 +74,10 @@ class abook_database extends addressbook_backend { $this->writeable = $param['writeable']; } + if (isset($param['listing'])) { + $this->listing = $param['listing']; + } + $this->open(true); } else { @@ -115,7 +125,7 @@ class abook_database extends addressbook_backend { if(!$this->open()) { return false; } - + /* To be replaced by advanded search expression parsing */ if (is_array($expr)) { return; @@ -191,6 +201,11 @@ class abook_database extends addressbook_backend { if (!$this->open()) { return false; } + + if(!$this->listing) { + return array(); + } + $query = sprintf("SELECT * FROM %s WHERE owner='%s'", $this->table, $this->owner);