function company()
{
+ if (empty($this->company_id)) {
+ return false;
+ }
$x = DB_DataObject::factory('core_company');
$x->autoJoin();
$x->get($this->company_id);
function setFromRoo($ar, $roo)
{
- $this->setFrom($ar);
+ $this->setFrom($ar);
if(!empty($ar['_enable_oath_key'])){
$oath_key = $this->generateOathKey();
}
// this only applies to our owner company..
$c = $this->company();
- if (empty($c->comptype_name) || $c->comptype_name != 'OWNER') {
+ if (empty($c) || empty($c->comptype_name) || $c->comptype_name != 'OWNER') {
return true;
}