} else { if ($types[$name] == "array") { $c->set_value("value", serialize($_POST[$name])); $TPL[$name] = $_POST[$name]; } } $c->save(); $TPL["message_good"] = "Saved configuration."; } } // Handle the only checkbox specially. If more checkboxes are added this // should be rewritten. #echo var_dump($_POST); if ($_POST['sbs_link'] == "rss" && !$_POST['rssShowProject']) { $c = new config(); $c->set_id(config::get_config_item_id('rssShowProject')); $c->select(); $c->set_value("value", '0'); $c->save(); } $TPL["message"] or $TPL["message_good"] = "Saved configuration."; } else { if ($_POST["delete_logo"]) { foreach (array(ALLOC_LOGO, ALLOC_LOGO_SMALL) as $logo) { if (file_exists($logo)) { if (unlink($logo)) { $TPL["message_good"][] = "Deleted " . $logo; } } if (file_exists($logo)) { alloc_error("Unable to delete " . $logo);
<?php // Add new Estimate options to the types of printable time sheets. $ops = config::get_config_item("timeSheetPrintOptions"); $ops["timeSheetPrintMode=estimate"] = "Estimate"; $ops["timeSheetPrintMode=estimate&printDesc=1"] = "Estimate+"; $id = config::get_config_item_id("timeSheetPrintOptions"); $c = new config(); $c->set_id($id); $c->select(); $c->set_value("value", serialize($ops)); $c->save();
<?php // Change email default From email addresses from Alex Lance <*****@*****.**> to alla@cyber.com.dsa $email = config::get_config_item("AllocFromEmailAddress"); $email = preg_replace("/^.*</", "", $email); $email = str_replace(">", "", $email); $configID = config::get_config_item_id("AllocFromEmailAddress"); $c = new config(); $c->set_id($configID); $c->select(); $c->set_value("value", $email); $c->save();
* * You should have received a copy of the GNU Affero General Public License * along with allocPSA. If not, see <http://www.gnu.org/licenses/>. */ require_once "../alloc.php"; if (!have_entity_perm("config", PERM_UPDATE, $current_user, true)) { alloc_error("Permission denied.", true); } $configName = $_POST["configName"] or $configName = $_GET["configName"]; $TPL["configName"] = $configName; $configType = $_POST["configType"] or $configType = $_GET["configType"] or $configType = "array"; $TPL["configType"] = $configType; if ($configName) { $config = new config(); $id = config::get_config_item_id($configName); $config->set_id($id); $config->select(); } if ($_POST["save"]) { if ($configType == "people") { $arr = config::get_config_item($configName); if (!in_array($_POST['value'], $arr)) { $arr[] = $_POST["value"]; $config->set_value("value", serialize($arr)); $config->save(); } } else { $arr = config::get_config_item($configName); $arr[$_POST["key"]] = $_POST["value"]; $config->set_value("value", serialize($arr)); $config->save();