本文整理汇总了PHP中_hint函数的典型用法代码示例。如果您正苦于以下问题:PHP _hint函数的具体用法?PHP _hint怎么用?PHP _hint使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_hint函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defined
<?php
defined('_SECURE_') or die('Forbidden');
if (!auth_isadmin()) {
auth_block();
}
include $core_config['apps_path']['plug'] . "/gateway/msgtoolbox/config.php";
switch (_OP_) {
case "manage":
if ($err = $_SESSION['error_string']) {
$content = "<div class=error_string>{$err}</div>";
}
$content .= "\n\t\t\t<h2>" . _('Manage msgtoolbox') . "</h2>\n\t\t\t<form action=index.php?app=main&inc=gateway_msgtoolbox&op=manage_save 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>\n\t\t\t\t\t<td class=label-sizer>" . _('Gateway name') . "</td><td>msgtoolbox</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('msgtoolbox URL') . "</td><td><input type=text maxlength=250 name=up_url value=\"" . $plugin_config['msgtoolbox']['url'] . "\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Route') . "</td><td><input type=text size=5 maxlength=5 name=up_route value=\"" . $plugin_config['msgtoolbox']['route'] . "\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<td>" . _('Username') . "</td><td><input type=text maxlength=30 name=up_username value=\"" . $plugin_config['msgtoolbox']['username'] . "\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Password') . "</td><td><input type=password maxlength=30 name=up_password value=\"\"> " . _hint(_('Fill to change the password')) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Module sender ID') . "</td><td><input type=text maxlength=16 name=up_module_sender value=\"" . $plugin_config['msgtoolbox']['module_sender'] . "\"> " . _hint(_('Max. 16 numeric or 11 alphanumeric char. empty to disable')) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Module timezone') . "</td><td><input type=text size=5 maxlength=5 name=up_global_timezone value=\"" . $plugin_config['msgtoolbox']['datetime_timezone'] . "\"> " . _hint(_('Eg: +0700 for Jakarta/Bangkok timezone')) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<p><input type=submit class=button value=\"" . _('Save') . "\">\n\t\t\t</form>";
$content .= _back('index.php?app=main&inc=core_gateway&op=gateway_list');
_p($content);
break;
case "manage_save":
$up_url = $_POST['up_url'];
$up_route = $_POST['up_route'];
$up_username = $_POST['up_username'];
$up_password = $_POST['up_password'];
$up_module_sender = $_POST['up_module_sender'];
$up_global_timezone = $_POST['up_global_timezone'];
$_SESSION['error_string'] = _('No changes have been made');
if ($up_url && $up_username) {
if ($up_password) {
$password_change = "cfg_password='{$up_password}',";
}
$db_query = "\n\t\t\t\tUPDATE " . _DB_PREF_ . "_gatewayMsgtoolbox_config\n\t\t\t\tSET c_timestamp='" . mktime() . "',\n\t\t\t\tcfg_url='{$up_url}',\n\t\t\t\tcfg_route='{$up_route}',\n\t\t\t\tcfg_username='{$up_username}',\n\t\t\t\t" . $password_change . "\n\t\t\t\tcfg_module_sender='{$up_module_sender}',\n\t\t\t\tcfg_datetime_timezone='{$up_global_timezone}'\n\t\t\t";
if (@dba_affected_rows($db_query)) {
$_SESSION['error_string'] = _('Gateway module configurations has been saved');
示例2: auth_block
if (!auth_isadmin()) {
auth_block();
}
include $core_config['apps_path']['plug'] . "/gateway/telerivet/config.php";
$gw = core_gateway_get();
if ($gw == $plugin_config['telerivet']['name']) {
$status_active = "<span class=status_active />";
} else {
$status_active = "<span class=status_inactive />";
}
switch (_OP_) {
case "manage":
if ($err = TRUE) {
$content = _dialog();
}
$tpl = array('name' => 'telerivet', 'vars' => array('DIALOG_DISPLAY' => $error_content, 'Manage telerivet' => _('Manage telerivet'), 'Gateway name' => _('Gateway name'), 'Project ID' => _('Project ID'), 'Telerivet URL' => _('Telerivet URL'), 'API key' => _('API key'), 'Callback URL' => _('Callback URL'), 'Callback Secret' => _('Callback Secret'), 'Save' => _('Save'), 'HINT_FILL_KEY' => _hint(_('Fill to change the API key')), 'BUTTON_BACK' => _back('index.php?app=main&inc=core_gateway&op=gateway_list'), 'status_active' => $status_active, 'telerivet_param_url' => $plugin_config['telerivet']['url'], 'telerivet_param_project_id' => $plugin_config['telerivet']['project_id'], 'telerivet_param_api_key' => $plugin_config['telerivet']['api_key'], 'telerivet_param_status_url' => $plugin_config['telerivet']['status_url'], 'telerivet_param_status_secret' => $plugin_config['telerivet']['status_secret']));
_p(tpl_apply($tpl));
break;
case "manage_save":
$up_url = $_POST['up_url'];
$up_project_id = $_POST['up_project_id'];
$up_api_key = $_POST['up_api_key'];
$up_status_url = $_POST['up_status_url'];
$up_status_secret = $_POST['up_status_secret'];
$_SESSION['dialog']['info'][] = _('No changes has been made');
if ($up_url && $up_project_id) {
if ($up_api_key) {
$api_key_change = "cfg_api_key='{$up_api_key}',";
}
$db_query = "\n UPDATE " . _DB_PREF_ . "_gatewayTelerivet_config\n SET c_timestamp='" . mktime() . "',\n cfg_url='{$up_url}',\n " . $api_key_change . "\n cfg_project_id='{$up_project_id}',\n cfg_status_url='{$up_status_url}',\n cfg_status_secret='{$up_status_secret}'";
_log('query:' . $db_query, 2, 'config telerivet');
示例3: defined
* 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('DIALOG_DISPLAY' => _dialog(), '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['dialog']['info'][] = _('SMS Sync configuration has been saved');
} else {
$_SESSION['dialog']['info'][] = _('Fail to save SMS Sync configuration');
}
header("Location: " . _u('index.php?app=main&inc=feature_sms_sync&op=sms_sync_list'));
exit;
break;
}
示例4: dba_query
$schedule_id = $_REQUEST['schedule_id'];
// schedule ID
$db_query = "SELECT * FROM " . _DB_PREF_ . "_featureSchedule WHERE uid='" . $user_config['uid'] . "' AND id='{$schedule_id}' AND flag_deleted='0'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$schedule_name = $db_row['name'];
$schedule_message = $db_row['message'];
if ($id && $schedule_id && $schedule_name && $schedule_message) {
$db_query = "SELECT * FROM " . _DB_PREF_ . "_featureSchedule_dst WHERE schedule_id='{$schedule_id}' AND id='{$id}'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$schedule = $db_row['schedule'];
$schedule = $schedule ? core_display_datetime($schedule) : '0000-00-00 00:00:00';
$name = $db_row['name'];
$destination = $db_row['destination'];
$content = _dialog() . "\n\t\t\t\t<h2>" . _('Schedule messages') . "</h2>\n\t\t\t\t<h3>" . _('Manage schedule') . "</h3>\n\t\t\t\t<h4>" . _('Edit destination') . "</h4>\n\t\t\t\t<form action=index.php?app=main&inc=feature_schedule&route=manage&op=dst_edit_yes method=post>\n\t\t\t\t" . _CSRF_FORM_ . "\n\t\t\t\t<input type=hidden name=schedule_id value='" . $schedule_id . "'>\n\t\t\t\t<input type=hidden name=id value='" . $id . "'>\n\t\t\t\t<table class=playsms-table cellpadding=1 cellspacing=2 border=0>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=label-sizer>" . _('Schedule name') . "</td><td>" . $schedule_name . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Scheduled message') . "</td><td>" . $schedule_message . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _mandatory(_('Name')) . "</td><td><input type=text maxlength=250 name=name value='" . $name . "'></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _mandatory(_('Destination')) . "</td><td><input type=text maxlength=20 name=destination value='" . $destination . "'> " . _hint(_('Separate by comma for multiple destinations')) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _mandatory(_('Schedule')) . "</td><td><input type=text maxlength=19 name=schedule value='" . $schedule . "'> " . _hint(_('Format YYYY-MM-DD hh:mm')) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t\t<p><input type=submit class=button value=\"" . _('Save') . "\">\n\t\t\t\t</form>\n\t\t\t\t" . _back('index.php?app=main&inc=feature_schedule&route=manage&op=list&id=' . $schedule_id);
} else {
auth_block();
}
_p($content);
break;
case "dst_edit_yes":
$id = $_REQUEST['id'];
// destination ID
$schedule_id = $_REQUEST['schedule_id'];
// schedule ID
$db_query = "SELECT * FROM " . _DB_PREF_ . "_featureSchedule WHERE uid='" . $user_config['uid'] . "' AND id='{$schedule_id}' AND flag_deleted='0'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$schedule_name = $db_row['name'];
$schedule_message = $db_row['message'];
示例5: _
$_SESSION['dialog']['info'][] = _('New ACL been added');
} else {
$_SESSION['dialog']['info'][] = _('Fail to add new ACL');
}
} else {
$_SESSION['dialog']['info'][] = _('Mandatory fields must not be empty');
}
header("Location: " . _u('index.php?app=main&inc=core_acl&op=add'));
exit;
break;
case "edit":
$id = (int) $_REQUEST['id'];
$db_query = "SELECT * FROM " . _DB_PREF_ . "_tblACL WHERE flag_deleted='0' AND id='" . $id . "'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$content = _dialog() . "\n\t\t\t<h2>" . _('Manage ACL') . "</h2>\n\t\t\t<h3>" . _('Edit ACL') . "</h3>\n\t\t\t<form action=index.php?app=main&inc=core_acl&op=edit_yes method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name=id value='" . $id . "'>\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>" . _('ACL ID') . "</td><td>" . $id . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Name') . "</td><td>" . strtoupper($db_row['name']) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Subuser ACL') . "</td><td><input type=text name=acl_subuser value='" . strtoupper($db_row['acl_subuser']) . "'> " . _hint(_('Comma separated for multiple entries')) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Disallowed URLs') . "</td><td>" . _yesno('acl_disallowed', $db_row['flag_disallowed']) . " " . _hint(_('Decide if this ACL is containing disallowed URLs rather than allowed URLs')) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('URLs') . "</td><td><textarea rows=5 name=url>" . $db_row['url'] . "</textarea><br />" . _hint(_('Comma separated for multiple entries')) . "</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=core_acl&op=acl_list');
_p($content);
break;
case "edit_yes":
$id = (int) $_POST['id'];
$name = trim(strtoupper($_POST['name']));
$acl_subusers = explode(',', trim(strtoupper($_POST['acl_subuser'])));
foreach ($acl_subusers as $item) {
$acl_subuser .= ' ' . trim(strtoupper($item)) . ',';
}
$acl_subuser = trim(substr($acl_subuser, 0, -1));
$acl_disallowed = (int) $_REQUEST['acl_disallowed'];
$url = trim($_POST['url']);
if ($id) {
$db_query = "\n\t\t\t\tUPDATE " . _DB_PREF_ . "_tblACL SET c_timestamp='" . mktime() . "',acl_subuser='" . $acl_subuser . "',url='" . $url . "',flag_disallowed='" . $acl_disallowed . "'\n\t\t\t\tWHERE id='" . $id . "'";
if ($new_id = @dba_affected_rows($db_query)) {
示例6: _
$form_title = _('Manage account');
if ($is_parent) {
$button_delete = "<input type=button class=button value='" . _('Delete') . "' onClick=\"javascript: ConfirmURL('" . _('Are you sure you want to delete subuser ?') . " (" . _('username') . ": " . $c_username . ")','index.php?app=main&inc=core_user&route=subuser_mgmnt&op=subuser_del" . $url_uname . "')\">";
$button_back = _back('index.php?app=main&inc=core_user&route=subuser_mgmnt&op=subuser_list');
} else {
$button_delete = "<input type=button class=button value='" . _('Delete') . "' onClick=\"javascript: ConfirmURL('" . _('Are you sure you want to delete user ?') . " (" . _('username') . ": " . $c_username . ")','index.php?app=main&inc=core_user&route=user_mgmnt&op=user_del" . $url_uname . "&view=" . $view . "')\">";
$button_back = _back('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view=' . $view);
}
} else {
$form_title = _('Preferences');
}
// error string
if ($err = TRUE) {
$error_content = _dialog();
}
$tpl = array('name' => 'user_pref', 'vars' => array('Account status' => _('Account status'), 'Parent account' => _('Parent account') . " (" . _('for subuser only') . ")", 'Login information' => _('Login information'), 'Username' => _('Username'), 'Password' => _('Password'), 'Re-type password' => _('Re-type password'), 'Personal information' => _('Personal information'), 'Name' => _mandatory(_('Name')), 'Email' => _mandatory(_('Email')), 'Mobile' => _('Mobile'), 'Address' => _('Address'), 'City' => _('City'), 'State or Province' => _('State or Province'), 'Country' => _('Country'), 'Zipcode' => _('Zipcode'), 'Save' => _('Save'), 'HINT_STATUS' => _hint(_('Cannot change status when user have subusers')), 'HINT_PARENT' => _hint(_('Parent account is mandatory for subusers only. If no value is given then the subuser will be automatically assigned to user admin')), 'STATUS' => _('User'), 'DIALOG_DISPLAY' => $error_content, 'FORM_TITLE' => $form_title, 'BUTTON_DELETE' => $button_delete, 'BUTTON_BACK' => $button_back, 'URL_UNAME' => $url_uname, 'VIEW' => $view, 'select_status' => $select_status, 'select_parents' => $select_parents, 'c_username' => $c_username, 'name' => $name, 'email' => $email, 'mobile' => $mobile, 'address' => $address, 'city' => $city, 'state' => $state, 'option_country' => $option_country, 'zipcode' => $zipcode), 'ifs' => array('edit_status' => $allow_edit_status, 'edit_parent' => $allow_edit_parent, 'edit_status_hint' => $show_status_hint, 'show_personal_information' => $show_personal_information));
_p(tpl_apply($tpl));
break;
case "user_pref_save":
$continue = TRUE;
$fields = array('name', 'email', 'mobile', 'address', 'city', 'state', 'country', 'password', 'zipcode');
if ($allow_edit_status) {
_log('saving username:' . $c_username . ' status:' . $_POST['up_status'], 3, 'user_pref');
$fields[] = 'status';
}
if ($allow_edit_parent) {
_log('saving username:' . $c_username . ' parent_uid:' . $_POST['up_parent_uid'], 3, 'user_pref');
$fields[] = 'parent_uid';
}
for ($i = 0; $i < count($fields); $i++) {
if ($c_data = trim($_POST['up_' . $fields[$i]])) {
示例7: dba_query
$db_query = "SELECT custom_keyword FROM " . _DB_PREF_ . "_featureCustom WHERE custom_id='{$custom_id}'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
if ($db_row['custom_keyword']) {
$db_query = "DELETE FROM " . _DB_PREF_ . "_featureCustom WHERE custom_id='{$custom_id}'";
if (@dba_affected_rows($db_query)) {
$_SESSION['dialog']['info'][] = _('SMS custom has been deleted');
} else {
$_SESSION['dialog']['danger'][] = _('Fail to delete SMS custom');
}
}
header("Location: " . _u('index.php?app=main&inc=feature_sms_custom&op=sms_custom_list'));
exit;
break;
case "sms_custom_add":
$content .= _dialog() . "\n\t\t\t<h2>" . _('Manage custom') . "</h2>\n\t\t\t<h3>" . _('Add SMS custom') . "</h3>\n\t\t\t<form action=index.php?app=main&inc=feature_sms_custom&op=sms_custom_add_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>\n\t\t\t\t\t<td class=label-sizer>" . _mandatory(_('Service name')) . "</td><td><input type=text size=30 maxlength=255 name=add_service_name value=\"" . _lastpost('add_service_name') . "\"></td>\n\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _mandatory(_('SMS custom keywords')) . "</td><td><input type=text size=30 maxlength=255 name=add_custom_keyword value=\"" . _lastpost('add_custom_keyword') . "\"> " . _hint('Multiple keywords seperated by space') . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Receiver number') . "</td><td><input type=text size=30 maxlength=20 name=add_sms_receiver value=\"" . _lastpost('add_sms_receiver') . "\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=2>" . _('Pass these parameters to custom URL field') . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td colspan=2>\n\t\t\t\t\t\t" . _('Pass these parameters to custom URL field') . "\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li>{SERVICENAME} " . _('will be replaced by service name') . "</li>\n\t\t\t\t\t\t\t<li>{SMSDATETIME} " . _('will be replaced by SMS incoming date/time') . "</li>\n\t\t\t\t\t\t\t<li>{SMSSENDER} " . _('will be replaced by sender number') . "</li>\n\t\t\t\t\t\t\t<li>{SMSRECEIVER} " . _('will be replaced by receiver number') . "</li>\n\t\t\t\t\t\t\t<li>{CUSTOMKEYWORD} " . _('will be replaced by custom keyword') . "</li>\n\t\t\t\t\t\t\t<li>{CUSTOMPARAM} " . _('will be replaced by custom parameter passed to server from SMS') . "</li>\n\t\t\t\t\t\t\t<li>{CUSTOMRAW} " . _('will be replaced by SMS raw message') . "</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t" . _('Example of SMS custom URL') . "\n\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t<li>" . htmlspecialchars('http://someserver.somedomain/handler.php?service={SERVICENAME}&datetime={SMSDATETIME}&sender={SMSSENDER}&receiver={SMSRECEIVER}&keyword={CUSTOMKEYWORD}¶m={CUSTOMPARAM}&raw={CUSTOMRAW}') . "</li>\n\t\t\t\t\t\t</ul>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _mandatory(_('SMS custom URL')) . "</td><td><input type=text maxlength=255 name=add_custom_url value=\"" . _lastpost('add_custom_url') . "\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Make return as reply') . "</td><td><input type=checkbox name=add_custom_return_as_reply></td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody>\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_custom&op=sms_custom_list');
_p($content);
break;
case "sms_custom_add_yes":
$add_service_name = trim($_POST['add_service_name']);
$add_sms_receiver = trim($_POST['add_sms_receiver']);
$add_custom_return_as_reply = $_POST['add_custom_return_as_reply'] == 'on' ? '1' : '0';
$add_custom_url = $_POST['add_custom_url'];
$add_custom_keyword = strtoupper($_POST['add_custom_keyword']);
$c_keywords = explode(' ', $add_custom_keyword);
foreach ($c_keywords as $keyword) {
if ($keyword) {
if (keyword_isavail($keyword, $add_sms_receiver)) {
$keywords .= core_sanitize_alphanumeric($keyword) . ' ';
} else {
$_SESSION['dialog']['danger'][] = sprintf(_('Keyword %s is not available'), $keyword);
示例8: auth_block
auth_block();
}
include $core_config['apps_path']['plug'] . "/gateway/uplink/config.php";
switch (_OP_) {
case "manage":
if ($plugin_config['uplink']['try_disable_footer']) {
$selected['yes'] = 'selected';
} else {
$selected['no'] = 'selected';
}
$option_try_disable_footer = "<option value=\"1\" " . $selected['yes'] . ">" . _('yes') . "</option>";
$option_try_disable_footer .= "<option value=\"0\" " . $selected['no'] . ">" . _('no') . "</option>";
if ($err = $_SESSION['error_string']) {
$error_content = "<div class=error_string>{$err}</div>";
}
$content = "\n\t\t\t" . $error_content . "\n\t\t\t<h2>" . _('Manage uplink') . "</h2>\n\t\t\t<form action=index.php?app=main&inc=gateway_uplink&op=manage_save 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>\n\t\t\t\t\t<td class=label-sizer>" . _('Gateway name') . "</td><td>uplink</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Master URL') . "</td><td><input type=text maxlength=250 name=up_master value=\"" . $plugin_config['uplink']['master'] . "\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Additional URL parameter') . "</td><td><input type=text maxlength=250 name=up_additional_param value=\"" . $plugin_config['uplink']['additional_param'] . "\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Webservice username') . "</td><td><input type=text maxlength=30 name=up_username value=\"" . $plugin_config['uplink']['username'] . "\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Webservice token') . "</td><td><input type=text maxlength=32 name=up_token value=\"\"></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Module sender ID') . "</td><td><input type=text maxlength=16 name=up_module_sender value=\"" . $plugin_config['uplink']['module_sender'] . "\"> " . _hint(_('Max. 16 numeric or 11 alphanumeric char. empty to disable')) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Try to disable SMS footer on master') . "</td><td><select name=up_try_disable_footer>" . $option_try_disable_footer . "</select></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Module timezone') . "</td><td><input type=text size=5 maxlength=5 name=up_global_timezone value=\"" . $plugin_config['uplink']['datetime_timezone'] . "\"> " . _hint(_('Eg: +0700 for Jakarta/Bangkok timezone')) . "</td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<p><input type=submit class=button value=\"" . _('Save') . "\">\n\t\t\t</form>";
$content .= _back('index.php?app=main&inc=core_gateway&op=gateway_list');
_p($content);
break;
case "manage_save":
$up_master = $_POST['up_master'];
$up_additional_param = $_POST['up_additional_param'];
$up_username = $_POST['up_username'];
if ($up_token = $_POST['up_token']) {
$update_token = "cfg_token='" . $up_token . "',";
}
$up_module_sender = $_POST['up_module_sender'];
$up_global_timezone = $_POST['up_global_timezone'];
$up_try_disable_footer = $_POST['up_try_disable_footer'];
$_SESSION['error_string'] = _('No changes have been made');
if ($up_master && $up_username) {
示例9: dba_query
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$edit_poll_title = $db_row['poll_title'];
$edit_poll_keyword = $db_row['poll_keyword'];
$edit_poll_access_code = $db_row['poll_access_code'];
$edit_poll_option_vote = (int) $db_row['poll_option_vote'];
$edit_poll_message_option = $db_row['poll_message_option'];
$edit_poll_message_valid = $db_row['poll_message_valid'];
$edit_poll_message_invalid = $db_row['poll_message_invalid'];
if (auth_isadmin()) {
$select_reply_smsc = "<tr><td>" . _('SMSC') . "</td><td>" . gateway_select_smsc('edit_smsc', $db_row['smsc']) . "</td></tr>";
}
if ($err = $_SESSION['error_string']) {
$content = "<div class=error_string>{$err}</div>";
}
$content .= "\n\t\t\t<h2>" . _('Manage poll') . "</h2>\n\t\t\t<h3>" . _('Edit SMS poll') . "</h3>\n\t\t\t<form action=index.php?app=main&inc=feature_sms_poll&op=sms_poll_edit_yes method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name=poll_id value=\"{$poll_id}\">\n\t\t\t<input type=hidden name=edit_poll_keyword value=\"{$edit_poll_keyword}\">\n\t\t\t<table class=playsms-table>\n\t\t\t<tr>\n\t\t\t\t<td class=label-sizer>" . _('SMS poll keyword') . "</td><td>{$edit_poll_keyword}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('SMS poll title') . "</td><td><input type=text maxlength=100 name=edit_poll_title value=\"{$edit_poll_title}\"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('SMS poll access code') . "</td><td><input type=text maxlength=100 name=edit_poll_access_code value=\"{$edit_poll_access_code}\"> " . _hint(_('SMS poll access code used mainly by webservices')) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Vote option') . "</td><td>" . _select('edit_poll_option_vote', $option_vote, $edit_poll_option_vote) . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Reply message on out of vote option') . "</td><td><textarea maxlength=160 name=\"edit_poll_message_option\">{$edit_poll_message_option}</textarea></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Reply message on valid vote') . "</td><td><textarea maxlength=160 name=\"edit_poll_message_valid\">{$edit_poll_message_valid}</textarea></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Reply message on invalid vote') . "</td><td><textarea maxlength=160 name=\"edit_poll_message_invalid\">{$edit_poll_message_invalid}</textarea></td>\n\t\t\t</tr>\n\t\t\t" . $select_reply_smsc . "\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<br />\n\t\t\t<h3>" . _('Edit SMS poll choices') . "</h3>";
$db_query = "SELECT choice_id,choice_title,choice_keyword FROM " . _DB_PREF_ . "_featurePoll_choice WHERE poll_id='{$poll_id}' ORDER BY choice_keyword";
$db_result = dba_query($db_query);
$content .= "\n\t\t\t<div class=table-responsive>\n\t\t\t<table class=playsms-table-list>\n\t\t\t<thead><tr>\n\t\t\t\t<th width=20%>" . _('Choice keyword') . "</th>\n\t\t\t\t<th width=70%>" . _('Description') . "</th>\n\t\t\t\t<th width=10%>" . _('Action') . "</th>\n\t\t\t</tr></thead>\n\t\t\t<tbody>";
$i = 0;
while ($db_row = dba_fetch_array($db_result)) {
$choice_id = $db_row['choice_id'];
$choice_keyword = $db_row['choice_keyword'];
$choice_title = $db_row['choice_title'];
$i++;
$content .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>{$choice_keyword}</td>\n\t\t\t\t\t<td>{$choice_title}</td>\n\t\t\t\t\t<td><a href=\"javascript:ConfirmURL('" . _('Are you sure you want to delete choice ?') . " (" . _('title') . ": " . addslashes($choice_title) . ", " . _('keyword') . ": " . $choice_keyword . ")','" . _u('index.php?app=main&inc=feature_sms_poll&op=sms_poll_choice_del&poll_id=' . $poll_id . '&choice_id=' . $choice_id) . "');\">" . $icon_config['delete'] . "</a></td>\n\t\t\t\t</tr>";
}
$content .= "\n\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t</div>\n\t\t\t<br />\n\t\t\t<p>" . _('Add choice to this poll') . "\n\t\t\t<form action=\"index.php?app=main&inc=feature_sms_poll&op=sms_poll_choice_add\" method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name=poll_id value=\"{$poll_id}\">\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>" . _('Choice keyword') . "</td><td><input type=text size=3 maxlength=10 name=add_choice_keyword></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Choice description') . "</td><td><input type=text maxlength=250 name=add_choice_title></td>\n\t\t\t</tr>\n\t\t\t</table>\n\t\t\t<p><input type=submit class=button value=\"" . _('Add') . "\">\n\t\t\t</form>\n\t\t\t" . _back('index.php?app=main&inc=feature_sms_poll&op=sms_poll_list');
_p($content);
break;
case "sms_poll_edit_yes":
示例10: auth_block
auth_block();
}
switch (_OP_) {
case "email2sms":
$items = registry_search($user_config['uid'], 'features', 'email2sms');
// option enable
$option_enable = _options(array(_('yes') => 1, _('no') => 0), $items['features']['email2sms']['enable']);
// option check email sender
$option_check_sender = _options(array(_('yes') => 1, _('no') => 0), $items['features']['email2sms']['check_sender']);
// option protocol
$option_protocol = _options(array('IMAP' => 'imap', 'POP3' => 'pop3'), $items['features']['email2sms']['protocol']);
// option ssl
$option_ssl = _options(array(_('yes') => 1, _('no') => 0), $items['features']['email2sms']['ssl']);
// option cert
$option_novalidate_cert = _options(array(_('yes') => 1, _('no') => 0), $items['features']['email2sms']['novalidate_cert']);
$tpl = array('name' => 'email2sms', 'vars' => array('DIALOG_DISPLAY' => _dialog(), 'FORM_TITLE' => _('Manage email to SMS'), 'ACTION_URL' => _u('index.php?app=main&inc=feature_email2sms&op=email2sms_save'), 'HTTP_PATH_THEMES' => _HTTP_PATH_THEMES_, 'HINT_PASSWORD' => _hint(_('Fill the password field to change password')), 'PIN for email to SMS' => _mandatory(_('PIN for email to SMS')), 'Enable email to SMS' => _('Enable email to SMS'), '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('select_users', 'option_enable', 'option_check_sender', 'option_protocol', 'option_ssl', 'option_novalidate_cert', 'items'));
_p(tpl_apply($tpl));
break;
case "email2sms_save":
$continue = FALSE;
$pin = core_sanitize_alphanumeric(substr($_REQUEST['pin'], 0, 40));
if ($pin) {
$continue = TRUE;
} else {
$_SESSION['dialog']['info'][] = _('PIN is empty');
$_SESSION['dialog']['info'][] = _('Fail to save email to SMS configuration');
}
if ($continue) {
$items = array('pin' => $pin, 'enable' => $_REQUEST['enable'], '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['password'] = $_REQUEST['password'];
示例11: _options
$options['logo_replace_title'] = _options(array(_('yes') => 1, _('no') => 0), $site_config['logo_replace_title']);
// get themes options
$options['themes_module'] = _options($core_config['plugins']['list']['themes'], $site_config['themes_module']);
// get language options
$lang_list = '';
for ($i = 0; $i < count($core_config['plugins']['list']['language']); $i++) {
$language = $core_config['plugins']['list']['language'][$i];
$c_language_title = $plugin_config[$language]['title'];
if ($c_language_title) {
$lang_list[$c_language_title] = $language;
}
}
if (is_array($lang_list)) {
$options['language_module'] = _options($lang_list, $site_config['language_module']);
}
$tpl = array('name' => 'site', 'vars' => array('ACTION_URL' => _u('index.php?app=main&inc=core_site&op=site_config_save'), 'HINT_ENABLE_LOGO' => _hint(_('Logo by default will be displayed at login, register and forgot password page')), 'HINT_DOMAIN' => _hint('Put your domain name here and then set your domain DNS A record to this server IP address'), 'DIALOG_DISPLAY' => _dialog(), 'Manage site' => _('Manage site'), 'Site configuration' => _('Site configuration'), 'Configuration' => _('Configuration'), 'Information page' => _('Information page'), 'Buy credit page' => _('Buy credit page'), 'Page title' => _('Page title'), 'Page content' => _('Page content'), 'Domain' => _('Domain'), 'Website title' => _('Website title'), 'Email service' => _('Email service'), 'Email footer' => _('Email footer'), 'Main website name' => _('Main website name'), 'Main website URL' => _('Main website URL'), 'Enable logo' => _('Enable logo'), 'Logo URL' => _('Logo URL'), 'Replace website title with logo' => _('Replace website title with logo'), 'Enable public registration' => _('Enable public registration'), 'Enable forgot password' => _('Enable forgot password'), 'Active themes' => _('Active themes'), 'Default language' => _('Default language'), 'Default credit upon registration' => _('Default credit upon registration'), 'Layout footer' => _('Layout footer'), 'Save' => _('Save')), 'injects' => array('core_config', 'site_config', 'options'));
_p(tpl_apply($tpl));
break;
case "site_config_save":
foreach ($_POST['up'] as $key => $val) {
$up[$key] = $val;
}
$site = site_config_getbydomain($up['domain']);
if ($up['domain'] && $site[0]['uid'] && $site[0]['uid'] != $user_config['uid']) {
$_SESSION['dialog']['info'][] = _('The domain is already configured by other user') . ' (' . _('domain') . ':' . $up['domain'] . ')';
} else {
site_config_set($up);
$_SESSION['dialog']['info'][] = _('Site configuration has been saved');
}
_log('site configuration saved. uid:' . $user_config['uid'] . ' domain:' . $up['domain'], 3, 'site');
header('Location:' . _u('index.php?app=main&inc=core_site&op=site_config'));
示例12: _
if ($plugin_config['kannel']['local_time']) {
$selected1 = 'selected';
} else {
$selected2 = 'selected';
}
$option_local_time = "\n\t\t\t<option value=1 {$selected1}>" . _('Yes') . "</option>\n\t\t\t<option value=0 {$selected2}>" . _('No') . "</option>\n\t\t\t";
$admin_port = $plugin_config['kannel']['admin_port'];
$admin_host = $plugin_config['kannel']['sendsms_host'];
$admin_host = $admin_port ? $admin_host . ':' . $admin_port : $admin_host;
$admin_password = $plugin_config['kannel']['admin_password'];
$url = 'http://' . $admin_host . '/status?password=' . urlencode($admin_password);
$kannel_status = @file_get_contents($url);
if (!$kannel_status) {
$kannel_status = 'Unable to access Kannel admin commands';
}
$content .= _dialog() . "\n\t\t\t<h2>" . _('Manage kannel') . "</h2>\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-configuration' data-toggle=tab>" . _('Configuration') . "</a></li>\n\t\t\t\t<li><a href='#tabs-operational' data-toggle=tab>" . _('Operational') . "</a></li>\n\t\t\t</ul>\n\t\t\t<div class=tab-content>\n\t\t\t\t<div id='tabs-configuration' class='tab-pane fade in active'>\n\t\t\t\t\t<form action=index.php?app=main&inc=gateway_kannel&op=manage_save method=post>\n\t\t\t\t\t" . _CSRF_FORM_ . "\n\t\t\t\t\t<table class=playsms-table cellpadding=1 cellspacing=2 border=0>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td class=label-sizer>" . _('Gateway name') . "</td><td>kannel</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Username') . "</td><td><input type=text maxlength=30 name=up_username value=\"" . $plugin_config['kannel']['username'] . "\"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Password') . "</td><td><input type=password maxlength=30 name=up_password value=\"\"> " . _hint(_('Fill to change the password')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Module sender ID') . "</td><td><input type=text maxlength=16 name=up_module_sender value=\"" . $plugin_config['kannel']['module_sender'] . "\"> " . _hint(_('Max. 16 numeric or 11 alphanumeric char. empty to disable')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Module timezone') . "</td><td><input type=text size=5 maxlength=5 name=up_module_timezone value=\"" . $plugin_config['kannel']['module_timezone'] . "\"> " . _hint(_('Eg: +0700 for Jakarta/Bangkok timezone')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Bearerbox hostname or IP') . "</td><td><input type=text maxlength=250 name=up_bearerbox_host value=\"" . $plugin_config['kannel']['bearerbox_host'] . "\"> " . _hint(_('Kannel specific')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Send SMS hostname or IP') . "</td><td><input type=text maxlength=250 name=up_sendsms_host value=\"" . $plugin_config['kannel']['sendsms_host'] . "\"> " . _hint(_('Kannel specific')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Send SMS port') . "</td><td><input type=text maxlength=10 name=up_sendsms_port value=\"" . $plugin_config['kannel']['sendsms_port'] . "\"> " . _hint(_('Kannel specific')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('DLR mask') . "</td><td><input type=text maxlength=2 name=up_dlr_mask value=\"" . $plugin_config['kannel']['dlr_mask'] . "\"> " . _hint(_('Kannel dlr-mask option')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Additional URL parameter') . "</td><td><input type=text maxlength=250 name=up_additional_param value=\"" . $plugin_config['kannel']['additional_param'] . "\"></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('playSMS web URL') . "</td><td><input type=text maxlength=250 name=up_playsms_web value=\"" . $plugin_config['kannel']['playsms_web'] . "\"> " . _hint(_('URL to playSMS, empty it to set it to base URL')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Incoming SMS time is in local time') . "</td><td><select name=up_local_time>" . $option_local_time . "</select> " . _hint(_('Select no if the incoming SMS time is in UTC')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t\t<p><input type=submit class=button value=\"" . _('Save') . "\">\n\t\t\t\t</div>\n\t\t\t\t<div id='tabs-operational' class='tab-pane fade'>\n\t\t\t\t\t<table class=playsms-table cellpadding=1 cellspacing=2 border=0>\n\t\t\t\t\t\t<tbody>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Kannel admin host') . "</td><td><input type=text maxlength=250 name=up_admin_host value=\"" . $plugin_config['kannel']['admin_host'] . " \"> " . _hint(_('HTTP Kannel admin host')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Kannel admin port') . "</td><td><input type=text maxlength=250 name=up_admin_port value=\"" . $plugin_config['kannel']['admin_port'] . "\"> " . _hint(_('HTTP Kannel admin port')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Kannel admin password') . "</td><td><input type=password maxlength=250 name=up_admin_password value=\"\"> " . _hint(_('HTTP Kannel admin password')) . "</td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td>" . _('Kannel status') . "</td><td><textarea rows='20' style='height: 25em; width: 100%' disabled>" . $kannel_status . "</textarea></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</tbody>\n\t\t\t\t\t</table>\n\t\t\t\t\t<p>\n\t\t\t\t\t\t<input type=submit class=button value=\"" . _('Save') . "\">\n\t\t\t\t\t\t<input type='button' value=\"" . _('Update status') . "\" class='button' onClick=\"parent.location.href='index.php?app=main&inc=gateway_kannel&op=manage_update'\">\n\t\t\t\t\t\t<input type='button' value=\"" . _('Restart Kannel') . "\" class='button' onClick=\"parent.location.href='index.php?app=main&inc=gateway_kannel&op=manage_restart'\">\n\t\t\t\t\t</p>\n\t\t\t\t\t</form>\n\t\t\t\t</div>\n\t\t\t\t<script type=\"text/javascript\" src=\"" . $core_config['http_path']['plug'] . "/themes/common/jscss/jquery.cookie.js\"></script>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\$(document).ready(function() {\n\t\t\t\t\t\t\$('a[data-toggle=\"tab\"]').on('shown.bs.tab', function(e){\n\t\t\t\t\t\t\t//save the latest tab using a cookie:\n\t\t\t\t\t\t\t\$.cookie('gateway_kannel_last_tab', \$(e.target).attr('href'));\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t\t//activate latest tab, if it exists:\n\t\t\t\t\t\tvar lastTab = \$.cookie('gateway_kannel_last_tab');\n\t\t\t\t\t\tif (lastTab) {\n\t\t\t\t\t\t\t\$('ul.nav-tabs').children().removeClass('active');\n\t\t\t\t\t\t\t\$('a[href='+ lastTab +']').parents('li:first').addClass('active');\n\t\t\t\t\t\t\t\$('div.tab-content').children().removeClass('in active');\n\t\t\t\t\t\t\t\$(lastTab).addClass('in active');\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t</script>\n\t\t\t</div>" . _back('index.php?app=main&inc=core_gateway&op=gateway_list');
_p($content);
break;
case "manage_save":
$items = array('username' => $_POST['up_username'], 'module_sender' => $_POST['up_module_sender'], 'module_timezone' => $_POST['up_module_timezone'], 'bearerbox_host' => $_POST['up_bearerbox_host'], 'sendsms_host' => $_POST['up_sendsms_host'], 'sendsms_port' => $_POST['up_sendsms_port'], 'playsms_web' => $_POST['up_playsms_web'], 'additional_param' => $_POST['up_additional_param'], 'dlr_mask' => $_POST['up_dlr_mask'], 'admin_host' => $_POST['up_admin_host'], 'admin_port' => $_POST['up_admin_port'], 'local_time' => $_POST['up_local_time']);
if ($_POST['up_password']) {
$items['password'] = $_POST['up_password'];
}
if ($_POST['up_admin_password']) {
$items['admin_password'] = $_POST['up_admin_password'];
}
registry_update(1, 'gateway', 'kannel', $items);
$_SESSION['dialog']['info'][] = _('Changes have been made');
header("Location: " . _u('index.php?app=main&inc=gateway_kannel&op=manage'));
exit;
break;
示例13: dba_query
break;
case "sms_autoreply_scenario_edit":
$autoreply_scenario_id = $_REQUEST['autoreply_scenario_id'];
$db_query = "SELECT * FROM " . _DB_PREF_ . "_featureAutoreply WHERE autoreply_id='{$autoreply_id}'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
$autoreply_keyword = $db_row['autoreply_keyword'];
$content .= "\n\t\t\t<h2>" . _('Manage autoreply') . "</h2>\n\t\t\t<h3>" . _('Edit SMS autoreply scenario') . "</h3>\n\t\t\t<form action=index.php?app=main&inc=feature_sms_autoreply&op=sms_autoreply_scenario_edit_yes method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name=autoreply_id value=\"{$autoreply_id}\">\n\t\t\t<input type=hidden name=autoreply_scenario_id value=\"{$autoreply_scenario_id}\">\n\t\t\t<table class=playsms-table>\n\t\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td class=label-sizer>" . _('SMS autoreply keyword') . "</td><td>" . $autoreply_keyword . "</td>\n\t\t\t\t</tr>";
$db_query = "SELECT * FROM " . _DB_PREF_ . "_featureAutoreply_scenario WHERE autoreply_id='{$autoreply_id}' AND autoreply_scenario_id='{$autoreply_scenario_id}'";
$db_result = dba_query($db_query);
$db_row = dba_fetch_array($db_result);
for ($i = 1; $i <= 7; $i++) {
${"edit_autoreply_scenario_param" . $i} = $db_row['autoreply_scenario_param' . $i];
}
for ($i = 1; $i <= 7; $i++) {
$content .= "\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('SMS autoreply scenario parameter') . " {$i}</td><td><input type=text size=10 maxlength=20 name=edit_autoreply_scenario_param{$i} value=\"" . ${"edit_autoreply_scenario_param" . $i} . "\"> " . _hint(_('This field is not mandatory')) . "</td>\n\t\t\t\t</tr>";
}
$edit_autoreply_scenario_result = $db_row['autoreply_scenario_result'];
$content .= "\n\t\t\t<tr>\n\t\t\t\t<td>" . _mandatory(_('SMS autoreply scenario reply')) . "</td><td><input type=text name=edit_autoreply_scenario_result value=\"{$edit_autoreply_scenario_result}\"></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<p>" . _back('index.php?app=main&inc=feature_sms_autoreply&op=sms_autoreply_manage&autoreply_id=' . $autoreply_id);
if ($err = TRUE) {
_p(_dialog());
}
_p($content);
break;
case "sms_autoreply_scenario_edit_yes":
$autoreply_scenario_id = $_POST['autoreply_scenario_id'];
$edit_autoreply_scenario_result = $_POST['edit_autoreply_scenario_result'];
for ($i = 1; $i <= 7; $i++) {
${"edit_autoreply_scenario_param" . $i} = trim(strtoupper($_POST['edit_autoreply_scenario_param' . $i]));
}
if ($edit_autoreply_scenario_result) {
示例14: defined
<?php
defined('_SECURE_') or die('Forbidden');
if (!auth_isadmin()) {
auth_block();
}
include $core_config['apps_path']['plug'] . "/gateway/gnokii/config.php";
switch (_OP_) {
case "manage":
if ($err = TRUE) {
$content = _dialog();
}
$content .= "\n\t\t\t<h2>" . _('Manage gnokii') . "</h2>\n\t\t\t<form action=index.php?app=main&inc=gateway_gnokii&op=manage_save 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>\n\t\t\t\t\t<td class=label-sizer>" . _('Gateway name') . "</td><td>gnokii</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>" . _('Gnokii installation path') . "</td><td><input type=text maxlength=250 name=up_path value=\"" . $plugin_config['gnokii']['path'] . "\"> " . _hint(_('No trailing slash') . " \"/\"") . "</td>\n\t\t\t\t</tr>\n\t\t\t\t</tbody>\n\t\t\t</table>\n\t\t\t<p><input type=submit class=button value=\"" . _('Save') . "\">\n\t\t\t</form>";
$content .= _back('index.php?app=main&inc=core_gateway&op=gateway_list');
_p($content);
break;
case "manage_save":
$up_path = $_POST['up_path'];
$_SESSION['dialog']['info'][] = _('No changes have been made');
if ($up_path) {
$db_query = "\n\t\t\t\tUPDATE " . _DB_PREF_ . "_gatewayGnokii_config\n\t\t\t\tSET c_timestamp='" . mktime() . "',cfg_path='{$up_path}'";
if (@dba_affected_rows($db_query)) {
$_SESSION['dialog']['info'][] = _('Gateway module configurations has been saved');
}
}
header("Location: " . _u('index.php?app=main&inc=gateway_gnokii&op=manage'));
exit;
break;
}
示例15: defined
*
* 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();
}
include $core_config['apps_path']['plug'] . "/gateway/openvox/config.php";
$callback_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['PHP_SELF']) . "/plugin/gateway/openvox/callback.php";
$callback_url = str_replace("//", "/", $callback_url);
$callback_url = "http://" . $callback_url;
switch (_OP_) {
case "manage":
if ($err = TRUE) {
$error_content = _dialog();
}
$tpl = array('name' => 'openvox', 'vars' => array('DIALOG_DISPLAY' => $error_content, 'Manage OpenVox' => _('Manage OpenVox'), 'Gateway name' => _('Gateway name'), 'Gateway host' => _('Gateway host'), 'Gateway port' => _('Gateway port'), 'Username' => _('Username'), 'Password' => _('Password'), 'Module sender ID' => _('Module sender ID'), 'Module timezone' => _('Module timezone'), 'Save' => _('Save'), 'Notes' => _('Notes'), 'HINT_FILL_SECRET' => _hint(_('Fill to change the password')), 'CALLBACK_URL_IS' => _('Your callback URL is'), 'CALLBACK_URL_ACCESSIBLE' => _('Your callback URL should be accessible from OpenVox'), 'BUTTON_BACK' => _back('index.php?app=main&inc=core_gateway&op=gateway_list'), 'openvox_param_gateway_host' => $plugin_config['openvox']['gateway_host'], 'openvox_param_gateway_port' => $plugin_config['openvox']['gateway_port'], 'openvox_param_username' => $plugin_config['openvox']['username'], 'callback_url' => $callback_url));
_p(tpl_apply($tpl));
break;
case "manage_save":
$_SESSION['dialog']['info'][] = _('Changes have been made');
$items = array('gateway_host' => $_POST['up_gateway_host'], 'gateway_port' => $_POST['up_gateway_port'], 'username' => $_POST['up_username'], 'password' => $_POST['up_password']);
if ($_POST['up_password']) {
$items['password'] = $_POST['up_password'];
}
registry_update(1, 'gateway', 'openvox', $items);
header("Location: " . _u('index.php?app=main&inc=gateway_openvox&op=manage'));
exit;
break;
}