Beispiel #1
0
 protected function _mergeAccountData(Zend_Db_Table_Row $data)
 {
     $data = (object) $data->toArray();
     $accountRolesModel = new Ot_Model_DbTable_AccountRoles();
     $rolesModel = new Ot_Model_DbTable_Role();
     $select = $this->getAdapter()->select()->from(array('a' => $accountRolesModel->info('name')))->join(array('r' => $rolesModel->info('name')), 'a.roleId = r.roleId')->where('accountId = ?', $data->accountId);
     $stmt = $select->query();
     $roles = $stmt->fetchAll();
     $roleList = array();
     foreach ($roles as $r) {
         $roleList[$r['name']] = $r['roleId'];
     }
     $data->role = $roleList;
     $aar = new Ot_Account_Attribute_Register();
     $vars = $aar->getVars($data->accountId);
     $data->accountAttributes = array();
     foreach ($vars as $varName => $var) {
         $data->accountAttributes[$varName] = $var;
     }
     $cahr = new Ot_CustomAttribute_HostRegister();
     $thisHost = $cahr->getHost('Ot_Profile');
     $attributes = $thisHost->getAttributes($data->accountId);
     $data->customAttributes = array();
     foreach ($attributes as $a) {
         $data->customAttributes[$a['var']->getName()] = $a['var'];
     }
     $authAdapter = new Ot_Model_DbTable_AuthAdapter();
     $adapter = $authAdapter->find($data->realm);
     $data->authAdapter = array('obj' => new $adapter->class(), 'enabled' => $adapter->enabled, 'name' => $adapter->name, 'description' => $adapter->description);
     return $data;
 }