|
@@ -598,7 +598,11 @@ class AddressBook {
|
|
$ret = FALSE;
|
|
$ret = FALSE;
|
|
}
|
|
}
|
|
|
|
|
|
- } else {
|
|
|
|
|
|
+ } elseif (! isset($this->backends[$bnum])) {
|
|
|
|
+ /* make sure that backend exists */
|
|
|
|
+ $this->error = _("Unknown address book backend");
|
|
|
|
+ $ret = false;
|
|
|
|
+ } else {
|
|
|
|
|
|
/* Search only one backend */
|
|
/* Search only one backend */
|
|
|
|
|
|
@@ -641,6 +645,10 @@ class AddressBook {
|
|
$ret = array();
|
|
$ret = array();
|
|
|
|
|
|
if ($bnum > -1) {
|
|
if ($bnum > -1) {
|
|
|
|
+ if (!isset($this->backends[$bnum])) {
|
|
|
|
+ $this->error = _("Unknown address book backend");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
$res = $this->backends[$bnum]->lookup($alias);
|
|
$res = $this->backends[$bnum]->lookup($alias);
|
|
if (is_array($res)) {
|
|
if (is_array($res)) {
|
|
return $res;
|
|
return $res;
|
|
@@ -678,6 +686,10 @@ class AddressBook {
|
|
|
|
|
|
if ($bnum == -1) {
|
|
if ($bnum == -1) {
|
|
$sel = $this->get_backend_list('');
|
|
$sel = $this->get_backend_list('');
|
|
|
|
+ } elseif (! isset($this->backends[$bnum])) {
|
|
|
|
+ /* make sure that backend exists */
|
|
|
|
+ $this->error = _("Unknown address book backend");
|
|
|
|
+ $ret = false;
|
|
} else {
|
|
} else {
|
|
$sel = array(0 => &$this->backends[$bnum]);
|
|
$sel = array(0 => &$this->backends[$bnum]);
|
|
}
|
|
}
|
|
@@ -729,6 +741,12 @@ class AddressBook {
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* make sure that backend exists */
|
|
|
|
+ if (! isset($this->backends[$bnum])) {
|
|
|
|
+ $this->error = _("Unknown address book backend");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* Check that specified backend accept new entries */
|
|
/* Check that specified backend accept new entries */
|
|
if (!$this->backends[$bnum]->writeable) {
|
|
if (!$this->backends[$bnum]->writeable) {
|
|
$this->error = _("Address book is read-only");
|
|
$this->error = _("Address book is read-only");
|
|
@@ -766,6 +784,12 @@ class AddressBook {
|
|
$alias = array(0 => $alias);
|
|
$alias = array(0 => $alias);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* make sure that backend exists */
|
|
|
|
+ if (! isset($this->backends[$bnum])) {
|
|
|
|
+ $this->error = _("Unknown address book backend");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* Check that specified backend is writable */
|
|
/* Check that specified backend is writable */
|
|
if (!$this->backends[$bnum]->writeable) {
|
|
if (!$this->backends[$bnum]->writeable) {
|
|
$this->error = _("Address book is read-only");
|
|
$this->error = _("Address book is read-only");
|
|
@@ -821,6 +845,12 @@ class AddressBook {
|
|
$userdata['nickname'] = $userdata['email'];
|
|
$userdata['nickname'] = $userdata['email'];
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* make sure that backend exists */
|
|
|
|
+ if (! isset($this->backends[$bnum])) {
|
|
|
|
+ $this->error = _("Unknown address book backend");
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
|
|
+
|
|
/* Check that specified backend is writable */
|
|
/* Check that specified backend is writable */
|
|
if (!$this->backends[$bnum]->writeable) {
|
|
if (!$this->backends[$bnum]->writeable) {
|
|
$this->error = _("Address book is read-only");;
|
|
$this->error = _("Address book is read-only");;
|