17 require_once SQ_LIB_PATH.
'/html_form/html_form.inc';
18 require_once SQ_INCLUDE_PATH.
'/general_occasional.inc';
19 require_once SQ_CORE_PACKAGE_PATH.
'/system/triggers/trigger_action/trigger_action.inc';
52 public static function execute($settings, &$state)
55 if (empty($state[
'asset'])) {
57 if (empty($state[
'assetid'])) {
60 $state[
'asset'] = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($state[
'assetid']);
63 if (is_null($state[
'asset']))
return FALSE;
65 $GLOBALS[
'SQ_SYSTEM']->setRunLevel($GLOBALS[
'SQ_SYSTEM']->getRunLevel() & SQ_RUN_LEVEL_FORCED);
66 if (!$state[
'asset']->
setForceSecure($settings[
'force_secure']))
return FALSE;
68 $GLOBALS[
'SQ_SYSTEM']->restoreRunLevel();
84 public static function getInterface($settings, $prefix, $write_access=FALSE)
88 '0' =>
'Allow all protocols',
89 '1' =>
'Force secure protocol (HTTPS)',
90 '-' =>
'Force insecure protocol (HTTP)',
92 combo_box($prefix.
'_force_secure', $options, FALSE, isset($settings[
'force_secure']) ? $settings[
'force_secure'] :
'');
93 $basic_part = ob_get_contents();
96 return translate(
'trigger_set_force_secure_basic', $basic_part);
115 $settings[
'force_secure'] = $request_data;
130 public static function getLocks($settings, &$state)
133 $state[
'assetid'] => Array(
'settings'),