18 require_once SQ_FUDGE_PATH.
'/general/file_system.inc';
19 require_once SQ_CORE_PACKAGE_PATH.
'/system/triggers/trigger_action/trigger_action.inc';
48 parent::__construct($assetid);
70 public static function execute($settings, &$state)
73 if (empty($settings[
'ipbsdk_path']) || !file_exists($settings[
'ipbsdk_path'])) {
79 if (empty($state[
'asset'])) {
81 if (empty($state[
'assetid'])) {
84 $state[
'asset'] =& $GLOBALS[
'SQ_SYSTEM']->am->getAsset($state[
'assetid']);
88 $username = $state[
'asset']->attr(
'username');
91 if (isset($settings[
'password']) && !empty($settings[
'password'])) {
92 $password = $settings[
'password'];
94 $password = $state[
'event'][
'data'][
'password'];
98 if (!file_exists($settings[
'ipbsdk_path'].
'/ipbsdk_class.inc.php')) {
99 trigger_localised_error(
'IPB0001', E_USER_WARNING);
102 require_once $settings[
'ipbsdk_path'].
'/ipbsdk_class.inc.php';
106 $old_reporting_level = error_reporting(0);
108 if (!$SDK->login($username, $password, 1)) {
111 error_reporting($old_reporting_level);
128 public static function getInterface($settings, $prefix, $write_access=FALSE)
130 $ipbsdk_path = array_get_index($settings,
'ipbsdk_path',
'');
135 <td valign=
"top"><b><?php echo translate(
'ipb_path_to_ipbsdk'); ?></b></td>
136 <td valign=
"top" style=
"padding-bottom: 10px;"><?php
139 echo text_box($prefix.
'[ipbsdk_path]', $ipbsdk_path,
'50');
141 echo $ipbsdk_path.
' ';
144 <br /><b>Note:</b> Please make sure the IPB SDK version is compatible with the installed IPB.
145 <br />For more information, please visit <a href=
"http://ipbsdk.sourceforge.net/">the IPBSDK website</a>
151 return ob_get_clean();
169 $ipbsdk_path = array_get_index($request_data,
'ipbsdk_path',
'');
170 $ipbsdk_path = trim($ipbsdk_path);
171 if ($ipbsdk_path ==
'') {
172 trigger_localised_error(
'IPB0002', E_USER_WARNING);
175 $settings[
'ipbsdk_path'] = $ipbsdk_path;
191 public static function getLocks($settings, &$state)
194 $state[
'assetid'] => Array(