public static function activate($params) { $token = $params['token']; $manageCronID = $taskCronID = ''; updateOption("easyCronToken", $token); self::loadAPIDetails(); //first add 1 min cron, if free user it will give error //add "task cron" $url = APP_FULL_URL . 'cron.php?type=task'; self::$easyCronAPIObj->setOptions(array('cron_job_name' => 'IWP Task Cron')); $result = self::$easyCronAPIObj->add($url, 1); if (!empty($result) && $result['status'] == 'success') { $taskCronID = $result['cron_job_id']; } else { return $result; } //add "manage cron" $url = APP_FULL_URL . 'cron.php?type=manage'; self::$easyCronAPIObj->setOptions(array('cron_job_name' => 'IWP Manage Cron')); $result = self::$easyCronAPIObj->add($url, 30); if (!empty($result) && $result['status'] == 'success') { $manageCronID = $result['cron_job_id']; } else { return $result; } //save the IDs in DB if ($taskCronID && $manageCronID) { updateOption("easyCronJobIDs", serialize(array('taskCronID' => $taskCronID, 'manageCronID' => $manageCronID))); } self::loadAPIDetails(); return array('status' => 'success'); }
/** * Sets a value in a Database. * @param string $value The value to set in the Database. */ public function set($value) { updateOption('google_access_token', $value); }
# Smarty template Init $tpl = new Smarty(); $tpl = initSmartyTpl($path, $tpl); $form->setDefaults($oreon->optGen); $subC =& $form->addElement('submit', 'submitC', _("Save")); $DBRESULT =& $form->addElement('reset', 'reset', _("Reset")); $valid = false; if ($form->validate()) { # Update in DB $ret = array(); $ret = $form->getSubmitValues(); updateOption($pearDB, "pdfreports_smtp_server_address", isset($ret["pdfreports_smtp_server_address"]) && $ret["pdfreports_smtp_server_address"] != NULL ? $ret["pdfreports_smtp_server_address"] : "127.0.0.1"); updateOption($pearDB, "pdfreports_email_sender", isset($ret["pdfreports_email_sender"]) && $ret["pdfreports_email_sender"] != NULL ? $ret["pdfreports_email_sender"] : "*****@*****.**"); updateOption($pearDB, "pdfreports_report_author", isset($ret["pdfreports_report_author"]) && $ret["pdfreports_report_author"] != NULL ? $ret["pdfreports_report_author"] : ""); updateOption($pearDB, "pdfreports_report_header_logo", isset($ret["pdfreports_report_header_logo"]) && $ret["pdfreports_report_header_logo"] != NULL ? $ret["pdfreports_report_header_logo"] : ""); updateOption($pearDB, "pdfreports_path_gen", isset($ret["pdfreports_path_gen"]) && $ret["pdfreports_path_gen"] != NULL ? $ret["pdfreports_path_gen"] : "/usr/local/centreon/www/modules/pdfreports/generatedFiles/"); # Update in Oreon Object $oreon->initOptGen($pearDB); $o = NULL; $valid = true; $form->freeze(); } if (!$form->validate() && isset($_POST["gopt_id"])) { print "<div class='msg' align='center'>" . _("Impossible to validate, one or more field is incorrect") . "</div>"; } $form->addElement("button", "change", _("Modify"), array("onClick" => "javascript:window.location.href='?p=" . $p . "&o=pdfreports'")); # ##Apply a template definition # $renderer =& new HTML_QuickForm_Renderer_ArraySmarty($tpl); $renderer->setRequiredTemplate('{$label} <font color="red" size="1">*</font>');
function dispatchMark($data) { $notif_count = 0; $notif_count_offer = 0; //refresh the notify count if (!getOption("notifyCenterRead")) { $notifyCenterRead = array(); } else { $notifyCenterRead = unserialize(getOption("notifyCenterRead")); } if (isset($data['notifyCenter'])) { updateOption("markNotifyCenter", serialize($data['notifyCenter'])); $notif_count = count($data['notifyCenter']); foreach ($data['notifyCenter'] as $ID => $notifyDetail) { if (array_key_exists($ID, $notifyCenterRead)) { $notif_count -= 1; } } } if (isset($data['notifyOffer']) && !isset($data['notifyOffer']['error'])) { updateOption("markNotifyOffer", serialize($data['notifyOffer'])); $notif_count_offer = count($data['notifyOffer']); if (!empty($notif_count_offer)) { $notif_count_offer = 1; } } else { updateOption("markNotifyOffer", ''); //clearing old notification offer } if (isset($data['bottomLines'])) { updateOption("markBottomLines", json_encode($data['bottomLines'])); } else { updateOption("markBottomLines", ''); } //update the count updateOption("notifCount", $notif_count + $notif_count_offer); }
$sql_upd = "update tx_multishop_products_description set promotext = '' where language_id = 0 and products_id = " . $pid; $GLOBALS['TYPO3_DB']->sql_query($sql_upd) or die($HTTP_HOST . '-' . $_SERVER['PHP_SELF'] . ' --- ' . $GLOBALS['TYPO3_DB']->sql_error() . "\n\n" . $sql_upd); } if (count($option) > 0) { foreach ($option as $optname => $optval) { $hide = 0; if ($optstat[$optname] == 'hide') { $hide = 1; } $optname = ucwords($optname); if (!empty($optname)) { $optid = getOptionID($optname); if (!$optid) { $optid = insertOption($optname, $hide); } else { updateOption($optid, $hide); } if (!empty($optval)) { $value_tmp = explode(';;', $optval); foreach ($value_tmp as $optval2) { $valstat = 0; $price = 0; list($optval3, $optvalprice) = explode('||', $optval2); if (substr($optvalprice, 0, 1) == '+') { $optvalprice = str_replace('+', '', $optvalprice); $pprefix = '+'; } else { if (substr($optvalprice, 0, 1) == '-') { $optvalprice = str_replace('-', '', $optvalprice); $pprefix = '-'; } else {
public static function saveTestSmtpSettings($params) { if (!empty($params) && is_array($params)) { return updateOption("emailTempSettings", serialize($params)); } return true; }
* www.revmakx.com * * * ************************************************************/ $executeFileTimeStart = $timeStart = microtime(true); @ignore_user_abort(true); define('IS_EXECUTE_FILE', true); $isExecuteJobs = false; if (@$_REQUEST['check'] == 'sameURL') { echo 'same_url_connection'; exit; } require_once 'includes/app.php'; if (@$_REQUEST['check'] == 'sameURLUsingDB') { echo 'same_url_connection'; sleep(5); updateOption('fsockSameURLCheckUsingDBValue', $_REQUEST['fsockSameURLCheckUsingDBValue']); exit; } set_time_limit(3600); //3600 = 1hr, this is only for safety, we are controlling timeout in CURL if ($_REQUEST['runOffBrowserLoad'] == 'true') { runOffBrowserLoad(); exit; } elseif (!empty($_POST['historyID']) && !empty($_POST['actionID'])) { $historyID = $_POST['historyID']; $actionID = $_POST['actionID']; //if(empty($historyID) || empty($actionID)){ echo 'invalidRequest'; exit; } //fix: add some security $isValid = DB::getExists("?:history", "historyID", "historyID = '" . $historyID . "' AND actionID = '" . $actionID . "'"); if ($isValid) { if (empty($GLOBALS['userID'])) {
* of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * GPL License: http://www.gnu.org/licenses/gpl-2.0.txt * * Developped by : * - Christophe Coraboeuf * - Charles Judith * - Olivier LI KIANG CHEONG * - Linagora */ /* * Write here you custom installation script */ /* ini_set('display_errors',1); error_reporting(E_ALL); */ global $pearDB, $centreon_path; require_once $centreon_path . "www/include/common/common-Func.php"; require_once $centreon_path . "www/include/options/oreon/generalOpt/DB-Func.php"; updateOption($pearDB, "pdfreports_smtp_server_address", "127.0.0.1"); updateOption($pearDB, "pdfreports_email_sender", "*****@*****.**"); updateOption($pearDB, "pdfreports_report_author", "Centreon Server"); updateOption($pearDB, "pdfreports_report_header_logo", "centreon.gif"); updateOption($pearDB, "pdfreports_path_gen", $centreon_path . "www/modules/pdfreports/generatedFiles");