function postProcess() { for ($i = 0; $i < NB_URLS_ALIAS_AVAILABLE; $i++) { $a_urls[] = array($this->siteAdmin, databaseEscape($this->getSubmitValue('form_url' . $i))); } $confSite = new SiteConfigDb(); $confSite->setUrls($a_urls, $this->siteAdmin); }
function postProcess() { $confSite = new SiteConfigDb(); // add a new nl if ($this->newsletterId == -1) { $confSite->addNewsletter($this->getSubmitValue('form_name'), $this->siteAdmin); } else { $confSite->setNewsletterName($this->getSubmitValue('form_name'), $this->getSubmitValue('form_id')); } }
function postProcess() { $ipFinal = array(); for ($i = 0; $i < NB_IPS_RANGE_AVAILABLE; $i++) { $ipa = ip2long($this->getSubmitValue('form_ipa' . $i)); $ipb = ip2long($this->getSubmitValue('form_ipb' . $i)); if ($ipa != 0 || $ipb != 0) { $ipFinal[] = array($ipa, $ipb, $this->siteAdmin); } } $ipFinal = array_reverse($ipFinal, true); $confSite = new SiteConfigDb(); $confSite->modIpExclude($ipFinal, $this->siteAdmin); }
function process() { $this->tpl->assign('action', $this->request->getActionName()); switch ($this->request->getActionName()) { case 'add': $siteAdmin = $this->needASiteAdminSelected(); if ($siteAdmin) { $form = new FormSitePartner($this->tpl, $siteAdmin); $done = $form->process(); if ($done) { $this->setMessage(); } } break; case 'mod': $siteAdmin = $this->needASiteAdminSelected(); if ($siteAdmin) { $idPartner = $this->needAPartner($siteAdmin); if ($idPartner) { $form = new FormSitePartner($this->tpl, $siteAdmin, $idPartner); $done = $form->process(); if ($done) { $this->setMessage(); } } } // else needASiteAdminSelected display the site selection form break; case 'del': $siteAdmin = $this->needASiteAdminSelected(); if ($siteAdmin) { $idPartner = $this->needAPartner($siteAdmin); if ($idPartner) { $confirmed = $this->needConfirmation('partner', $idPartner); if ($confirmed) { $confSite = new SiteConfigDb(); $confSite->delPartner($idPartner); $this->setMessage(); } } } break; } $this->site->generateFiles(); }
function postProcess() { $confSite = new SiteConfigDb(); $a_urls = array(); for ($i = 0; $i < NB_URLS_ALIAS_AVAILABLE; $i++) { $url = $this->getSubmitValue('form_url' . $i); if (!empty($url)) { $a_urls[] = $url; } } // add a new nl if ($this->partnerId == -1) { $confSite->addPartner($this->getSubmitValue('form_name'), $a_urls, $this->siteAdmin); } else { if (!isset($a_urls) || sizeof($a_urls) == 0) { $a_urls = array(); } $confSite->setPartner($this->getSubmitValue('form_name'), $a_urls, $this->getSubmitValue('form_id')); } }
function process() { $this->tpl->assign('action', $this->request->getActionName()); switch ($this->request->getActionName()) { case 'add': $form = new FormSiteGeneral($this->tpl); $done = $form->process(); if ($done) { $this->setMessageAdd($form); $this->tpl->clear_all_cache(); } break; case 'mod': $siteAdmin = $this->needASiteAdminSelected(); if ($siteAdmin) { $form = new FormSiteGeneral($this->tpl, $siteAdmin); $done = $form->process(); if ($done) { $this->setMessage(); } } break; case 'del': $siteAdmin = $this->needASiteAdminSelected(); if ($siteAdmin) { $confirmed = $this->needConfirmation('site', $siteAdmin); if ($confirmed) { $confSite = new SiteConfigDb(); $confSite->delSite($siteAdmin); $this->setMessage(); $this->tpl->clear_all_cache(); } } break; } // case no site installed, do not generate if (is_a($this->site, "Site")) { $this->site->generateFiles(); } }
function postProcess() { $confSite = new SiteConfigDb(); $infoSite = array('name' => $this->getSubmitValue('form_name'), 'logo' => $this->getSubmitValue('form_logo') == 'yes' ? $this->getSubmitValue('form_logo_no') : 'pixel.gif', 'params_choice' => $this->getSubmitValue('form_params'), 'idpdf' => $this->getSubmitValue('form_idpdf'), 'path_theme' => $this->getSubmitValue('form_path_theme')); $urlSite = $this->getSubmitValue('form_url'); $params_names = $this->getSubmitValue('form_params_names'); if (!empty($params_names)) { $infoSite['params_names'] = $params_names; } $req =& Request::getInstance(); switch ($req->getActionName()) { case 'add': $this->siteAdmin = $confSite->addSite($infoSite, $urlSite); break; case 'mod': $infoSite['idsite'] = $this->siteAdmin; $confSite->modSite($infoSite, $urlSite); break; default: trigger_error('Action not specified for Site configuration. Were you trying to add, modify, delete? Only YOU know that!', E_USER_ERROR); break; } }
/** * returns Name of the newsletter who has id = $id * * @param int $id * @param bool $forceCreate : if newsletter not exists create it * * @return string */ function getNewsletterName($id, $forceCreate = false) { if (!isset($this->a_newsletters)) { $this->loadNewsletter(); } if (!isset($this->a_newsletters[$id]) && $forceCreate) { // If not exists, and force create : create Newsletter $confSite = new SiteConfigDb(); if (defined("NEWSLETTER_CREATE_NAME")) { $confSite->createNewsletter($id, NEWSLETTER_CREATE_NAME . $id, $this->id); } else { $confSite->createNewsletter($id, 'Newsletter : ' . $id, $this->id); } // Reload Newsletter $this->loadNewsletter(); } return isset($this->a_newsletters[$id]) ? $this->a_newsletters[$id] : false; }