/**
- * Open the database.
+ * Open the database.
* @param bool $new new connection if it is true
* @return bool
*/
* @param string $expr search expression
* @return array search results
*/
- function &search($expr) {
+ function search($expr) {
$ret = array();
if(!$this->open()) {
return false;
return;
}
+ // don't allow wide search when listing is disabled.
+ if ($expr=='*' && ! $this->listing)
+ return array();
+
/* Make regexp from glob'ed expression */
$expr = str_replace('?', '_', $expr);
$expr = str_replace('*', '%', $expr);
* @param string $alias alias
* @return array search results
*/
- function &lookup($alias) {
+ function lookup($alias) {
if (empty($alias)) {
return array();
}
}
/**
- * List all addresses
+ * List all addresses
* @return array search results
*/
- function &list_addr() {
+ function list_addr() {
$ret = array();
if (!$this->open()) {
return false;
/* See if user exist already */
$ret = $this->lookup($userdata['nickname']);
if (!empty($ret)) {
- return $this->set_error(sprintf(_("User '%s' already exist"),
- $ret['nickname']));
+ return $this->set_error(sprintf(_("User \"%s\" already exists"),$ret['nickname']));
}
/* Create query */
/* See if user exist */
$ret = $this->lookup($alias);
if (empty($ret)) {
- return $this->set_error(sprintf(_("User '%s' does not exist"),
- $alias));
+ return $this->set_error(sprintf(_("User \"%s\" does not exist"),$alias));
}
/* Create query */