auth_block(); } switch (_OP_) { case "mailsms": $items_global = registry_search(0, 'features', 'mailsms'); // option enable fetch $option_enable_fetch = _options(array(_('yes') => 1, _('no') => 0), $items_global['features']['mailsms']['enable_fetch']); // option check email sender $option_check_sender = _options(array(_('yes') => 1, _('no') => 0), $items_global['features']['mailsms']['check_sender']); // option protocol $option_protocol = _options(array('IMAP' => 'imap', 'POP3' => 'pop3'), $items_global['features']['mailsms']['protocol']); // option ssl $option_ssl = _options(array(_('yes') => 1, _('no') => 0), $items_global['features']['mailsms']['ssl']); // option cert $option_novalidate_cert = _options(array(_('yes') => 1, _('no') => 0), $items_global['features']['mailsms']['novalidate_cert']); $tpl = array('name' => 'mailsms', 'vars' => array('ERROR' => _err_display(), 'FORM_TITLE' => _('Manage email to SMS'), 'ACTION_URL' => _u('index.php?app=main&inc=feature_mailsms&op=mailsms_save'), 'HTTP_PATH_THEMES' => _HTTP_PATH_THEMES_, 'HINT_PASSWORD' => _hint(_('Fill the password field to change password')), 'Email to SMS address' => _('Email to SMS address'), 'Enable fetch new emails' => _('Enable fetch new emails'), 'Check email sender' => _('Check email sender'), 'Email protocol' => _('Email protocol'), 'Use SSL' => _('Use SSL'), 'No validate cert option' => _('No validate cert option'), 'Mail server address' => _('Mail server address'), 'Mail server port' => _('Mail server port'), 'Mailbox username' => _('Mailbox username'), 'Mailbox password' => _('Mailbox password'), 'PORT_DEFAULT' => '443', 'PORT_DEFAULT_SSL' => '993'), 'injects' => array('option_enable_fetch', 'option_check_sender', 'option_protocol', 'option_ssl', 'option_novalidate_cert', 'items_global')); _p(tpl_apply($tpl)); break; case "mailsms_save": $items_global = array('email' => $_REQUEST['email'], 'enable_fetch' => $_REQUEST['enable_fetch'], 'check_sender' => $_REQUEST['check_sender'], 'protocol' => $_REQUEST['protocol'], 'ssl' => $_REQUEST['ssl'], 'novalidate_cert' => $_REQUEST['novalidate_cert'], 'port' => $_REQUEST['port'], 'server' => $_REQUEST['server'], 'username' => $_REQUEST['username'], 'hash' => md5($_REQUEST['username'] . $_REQUEST['server'] . $_REQUEST['port'])); if ($_REQUEST['password']) { $items_global['password'] = $_REQUEST['password']; } registry_update(0, 'features', 'mailsms', $items_global); if ($_REQUEST['enable_fetch']) { $enabled = 'enabled'; $_SESSION['error_string'] = _('Email to SMS configuration has been saved and service enabled'); } else { $enabled = 'disabled'; $_SESSION['error_string'] = _('Email to SMS configuration has been saved and service disabled'); }
} else { $_SESSION['error_string'] = _('Fail to edit SMSC'); } } else { $_SESSION['error_string'] = _('Unknown error'); header('Location: ' . _u('index.php?app=main&inc=core_gateway&op=gateway_list')); exit; } header('Location: ' . _u('index.php?app=main&inc=core_gateway&op=edit_smsc&id=' . $c_id)); exit; break; case 'del_smsc': if ($c_id = $_REQUEST['id']) { $db_table = _DB_PREF_ . '_tblGateway'; $condition = array('id' => $c_id); if (dba_remove($db_table, $condition)) { $_SESSION['error_string'] = _('SMSC has been removed'); } else { $_SESSION['error_string'] = _('Fail to remove SMSC'); } } else { $_SESSION['error_string'] = _('Unknown error'); } header('Location: ' . _u('index.php?app=main&inc=core_gateway&op=gateway_list')); exit; break; default: $content = "\n\t\t\t<h3>" . _('List of gateways and SMSCs') . "</h3>\n\t\t\t<ul class='nav nav-tabs nav-justified' id='playsms-tab'>\n\t\t\t\t<li class=active><a href='#tabs-gateway' data-toggle=tab>" . _('Gateways') . "</a></li>\n\t\t\t\t<li><a href='#tabs-virtual' data-toggle=tab>" . _('SMSCs') . "</a></li>\n\t\t\t</ul>\n\t\t\t<div class=tab-content>\n\t\t\t\t<div id='tabs-gateway' class='tab-pane fade in active'>\n\t\t\t\t\t" . _gateway_display() . "\n\t\t\t\t</div>\n\t\t\t\t<div id='tabs-virtual' class='tab-pane fade'>\n\t\t\t\t\t" . _gateway_display_smsc() . "\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<script type=\"text/javascript\" src=\"" . $core_config['http_path']['plug'] . "/themes/common/jscss/jquery.cookie.js\"></script>\n\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\$('a[data-toggle=\"tab\"]').on('shown.bs.tab', function(e){\n\t\t\t\t\t\t//save the latest tab using a cookie:\n\t\t\t\t\t\t\$.cookie('gateway_last_tab', \$(e.target).attr('href'));\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\t//activate latest tab, if it exists:\n\t\t\t\t\tvar lastTab = \$.cookie('gateway_last_tab');\n\t\t\t\t\tif (lastTab) {\n\t\t\t\t\t\t\$('ul.nav-tabs').children().removeClass('active');\n\t\t\t\t\t\t\$('a[href='+ lastTab +']').parents('li:first').addClass('active');\n\t\t\t\t\t\t\$('div.tab-content').children().removeClass('in active');\n\t\t\t\t\t\t\$(lastTab).addClass('in active');\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t</script>\n\t\t"; } $final_content = _err_display() . "\n\t<h2>" . _('Manage gateway and SMSC') . "</h2>\n\t" . $content; _p($final_content);
case "sms_board_del": $db_query = "SELECT board_keyword FROM " . _DB_PREF_ . "_featureBoard WHERE board_id='{$board_id}'"; $db_result = dba_query($db_query); $db_row = dba_fetch_array($db_result); $board_keyword = $db_row['board_keyword']; if ($board_keyword) { $db_query = "DELETE FROM " . _DB_PREF_ . "_featureBoard WHERE board_keyword='{$board_keyword}'"; if (@dba_affected_rows($db_query)) { $_SESSION['error_string'] = _('SMS board with all its messages has been deleted') . " (" . _('keyword') . ": {$board_keyword})"; } } header("Location: " . _u('index.php?app=main&inc=feature_sms_board&op=sms_board_list')); exit; break; case "sms_board_add": $content = _err_display() . "\n\t\t\t<h2>" . _('Manage board') . "</h2>\n\t\t\t<h3>" . _('Add SMS board') . "</h3>\n\t\t\t<form action=index.php?app=main&inc=feature_sms_board&op=sms_board_add_yes method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<table class=playsms-table cellpadding=1 cellspacing=2 border=0>\n\t\t\t<tr>\n\t\t\t\t<td class=label-sizer>" . _('SMS board keyword') . "</td><td><input type=text maxlength=30 name=add_board_keyword value=\"{$add_board_keyword}\"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Forward to email') . "</td><td><input type=text name=add_email value=\"{$add_email}\"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('CSS URL') . "</td><td><input type=text name=add_css value=\"{$add_css}\"></td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<p><input type=submit class=button value=\"" . _('Save') . "\">\n\t\t\t</form>\n\t\t\t" . _back('index.php?app=main&inc=feature_sms_board&op=sms_board_list'); _p($content); break; case "sms_board_add_yes": $add_board_keyword = strtoupper($_POST['add_board_keyword']); $add_email = $_POST['add_email']; $add_css = $_POST['add_css']; $add_template = $_POST['add_template']; if ($add_board_keyword) { if (checkavailablekeyword($add_board_keyword)) { if (!$add_template) { $add_template = "<div class=sms_board_row>\n"; $add_template .= "\t<div class=sender>{SENDER}</div>\n"; $add_template .= "\t<div class=datetime>{DATETIME}</div>\n"; $add_template .= "\t<div class=message>{MESSAGE}</div>\n"; $add_template .= "</div>\n";
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with playSMS. If not, see <http://www.gnu.org/licenses/>. */ defined('_SECURE_') or die('Forbidden'); if (!auth_isadmin()) { auth_block(); } switch (_OP_) { case "simulate": $sender = '629876543210'; $receiver = '1234'; $datetime = core_get_datetime(); $content .= _err_display() . "\n\t\t\t<h2>" . _('Simulate incoming SMS') . "</h2>\n\t\t\t<form action=\"index.php?app=main&inc=gateway_dev&route=simulate&op=simulate_yes\" method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<table class=playsms-table>\n\t\t\t\t<tbody>\n\t\t\t\t<tr><td class=label-sizer>" . _('Message') . "</td><td><input type=text name=message value=\"{$message}\" maxlength=250></td></tr>\n\t\t\t\t<tr><td>" . _('Sender') . "</td><td><input type=text name=sender value=\"{$sender}\" maxlength=20></td></tr>\n\t\t\t\t<tr><td>" . _('Receiver') . "</td><td><input type=text name=receiver value=\"{$receiver}\" maxlength=20></td></tr>\n\t\t\t\t<tr><td>" . _('Date/Time') . "</td><td><input type=text name=datetime value=\"" . core_display_datetime($datetime) . "\" maxlength=20></td></tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<p><input type=submit class=button value=\"" . _('Submit') . "\">\n\t\t\t</form>"; _p($content); break; case "simulate_yes": $sms_sender = $_REQUEST['sender'] ? $_REQUEST['sender'] : '629876543210'; $sms_receiver = $_REQUEST['receiver'] ? $_REQUEST['receiver'] : '1234'; $sms_datetime = $_REQUEST['datetime'] ? $_REQUEST['datetime'] : core_get_datetime(); $message = $_REQUEST['message'] ? $_REQUEST['message'] : _('This is a test incoming SMS message'); if (trim($sms_sender) && trim($sms_receiver) && trim($sms_datetime) && trim($message)) { recvsms($sms_datetime, $sms_sender, $message, $sms_receiver, 'dev'); $err[] = "Sender ID: " . $sms_sender; $err[] = "Receiver number: " . $sms_receiver; $err[] = "Sent: " . $sms_datetime; $err[] = "Message: " . stripslashes($message); _log(print_r($err, TRUE), 3, "dev incoming"); $_SESSION['error_string'] = $err;
* playSMS 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. * * You should have received a copy of the GNU General Public License * along with playSMS. If not, see <http://www.gnu.org/licenses/>. */ defined('_SECURE_') or die('Forbidden'); if (!auth_isvalid()) { auth_block(); } switch (_OP_) { case "queuelog_list": $nav = themes_nav($count, "index.php?app=main&inc=feature_queuelog&op=queuelog_list"); $content = _err_display() . "\n\t\t\t<h2>" . _('View SMS queue') . "</h2>"; $count = queuelog_countall(); if ($count) { $content .= "<p><a href=\"javascript: ConfirmURL('" . addslashes(_("Are you sure you want to delete ALL queues")) . " ?','" . _u('index.php?app=main&inc=feature_queuelog&op=queuelog_delete_all') . "')\">" . $icon_config['delete'] . _("Delete ALL queues") . " ({$count})</a></p>"; } $content .= "<div align=center>" . $nav['form'] . "</div>\n\t\t\t<div class=table-responsive>\n\t\t\t<table class=playsms-table-list>\n\t\t\t<thead>\n\t\t\t<tr>\n\t\t"; if (auth_isadmin()) { $content .= "\n\t\t\t\t<th width=20%>" . _('Queue Code') . "</th>\n\t\t\t\t<th width=15%>" . _('User') . "</th>\n\t\t\t"; } else { $content .= "\n\t\t\t\t<th width=30%>" . _('Queue Code') . "</th>\n\t\t\t"; } $content .= "\n\t\t\t\t<th width=15%>" . _('Scheduled') . "</th>\n\t\t\t\t<th width=10%>" . _('Count') . "</th>\n\t\t\t\t<th width=30%>" . _('Message') . "</th>\n\t\t\t\t<th width=10%>" . _('Action') . "</th>\n\t\t\t</tr>\n\t\t\t</thead>\n\t\t\t<tbody>\n\t\t"; $data = queuelog_get($nav['limit'], $nav['offset']); for ($c = count($data) - 1; $c >= 0; $c--) { $c_queue_code = $data[$c]['queue_code']; $c_datetime_scheduled = core_display_datetime($data[$c]['datetime_scheduled']);
* You should have received a copy of the GNU General Public License * along with playSMS. If not, see <http://www.gnu.org/licenses/>. */ defined('_SECURE_') or die('Forbidden'); if (!auth_isvalid()) { auth_block(); } switch (_OP_) { case "sms_sync_list": $list = registry_search($user_config['uid'], 'feature', 'sms_sync'); $sms_sync_secret = $list['feature']['sms_sync']['secret']; if ($list['feature']['sms_sync']['enable']) { $option_enable = 'checked'; } $sync_url = $core_config['http_path']['base'] . '/plugin/feature/sms_sync/sync.php?uid=' . $user_config['uid']; unset($tpl); $tpl = array('name' => 'sms_sync', 'vars' => array('ERROR' => _err_display(), 'HINT_SECRET' => _hint(_('Secret key is used in SMSSync app')), 'HINT_ENABLE' => _hint(_('Check to enable receiving push messages from SMSSync app')), 'SECRET' => $sms_sync_secret, 'CHECKED' => $option_enable, 'SYNC_URL' => $sync_url, 'Manage sync' => _('Manage sync'), 'Secret key' => _('Secret key'), 'Enable SMS Sync' => _('Enable SMS Sync'), 'Sync URL' => _('Sync URL'), 'Notes' => _('Notes'), 'Download SMSSync app for Android from' => _('Download SMSSync app for Android from'), 'Save' => _('Save'))); _p(tpl_apply($tpl)); break; case "sms_sync_save": $items['secret'] = $_POST['sms_sync_secret']; $items['enable'] = trim($_POST['sms_sync_enable']) ? 1 : 0; if (registry_update($user_config['uid'], 'feature', 'sms_sync', $items)) { $_SESSION['error_string'] = _('SMS Sync configuration has been saved'); } else { $_SESSION['error_string'] = _('Fail to save SMS Sync configuration'); } header("Location: " . _u('index.php?app=main&inc=feature_sms_sync&op=sms_sync_list')); exit; break; }
* GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with playSMS. If not, see <http://www.gnu.org/licenses/>. */ defined('_SECURE_') or die('Forbidden'); if (!auth_isvalid()) { auth_block(); } switch (_OP_) { case "mailsms_user": $items_global = registry_search(0, 'features', 'mailsms'); $items = registry_search($user_config['uid'], 'features', 'mailsms_user'); // option enable $option_enable = _options(array(_('yes') => 1, _('no') => 0), $items['features']['mailsms_user']['enable']); $tpl = array('name' => 'mailsms_user', 'vars' => array('ERROR' => _err_display(), 'FORM_TITLE' => _('My email to SMS'), 'ACTION_URL' => _u('index.php?app=main&inc=feature_mailsms&route=mailsms_user&op=mailsms_user_save'), 'HTTP_PATH_THEMES' => _HTTP_PATH_THEMES_, 'HINT_PASSWORD' => _hint(_('Fill the password field to change password')), 'Email to SMS address' => _('Email to SMS address'), 'PIN for email to SMS' => _mandatory(_('PIN for email to SMS'))), 'injects' => array('option_enable', 'items_global', 'items')); _p(tpl_apply($tpl)); break; case "mailsms_user_save": $continue = FALSE; $pin = core_sanitize_alphanumeric(substr(trim($_REQUEST['pin']), 0, 40)); if ($pin) { $continue = TRUE; } else { $_SESSION['error_string'][] = _('PIN is empty'); $_SESSION['error_string'][] = _('Fail to save email to SMS PIN'); } if ($continue) { $items = array('pin' => $pin); registry_update($user_config['uid'], 'features', 'mailsms_user', $items); $items_global = registry_search(0, 'features', 'mailsms');
if ($nav['url']) { $ref = $nav['url'] . '&search_keyword=' . $search['keyword'] . '&page=' . $nav['page'] . '&nav=' . $nav['nav']; } else { $ref = 'index.php?app=main&inc=core_sender_id&op=sender_id_list'; } $items['id'] = $_REQUEST['id']; $items['uid'] = $uid; $items['sender_id'] = $data_sender_id[0]['registry_key']; $items['description'] = sender_id_description($uid, $data_sender_id[0]['registry_key']); if (auth_isadmin()) { $select_approve = _yesno('approved', $data_sender_id[0]['registry_value']); $select_users = user_getfieldbyuid($uid, 'name') . ' (' . user_uid2username($uid) . ')'; } $default_sender_id = sender_id_default_get($uid); $select_default = _yesno('default', strtoupper($data_sender_id[0]['registry_key']) == strtoupper($default_sender_id) ? 1 : 0); $tpl = array('name' => 'sender_id_add', 'vars' => array('ERROR' => _err_display(), 'FORM_TITLE' => _('Manage sender ID'), 'FORM_SUBTITLE' => _('Edit sender ID'), 'ACTION_URL' => _u('index.php?app=main&inc=core_sender_id&op=sender_id_edit_yes'), 'BUTTON_BACK' => _back($ref), 'HTTP_PATH_THEMES' => _HTTP_PATH_THEMES_, 'HINT_DEFAULT' => _hint(_('Only when the sender ID is approved')), 'input_tag' => 'readonly', 'Sender ID' => _mandatory(_('Sender ID')), 'Description' => _('Description'), 'User' => _('User'), 'Approve sender ID' => _('Approve sender ID'), 'Set as default' => _('Set as default')), 'ifs' => array('isadmin' => auth_isadmin()), 'injects' => array('select_default', 'select_approve', 'select_users', 'items', 'icon_config', 'core_config')); _p(tpl_apply($tpl)); break; case "sender_id_edit_yes": if (sender_id_update($uid, $c_sender_id, $c_sender_id_description, $_REQUEST['default'], $_REQUEST['approved'])) { $_SESSION['error_string'] = _('Sender ID description has been updated') . ' (' . _('Sender ID') . ': ' . $c_sender_id . ')'; } else { $_SESSION['error_string'] = _('Fail to update due to invalid sender ID') . ' (' . _('Sender ID') . ': ' . $c_sender_id . ')'; } header("Location: " . _u('index.php?app=main&inc=core_sender_id&op=sender_id_edit&id=' . $_REQUEST['id'])); exit; break; case "toggle_status": $search = array('id' => $_REQUEST['id'], 'registry_family' => 'sender_id'); foreach (registry_search_record($search) as $row) { $status = $row['registry_value'] == 0 ? 1 : 0;
case 'delete': foreach ($items as $item) { $conditions = array('id' => $item); dba_remove(_DB_PREF_ . '_featureFirewall', $conditions); } break; } $search = themes_search_session(); $nav = themes_nav_session(); $_SESSION['error_string'] = _('IP addreses has been deleted'); $ref = $search['url'] . '&search_keyword=' . $search['keyword'] . '&search_category=' . $search['category'] . '&page=' . $nav['page'] . '&nav=' . $nav['nav']; header("Location: " . _u($ref)); exit; break; case "firewall_add": $content = _err_display() . "\n\t\t\t<h2>" . _('Manage firewall') . "</h2>\n\t\t\t<h3>" . _('Add blocked IP addresses') . " " . _hint(_('Multiple IP addresses must be comma seperated')) . "</h3>\n\t\t\t<form action='index.php?app=main&inc=feature_firewall&op=firewall_add_yes' method='post'>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<table class=playsms-table>\n\t\t\t<tr>\n\t\t\t\t<td class=label-sizer>" . _mandatory(_('Select username')) . "</td>\n\t\t\t\t<td>" . themes_select_users_single('add_username') . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=label-sizer>" . _mandatory(_('IP addresses')) . "</td>\n\t\t\t\t<td><textarea name='add_ip_address' required></textarea></td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<p><input type='submit' class='button' value='" . _('Save') . "'></p>\n\t\t\t</form>\n\t\t\t" . _back('index.php?app=main&inc=feature_firewall&op=firewall_list'); _p($content); break; case "firewall_add_yes": $add_username = user_uid2username($_POST['add_username']); $add_ip_address = $_POST['add_ip_address']; if ($add_username && $add_ip_address) { foreach (explode(',', str_replace(' ', '', $add_ip_address)) as $ip) { blacklist_addip($add_username, $ip); } $_SESSION['error_string'] = _('IP addresses have been blocked'); } else { $_SESSION['error_string'] = _('You must fill all fields'); } header("Location: " . _u('index.php?app=main&inc=feature_firewall&op=firewall_add')); exit;
unset($params); $params = array('size' => '100%', 'maxlength' => 30, 'placeholder' => _('Insert keyword')); $input_prefix = _input('text', 'sandbox_prefix', $post_rules['insert_prefix'], $params, 'playsms-sandbox-prefix', 'form-control'); // sandbox forward to users unset($params); $params = array('width' => '100%', 'placeholder' => _('Select users')); $select_users = themes_select_users_multi('uids', $post_rules['forward_to'], $params, 'playsms-route-to-users'); $form_post_rules = array(array('id' => 'playsms-sandbox-match-sender-id', 'label' => _('Route all sandbox SMS with matched sender ID'), 'input' => $select_match_sender_id, 'help' => _('Route to user inbox if receiver number matched with user sender ID')), array('id' => 'playsms-route-to-users', 'label' => _('Route all sandbox SMS to users'), 'input' => $select_users, 'help' => '')); // form settings $settings = incoming_settings_get(); // settings to leave copy on sandbox $settings_leave_copy_sandbox = _yesno('settings_leave_copy_sandbox', $settings['leave_copy_sandbox'], '', '', '', 'settings_leave_copy_sandbox', 'form-control'); // settings to match with all approved sender ID $settings_match_all_sender_id = _yesno('settings_match_all_sender_id', $settings['match_all_sender_id'], '', '', '', 'settings_match_all_sender_id', 'form-control'); $form_settings = array(array('id' => 'playsms-settings-leave-copy', 'label' => _('Leave a copy in sandbox SMS page'), 'input' => $settings_leave_copy_sandbox, 'help' => _('Leaving a copy in sandbox SMS page may be useful for audit or reviews')), array('id' => 'playsms-settings-match-all', 'label' => _('Match with all approved sender ID'), 'input' => $settings_match_all_sender_id, 'help' => _('Receiver number can be matched with default sender ID or with all approved sender ID'))); $tpl = array('name' => 'incoming', 'vars' => array('ERROR' => _err_display(), 'PAGE_TITLE' => _('Route incoming SMS'), 'ACTION_URL' => _u('index.php?app=main&inc=feature_incoming&op=incoming_save'), 'HTTP_PATH_THEMES' => _HTTP_PATH_THEMES_, 'HINT_PRE_RULES' => _hint(_('Rules applied before incoming SMS processed')), 'HINT_POST_RULES' => _hint(_('Rules applied after incoming SMS processed')), 'Pre rules' => _('Pre rules'), 'Post rules' => _('Post rules'), 'Settings' => _('Settings'), 'Save' => _('Save')), 'loops' => array('form_pre_rules' => $form_pre_rules, 'form_post_rules' => $form_post_rules, 'form_settings' => $form_settings), 'injects' => array('core_config')); _p(tpl_apply($tpl)); break; case "incoming_save": // form pre rules // scan message for @username $pre_rules['match_username'] = (int) $_REQUEST['incoming_match_username']; $items['incoming_match_username'] = $pre_rules['match_username']; // scan message for #groupcode $pre_rules['match_groupcode'] = (int) $_REQUEST['incoming_match_groupcode']; $items['incoming_match_groupcode'] = $pre_rules['match_groupcode']; // form post rules // sandbox match receiver number and sender ID $post_rules['match_sender_id'] = (int) $_REQUEST['sandbox_match_sender_id']; $items['sandbox_match_sender_id'] = $post_rules['match_sender_id']; // sandbox prefix