function serviceAddGline($serviceGline) { if ($this->getDbGline($serviceGline->getMask())) { return $this->serviceChangeGline($serviceGline); } $db_gline = new DB_Gline(); $db_gline->setTs($serviceGline->getSetTs()); $db_gline->setLastMod($serviceGline->getLastMod()); $db_gline->setLifetime($serviceGline->getLifetime()); $db_gline->setMask($serviceGline->getMask()); $db_gline->setDuration($serviceGline->getDuration()); $db_gline->setReason($serviceGline->getReason()); $db_gline->setActiveState($serviceGline->isActive() ? 1 : 0); $db_gline->save(); $gline_key = strtolower($serviceGline->getMask()); $this->db_glines[$gline_key] = $db_gline; }
function serviceAddGline($host, $duration, $lastmod, $reason) { if ($this->getDbGline($host)) { return false; } $gline = new DB_Gline(); $gline->setTs($lastmod); $gline->setMask($host); $gline->setDuration($duration); $gline->setReason($reason); $gline->save(); $gline_key = strtolower($host); $this->db_glines[$gline_key] = $gline; }