Exemplo n.º 1
0
$pending = JRequest::getVar("pending", "0");
$state = JRequest::getVar("state", "");
$display_settings = "none";
$display_managers = "none";
$display_new_ads = "none";
$display_geotargeting = "none";
$display_reports = "none";
$li_settings = "";
$li_managers = "";
$li_new_ads = "";
$li_geotargeting = "";
$li_reports = "";
$li_payments = "";
$li_about = "";
include_once "components/com_adagency/models/adagencyconfig.php";
$ad_configs = new adagencyAdminModeladagencyConfig();
$is_js_installed = $ad_configs->isJomSocialStreamAd();
if ($controller_req == "adagencyConfigs") {
    $display_settings = "block";
    $li_settings = 'class="open"';
} elseif ($controller_req == "adagencyAds" || $controller_req == "adagencyZones" || $controller_req == "adagencyCampaigns" || $controller_req == "adagencyAdvertisers" || $controller_req == "adagencyOrders" || $controller_req == "adagencyPackages" || $controller_req == "adagencyPromocodes" || $controller_req == "adagencyBlacklist") {
    $display_managers = "block";
    $li_managers = 'class="open"';
} elseif ($controller_req == "adagencyTransition" || $controller_req == "adagencyFloating" || $controller_req == "adagencyFlash" || $controller_req == "adagencyPopup" || $controller_req == "adagencyAdcode" || $controller_req == "adagencyTextlink" || $controller_req == "adagencyStandard" || $controller_req == "adagencyJomsocial") {
    $display_new_ads = "block";
    $li_new_ads = 'class="open"';
} elseif ($controller_req == "adagencyGeo") {
    $display_geotargeting = "block";
    $li_geotargeting = 'class="open"';
} elseif ($controller_req == "adagencyReports") {
    $display_reports = "block";
Exemplo n.º 2
0
 function store()
 {
     $database = JFactory::getDBO();
     $item = $this->getTable('adagencyConfig');
     $data = JRequest::get('post');
     if (isset($data['allowstand'])) {
         $data['allowstand'] = 1;
     } else {
         $data['allowstand'] = 0;
     }
     if (isset($data['allowadcode'])) {
         $data['allowadcode'] = 1;
     } else {
         $data['allowadcode'] = 0;
     }
     if (isset($data['allowpopup'])) {
         $data['allowpopup'] = 1;
     } else {
         $data['allowpopup'] = 0;
     }
     if (isset($data['allowswf'])) {
         $data['allowswf'] = 1;
     } else {
         $data['allowswf'] = 0;
     }
     if (isset($data['allowtxtlink'])) {
         $data['allowtxtlink'] = 1;
     } else {
         $data['allowtxtlink'] = 0;
     }
     if (isset($data['allowtrans'])) {
         $data['allowtrans'] = 1;
     } else {
         $data['allowtrans'] = 0;
     }
     if (isset($data['allowfloat'])) {
         $data['allowfloat'] = 1;
     } else {
         $data['allowfloat'] = 0;
     }
     if (!$item->bind($data)) {
         return JError::raiseError(500, $database->getErrorMsg());
         return false;
     }
     if (!$item->check()) {
         return JError::raiseError(500, $database->getErrorMsg());
         return false;
     }
     if (!$item->store()) {
         return JError::raiseError(500, $database->getErrorMsg());
         return false;
     }
     $respathfe = JPATH_ROOT . DS . "language" . DS . "en-GB" . DS . "en-GB.com_adagency.ini";
     $respathbe = JPATH_ROOT . DS . "administrator" . DS . "language" . DS . "en-GB" . DS . "en-GB.com_adagency.ini";
     /*Saving LANGUAGE*/
     $textfe = JRequest::getVar("filecontentFE");
     $f = fopen($respathfe, "w");
     fwrite($f, $textfe);
     fclose($f);
     $textbe = JRequest::getVar("filecontentBE");
     $g = fopen($respathbe, "w");
     fwrite($g, $textbe);
     fclose($g);
     /*Saving PLUGIN*/
     $plugin_handler = adagencyAdminModeladagencyConfig::makePluginList();
     if (count($plugin_handler) > 0) {
         foreach ($plugin_handler as $name => $plugin) {
             $name = $plugin->name;
             $value = JRequest::getVar($name . "_account", array(0), 'array');
             $value = implode(" ", $value);
             $default = JRequest::getVar("default", null, 'post');
             $sandbox = JRequest::getVar($name . "_sandbox", 0, 'post');
             $reqhttps = JRequest::getVar($name . "_reqhttps", 0, 'post');
             $default = substr($default, 0, strlen($default) - 4);
             $value = $database->escape($value);
             if ($plugin->type == 'encoding' && file_exists($value)) {
                 $query = "update #__ad_agency_plugins set value='" . $value . "', sandbox='" . intval($sandbox) . "' where name='" . addslashes(trim($name)) . "';";
             } else {
                 if ($plugin->type != 'encoding') {
                     $query = "update #__ad_agency_plugins set value='" . $value . "', sandbox='" . intval($sandbox) . "', reqhttps='" . intval($reqhttps) . "' where name='" . addslashes(trim($name)) . "';";
                 } else {
                     $query = '';
                 }
             }
             $database->setQuery($query);
             $database->query();
             $query = "update #__ad_agency_plugins set def='' where def='default';";
             $database->setQuery($query);
             $database->query();
             $query = "update #__ad_agency_plugins set def='default' where name='" . addslashes(trim($default)) . "';";
             $database->setQuery($query);
             $database->query();
         }
     }
     return true;
 }
Exemplo n.º 3
0
 function store()
 {
     jimport('joomla.filesystem.folder');
     $item = $this->getTable('adagencyConfig');
     $imagepath = str_replace("/administrator", "", JPATH_BASE);
     $imagepath = $imagepath . "/images/stories/";
     $data = JRequest::get('post');
     $newimgfolder = $data['imgfolder'];
     $full_path = JFolder::makeSafe($imagepath . $newimgfolder);
     if (!JFolder::exists($full_path)) {
         JFolder::create($full_path);
         // mkdir ( $imagepath . $newimgfolder );
     }
     if (JPath::canChmod($full_path)) {
         JPath::setPermissions($full_path);
     }
     $data['payment'] = @serialize($data['payment']);
     $show = '';
     $mandatory = '';
     $database = JFactory::getDBO();
     if (isset($data['show'])) {
         foreach ($data['show'] as $key => $value) {
             if ($value == 1) {
                 $show .= $key . ';';
             }
         }
     }
     if (isset($data['mandatory'])) {
         foreach ($data['mandatory'] as $key => $value) {
             if ($value == 1) {
                 $mandatory .= $key . ';';
             }
         }
     }
     $data['params'] = @serialize($data['params']);
     $data['show'] = $show;
     $data['mandatory'] = $mandatory;
     $data['txtafterreg'] = JRequest::getVar("txtafterreg", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodyafterreg'] = JRequest::getVar("bodyafterreg", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodyafterregaa'] = JRequest::getVar("bodyafterregaa", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodyactivation'] = JRequest::getVar("bodyactivation", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodyrep'] = JRequest::getVar("bodyrep", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodycmpappv'] = JRequest::getVar("bodycmpappv", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodycmpdis'] = JRequest::getVar("bodycmpdis", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodyadappv'] = JRequest::getVar("bodyadappv", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodyaddisap'] = JRequest::getVar("bodyaddisap", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodyadvdis'] = JRequest::getVar("bodyadvdis", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodynewad'] = JRequest::getVar("bodynewad", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodynewcmp'] = JRequest::getVar("bodynewcmp", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodycmpex'] = JRequest::getVar("bodycmpex", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodynewuser'] = JRequest::getVar("bodynewuser", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['overviewcontent'] = JRequest::getVar("overviewcontent", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['sbcmpexpadm'] = JRequest::getVar("sbcmpexpadm", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['bodycmpexpadm'] = JRequest::getVar("bodycmpexpadm", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['forcehttps'] = JRequest::getVar("forcehttps", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['sbadchanged'] = JRequest::getVar("sbadchanged", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['boadchanged'] = JRequest::getVar("boadchanged", "", "post", "string", JREQUEST_ALLOWHTML);
     $data['txtafterreg'] = fk_slashes($data['txtafterreg']);
     $data['bodyafterreg'] = fk_slashes($data['bodyafterreg']);
     $data['bodyafterregaa'] = fk_slashes($data['bodyafterregaa']);
     $data['bodyactivation'] = fk_slashes($data['bodyactivation']);
     $data['bodyrep'] = fk_slashes($data['bodyrep']);
     $data['bodycmpappv'] = fk_slashes($data['bodycmpappv']);
     $data['bodycmpdis'] = fk_slashes($data['bodycmpdis']);
     $data['bodyadappv'] = fk_slashes($data['bodyadappv']);
     $data['bodyaddisap'] = fk_slashes($data['bodyaddisap']);
     $data['bodyadvdis'] = fk_slashes($data['bodyadvdis']);
     $data['bodynewad'] = fk_slashes($data['bodynewad']);
     $data['bodynewcmp'] = fk_slashes($data['bodynewcmp']);
     $data['bodycmpex'] = fk_slashes($data['bodycmpex']);
     $data['bodynewuser'] = fk_slashes($data['bodynewuser']);
     $data['overviewcontent'] = fk_slashes($data['overviewcontent']);
     $data['sbcmpexpadm'] = fk_slashes($data['sbcmpexpadm']);
     $data['bodycmpexpadm'] = fk_slashes($data['bodycmpexpadm']);
     $data['txtafterreg'] = $this->addFullUrl($data['txtafterreg']);
     $data['bodyafterreg'] = $this->addFullUrl($data['bodyafterreg']);
     $data['bodyafterregaa'] = $this->addFullUrl($data['bodyafterregaa']);
     $data['bodyactivation'] = $this->addFullUrl($data['bodyactivation']);
     $data['bodyrep'] = $this->addFullUrl($data['bodyrep']);
     $data['bodycmpappv'] = $this->addFullUrl($data['bodycmpappv']);
     $data['bodycmpdis'] = $this->addFullUrl($data['bodycmpdis']);
     $data['bodyadappv'] = $this->addFullUrl($data['bodyadappv']);
     $data['bodyaddisap'] = $this->addFullUrl($data['bodyaddisap']);
     $data['bodyadvdis'] = $this->addFullUrl($data['bodyadvdis']);
     $data['bodynewad'] = $this->addFullUrl($data['bodynewad']);
     $data['bodynewcmp'] = $this->addFullUrl($data['bodynewcmp']);
     $data['bodycmpex'] = $this->addFullUrl($data['bodycmpex']);
     $data['bodynewuser'] = $this->addFullUrl($data['bodynewuser']);
     $data['overviewcontent'] = $this->addFullUrl($data['overviewcontent']);
     $data['sbcmpexpadm'] = $this->addFullUrl($data['sbcmpexpadm']);
     $data['bodycmpexpadm'] = $this->addFullUrl($data['bodycmpexpadm']);
     /* Pictures in Emails */
     $data['txtafterreg'] = $this->fixIMG($data['txtafterreg']);
     $data['bodyafterreg'] = $this->fixIMG($data['bodyafterreg']);
     $data['bodyafterregaa'] = $this->fixIMG($data['bodyafterregaa']);
     $data['bodyactivation'] = $this->fixIMG($data['bodyactivation']);
     $data['bodyrep'] = $this->fixIMG($data['bodyrep']);
     $data['bodycmpappv'] = $this->fixIMG($data['bodycmpappv']);
     $data['bodycmpdis'] = $this->fixIMG($data['bodycmpdis']);
     $data['bodyadappv'] = $this->fixIMG($data['bodyadappv']);
     $data['bodyaddisap'] = $this->fixIMG($data['bodyaddisap']);
     $data['bodyadvdis'] = $this->fixIMG($data['bodyadvdis']);
     $data['bodynewad'] = $this->fixIMG($data['bodynewad']);
     $data['bodynewcmp'] = $this->fixIMG($data['bodynewcmp']);
     $data['bodycmpex'] = $this->fixIMG($data['bodycmpex']);
     $data['bodynewuser'] = $this->fixIMG($data['bodynewuser']);
     $data['overviewcontent'] = $this->fixIMG($data['overviewcontent']);
     $data['sbcmpexpadm'] = $this->fixIMG($data['sbcmpexpadm']);
     $data['bodycmpexpadm'] = $this->fixIMG($data['bodycmpexpadm']);
     if (isset($_POST['jomfields']) && is_array($_POST['jomfields'])) {
         $data['jomfields'] = json_encode($_POST['jomfields']);
     } else {
         $data['jomfields'] = '';
     }
     if (!$item->bind($data)) {
         return JError::raiseError(500, $database->getErrorMsg());
         return false;
     }
     if (!$item->check()) {
         return JError::raiseError(500, $database->getErrorMsg());
         return false;
     }
     if (!$item->store()) {
         return JError::raiseError(500, $database->getErrorMsg());
         return false;
     }
     /*Salvam PLUGIN*/
     $plugin_handler = adagencyAdminModeladagencyConfig::makePluginList();
     if (count($plugin_handler) > 0) {
         foreach ($plugin_handler as $name => $plugin) {
             $name = $plugin->name;
             $value = JRequest::getVar($name . "_account", array(0), 'array');
             $value = implode(" ", $value);
             $default = JRequest::getVar("default", null, 'post');
             $sandbox = JRequest::getVar($name . "_sandbox", 0, 'post');
             $reqhttps = JRequest::getVar($name . "_reqhttps", 0, 'post');
             $default = substr($default, 0, strlen($default) - 4);
             $value = $database->escape($value);
             if ($plugin->type == 'encoding' && file_exists($value)) {
                 $query = "update #__ad_agency_plugins set value='{$value}', sandbox='{$sandbox}' where name='{$name}';";
             } else {
                 if ($plugin->type != 'encoding') {
                     $query = "update #__ad_agency_plugins set value='{$value}', sandbox='{$sandbox}', reqhttps='{$reqhttps}' where name='{$name}';";
                 } else {
                     $query = '';
                 }
             }
             $database->setQuery($query);
             $database->query();
             $query = "update #__ad_agency_plugins set def='' where def='default';";
             $database->setQuery($query);
             $database->query();
             $query = "update #__ad_agency_plugins set def='default' where name='" . stripslashes($default) . "';";
             $database->setQuery($query);
             $database->query();
         }
     }
     if (isset($data['aa'])) {
         foreach ($data['aa'] as $key => $value) {
             $query = "";
             if ($key == "campaign_2") {
                 $query = "ALTER TABLE `#__ad_agency_campaign` CHANGE `renewcmp` `renewcmp` INT( 3 ) NOT NULL default " . $value;
             } else {
                 $query = "ALTER TABLE `#__ad_agency_" . $key . "` CHANGE `approved` `approved` ENUM( 'Y', 'N', 'P' ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT '" . $value . "'";
             }
             $database->setQuery($query);
             $database->query();
         }
         $allow_add_keywords = JRequest::getVar("allow_add_keywords", "0");
         $sql = "UPDATE `#__ad_agency_settings` SET `allow_add_keywords` = '" . intval($allow_add_keywords) . "' WHERE `id`=1";
         $database->setQuery($sql);
         $database->query();
     }
     return true;
 }