fixed sql error in setup/account_migration, as there are no grants, if there's no user

This commit is contained in:
Ralf Becker 2006-07-08 21:38:54 +00:00
parent 82af1db4bd
commit cc7020f9a6

View File

@ -193,11 +193,14 @@ class socontacts
$this->contact_repository = 'ldap'; $this->contact_repository = 'ldap';
$this->somain =& CreateObject('addressbook.so_ldap'); $this->somain =& CreateObject('addressbook.so_ldap');
// static grants from ldap: all rights for the own personal addressbook and the group ones of the meberships if ($this->user) // not set eg. in setup
$this->grants = array($this->user => ~0);
foreach($this->memberships as $gid)
{ {
$this->grants[$gid] = ~0; // static grants from ldap: all rights for the own personal addressbook and the group ones of the meberships
$this->grants = array($this->user => ~0);
foreach($this->memberships as $gid)
{
$this->grants[$gid] = ~0;
}
} }
$this->columns_to_search = $this->ldap_search_attributes; $this->columns_to_search = $this->ldap_search_attributes;
} }
@ -208,9 +211,13 @@ class socontacts
$this->contact_repository = 'sql-ldap'; $this->contact_repository = 'sql-ldap';
} }
$this->somain =& CreateObject('addressbook.socontacts_sql'); $this->somain =& CreateObject('addressbook.socontacts_sql');
// group grants are now grants for the group addressbook and NOT grants for all its members, therefor the param false!
$this->grants = $GLOBALS['egw']->acl->get_grants($contact_app,false); if ($this->user) // not set eg. in setup
{
// group grants are now grants for the group addressbook and NOT grants for all its members,
// therefor the param false!
$this->grants = $GLOBALS['egw']->acl->get_grants($contact_app,false);
}
// remove some columns, absolutly not necessary to search in sql // remove some columns, absolutly not necessary to search in sql
$this->columns_to_search = array_diff(array_values($this->somain->db_cols),$this->sql_cols_not_to_search); $this->columns_to_search = array_diff(array_values($this->somain->db_cols),$this->sql_cols_not_to_search);
} }