} else { $form_title = _('User configuration'); // fixme anton - now disabled since plugin/feature/credit exists // $option_credit = "<tr><td>" . _('Credit') . "</td><td>$credit</td></tr>"; } // get access control list $c_option_acl = array_flip(acl_getall()); $option_acl = _input('text', '', acl_getname($acl_id), array('readonly')); if (auth_isadmin()) { $option_acl = _select('up_acl_id', $c_option_acl, $acl_id); } if ($user_edited['status'] == 4) { $parent_id = user_getparentbyuid($user_edited['uid']); if ($parent_id == $user_config['uid']) { $c_option_acl = array_flip(acl_getallbyuid($user_config['uid'])); $option_acl = _select('up_acl_id', $c_option_acl, $acl_id); } } // additional user's config available on registry $data = registry_search($c_uid, 'core', 'user_config'); // credit unicodes messages as single message $option_enable_credit_unicode = _options(array(_('yes') => 1, _('no') => 0), $data['core']['user_config']['enable_credit_unicode']); if (auth_isadmin()) { $option_enable_credit_unicode = "<select name='edit_enable_credit_unicode'>" . $option_enable_credit_unicode . "</select>"; } else { $option_enable_credit_unicode = $user_config['opt']['enable_credit_unicode'] ? _('yes') : _('no'); } // error string if ($err = TRUE) { $error_content = _dialog(); }
function gateway_select_smsc($select_name, $default_smsc) { $c_options = array(_('Supplied SMSC') => '_smsc_supplied_', _('Routed SMSC') => '_smsc_routed_') + gateway_getall_smsc_names(); $ret = _select($select_name, $c_options, $default_smsc); return $ret; }
break; case "sms_subscribe_edit": $db_query = "SELECT * FROM " . _DB_PREF_ . "_featureSubscribe WHERE subscribe_id='{$subscribe_id}'"; $db_result = dba_query($db_query); $db_row = dba_fetch_array($db_result); $edit_subscribe_keyword = $db_row['subscribe_keyword']; $edit_subscribe_msg = $db_row['subscribe_msg']; $edit_unsubscribe_msg = $db_row['unsubscribe_msg']; $edit_subscribe_param = $db_row['subscribe_param']; $edit_unsubscribe_param = $db_row['unsubscribe_param']; $edit_forward_param = $db_row['forward_param']; $max_length = $core_config['main']['max_sms_length']; $edit_unknown_format_msg = $db_row['unknown_format_msg']; $edit_already_member_msg = $db_row['already_member_msg']; $edit_expire_msg = $db_row['expire_msg']; $select_durations = _select('edit_duration', $plugin_config['sms_subscribe']['durations'], $db_row['duration']); if (auth_isadmin()) { $select_reply_smsc = "<tr><td>" . _('SMSC') . "</td><td>" . gateway_select_smsc('smsc', $db_row['smsc']) . "</td></tr>"; } if ($err = $_SESSION['error_string']) { $content = "<div class=error_string>{$err}</div>"; } $content .= "\n\t\t\t<link rel='stylesheet' type='text/css' href=" . _HTTP_PATH_THEMES_ . "/common/jscss/sms_subscribe.css />\n\t\t\t<h2>" . _('Manage subscribe') . "</h2>\n\t\t\t<h3>" . _('Edit SMS subscribe') . "</h3>\n\t\t\t<form name=\"form_subscribe_edit\" id=\"form_subscribe_edit\" action=index.php?app=main&inc=feature_sms_subscribe&op=sms_subscribe_edit_yes method=post>\n\t\t\t" . _CSRF_FORM_ . "\n\t\t\t<input type=hidden name=subscribe_id value=\"{$subscribe_id}\">\n\t\t\t<input type=hidden name=edit_subscribe_keyword value=\"{$edit_subscribe_keyword}\">\n\t\t\t<table class=playsms-table>\n\t\t\t<tr>\n\t\t\t\t<td class=label-sizer>" . _('SMS subscribe keyword') . "</td><td>{$edit_subscribe_keyword}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=label-sizer>" . _('SMS subscribe parameter') . "</td>\n\t\t\t\t\n\t\t\t\t<td>\n\t\t\t\t\t<input type=text size=10 maxlength=20 name=edit_subscribe_param value=\"{$edit_subscribe_param}\">\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('SMS subscribe reply') . "</td>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea maxlength=\"140\" name=\"edit_subscribe_msg\" id=\"edit_subscribe_msg\" value=\"\" cols=\"35\" rows=\"3\" \n\t\t\t\t\t\tonClick=\"SmsSetCounter_Abstract('edit_subscribe_msg','txtcount','hiddcount','hiddcount_unicode');\" \n\t\t\t\t\t\tonkeypress=\"SmsSetCounter_Abstract('edit_subscribe_msg','txtcount','hiddcount','hiddcount_unicode');\" \n\t\t\t\t\t\tonblur=\"SmsSetCounter_Abstract('edit_subscribe_msg','txtcount','hiddcount','hiddcount_unicode');\" \n\t\t\t\t\t\tonKeyUp=\"SmsSetCounter_Abstract('edit_subscribe_msg','txtcount','hiddcount','hiddcount_unicode');\"\t\n\t\t\t\t\t\tonKeyUp=\"SmsCountKeyUp_Abstract({$max_length}, 'form_subscribe_edit', 'edit_subscribe_msg');\" \n\t\t\t\t\t\tonKeyDown=\"SmsCountKeyDown_Abstract({$max_length}, 'form_subscribe_edit');\">{$edit_subscribe_msg}</textarea>\n\t\t\t\t\t<br>\n\t\t\t\t\t<input type=\"text\" style=\"font-weight:bold;\" name=\"txtcount\" id=\"txtcount\" value=\"0 char : 0 SMS\" size=\"17\" onFocus=\"document.form_subscribe_edit.edit_subscribe_msg.focus();\" readonly>\n\t\t\t\t\t<input type=\"hidden\" value=\"" . $core_config['main']['max_sms_length'] . "\" name=\"hiddcount\" id=\"hiddcount\"> \n\t\t\t\t\t<input type=\"hidden\" value=\"" . $core_config['main']['max_sms_length_unicode'] . "\" name=\"hiddcount_unicode\" id=\"hiddcount_unicode\"> \n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=label-sizer>" . _('SMS unsubscribe parameter') . "</td>\n\t\t\t\t\n\t\t\t\t<td>\n\t\t\t\t\t<input type=text size=10 maxlength=20 name=edit_unsubscribe_param value=\"{$edit_unsubscribe_param}\">\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('SMS unsubscribe reply') . "</td>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea maxlength=\"140\" name=\"edit_unsubscribe_msg\" id=\"edit_unsubscribe_msg\" value=\"\" cols=\"35\" rows=\"3\" \n\t\t\t\t\t\tonClick=\"SmsSetCounter_Abstract('edit_unsubscribe_msg','txtcount_un','hiddcount_un','hiddcount_unicode_un');\" \n\t\t\t\t\t\tonkeypress=\"SmsSetCounter_Abstract('edit_unsubscribe_msg','txtcount_un','hiddcount_un','hiddcount_unicode_un');\" \n\t\t\t\t\t\tonblur=\"SmsSetCounter_Abstract('edit_unsubscribe_msg','txtcount_un','hiddcount_un','hiddcount_unicode_un');\" \n\t\t\t\t\t\tonKeyUp=\"SmsSetCounter_Abstract('edit_unsubscribe_msg','txtcount_un','hiddcount_un','hiddcount_unicode_un');\"\t\n\t\t\t\t\t\tonKeyUp=\"SmsCountKeyUp_Abstract({$max_length}, 'form_subscribe_edit', 'edit_unsubscribe_msg');\" \n\t\t\t\t\t\tonKeyDown=\"SmsCountKeyDown_Abstract({$max_length}, 'form_subscribe_edit');\">{$edit_unsubscribe_msg}</textarea>\n\t\t\t\t\t<br>\n\t\t\t\t\t<input type=\"text\" style=\"font-weight:bold;\" name=\"txtcount_un\" id=\"txtcount_un\" value=\"0 char : 0 SMS\" size=\"17\" onFocus=\"document.form_subscribe_edit.edit_unsubscribe_msg.focus();\" readonly>\n\t\t\t\t\t<input type=\"hidden\" value=\"" . $core_config['main']['max_sms_length'] . "\" name=\"hiddcount_un\" id=\"hiddcount_un\"> \n\t\t\t\t\t<input type=\"hidden\" value=\"" . $core_config['main']['max_sms_length_unicode'] . "\" name=\"hiddcount_unicode_un\" id=\"hiddcount_unicode_un\"> \n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td class=label-sizer>" . _('SMS forward parameter') . "</td>\t\t\t\t\n\t\t\t\t<td>\n\t\t\t\t\t<input type=text size=10 maxlength=20 name=edit_forward_param value=\"{$edit_forward_param}\">\n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Subscribe duration') . "</td>\t\t\t\t\n\t\t\t\t<td>" . $select_durations . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Subscription expired reply') . "</td>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea maxlength=\"140\" name=\"edit_expire_msg\" id=\"edit_expire_msg\" value=\"\" cols=\"35\" rows=\"3\" \n\t\t\t\t\t\tonClick=\"SmsSetCounter_Abstract('edit_expire_msg','txtcount_ex','hiddcount_ex','hiddcount_unicode_ex');\" \n\t\t\t\t\t\tonkeypress=\"SmsSetCounter_Abstract('edit_expire_msg','txtcount_ex','hiddcount_ex','hiddcount_unicode_ex');\" \n\t\t\t\t\t\tonblur=\"SmsSetCounter_Abstract('edit_expire_msg','txtcount_ex','hiddcount_ex','hiddcount_unicode_ex');\" \n\t\t\t\t\t\tonKeyUp=\"SmsSetCounter_Abstract('edit_expire_msg','txtcount_ex','hiddcount_ex','hiddcount_unicode_ex');\"\t\n\t\t\t\t\t\tonKeyUp=\"SmsCountKeyUp_Abstract({$max_length}, 'form_subscribe_add', 'edit_expire_msg');\" \n\t\t\t\t\t\tonKeyDown=\"SmsCountKeyDown_Abstract({$max_length}, 'form_subscribe_add');\">{$edit_expire_msg}</textarea>\n\t\t\t\t\t<br>\n\t\t\t\t\t<input type=\"text\" style=\"font-weight:bold;\" name=\"txtcount_ex\" id=\"txtcount_ex\" value=\"0 char : 0 SMS\" size=\"17\" onFocus=\"document.form_subscribe_add.edit_expire_msg.focus();\" readonly>\n\t\t\t\t\t<input type=\"hidden\" value=\"" . $core_config['main']['max_sms_length'] . "\" name=\"hiddcount_ex\" id=\"hiddcount_ex\"> \n\t\t\t\t\t<input type=\"hidden\" value=\"" . $core_config['main']['max_sms_length_unicode'] . "\" name=\"hiddcount_unicode_ex\" id=\"hiddcount_unicode_ex\"> \n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Unknown format reply') . "</td>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea maxlength=\"140\" name=\"edit_unknown_format_msg\" id=\"edit_unknown_format_msg\" value=\"\" cols=\"35\" rows=\"3\" \n\t\t\t\t\t\tonClick=\"SmsSetCounter_Abstract('edit_unknown_format_msg','txtcount_uk','hiddcount_uk','hiddcount_unicode_uk');\" \n\t\t\t\t\t\tonkeypress=\"SmsSetCounter_Abstract('edit_unknown_format_msg','txtcount_uk','hiddcount_uk','hiddcount_unicode_uk');\" \n\t\t\t\t\t\tonblur=\"SmsSetCounter_Abstract('edit_unknown_format_msg','txtcount_uk','hiddcount_uk','hiddcount_unicode_uk');\" \n\t\t\t\t\t\tonKeyUp=\"SmsSetCounter_Abstract('edit_unknown_format_msg','txtcount_uk','hiddcount_uk','hiddcount_unicode_uk');\"\t\n\t\t\t\t\t\tonKeyUp=\"SmsCountKeyUp_Abstract({$max_length}, 'form_subscribe_add', 'edit_unknown_format_msg');\" \n\t\t\t\t\t\tonKeyDown=\"SmsCountKeyDown_Abstract({$max_length}, 'form_subscribe_add');\">{$edit_unknown_format_msg}</textarea>\n\t\t\t\t\t<br>\n\t\t\t\t\t<input type=\"text\" style=\"font-weight:bold;\" name=\"txtcount_uk\" id=\"txtcount_uk\" value=\"0 char : 0 SMS\" size=\"17\" onFocus=\"document.form_subscribe_add.edit_unknown_format_msg.focus();\" readonly>\n\t\t\t\t\t<input type=\"hidden\" value=\"" . $core_config['main']['max_sms_length'] . "\" name=\"hiddcount_uk\" id=\"hiddcount_uk\"> \n\t\t\t\t\t<input type=\"hidden\" value=\"" . $core_config['main']['max_sms_length_unicode'] . "\" name=\"hiddcount_unicode_uk\" id=\"hiddcount_unicode_uk\"> \n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Already a member reply') . "</td>\n\t\t\t\t<td>\n\t\t\t\t\t<textarea maxlength=\"140\" name=\"edit_already_member_msg\" id=\"edit_already_member_msg\" value=\"\" cols=\"35\" rows=\"3\" \n\t\t\t\t\t\tonClick=\"SmsSetCounter_Abstract('edit_already_member_msg','txtcount_am','hiddcount_am','hiddcount_unicode_am');\" \n\t\t\t\t\t\tonkeypress=\"SmsSetCounter_Abstract('edit_already_member_msg','txtcount_am','hiddcount_am','hiddcount_unicode_am');\" \n\t\t\t\t\t\tonblur=\"SmsSetCounter_Abstract('edit_already_member_msg','txtcount_am','hiddcount_am','hiddcount_unicode_am');\" \n\t\t\t\t\t\tonKeyUp=\"SmsSetCounter_Abstract('edit_already_member_msg','txtcount_am','hiddcount_am','hiddcount_unicode_am');\"\t\n\t\t\t\t\t\tonKeyUp=\"SmsCountKeyUp_Abstract({$max_length}, 'form_subscribe_add', 'edit_already_member_msg');\" \n\t\t\t\t\t\tonKeyDown=\"SmsCountKeyDown_Abstract({$max_length}, 'form_subscribe_add');\">{$edit_already_member_msg}</textarea>\n\t\t\t\t\t<br>\n\t\t\t\t\t<input type=\"text\" style=\"font-weight:bold;\" name=\"txtcount_am\" id=\"txtcount_am\" value=\"0 char : 0 SMS\" size=\"17\" onFocus=\"document.form_subscribe_add.edit_already_member_msg.focus();\" readonly>\n\t\t\t\t\t<input type=\"hidden\" value=\"" . $core_config['main']['max_sms_length'] . "\" name=\"hiddcount_am\" id=\"hiddcount_am\"> \n\t\t\t\t\t<input type=\"hidden\" value=\"" . $core_config['main']['max_sms_length_unicode'] . "\" name=\"hiddcount_unicode_am\" id=\"hiddcount_unicode_am\"> \n\t\t\t\t</td>\n\t\t\t</tr>\n\t\t\t" . $select_reply_smsc . "\n\t\t</table>\n\t\t<p><input type=submit class=button value=\"" . _('Save') . "\">\n\t\t</form>\n\t\t<p>" . _back('index.php?app=main&inc=feature_sms_subscribe&op=sms_subscribe_list'); _p($content); break; case "sms_subscribe_edit_yes": $edit_subscribe_keyword = strtoupper($_POST['edit_subscribe_keyword']); $edit_subscribe_msg = $_POST['edit_subscribe_msg']; $edit_unsubscribe_msg = $_POST['edit_unsubscribe_msg']; $edit_subscribe_param = strtoupper($_POST['edit_subscribe_param']); $edit_unsubscribe_param = strtoupper($_POST['edit_unsubscribe_param']);
$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":
$default_parent_uid = $parent_uid && $parent['uid'] == $user_edited['parent_uid'] ? $parent['uid'] : $core_config['main']['default_parent']; $select_parents = themes_select_account_level_single(3, 'add_parent_uid', $default_parent_uid); if ($view == 'admin') { $selected_admin = 'selected'; } else { if ($view == 'users') { $selected_users = 'selected'; } else { if ($view == 'subusers') { $selected_subusers = 'selected'; } } } $option_status = "\n\t\t\t<option value='2' " . $selected_admin . ">" . _('Administrator') . "</option>\n\t\t\t<option value='3' " . $selected_users . ">" . _('User') . "</option>\n\t\t\t<option value='4' " . $selected_subusers . ">" . _('Subuser') . "</option>\n\t\t"; // get access control list $option_acl = _select('add_acl_id', array_flip(acl_getall())); $content .= "\n\t\t<h2>" . _('Manage account') . "</h2>\n\t\t<h3>" . _('Add account') . "</h3>\n\t\t<form action='index.php?app=main&inc=core_user&route=user_mgmnt&op=user_add_yes&view=" . $view . "' method=POST>\n\t\t" . _CSRF_FORM_ . "\n\t\t<table class=playsms-table>\n\t\t<tbody>\n\t\t<tr>\n\t\t\t<td class=label-sizer>" . _('Account status') . "</td><td><select name='add_status'>{$option_status}</select></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Access Control List') . "</td><td>" . $option_acl . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Parent account') . " (" . _('for subuser only') . ") </td><td>" . $select_parents . " " . _hint(_('Parent account is mandatory for subusers only. If no value is given then the subuser will be automatically assigned to user admin')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Username')) . "</td><td><input type='text' maxlength='30' name='add_username' value=\"{$add_username}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Password')) . "</td><td><input type='password' maxlength='30' name='add_password' value=\"{$add_password}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Full name')) . "</td><td><input type='text' maxlength='100' name='add_name' value=\"{$add_name}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Email')) . "</td><td><input type='text' maxlength='250' name='add_email' value=\"{$add_email}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Mobile') . "</td><td><input type='text' size='16' maxlength='16' name='add_mobile' value=\"{$add_mobile}\"> " . _hint(_('Max. 16 numeric or 11 alphanumeric characters')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('SMS footer') . "</td><td><input type='text' maxlength='30' name='add_footer' value=\"{$add_footer}\"> " . _hint(_('Max. 30 alphanumeric characters')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Timezone') . "</td><td><input type='text' size='5' maxlength='5' name='add_datetime_timezone' value=\"{$add_datetime_timezone}\"> " . _hint(_('Eg: +0700 for Jakarta/Bangkok timezone')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Active language') . "</td><td><select name='add_language_module'>{$option_language_module}</select></td>\n\t\t</tr>\n\t\t</tbody>\n\t\t</table>\n\t\t<p><input type='submit' class='button' value='" . _('Save') . "'></p>\n\t\t</form>\n\t\t" . _back('index.php?app=main&inc=core_user&route=user_mgmnt&op=user_list&view=' . $view); _p($content); break; case "user_add_yes": $add['email'] = $_POST['add_email']; $add['status'] = $_POST['add_status']; $add['acl_id'] = (int) $_POST['add_acl_id']; $add['username'] = $_POST['add_username']; $add['password'] = $_POST['add_password']; $add['mobile'] = $_POST['add_mobile']; $add['name'] = $_POST['add_name']; $add['footer'] = $_POST['add_footer']; $add['datetime_timezone'] = $_POST['add_datetime_timezone']; $add['language_module'] = $_POST['add_language_module']; // subuser's parent uid, by default its uid=1
$i = 0; while ($db_row = dba_fetch_array($db_result)) { $status_active = "<a href=\"" . _u('index.php?app=main&inc=feature_schedule&op=status&id=' . $db_row['id'] . '&status=0') . "\"><span class=status_enabled /></a>"; $status_inactive = "<a href=\"" . _u('index.php?app=main&inc=feature_schedule&op=status&id=' . $db_row['id'] . '&status=1') . "\"><span class=status_disabled /></a>"; $status = $db_row['flag_active'] == 1 ? $status_active : $status_inactive; $action = "<a href=\"" . _u('index.php?app=main&inc=feature_schedule&route=manage&op=list&id=' . $db_row['id']) . "\">" . $icon_config['manage'] . "</a> "; $action .= "<a href=\"" . _u('index.php?app=main&inc=feature_schedule&route=edit&op=list&id=' . $db_row['id']) . "\">" . $icon_config['edit'] . "</a> "; $action .= "<a href=\"javascript: ConfirmURL('" . _('Are you sure you want to delete SMS schedule ?') . " (" . _('Schedule ID') . ": " . $db_row['id'] . ")','" . _u('index.php?app=main&inc=feature_schedule&op=del&id=' . $db_row['id']) . "')\">" . $icon_config['delete'] . "</a>"; $i++; $content .= "\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>" . $db_row['id'] . "</td>\n\t\t\t\t\t\t<td>" . $db_row['name'] . "</td>\n\t\t\t\t\t\t<td>" . $db_row['message'] . "</td>\n\t\t\t\t\t\t<td>" . $status . "</td>\n\t\t\t\t\t\t<td>" . $action . "</td>\n\t\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" . _button('index.php?app=main&inc=feature_schedule&op=add', _('Add SMS schedule')); _p($content); break; case "add": $content = _dialog() . "\n\t\t\t<h2>" . _('Schedule messages') . "</h2>\n\t\t\t<h3>" . _('Add SMS schedule') . "</h3>\n\t\t\t<form action=index.php?app=main&inc=feature_schedule&op=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>" . _mandatory(_('Schedule name')) . "</td><td><input type=text maxlength=100 name=name></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _mandatory(_('Scheduled message')) . "</td><td><input type=text name=message></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Schedule rule') . "</td><td>" . _select('schedule_rule', $plugin_config['schedule']['rules']) . "</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_schedule&op=list'); _p($content); break; case "add_yes": $name = $_POST['name']; $message = $_POST['message']; $schedule_rule = (int) $_POST['schedule_rule']; if ($name && $message) { // flag_active : 1 active, 2 inactive, 0 considered inactive // flag_deleted : 1 deleted, other values considered non-deleted $db_query = "\n\t\t\t\tINSERT INTO " . _DB_PREF_ . "_featureSchedule (c_timestamp,uid,name,message,schedule_rule,flag_active,flag_deleted)\n\t\t\t\tVALUES (" . mktime() . ",'" . $user_config['uid'] . "','{$name}','{$message}','{$schedule_rule}','2','0')"; if ($new_uid = @dba_insert_id($db_query)) { $_SESSION['dialog']['info'][] = _('New SMS schedule been added'); } else { $_SESSION['dialog']['info'][] = _('Fail to add new SMS schedule'); }
$sql = "select * from " . tablePrefix() . "house_category where 1=1 " . $where . " order by id asc"; $array = _select($sql, $where_data); echo json_encode($array); exit; } //edit if (!empty($type) && $type == "edit") { #list $sql_fl = "select * from " . tablePrefix() . "house_category where status = 0 and parent_id=0 order by id asc"; $arr_fl = _select($sql_fl); #id $id = @$_GET['id']; $map = null; if (!empty($id)) { $sql = "select * from " . tablePrefix() . "house_category where id = ?"; $array = _select($sql, array($id)); if (!empty($array) && count($array) > 0) { $map = $array[0]; } } #tpl include_once getTPL("house_category-edit"); exit; } //status if (!empty($type) && $type == "status") { #param $status = @$_GET["status"]; $id = @$_GET["id"]; #update if (!empty($id)) {
//status if (!empty($type) && $type == "status") { #param $status = @$_GET["status"]; $id = @$_GET["id"]; #update if (!empty($id)) { if ($status != null && $status == "0") { $status = 1; } else { $status = 0; } $sql = "update " . tablePrefix() . "house_village set status =? where id = ?"; _execute($sql, array($status, $id)); $error = "操作成功"; } else { $error = "操作失败,缺少必要参数"; } #tpl include_once getTPL("tishi"); exit; } //edit if (!empty($type) && $type == 'edit') { #地区 $sql_dq = "select id,name,parent_id from " . tablePrefix() . "house_area where status= 0 order by id asc"; $arr_dq = _select($sql_dq); #tpl include_once getTPL("house_village-edit"); exit; }
$error = ""; if (!empty($type) && $type == "logout") { $error = "用户已退出,请重新登录"; } #timeout if (!empty($type) && $type == 'timeout') { $error = "用户认证超时,请重新登录"; } #login $status = 0; if (!empty($type) && $type == "login") { $username = @$_POST['username']; $password = @$_POST['password']; if (!empty($username) && !empty($password)) { $sql = "select * from " . tablePrefix() . "user where username=? and status=1 limit 1"; $res = _select($sql, array($username)); if (!empty($res) && count($res) > 0) { $user = $res[0]; $user_pwd = $user['password']; if (md5($password) == $user_pwd) { $_SESSION['user'] = $user; //session $error = "登录成功,正在跳转"; $status = 1; } else { $error = "密码错误,请检查密码填写"; $status = 0; } } else { $error = "登录失败,未找到该用户"; $status = 0;
function select($name, $values = array(), $selected = null, $attributes = array(), $options = array()) { echo _select($name, $values, $selected, $attributes, $options); }
$option_enable_forgot = _options(array(_('yes') => 1, _('no') => 0), $main_config['enable_forgot']); // disable login as subuser yes-no option $option_disable_login_as = _options(array(_('yes') => 1, _('no') => 0), $main_config['disable_login_as']); // enhance privacy for subusers $option_enhance_privacy_subuser = _options(array(_('yes') => 1, _('no') => 0), $main_config['enhance_privacy_subuser']); // enable logo yes-no option $option_enable_logo = _options(array(_('yes') => 1, _('no') => 0), $main_config['enable_logo']); // enable logo to replace main website title yes-no option $option_logo_replace_title = _options(array(_('yes') => 1, _('no') => 0), $main_config['logo_replace_title']); // option default account status on user registration $option_default_user_status = _options(array(_('User') => 3, _('Subuser') => 4), $main_config['default_user_status']); // option default parent upon registration $option_default_parent = themes_select_account_level_single(3, 'edit_default_parent', $main_config['default_parent']); // get access control list $c_option_default_acl = array_flip(acl_getall()); $option_default_acl = _select('edit_default_acl', $c_option_default_acl, $main_config['default_acl']); // get gateway options $main_gateway = $main_config['gateway_module']; unset($smsc_list); $list = gateway_getall_smsc(); foreach ($list as $smsc) { $smsc_list[] = $smsc['name']; } $option_gateway_module = _options($smsc_list, $main_gateway); // get themes options $main_themes = $main_config['themes_module']; $option_themes_module = _options($core_config['themeslist'], $main_themes); // get language options $lang_list = ''; for ($i = 0; $i < count($core_config['languagelist']); $i++) { $language = $core_config['languagelist'][$i];
$sql_bq = "select id,name,parent_id from " . tablePrefix() . "house_label where status = 0 order by id asc"; $arr_bq = _select($sql_bq); #联系人 $sql_lxr = "select id,name,mobile from " . tablePrefix() . "house_contacts where status = 0 order by id asc"; $arr_lxr = _select($sql_lxr); #判断是否有id $id = @$_GET["id"]; $map = null; $thumbs = null; if (!empty($id)) { $sql = "select * from " . tablePrefix() . "house where status = 0 and id = ?"; $arr_maps = _select($sql, array($id)); if (!empty($arr_maps)) { $map = $arr_maps[0]; $sql2 = "select * from " . tablePrefix() . "thumbs where status=0 and refer_table = 'house' and refer_id=" . $map["id"] . " order by createtime asc limit 5"; $thumbs = _select($sql2); } } include_once getTPL("house-edit"); exit; } //设置封面操作 if (!empty($type) && $type == "set_thumb") { $url = @$_POST["url"]; $id = @$_POST["id"]; if (!empty($id) && !empty($url)) { $sql = "update " . tablePrefix() . "house set thumb = ? where id = ?"; _execute($sql, array($url, $id)); echo json_encode(array("status" => 1)); } else { echo json_encode(array("status" => 0));
$c_language_title = $plugin_config[$language]['title']; if ($c_language_title) { $lang_list[$c_language_title] = $language; } } if (is_array($lang_list)) { foreach ($lang_list as $key => $val) { if ($val == core_lang_get()) { $selected = "selected"; } $option_language_module .= "<option value=\"" . $val . "\" {$selected}>" . $key . "</option>"; $selected = ""; } } // get access control list $option_acl = _select('add_acl_id', array_flip(acl_getallbyuid($user_config['uid']))); $content .= "\n\t\t<h2>" . _('Manage subuser') . "</h2>\n\t\t<h3>" . _('Add subuser') . "</h3>\n\t\t<form action='index.php?app=main&inc=core_user&route=subuser_mgmnt&op=subuser_add_yes' method=POST>\n\t\t" . _CSRF_FORM_ . "\n\t\t<table class=playsms-table>\n\t\t<tbody>\n\t\t<tr>\n\t\t\t<td class=label-sizer>" . _('Access Control List') . "</td><td>" . $option_acl . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Username')) . "</td><td><input type='text' maxlength='30' name='add_username' value=\"{$add_username}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Password')) . "</td><td><input type='password' maxlength='30' name='add_password' value=\"{$add_password}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Full name')) . "</td><td><input type='text' maxlength='100' name='add_name' value=\"{$add_name}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _mandatory(_('Email')) . "</td><td><input type='text' maxlength='250' name='add_email' value=\"{$add_email}\"></td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Mobile') . "</td><td><input type='text' size='16' maxlength='16' name='add_mobile' value=\"{$add_mobile}\"> " . _hint(_('Max. 16 numeric or 11 alphanumeric characters')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('SMS footer') . "</td><td><input type='text' maxlength='30' name='add_footer' value=\"{$add_footer}\"> " . _hint(_('Max. 30 alphanumeric characters')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Timezone') . "</td><td><input type='text' size='5' maxlength='5' name='add_datetime_timezone' value=\"{$add_datetime_timezone}\"> " . _hint(_('Eg: +0700 for Jakarta/Bangkok timezone')) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>" . _('Active language') . "</td><td><select name='add_language_module'>{$option_language_module}</select></td>\n\t\t</tr>\n\t\t</tbody>\n\t\t</table>\n\t\t<p><input type='submit' class='button' value='" . _('Save') . "'></p>\n\t\t</form>\n\t\t" . _back('index.php?app=main&inc=core_user&route=subuser_mgmnt&op=subuser_list'); _p($content); break; case "subuser_add_yes": $add['acl_id'] = (int) $_POST['add_acl_id']; $add['email'] = $_POST['add_email']; $add['username'] = $_POST['add_username']; $add['password'] = $_POST['add_password']; $add['mobile'] = $_POST['add_mobile']; $add['name'] = $_POST['add_name']; $add['footer'] = $_POST['add_footer']; $add['datetime_timezone'] = $_POST['add_datetime_timezone']; $add['language_module'] = $_POST['add_language_module']; // subuser settings $add['parent_uid'] = $user_config['uid'];
*/ defined('_SECURE_') or die('Forbidden'); if (!auth_isvalid()) { auth_block(); } switch (_OP_) { case "list": $id = $_REQUEST['id']; $db_query = "SELECT * FROM " . _DB_PREF_ . "_featureSchedule WHERE uid='" . $user_config['uid'] . "' AND id='{$id}' AND flag_deleted='0'"; $db_result = dba_query($db_query); $db_row = dba_fetch_array($db_result); $name = $db_row['name']; $message = $db_row['message']; $schedule_rule = $db_row['schedule_rule']; if ($id && $name && $message) { $content = _dialog() . "\n\t\t\t<h2>" . _('Schedule messages') . "</h2>\n\t\t\t<h3>" . _('Edit schedule') . "</h3>\n\t\t\t<form action=index.php?app=main&inc=feature_schedule&route=edit&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>\n\t\t\t<tr>\n\t\t\t\t<td class=label-sizer>" . _('Schedule ID') . "</td><td>" . $id . "</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _mandatory(_('Schedule name')) . "</td><td><input type=text maxlength=100 name=name value=\"" . $name . "\"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _mandatory(_('Scheduled message')) . "</td><td><input type=text name=message value=\"" . $message . "\"></td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td>" . _('Schedule rule') . "</td><td>" . _select('schedule_rule', $plugin_config['schedule']['rules'], $schedule_rule) . "</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_schedule&op=list'); } else { auth_block(); } _p($content); break; case "edit_yes": $id = $_POST['id']; $name = $_POST['name']; $message = $_POST['message']; $schedule_rule = (int) $_POST['schedule_rule']; if ($id && $name && $message) { $db_query = "\n\t\t\t\tUPDATE " . _DB_PREF_ . "_featureSchedule\n\t\t\t\tSET c_timestamp='" . mktime() . "',name='{$name}',message='{$message}', schedule_rule='{$schedule_rule}'\n\t\t\t\tWHERE uid='" . $user_config['uid'] . "' AND id='{$id}' AND flag_deleted='0'"; if (@dba_affected_rows($db_query)) { $_SESSION['dialog']['info'][] = _('SMS schedule been saved'); } else {