'; beginChairSession(); printHeader("Privacy Settings", 1); $OC_configVars = array('OC_privacy_display', 'OC_privacy_link', 'OC_privacy_banner_options'); $OC_privacyDisplayOptionsAR = array( 0 => 'none', 1 => 'menu', 2 => 'page footer' ); function ef($fsf, $ochsf) { if (preg_match("/(,?)" . $fsf . "(,?)/", $ochsf, $efmatches)) { if (($efmatches[1] == ',') && ($efmatches[2] == ',')) { $efreplace = ','; } else { $efreplace = ''; } $ochsf = preg_replace("/,?" . $fsf . ",?/", $efreplace, $ochsf); } return($ochsf); } $oc_bannerAR = json_decode($OC_configAR['OC_privacy_banner_options'], true) or err('Invalid banner options setting'); if (isset($_POST['submit']) && ($_POST['submit'] == 'Save Settings')) { // Check for valid submission if (!validToken('chair')) { warn('Invalid submission'); } $err = array(); // Check input if (!preg_match("/^[01]$/", $_POST['OC_privacy_banner_display'])) { $err[] = 'Banner Display option invalid'; } if (!isset($_POST['OC_privacy_display']) || !isset($OC_privacyDisplayOptionsAR[$_POST['OC_privacy_display']])) { $err[] = 'Policy Link Display invalid'; } if (isset($_POST['OC_privacy_display']) && (oc_strlen($_POST['OC_privacy_display']) > 250)) { $err[] = 'Policy Web Address too long'; } if (!empty($err)) { print '

Please re-enter your settings, noting the following:



'; } else { // Update bannerAR $oc_bannerAR['display'] = $_POST['OC_privacy_banner_display']; $oc_bannerAR['message'] = $_POST['OC_privacy_banner_message']; $oc_bannerAR['dismiss'] = $_POST['OC_privacy_banner_dismiss']; $_POST['OC_privacy_banner_options'] = json_encode($oc_bannerAR); // Update config updateAllConfigSettings($OC_configVars, $_POST, 'OC'); // Update Template if ( ! ocsql_query("UPDATE `" . OCC_TABLE_TEMPLATE . "` SET `subject`='', `body`='" . safeSQLstr(varValue('OC_privacy_policy', $_POST)) . "', `updated`='" . safeSQLstr(date("Y-m-d")) . "' WHERE `templateid`='privacy_policy' AND `type`='other' LIMIT 1") ) { warn('Failed to save privacy policy'); } // Update consent form fields if necessary if (OCC_LICENSE == 'Public') { if (($_POST['OC_privacy_display'] == 0)) { if ( ! preg_match("/fs_consent:consent/", $OC_configAR['OC_hideSubFields']) ) { ocsql_query("UPDATE `" . OCC_TABLE_CONFIG . "` SET `value`=CONCAT(`value`, ',fs_consent:consent') WHERE `module`='OC' AND `setting`='OC_hideSubFields' LIMIT 1"); } if ( ! preg_match("/fs_consent:consent/", $OC_configAR['OC_hideCmtFields']) ) { ocsql_query("UPDATE `" . OCC_TABLE_CONFIG . "` SET `value`=CONCAT(`value`, ',fs_consent:consent') WHERE `module`='OC' AND `setting`='OC_hideCmtFields' LIMIT 1"); } } else { if (preg_match("/fs_consent:consent/", $OC_configAR['OC_hideSubFields'])) { ocsql_query("UPDATE `" . OCC_TABLE_CONFIG . "` SET `value`='" . safeSQLstr(ef('fs_consent:consent', $OC_configAR['OC_hideSubFields'])) . "' WHERE `module`='OC' AND `setting`='OC_hideSubFields' LIMIT 1"); } if (preg_match("/fs_consent:consent/", $OC_configAR['OC_hideCmtFields'])) { ocsql_query("UPDATE `" . OCC_TABLE_CONFIG . "` SET `value`='" . safeSQLstr(ef('fs_consent:consent', $OC_configAR['OC_hideCmtFields'])) . "' WHERE `module`='OC' AND `setting`='OC_hideCmtFields' LIMIT 1"); } } } // notify user print '

Settings Saved

'; } $OC_privacy_policy = $_POST['OC_privacy_policy']; } else { // retrieve policy template list($none, $OC_privacy_policy) = oc_getTemplate('privacy_policy'); } print '
Banner (collapse)
When Display Banner is set to Yes, a banner with the Message below is shown until the Dismiss Button is clicked. If the Privacy Policy is enabled, a link to the policy is automatically included in the banner.
' . generateRadioOptions('OC_privacy_banner_display', $yesNoAR, $oc_bannerAR['display']) . '
Privacy Policy (collapse)
Select whether to include a Privacy Policy link in the menu or page footer, and either provide a link to the policy on your own web site or customize the one below. Although not required, it is strongly recommended that a privacy policy be provided. Translations of the privacy policy are not included, however may be entered below. A Display option other than "none" must be set for the Privacy Policy to be viewed.
' . generateRadioOptions('OC_privacy_display', $OC_privacyDisplayOptionsAR, varValue('OC_privacy_display', $OC_configAR)) . '
Location to display Privacy Policy link.' . ((OCC_LICENSE == 'Public') ? ' If location set, consent fields are added to non-custom forms.' : '') . '
Enter the full URL of the privacy policy on your web site or leave blank to display the policy below
'; oc_replaceCKEditor(array('OC_privacy_policy'), true, 600, 400); printFooter(); ?>