/** * Returns identifier of primary user account. * * @param int $iUserId WebMail Pro user identifier. * * @return int */ public function getDefaultAccountId($iUserId) { $iResult = -1; if ($this->oConnection->Execute($this->oCommandCreator->getDefaultAccountIdQuery($iUserId))) { $oRow = $this->oConnection->GetNextRecord(); if ($oRow) { $iResult = (int) $oRow->id_acct; if (1 > $iResult) { $iResult = -1; } } $this->oConnection->FreeResult(); } return $iResult; }