$userFilters = tsms_UserFilter($_POST['msendtype'], $filterParams); show_window(__('Confirmation'), web_TsmsMassendConfirm($userFilters)); } //sending subroutine if (wf_CheckPost(array('massendConfirm'))) { $smsTemplate = tsms_GetTemplate(); $smsWap = tsms_GetWap(); $smsSign = tsms_GetSign(); $smsTz = tsms_GetTz(); $unpackData = base64_decode($_POST['massendConfirm']); $unpackData = unserialize($unpackData); if (!empty($_POST['massendConfirm'])) { if (!empty($unpackData)) { log_register("TSMS SEND MASS FOR `" . sizeof($unpackData) . "` USERS"); foreach ($unpackData as $eachLogin => $eachPhone) { $newMessage = tsms_ParseTemplate($eachLogin, $smsTemplate); tsms_SendSMS($eachPhone, $smsSign, $newMessage, $smsWap, $smsTz); } $notifyText = sizeof($unpackData) . ' ' . __('SMS queued and waiting to send') . wf_Link('?module=turbosms', __('Click here to view today sending queue'), true, 'ubButton'); $doneNotify = wf_modalOpened(__('Send SMS for user group'), $notifyText, '400', '200'); show_window('', $doneNotify); } } } } } else { show_error(__('TurboSMS support is disabled')); } } else { show_error(__('You cant control this module')); }
$form->addrow(__('Scenario'), $content); // Сервис (disabled) $content = $form->select_tag('edit[netid]', getServiceIdDesc(), $netid, 'disabled'); $content .= $form->checkbox('edit[login]', '*', __('Foreach'), $result['login']); $form->addrow(__('Service'), $content); // Атрибут $content = $form->text_box('edit[Attribute]', $result['Attribute']); $form->addrow(__('Attribute'), $content); // Оператор $content = $form->select_tag('edit[op]', $operators, $result['op']); $form->addrow(__('op'), $content); // Значение $content = $form->text_box('edit[Value]', $result['Value']); $form->addrow(__('Value'), $content); // Добавляем в код страницы открытое модальное окно $html .= wf_modalOpened(__('Editing of RADIUS-attribute'), $form->show(1), 450, 275); } if (wf_checkPost(array('reassignment'))) { // Экранируем все введённые данные foreach ($_POST['reassignment'] as &$value) { $value = mysql_real_escape_string($value); } extract($_POST['reassignment']); // Добавляем информацию о переназначении $query = "INSERT INTO `radius_reassigns` (`netid`, `value`) VALUES ({$netid}, '{$value}') ON DUPLICATE KEY UPDATE `value` = '{$value}'"; if (nr_query($query)) { rcms_redirect("?module=freeradius&netid={$netid}"); } } $query = "SELECT `id`, `login`, `scenario`, `Attribute`, `op`, `Value` FROM `radius_attributes` WHERE `netid` = '{$netid}'"; $results = simple_queryall($query);
function wf_if_save($result = '', $autoclose = '') { global $system; $result = empty($result) ? __('Settings saved') : $result; $data = wf_modalOpened(__('Result'), $result, 300, 200, $autoclose); $system->output['modules'][] = array('', $data, 'center'); }
show_window(__('Edit signup price for tariff') . ' "' . $tariff . '"', $form); show_window('', wf_Link("?module=signupprices", 'Back', true, 'ubButton')); } elseif (isset($_GET['username'])) { $login = mysql_real_escape_string($_GET['username']); $has_paid = zb_UserGetSignupPricePaid($login); $old_price = zb_UserGetSignupPrice($login); $new_price = isset($_POST['new_price']) ? mysql_real_escape_string($_POST['new_price']) : null; if (!is_null($new_price)) { if ($new_price >= $has_paid) { $cash = $old_price - $new_price; zb_UserChangeSignupPrice($login, $new_price); $billing->addcash($login, $cash); log_register("CHARGE SignupPriceFee(" . $login . ") " . $cash); rcms_redirect("?module=useredit&username="******"" method="POST"> <table width="100%" border="0"> <tr> <td class="row2">' . __('Signup price') . '</td> <td class="row3"> <input type="text" name="new_price" value="' . $old_price . '"> </td> </tr> </table> <input type="submit" value="' . __('Change') . '"> </form><br><br>'; show_window(__('Edit signup price for user') . ' "' . $login . '"', $form); show_window('', wf_Link("?module=useredit&username=" . $login, 'Back', true, 'ubButton'));
/** * Shows user register form of express card * * * @return string */ function web_ExpressCardRegForm() { $altconf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini"); $allcontracts = zb_UserGetAllContracts(); //contract proposal $top_offset = 100000; //contract generation mode default if ($altconf['CONTRACT_GENERATION_DEFAULT']) { for ($i = 1; $i < $top_offset; $i++) { if (!isset($allcontracts[$i])) { $contract = $i; break; } } } else { //alternate generation method $max_contract = max(array_keys($allcontracts)); $contract = $max_contract + 1; } $mac = '14:' . '88' . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99) . ':' . rand(10, 99); $phone = ''; $mobile = ''; $email = ''; $notes = ''; $stgdata = ''; $currenttariff = ''; $birthdate = ''; $passportnum = ''; $passportdate = ''; $passportwho = ''; $pcity = ''; $pstreet = ''; $pbuild = ''; $papt = ''; $inputs = zb_AjaxLoader() . wf_delimiter(); $inputs .= __('Contract'); $inputs .= wf_TextInput('newcontract', '', $contract, false, '10'); $inputs .= __('Contract date'); $inputs .= wf_DatePickerPreset('newcontractdate', @$allcontractdates[$contract]); $inputs .= wf_delimiter(); $inputs .= __('Surname'); $inputs .= wf_TextInput('newsurname', '', '', false, '20'); $inputs .= __('Name'); $inputs .= wf_TextInput('newname', '', '', false, '20'); $inputs .= __('Patronymic'); $inputs .= wf_TextInput('newpatronymic', '', '', false, '20'); $inputs .= __('Birth date'); $inputs .= wf_DatePickerPreset('newbirthdate', $birthdate); $inputs .= wf_delimiter(); $inputs .= __('Passport number'); $inputs .= wf_TextInput('newpassportnum', '', $passportnum, false, '30'); $inputs .= __('Date of issue'); $inputs .= wf_DatePickerPreset('newpassportdate', $passportdate); $inputs .= __('Issuing authority'); $inputs .= wf_TextInput('newpassportwho', '', $passportwho, false, '40'); $inputs .= wf_delimiter(); $inputs .= __('Phone'); $inputs .= wf_TextInput('newphone', '', $phone, false, '20'); $inputs .= __('Mobile'); $inputs .= wf_TextInput('newmobile', '', $mobile, false, '20'); $inputs .= __('email'); $inputs .= wf_TextInput('newemail', '', $email, false, '20'); $inputs .= wf_delimiter(); $inputs .= wf_tag('fieldset'); //address data form $inputs .= __('Address of service') . ' '; //new address creation form $inputs .= web_ExpressAddressOccupancyForm(); $inputs .= wf_delimiter(); //additional address fields $inputs .= __('Registration address') . ' '; $inputs .= zb_JSHider(); $inputs .= web_PaddressUnhideBox(); $inputs .= web_HidingDiv('paddress'); $inputs .= __('City'); $inputs .= wf_TextInput('newpcity', '', $pcity, false, '20'); $inputs .= __('Street'); $inputs .= wf_TextInput('newpstreet', '', $pstreet, false, '20'); $inputs .= __('Build'); $inputs .= wf_TextInput('newpbuild', '', $pbuild, false, '5'); $inputs .= __('Apartment'); $inputs .= wf_TextInput('newpapt', '', $papt, false, '5'); $inputs .= wf_tag('div', true); $inputs .= wf_tag('fieldset', true); $inputs .= wf_delimiter(); $inputs .= __('Tariff'); $inputs .= web_ExpressTariffSelector('newtariff', $currenttariff); $inputs .= __('Service'); $inputs .= web_ExpressServiceSelectorReg(); $inputs .= __('IP'); $inputs .= wf_tag('span', false, '', 'id="dipbox"'); $allservices = multinet_get_services(); if (!empty($allservices)) { $firstService = $allservices[0]; $firstNet = $firstService['netid']; @($ip_proposal = multinet_get_next_freeip('nethosts', 'ip', $firstNet)); if (empty($ip_proposal)) { show_window('', wf_modalOpened(__('Error'), __('No free IP available in selected pool'), '400', '250')); } } else { $ip_proposal = __('Error'); } $inputs .= wf_TextInput('editip', '', $ip_proposal, false, '20'); $inputs .= wf_tag('span', true); //dummy login proposal $login = zb_RegLoginProposal('', '', '', '', $ip_proposal); $inputs .= __('MAC'); $inputs .= wf_TextInput('newmac', '', $mac, false, '20'); $inputs .= __('Login'); $inputs .= wf_TextInput('newlogin', '', $login, false, '20'); $inputs .= wf_delimiter(); $inputs .= __('Notes'); $inputs .= wf_TextInput('newnotes', '', $notes, false, '120'); $inputs .= wf_HiddenInput('expresscardreg', 'true'); $inputs .= wf_delimiter(); $inputs .= wf_Submit('Let register that user'); $expresscardform = wf_Form("", "POST", $inputs, 'expresscard'); show_window(__('Express card user register'), $expresscardform); }
/** * Returns alert if generated user login have rscripd incompatible lenght * * @param string $login * @return string */ function zb_CheckLoginRscriptdCompat($login) { $maxRsLen = 31; $maxStLen = 42; $loginLen = strlen($login); if ($loginLen >= $maxRsLen) { //rscriptd notice if ($loginLen < $maxStLen) { $alert = __('Attention generated login longer than') . ' ' . $maxRsLen . ' ' . __('bytes') . '. (' . $loginLen . ') ' . __('This can lead to the inability to manage this user on remote NAS running rscriptd') . '. '; $alert .= __('Perhaps you need to shorten the alias, or use a different model for the generation of logins') . '.'; $result = wf_modalOpened(__('Warning'), $alert, '500', '200'); } //stargazer incompat notice if ($loginLen >= $maxStLen) { $alert = __('Attention generated login longer than') . ' ' . $maxStLen . ' ' . __('bytes') . '. (' . $loginLen . ') ' . __('And is not compatible with Stargazer') . '. '; $alert .= __('Perhaps you need to shorten the alias, or use a different model for the generation of logins') . '.'; $result = wf_modalOpened(__('Error'), $alert, '500', '200'); } } else { $result = ''; } return $result; }
$paymentVisibility = 1; $paymentNotes .= 'MOCK:'; } //set payment notes if (wf_CheckPost(array('paymentnotes'))) { $paymentNotes .= $_POST['paymentnotes']; } if ($ukv->isMoney($_POST['paymentsumm'])) { if ($_POST['paymenttype'] != 'mock') { $ukv->userAddCash($_POST['manualpaymentprocessing'], $_POST['paymentsumm'], $paymentVisibility, $_POST['paymentcashtype'], $paymentNotes); } else { $ukv->logPayment($_POST['manualpaymentprocessing'], $_POST['paymentsumm'], $paymentVisibility, $_POST['paymentcashtype'], $paymentNotes); } rcms_redirect(UkvSystem::URL_USERS_PROFILE . $_POST['manualpaymentprocessing']); } else { show_window('', wf_modalOpened(__('Error'), __('Wrong format of a sum of money to pay'), '400', '200')); log_register('UKV BALANCEADDFAIL ((' . $_POST['manualpaymentprocessing'] . ')) WRONG SUMM `' . $_POST['paymentsumm'] . '`'); } } show_window(__('User profile'), $ukv->userProfile($_GET['showuser'])); } // bank statements processing if (wf_CheckGet(array('banksta'))) { //banksta upload if (wf_CheckPost(array('uploadukvbanksta'))) { $bankstaUploaded = $ukv->bankstaDoUpload(); if (!empty($bankstaUploaded)) { if (wf_CheckPost(array('ukvbankstatype'))) { if ($_POST['ukvbankstatype'] == 'oschad') { $processedBanksta = $ukv->bankstaPreprocessing($bankstaUploaded); rcms_redirect(UkvSystem::URL_BANKSTA_PROCESSING . $processedBanksta);
$note = isset($_POST['newpaymentnote']) ? mysql_real_escape_string($_POST['newpaymentnote']) : ''; // Empty cash hotfix: if ($cash != '') { if (zb_checkMoney($cash)) { if (isset($alter['SIGNUP_PAYMENTS']) && !empty($alter['SIGNUP_PAYMENTS'])) { zb_CashAddWithSignup($login, $cash, $operation, $cashtype, $note); } else { zb_CashAdd($login, $cash, $operation, $cashtype, $note); } rcms_redirect("?module=addcash&username=" . $login); } else { show_window('', wf_modalOpened(__('Error'), __('Wrong format of a sum of money to pay'), '400', '200')); log_register('BALANCEADDFAIL (' . $login . ') WRONG SUMM `' . $cash . '`'); } } else { show_window('', wf_modalOpened(__('Error'), __('You have not completed the required amount of money to deposit into account. We hope next time you will be more attentive.'), '400', '150')); log_register('BALANCEADDFAIL (' . $login . ') EMPTY SUMM `' . $cash . '`'); } } // Profile: $profile = new UserProfile($login); show_window(__('User profile'), $profile->render()); $user_data = $profile->extractUserData(); $current_balance = $user_data['Cash']; $useraddress = $profile->extractUserAddress() . ' (' . $login . ')'; // Edit money form construct: $user_tariff = $user_data['Tariff']; $tariff_price = zb_TariffGetPrice($user_tariff); $fieldnames = array('fieldname1' => __('Current Cash state'), 'fieldname2' => __('New cash')); $fieldkey = 'newcash'; $form = '';
<?php if (cfr('UBIM')) { $altcfg = $ubillingConfig->getAlter(); //posting new message if (wf_CheckPost(array('im_message_to', 'im_message_text'))) { im_CreateMessage($_POST['im_message_to'], $_POST['im_message_text']); rcms_redirect("?module=ubim&gothread=" . $_POST['im_message_to']); } //checking for new messages if (!wf_CheckGet(array('checknew'))) { $unreadMessageCount = im_CheckForUnreadMessages(); if ($unreadMessageCount) { $unreadIMNotify = __('You received') . ' ' . $unreadMessageCount . ' ' . __('new messages'); $urlIM = $unreadIMNotify . wf_delimiter() . wf_Link("?module=ubim&checknew=true", __('Click here to go to the instant messaging service.'), false, 'ubButton'); show_window('', wf_modalOpened(__('New messages received'), $urlIM, '450', '200')); } } //ajax thread data if (wf_CheckGet(array('showthread'))) { $threadContent = im_ConversationForm($_GET['showthread']) . im_ThreadShow($_GET['showthread']); die($threadContent); } //refresh time testing for unread messages if (wf_CheckGet(array('timecheckunread'))) { $unreadMessageCount = im_CheckForUnreadMessages(); if ($unreadMessageCount) { die(json_encode(array('messagesCount' => $unreadMessageCount))); } } if (!wf_checkGet(array('avatarcontrol'))) {