/** * Return contact list * * @return string */ function im_ContactList() { $me = whoami(); @($employeeNames = unserialize(ts_GetAllEmployeeLoginsCached())); $alladmins = rcms_scandir(DATA_PATH . "users/"); $activeAdmins = im_GetActiveAdmins(); $result = ''; $rows = ''; if (!empty($alladmins)) { foreach ($alladmins as $eachadmin) { if ($eachadmin != $me) { //need checks for unread messages for each user if (wf_CheckGet(array('checknew'))) { $unreadCounter = im_CheckForUnreadMessagesByUser($eachadmin); if ($unreadCounter != 0) { $blinker = wf_img('skins/icon_mail.gif'); } else { $blinker = ''; } } else { $blinker = ''; } if (isset($activeAdmins[$eachadmin])) { $aliveFlag = web_bool_led(true); } else { $aliveFlag = web_bool_led(false); } $conatactAvatar = gravatar_ShowAdminAvatar($eachadmin, '32') . ' '; $adminName = isset($employeeNames[$eachadmin]) ? $employeeNames[$eachadmin] : $eachadmin; $threadLink = wf_AjaxLink("?module=ubim&showthread=" . $eachadmin, $adminName . ' ' . $blinker, 'threadContainer', false, 'ubimcontact'); //$threadLink.=$blinker; $cells = wf_TableCell($aliveFlag, '', '', 'valign="center" align="center"'); $cells .= wf_TableCell($conatactAvatar, '35', '', 'valign="center" align="left"'); $cells .= wf_TableCell($threadLink, '', '', 'valign="center" align="left"'); $rows .= wf_TableRow($cells, ''); } } $result = wf_TableBody($rows, '100%', '0', 'glamour'); $result .= wf_delimiter() . wf_Link("?module=ubim&avatarcontrol=true", __('Avatar control'), false, 'ubButton'); } return $result; }
$newnetid = $_POST['networkselect']; $newnasname = $_POST['newnasname']; $newnastype = $_POST['newnastype']; $newbandw = $_POST['newbandw']; if (!empty($newnasip) and !empty($newnasname)) { zb_NasAdd($newnetid, $newnasip, $newnasname, $newnastype, $newbandw); zb_NasConfigSave(); rcms_redirect("?module=nas"); } } // Show available NASes $allnas = zb_NasGetAllData(); // construct needed editor $titles = array('ID', 'Network', 'IP', 'NAS name', 'NAS type', 'Bandwidthd URL'); $keys = array('id', 'netid', 'nasip', 'nasname', 'nastype', 'bandw'); if (!wf_CheckGet(array('edit'))) { $altCfg = $ubillingConfig->getAlter(); if ($altCfg['FREERADIUS_ENABLED']) { $freeRadiusClientsData = web_FreeRadiusListClients(); $radiusControls = wf_modal(web_icon_extended(__('FreeRADIUS NAS parameters')), __('FreeRADIUS NAS parameters'), $freeRadiusClientsData, '', '600', '300'); } else { $radiusControls = ''; } show_window(__('Network Access Servers') . ' ' . $radiusControls, web_GridEditorNas($titles, $keys, $allnas, 'nas')); show_window(__('Add new'), web_NasAddForm()); //vlangen patch start if ($altCfg['VLANGEN_SUPPORT']) { $terminator = new VlanTerminator(); if (isset($_GET['DeleteTerminator'])) { $TermID = $_GET['DeleteTerminator']; $terminator->delete($TermID);
/** * Listens API requests and renders replies for it * * @return void */ public function catchRequest() { if (wf_CheckGet(array('request'))) { $request = $_GET['request']; if (isset($this->supportedMethods[$request])) { switch ($request) { case 'get_tariff_list': $this->renderReply($this->getTariffsData()); break; case 'get_city_list': $this->renderReply($this->getCitiesData()); break; case 'get_street_list': $this->renderReply($this->getStreetsData()); break; case 'get_house_list': $this->renderReply($this->getBuildsData()); break; case 'get_user_additional_data_type_list': $this->renderReply($this->getCFTypesData()); break; case 'get_user_state_list': $this->renderReply($this->getUsersStateList()); break; case 'get_supported_method_list': $this->renderReply($this->getMethodsList()); break; case 'get_api_information': $this->renderReply($this->getApiInformation()); break; case 'get_user_group_list': $this->renderReply($this->getTagTypesList()); break; case 'get_system_information': $this->renderReply($this->getSystemInformation()); break; case 'get_user_list': $this->renderReply($this->getUsersList()); break; } } else { header('HTTP/1.1 400 Unknown Action"', true, 400); die('Unknown Action'); } } else { header('HTTP/1.1 400 Undefined request', true, 400); die('Undefined request'); } }
/** * Listens API requests and renders replies for it * * @return void */ public function catchRequest() { if (wf_CheckGet(array('request'))) { $request = $_GET['request']; if (isset($this->supportedMethods[$request])) { switch ($request) { case 'get_user_info': if (isset($_GET['username'])) { $this->loadUserInfo($_GET['username']); $this->renderReply($this->userInfo); } break; case 'get_realnames': if (isset($_GET['like'])) { $this->loadRealNames($_GET['like']); $this->renderReply($this->allRealNames); } break; } } else { header('HTTP/1.1 400 Unknown Action"', true, 400); die('Unknown Action'); } } else { header('HTTP/1.1 400 Undefined request', true, 400); die('Undefined request'); } }
} //reports if (wf_CheckGet(array('reports'))) { if (wf_CheckGet(array('ajaxtremains'))) { $warehouse->{$avidity}['A']['SEENOEVIL'](); } if (wf_CheckGet(array('calendarops'))) { show_window(__('Operations in the context of time'), $warehouse->reportCalendarOps()); $warehouse->{$avidity}['M']['FALL']($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&' . 'totalremains=true'); } if (wf_CheckGet(array('totalremains'))) { $calendarLink = wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&calendarops=true', wf_img('skins/icon_calendar.gif', __('Operations in the context of time')), false, ''); $dateRemainsLink = wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&dateremains=true', wf_img('skins/ukv/report.png', __('Date remains'))); show_window(__('The remains in all storages') . ' ' . $calendarLink . ' ' . $dateRemainsLink, $warehouse->reportAllStoragesRemains()); $warehouse->{$avidity}['M']['FALL'](); } if (wf_CheckGet(array('dateremains'))) { show_window(__('Date remains'), $warehouse->reportDateRemains()); $warehouse->{$avidity}['M']['FALL'](); } } $warehouse->{$avidity}['M']['FRONT'](); } else { show_error(__('No license key available')); } } else { show_error(__('This module is disabled')); } } else { show_error(__('Permission denied')); }
/** * Shows signup tariffs popularity chart * * @return void */ function web_SignupGraph() { if (!wf_CheckGet(array('month'))) { $cmonth = curmonth(); } else { $cmonth = mysql_real_escape_string($_GET['month']); } $where = "WHERE `date` LIKE '" . $cmonth . "%'"; $alltariffnames = zb_TariffsGetAll(); $tariffusers = zb_TariffsGetAllUsers(); $allsignups = zb_SignupsGet($where); $tcount = array(); if (!empty($allsignups)) { foreach ($alltariffnames as $io => $eachtariff) { foreach ($allsignups as $ii => $eachsignup) { if (@$tariffusers[$eachsignup['login']] == $eachtariff['name']) { @($tcount[$eachtariff['name']] = $tcount[$eachtariff['name']] + 1); } } } } $tablecells = wf_TableCell(__('Tariff')); $tablecells .= wf_TableCell(__('Count')); $tablecells .= wf_TableCell(__('Visual')); $tablerows = wf_TableRow($tablecells, 'row1'); if (!empty($tcount)) { foreach ($tcount as $sigtariff => $eachcount) { $tablecells = wf_TableCell($sigtariff); $tablecells .= wf_TableCell($eachcount); $tablecells .= wf_TableCell(web_bar($eachcount, sizeof($allsignups)), '', '', 'sorttable_customkey="' . $eachcount . '"'); $tablerows .= wf_TableRow($tablecells, 'row3'); } } $result = wf_TableBody($tablerows, '100%', '0', 'sortable'); show_window(__('Tariffs report'), $result); }
show_window(__('Error'), __('You are not mentally prepared for this')); } } show_window(__('Actions'), $corps->userUnbindForm($_GET['usercallback'])); } } else { if (!wf_CheckGet(array('add'))) { if (method_exists($corps, $beggar['METH']['RENDER'])) { show_window(__('Available corps'), $corps->{$beggar}['METH']['RENDER']()); } } } } //user management if ($route == Corps::URL_USER) { if (wf_CheckGet(array('username'))) { $login = mysql_real_escape_string($_GET['username']); $userCorpCheck = $corps->userIsCorporate($login); if ($userCorpCheck) { //enterprise user $corpsControls = $corps->corpPreview($userCorpCheck); $corpsControls .= wf_Link(Corps::URL_CORPS_EDIT . $userCorpCheck . '&usercallback=' . $login, web_edit_icon() . ' ' . __('Edit'), true, 'ubButton'); $corpsControls .= wf_delimiter(); $corpsControls .= web_UserControls($login); show_window(__('Corporate user'), $corpsControls); } else { //user is private if (wf_CheckPost(array('bindsomelogin', 'bindlogintocorpid'))) { $corps->userBind($_POST['bindsomelogin'], $_POST['bindlogintocorpid']); rcms_redirect(Corps::URL_USER_MANAGE . $_POST['bindsomelogin']); }
$rawtemplate = zb_PhpConsoleGetTemplate($_GET['runtpl']); $runcode = $rawtemplate['body']; } else { $runcode = ''; } $phpinputs .= wf_TextArea('phpq', '', $runcode, true, '80x10'); $phpinputs .= wf_CheckInput('phphightlight', 'Hightlight this PHP code', true, true); $phpinputs .= wf_Submit('Run this code inside framework'); $phpform = wf_Form('?module=sqlconsole&devconsole=true', 'POST', $phpinputs, 'glamour'); //php console grid assemble $phpcells = wf_TableCell($phpform, '50%', '', 'valign="top"'); if (wf_CheckGet(array('templateadd'))) { //show template creation form $phpcells .= wf_TableCell(web_PhpConsoleTemplateCreateForm(), '50%', '', 'valign="top"'); } else { if (wf_CheckGet(array('edittemplate'))) { //show template edit form $phpcells .= wf_TableCell(web_PhpConsoleTemplateEditForm($_GET['edittemplate']), '50%', '', 'valign="top"'); } else { //show template list $phpcells .= wf_TableCell(web_PhpConsoleShowTemplates(), '50%', '', 'valign="top"'); } } $phprows = wf_TableRow($phpcells); $phpgrid = wf_TableBody($phprows, '100%', '0', ''); //show needed form if (!isset($_GET['devconsole'])) { show_window(__('SQL Console'), $sqlform); } else { show_window(__('Developer Console'), $phpgrid); }
} //changing task if (wf_CheckPost(array('editname'))) { $interface->changeTask(); rcms_redirect("?module=watchdog"); } //changing watchdog settings if (wf_CheckPost(array('changealert'))) { $interface->saveSettings(); rcms_redirect("?module=watchdog"); } //show watchdog main control panel show_window('', $interface->panel()); if (!wf_CheckGet(array('edit'))) { //show previous detections if (wf_CheckGet(array('previousalerts'))) { $interface->loadAllPreviousAlerts(); if (wf_CheckPost(array('previousalertsearch'))) { //do the search show_window(__('Search results'), $interface->alertSearchResults($_POST['previousalertsearch'])); } else { //calendar show_window(__('Previous alerts'), $interface->renderAlertsCalendar()); } } else { //or list of existing tasks show_window(__('Available Watchdog tasks'), $interface->listAllTasks()); } } else { //show task edit form show_window(__('Edit task'), $interface->editTaskForm($_GET['edit']));
if (!empty($editmodemid)) { $newmodemuserbind = mysql_real_escape_string($_POST['edituserbind']); $newmodemnote = mysql_real_escape_string($_POST['editnote']); simple_update_field('modems', 'userbind', $newmodemuserbind, "WHERE `id`='" . $editmodemid . "'"); simple_update_field('modems', 'note', $newmodemnote, "WHERE `id`='" . $editmodemid . "'"); log_register("DOCSIS MODEM EDIT BIND `" . $newmodemuserbind . "` [" . $editmodemid . "]"); rcms_redirect("?module=docsis&showmodem=" . $editmodemid); } else { show_window(__('Error'), __('Strange exeption')); } } //setting modem snmp community if (wf_CheckPost(array('newmodemcommunity', 'newsnmpwalkpath'))) { docsis_ModemSnmpSet($_POST['newmodemcommunity']); docsis_ModemSnmpWalkSet($_POST['newsnmpwalkpath']); rcms_redirect("?module=docsis"); } //show controls docsis_ControlsShow(); //show modems list by default if (!wf_CheckGet(array('showmodem'))) { docsis_ModemsList(); } else { docsis_ModemProfileShow($_GET['showmodem']); } } else { show_window(__('Error'), __('DOCSIS support is not enabled')); } } else { show_error(__('Access denied')); }
if (wf_CheckPost(array('newsign', 'newwap'))) { tsms_SetSign($_POST['newsign']); tsms_SetWap($_POST['newwap']); tsms_SetTz($_POST['newtz']); rcms_redirect("?module=turbosms"); } if (wf_CheckPost(array('newexcludelogin'))) { tsms_ExcludeUserAdd($_POST['newexcludelogin']); rcms_redirect("?module=turbosms"); } if (wf_CheckGet(array('excludedelete'))) { tsms_ExcludeUserDelete($_GET['excludedelete']); rcms_redirect("?module=turbosms"); } //template & sending if (!wf_CheckGet(array('sending'))) { $availMacro = wf_tag('h3') . __('Available macroses') . wf_tag('h3', true); $availMacro .= '{LOGIN}' . wf_tag('br'); $availMacro .= '{REALNAME}' . wf_tag('br'); $availMacro .= '{REALNAMETRANS}' . wf_tag('br'); $availMacro .= '{CASH}' . wf_tag('br'); $availMacro .= '{ROUNDCASH}' . wf_tag('br'); $availMacro .= '{CREDIT}' . wf_tag('br'); $availMacro .= '{TARIFF}' . wf_tag('br'); $availMacro .= '{TARIFFPRICE}' . wf_tag('br'); $availMacro .= '{CURDATE}' . wf_tag('br'); $availMacro .= '{PAYID}' . wf_tag('br'); $templateEditForm = wf_TableCell(web_TsmsTemplateEditForm(), '50%', '', 'valign="top"'); $templateEditForm .= wf_TableCell($availMacro, '50%', '', 'valign="top"'); $templateEditForm = wf_TableRow($templateEditForm); $templateEditForm = wf_TableBody($templateEditForm, '100%', 0, '');
<?php if (cfr('REPORTFINANCE')) { if (!wf_CheckGet(array('analytics'))) { if (!wf_CheckPost(array('yearsel'))) { $show_year = curyear(); } else { $show_year = $_POST['yearsel']; } $altcfg = $ubillingConfig->getAlter(); $dateSelectorPreset = wf_CheckPost(array('showdatepayments')) ? $_POST['showdatepayments'] : curdate(); $dateinputs = wf_DatePickerPreset('showdatepayments', $dateSelectorPreset); $dateinputs .= wf_Submit(__('Show')); $dateform = wf_Form("?module=report_finance", 'POST', $dateinputs, 'glamour'); $yearinputs = wf_YearSelector('yearsel'); $yearinputs .= wf_Submit(__('Show')); $yearform = wf_Form("?module=report_finance", 'POST', $yearinputs, 'glamour'); $controlcells = wf_TableCell(wf_tag('h3', false, 'title') . __('Year') . wf_tag('h3', true)); $controlcells .= wf_TableCell(wf_tag('h3', false, 'title') . __('Payments by date') . wf_tag('h3', true)); $controlcells .= wf_TableCell(wf_tag('h3', false, 'title') . __('Payment search') . wf_tag('h3', true)); $controlcells .= wf_TableCell(wf_tag('h3', false, 'title') . __('Analytics') . wf_tag('h3', true)); $controlcells .= wf_TableCell(wf_tag('h3', false, 'title') . __('ARPU') . wf_tag('h3', true)); if ($altcfg['AGENTS_ASSIGN'] == '2') { $controlcells .= wf_TableCell(wf_tag('h3', false, 'title') . __('Agent payments') . wf_tag('h3', true)); } $controlrows = wf_TableRow($controlcells); $controlcells = wf_TableCell($yearform); $controlcells .= wf_TableCell($dateform); $controlcells .= wf_TableCell(wf_Link("?module=payfind", web_icon_search() . ' ' . __('Find'), false, 'ubButton')); $controlcells .= wf_TableCell(wf_Link("?module=report_finance&analytics=true", wf_img('skins/icon_stats.gif') . ' ' . __('Show'), false, 'ubButton')); $controlcells .= wf_TableCell(wf_Link("?module=report_arpu", wf_img('skins/ukv/report.png') . ' ' . __('Show'), false, 'ubButton'));
} } } if (wf_CheckGet(array('layers'))) { $layers = $_GET['layers']; //switches layer if (ispos($layers, 'sw')) { $placemarks .= sm_MapDrawSwitches(); } //switches uplinks layer if (ispos($layers, 'ul')) { $placemarks .= sm_MapDrawSwitchUplinks(); } //builds layer if (ispos($layers, 'bs')) { $placemarks .= um_MapDrawBuilds(); } } if (wf_CheckGet(array('mapedit', 'showmap'))) { $editor = $custmaps->mapLocationEditor(); } else { $editor = ''; } show_window($custmaps->mapGetName($mapId), $custmaps->mapInit($placemarks, $editor)); } } else { show_error(__('This module is disabled')); } } else { show_error(__('Access denied')); }
} //subscriptions manual control if (wf_CheckGet(array('subview'))) { $subId = $_GET['subid']; if (wf_CheckGet(array('subid', 'maction'))) { $mactionResult = $interface->catchManualAction(); if (!$mactionResult) { rcms_redirect($interface::URL_ME . '&' . $interface::URL_SUBVIEW . '&subid=' . $subId); } else { show_window(__('Something went wrong'), $mactionResult); } } show_window(__('Edit'), $interface->renderSubManagerForm($subId)); show_window('', wf_Link($interface::URL_ME . '&' . $interface::URL_SUBS, __('Back'), false, 'ubButton')); } //subscriptions report if (wf_CheckGet(array('reports'))) { if ($altCfg['MG_SPREAD']) { //daily accounting report show_window(__('Subscriptions report'), $interface->renderSubscribtionsReportDaily()); } else { //montly accounting report show_window(__('Subscriptions report'), $interface->renderSubscribtionsReportMonthly()); } } } else { show_error(__('You cant control this module')); } } else { show_error(__('This module disabled')); }
header('Content-Disposition: attachment; filename=userbase.csv'); echo $result; die; } } // show reports list if (cfr('REPORTMASTERADM')) { $export_link = wf_Link('?module=reportmaster&exportuserbase=excel', wf_img("skins/excel.gif", __('Export userbase')), false); } else { $export_link = ''; } $newreport_link = wf_Link('?module=reportmaster&add=true', web_add_icon(), false); $action_links = ' ' . $export_link . ' ' . $newreport_link; show_window(__('Available reports') . $action_links, web_ReportMasterShowReportsList()); //userbase exporting if (wf_CheckGet(array('exportuserbase'))) { zb_RMExportUserbaseCsv(); } //create new report if (isset($_POST['newreportname']) and isset($_POST['newsqlquery']) and isset($_POST['newdatakeys']) and isset($_POST['newfieldnames'])) { if (cfr('REPORTMASTERADM')) { zb_RMCreateReport($_POST['newreportname'], $_POST['newsqlquery'], $_POST['newdatakeys'], $_POST['newfieldnames'], $_POST['newaddr'], $_POST['newrnames'], $_POST['newrowcount']); rcms_redirect("?module=reportmaster"); } else { show_error(__('You cant control this module')); } } //delete existing report if (isset($_GET['delete'])) { if (cfr('REPORTMASTERADM')) { zb_RMDeleteReport($_GET['delete']);
/** * Returns list of all available switches devices with its controls. Also catches ajaxping and forcereping events. * * @return string */ function web_SwitchesShow() { global $ubillingConfig; $alterconf = $ubillingConfig->getAlter(); $allswitches = zb_SwitchesGetAll(); $modelnames = zb_SwitchModelsGetAllTag(); $currenttime = time(); $reping_timeout = $alterconf['SW_PINGTIMEOUT']; $deathTime = zb_SwitchesGetAllDeathTime(); //counters $countTotal = 0; $countAlive = 0; $countDead = 0; $countNp = 0; $countOnMap = 0; $countSwpoll = 0; $countMtsigmon = 0; $countOlt = 0; $countLinked = 0; //non realtime switches pinging $last_pingtime = zb_StorageGet('SWPINGTIME'); if (!$last_pingtime) { zb_SwitchesRepingAll(); zb_StorageSet('SWPINGTIME', $currenttime); $last_pingtime = $currenttime; } else { if ($currenttime > $last_pingtime + $reping_timeout * 60) { // normal timeout reping sub here zb_SwitchesRepingAll(); zb_StorageSet('SWPINGTIME', $currenttime); } } //force total reping and update cache if (wf_CheckGet(array('forcereping'))) { zb_SwitchesRepingAll(); zb_StorageSet('SWPINGTIME', $currenttime); if (wf_CheckGet(array('ajaxping'))) { $dead_raw = zb_StorageGet('SWDEAD'); $deathTime = zb_SwitchesGetAllDeathTime(); $deadarr = array(); $ajaxResult = ''; if ($dead_raw) { $deadarr = unserialize($dead_raw); if (!empty($deadarr)) { //there is some dead switches $deadcount = sizeof($deadarr); if ($alterconf['SWYMAP_ENABLED']) { //getting geodata $switchesGeo = zb_SwitchesGetAllGeo(); } //ajax container $ajaxResult .= wf_tag('div', false, '', 'id="switchping"'); foreach ($deadarr as $ip => $switch) { if ($alterconf['SWYMAP_ENABLED']) { if (isset($switchesGeo[$ip])) { if (!empty($switchesGeo[$ip])) { $devicefind = wf_Link('?module=switchmap&finddevice=' . $switchesGeo[$ip], wf_img('skins/icon_search_small.gif', __('Find on map'))) . ' '; } else { $devicefind = ''; } } else { $devicefind = ''; } } else { $devicefind = ''; } //check morgue records for death time if (isset($deathTime[$ip])) { $deathClock = wf_img('skins/clock.png', __('Switch dead since') . ' ' . $deathTime[$ip]) . ' '; } else { $deathClock = ''; } //switch location link $switchLocator = wf_Link('?module=switches&gotoswitchbyip=' . $ip, web_edit_icon(__('Go to switch'))); //add switch as dead $ajaxResult .= $devicefind . ' ' . $switchLocator . ' ' . $deathClock . $ip . ' - ' . $switch . '<br>'; } } else { $ajaxResult = __('Switches are okay, everything is fine - I guarantee'); } } $ajaxResult .= wf_delimiter() . __('Cache state at time') . ': ' . date("H:i:s"); print $ajaxResult; //darkvoid update $notifyArea = new DarkVoid(); $notifyArea->flushCache(); die; } } //load dead switches cache $dead_switches_raw = zb_StorageGet('SWDEAD'); if (!$dead_switches_raw) { $dead_switches = array(); } else { $dead_switches = unserialize($dead_switches_raw); } //create new ADcomments object if enabled if ($alterconf['ADCOMMENTS_ENABLED']) { $adcomments = new ADcomments('SWITCHES'); } $tablecells = wf_TableCell(__('ID')); $tablecells .= wf_TableCell(__('IP')); $tablecells .= wf_TableCell(__('Location')); $tablecells .= wf_TableCell(__('Active')); $tablecells .= wf_TableCell(__('Model')); $tablecells .= wf_TableCell(__('SNMP community')); $tablecells .= wf_TableCell(__('Geo location')); $tablecells .= wf_TableCell(__('Description')); $tablecells .= wf_TableCell(__('Actions')); $tablerows = wf_TableRow($tablecells, 'row1'); $lighter = 'onmouseover="this.className = \'row2\';" onmouseout="this.className = \'row3\';" '; if (!empty($allswitches)) { foreach ($allswitches as $io => $eachswitch) { if (isset($dead_switches[$eachswitch['ip']])) { if (isset($deathTime[$eachswitch['ip']])) { $obituary = __('Switch dead since') . ' ' . $deathTime[$eachswitch['ip']]; } else { $obituary = ''; } $aliveled = web_red_led($obituary); $aliveflag = '0'; $countDead++; } else { if (strpos($eachswitch['desc'], 'NP') === false) { $aliveled = web_green_led(); $aliveflag = '1'; $countAlive++; } else { $aliveled = web_yellow_led(); $aliveflag = '2'; $countNp++; } } $tablecells = wf_TableCell($eachswitch['id']); $tablecells .= wf_TableCell($eachswitch['ip'], '', '', 'sorttable_customkey="' . ip2int($eachswitch['ip']) . '"'); $tablecells .= wf_TableCell($eachswitch['location']); $tablecells .= wf_TableCell($aliveled, '', '', 'sorttable_customkey="' . $aliveflag . '"'); $tablecells .= wf_TableCell(@$modelnames[$eachswitch['modelid']]); $tablecells .= wf_TableCell($eachswitch['snmp']); $tablecells .= wf_TableCell($eachswitch['geo']); $tablecells .= wf_TableCell($eachswitch['desc']); $switchcontrols = ''; if (cfr('SWITCHESEDIT')) { $switchcontrols .= wf_Link('?module=switches&edit=' . $eachswitch['id'], web_edit_icon()); } if (cfr('SWITCHPOLL')) { if (!empty($eachswitch['snmp']) and ispos($eachswitch['desc'], 'SWPOLL')) { $switchcontrols .= ' ' . wf_Link('?module=switchpoller&switchid=' . $eachswitch['id'], wf_img('skins/snmp.png', __('SNMP query'))); $countSwpoll++; } } if ($alterconf['SWYMAP_ENABLED']) { if (!empty($eachswitch['geo'])) { $switchcontrols .= wf_Link('?module=switchmap&finddevice=' . $eachswitch['geo'], wf_img('skins/icon_search_small.gif', __('Find on map'))); $countOnMap++; } if (!empty($eachswitch['parentid'])) { $switchcontrols .= wf_Link('?module=switchmap&finddevice=' . $eachswitch['geo'] . '&showuplinks=true&traceid=' . $eachswitch['id'], wf_img('skins/ymaps/uplinks.png', __('Uplink switch'))); $countLinked++; } } if (ispos($eachswitch['desc'], 'MTSIGMON')) { $countMtsigmon++; } if (ispos($eachswitch['desc'], 'OLT')) { $countOlt++; } if ($alterconf['ADCOMMENTS_ENABLED']) { $switchcontrols .= $adcomments->getCommentsIndicator($eachswitch['id']); } if (isset($alterconf['SW_WEBNAV'])) { if ($alterconf['SW_WEBNAV']) { $switchcontrols .= ' ' . wf_tag('a', false, '', 'href="http://' . $eachswitch['ip'] . '" target="_BLANK"') . wf_img('skins/ymaps/globe.png', __('Go to the web interface')) . wf_tag('a', true); } } $tablecells .= wf_TableCell($switchcontrols); $tablerows .= wf_tag('tr', false, 'row3', $lighter); $tablerows .= $tablecells; $tablerows .= wf_tag('tr', true); $countTotal++; } } $result = wf_TableBody($tablerows, '100%', '0', 'sortable'); $result .= wf_img('skins/icon_active.gif') . ' ' . __('Alive switches') . ' - ' . ($countAlive + $countNp) . ' (' . $countAlive . '+' . $countNp . ')' . wf_tag('br'); $result .= wf_img('skins/icon_inactive.gif') . ' ' . __('Dead switches') . ' - ' . $countDead . wf_tag('br'); $result .= wf_img('skins/yellow_led.png') . ' ' . __('NP switches') . ' - ' . $countNp . wf_tag('br'); $result .= wf_img('skins/snmp.png') . ' ' . __('SWPOLL query') . ' - ' . $countSwpoll . wf_tag('br'); $result .= wf_img('skins/wifi.png') . ' ' . __('MTSIGMON devices') . ' - ' . $countMtsigmon . wf_tag('br'); $result .= wf_img('skins/pon_icon.gif') . ' ' . __('OLT devices') . ' - ' . $countOlt . wf_tag('br'); $result .= wf_img('skins/icon_search_small.gif') . ' ' . __('Placed on map') . ' - ' . $countOnMap . wf_tag('br'); $result .= wf_img('skins/ymaps/uplinks.png') . ' ' . __('Have uplinks') . ' - ' . $countLinked . wf_tag('br'); $result .= wf_tag('br') . wf_tag('b') . __('Total') . ': ' . $countTotal . wf_tag('b', true) . wf_tag('br'); return $result; }
} /** * Deletes SMS from local queue * * @param string $filename Existing sms filename * * @return int 0 - ok */ public function deleteSms($filename) { $result = $this->smsObj->deleteSms($filename); return $result; } } $tsmsQueue = new TSMSQueue(); if (wf_CheckGet(array('deletesms'))) { $deletionResult = $tsmsQueue->deleteSms($_GET['deletesms']); if ($deletionResult == 0) { $darkVoid = new DarkVoid(); $darkVoid->flushCache(); rcms_redirect('?module=tsmsqueue'); } else { if ($deletionResult == 2) { show_error(__('Not existing item')); } if ($deletionResult == 1) { show_error(__('Permission denied')); } } } show_window(__('SMS in queue'), $tsmsQueue->render());
if (wf_CheckPost(array('deletealias'))) { $newStoreAliases = $numAliases; $deleteAliasNum = mysql_real_escape_string($_POST['deletealias']); if (isset($newStoreAliases[$deleteAliasNum])) { unset($newStoreAliases[$deleteAliasNum]); $newStoreAliases = serialize($newStoreAliases); $newStoreAliases = base64_encode($newStoreAliases); zb_StorageSet('ASKOZIAPBX_NUMALIAS', $newStoreAliases); log_register("ASKOZIAPBX ALIAS DELETE `" . $deleteAliasNum . "`"); rcms_redirect("?module=askozia&config=true"); } } show_window(__('Settings'), web_AskoziaConfigForm()); show_window(__('Phone book'), web_AskoziaAliasesForm()); } else { //showing call history form show_window(__('Calls history'), web_AskoziaDateForm()); } } else { show_error(__('Permission denied')); } if (wf_CheckPost(array('datefrom', 'dateto'))) { zb_AskoziaGetCallHistory($_POST['datefrom'], $_POST['dateto']); } else { if (!wf_CheckGet(array('config'))) { zb_AskoziaGetCurrentStatus(); } } } else { show_error(__('AskoziaPBX integration now disabled')); }
<?php // check for right of current admin on this module if (cfr('CATVSTATS')) { catv_GlobalControlsShow(); if (wf_CheckGet(array('userid'))) { $userid = vf($_GET['userid'], 3); $userdata = catv_UserGetData($userid); $realname = $userdata['realname']; $address = $userdata['street'] . ' ' . $userdata['build'] . '/' . $userdata['apt']; //target year selection $yearforminputs = wf_YearSelector('yearselect', 'Year', false); $yearforminputs .= ' '; $yearforminputs .= wf_Submit('Show'); $yearform = wf_Form('', 'POST', $yearforminputs, 'glamour', ''); show_window($address . ' ' . $realname, $yearform . '<div style="clear: both;"></div>'); if (wf_CheckPost(array('yearselect'))) { $target_year = $_POST['yearselect']; } else { $target_year = curyear(); } catv_UserStatsByYear($userid, $target_year); catv_DecoderShowAllChanges($userid); catv_ActivityShowAll($userid); catv_ProfileBack($userid); } } else { show_error(__('You cant control this module')); }
if (isset($_GET['switchdelete'])) { $swlinks = ''; $swlinks .= wf_Link('?module=switches&edit=' . $_GET['switchdelete'], web_edit_icon() . ' ' . __('Edit'), false, 'ubButton') . ' '; $swlinks .= wf_JSAlertStyled('?module=switches&switchdelete=' . $_GET['switchdelete'] . '&forcedel=true', web_delete_icon() . ' ' . __('Force deletion'), __('Removing this may lead to irreparable results'), 'ubButton'); } show_window('', $swlinks); if (!isset($_GET['timemachine'])) { if (!isset($_GET['switchdelete'])) { //display switches list show_window(__('Available switches'), web_SwitchesShow()); } } else { //show dead switch time machine if (!isset($_GET['snapshot'])) { //cleanup subroutine if (wf_CheckGet(array('flushalldead'))) { ub_SwitchesTimeMachineCleanup(); rcms_redirect("?module=switches&timemachine=true"); } //calendar view time machine if (!wf_CheckPost(array('switchdeadlogsearch'))) { $deadTimeMachine = ub_JGetSwitchDeadLog(); $timeMachine = wf_FullCalendar($deadTimeMachine); } else { //search processing $timeMachine = ub_SwitchesTimeMachineSearch($_POST['switchdeadlogsearch']); } $timeMachineCleanupControl = wf_JSAlert('?module=switches&timemachine=true&flushalldead=true', wf_img('skins/icon_cleanup.png', __('Cleanup')), __('Are you serious')); //here some searchform $timeMachineSearchForm = web_SwitchTimeMachineSearchForm() . wf_tag('br'); show_window(__('Dead switches time machine') . ' ' . $timeMachineCleanupControl, $timeMachineSearchForm . $timeMachine);
$photoStorage->catchWebcamUpload(); } //catch file upload request if (wf_CheckGet(array('uploadfilephoto'))) { $photoStorage->catchFileUpload(); } //catch file download if (wf_CheckGet(array('download'))) { $photoStorage->catchDownloadImage($_GET['download']); } //catch file deletion event if (wf_CheckGet(array('delete'))) { $photoStorage->catchDeleteImage($_GET['delete']); } //show webcam snapshot form if (wf_CheckGet(array('mode'))) { $modeSet = $_GET['mode']; //webcamera snapshot if ($modeSet == 'cam') { show_window(__('Webcamera snapshot'), $photoStorage->renderWebcamForm(false)); } //webcamera cropped snapshot if ($modeSet == 'avacam') { show_window(__('Webcamera snapshot') . ' - ' . __('avatar'), $photoStorage->renderWebcamForm(true)); } //just file upload interface if ($modeSet == 'loader') { show_window(__('Upload images'), $photoStorage->renderUploadForm()); } //listing images for some object if ($modeSet == 'list') {
<?php $altcfg = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini'); if ($altcfg['SWITCH_AUTOCONFIG']) { $swLogin = new SwitchLogin(); if (cfr(SwitchLogin::MODULE)) { if (wf_CheckGet(array('ajax'))) { if ($_GET['ajax'] == 'snmp') { $swLogin->SwLoginAddSnmpForm(); } if ($_GET['ajax'] == 'connect') { $swLogin->SwLoginAddConnForm(); } if ($_GET['ajax'] == 'snmp_edit') { $swLogin->SwLoginEditSnmpForm($_GET['edit']); } if ($_GET['ajax'] == 'connect_edit') { $swLogin->SwLoginEditConnForm($_GET['edit']); } } if (!isset($_GET['edit'])) { $megaForm = wf_AjaxLoader(); $megaForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&ajax=snmp', 'SNMP', 'megaContainer1', false, 'ubButton'); $megaForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&ajax=connect', 'Connect', 'megaContainer1', false, 'ubButton'); $megaForm .= wf_tag('div', false, '', 'id="megaContainer1"') . wf_tag('div', true); show_window(__("Switches login data"), $megaForm); $swLogin->ShowSwAllLogin(); } else { $megaEditForm = wf_AjaxLoader(); $megaEditForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&edit=' . $_GET['edit'] . '&ajax=snmp_edit', 'SNMP', 'megaContainer1', false, 'ubButton'); $megaEditForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&edit=' . $_GET['edit'] . '&ajax=connect_edit', 'Connect', 'megaContainer1', false, 'ubButton');
$cityid = $_GET['cityid']; if ($_GET['action'] == 'delete') { if (!zb_AddressCityProtected($cityid)) { zb_AddressDeleteCity($cityid); rcms_redirect('?module=city'); } else { show_window(__('Error'), __('You can not just remove a city where there are streets and possibly survivors')); show_window('', wf_Link('?module=city', __('Back'), true, 'ubButton')); } } if ($_GET['action'] == 'edit') { if (isset($_POST['editcityname'])) { if (!empty($_POST['editcityname'])) { zb_AddressChangeCityName($cityid, $_POST['editcityname']); } zb_AddressChangeCityAlias($cityid, $_POST['editcityalias']); rcms_redirect('?module=city'); } show_window(__('Edit City'), web_CityEditForm($cityid)); } } } // create form if (!wf_CheckGet(array('action'))) { show_window(__('Create new city'), web_CityCreateForm()); } //list show_window(__('Available cities'), web_CityLister()); } else { show_error(__('You cant control this module')); }
$documents = new ProfileDocuments(); $date = wf_CheckPost(array('showdate')) ? $_POST['showdate'] : ''; $documents->loadAllUsersDocuments($date); //existing document downloading if (wf_CheckGet(array('documentdownload'))) { zb_DownloadFile($documents::DOCUMENTS_PATH . $_GET['documentdownload'], 'docx'); } //document deletion from database if (wf_CheckGet(array('deletedocument'))) { $documents->unregisterDocument($_GET['deletedocument']); rcms_redirect('?module=report_documents'); } //controls $actionLinks = wf_Link('?module=report_documents', __('Grid view') . ' ' . wf_img('skins/icon_table.png'), false, 'ubButton'); $actionLinks .= wf_Link('?module=report_documents&calendarview=true', __('As calendar') . ' ' . wf_img('skins/icon_calendar.gif'), false, 'ubButton'); show_window('', $actionLinks); if (!wf_CheckGet(array('calendarview'))) { //show calendar control show_window(__('By date'), $documents->dateControl()); //list available documents show_window(__('Previously generated documents'), $documents->renderAllUserDocuments()); } else { //or calendar view show_window(__('Previously generated documents'), $documents->renderAllUserDocumentsCalendar()); } } else { show_error(__('This module is disabled')); } } else { show_error(__('You cant control this module')); }
/** * Returns available cities selector * * @return string */ function web_CitySelector() { $allcity = array(); $tmpCity = zb_AddressGetCityAllData(); if (!empty($tmpCity)) { foreach ($tmpCity as $io => $each) { $allcity[$each['id']] = $each['cityname']; } } $selected = wf_CheckGet(array('citypreset')) ? vf($_GET['citypreset'], 3) : ''; $selector = wf_Selector('citysel', $allcity, '', $selected, false); return $selector; }
<?php if (cfr('SENDDOG')) { $altCfg = $ubillingConfig->getAlter(); if ($altCfg['SENDDOG_ENABLED']) { $sendDog = new SendDog(); //editing config if (wf_CheckPost(array('editconfig'))) { $sendDog->saveConfig(); rcms_redirect($sendDog->getBaseUrl()); } if (!wf_CheckGet(array('showmisc'))) { //render config interface show_window(__('SendDog configuration'), $sendDog->renderConfigForm()); } else { //render SMS queue $smsQueue = $_GET['showmisc']; switch ($smsQueue) { case 'tsms': show_window(__('View SMS sending queue'), $sendDog->renderTurboSMSQueue()); break; case 'smsflybalance': show_window(__('SMS-Fly') . ' ' . __('Balance'), $sendDog->renderSmsflyBalance()); break; case 'telegramcontacts': show_window(__('Telegram bot contacts'), $sendDog->renderTelegramContacts()); break; } } } else { show_error(__('This module is disabled'));
/** * renders streets report * * @return void */ public function reportStreets() { $ukvCities = array(); $ukvStreets = array(); //loads cities and streets occupied by UKV users $ukvCities_q = "SELECT DISTINCT `city` from `ukv_users` ORDER BY `city` ASC"; $ukvCitiesRaw = simple_queryall($ukvCities_q); if (!empty($ukvCitiesRaw)) { foreach ($ukvCitiesRaw as $ieuc => $euc) { $ukvCities[$euc['city']] = $euc['city']; } } $ukvStreets_q = "SELECT DISTINCT `street` from `ukv_users` ORDER BY `street` ASC"; $ukvStreetsRaw = simple_queryall($ukvStreets_q); if (!empty($ukvStreetsRaw)) { foreach ($ukvStreetsRaw as $ieus => $eus) { $ukvStreets[$eus['street']] = $eus['street']; } } //main codepart $citySelected = wf_CheckPost(array('streetreportcity')) ? $_POST['streetreportcity'] : ''; $streetSelected = wf_CheckPost(array('streetreportstreet')) ? $_POST['streetreportstreet'] : ''; $inputs = wf_Selector('streetreportcity', $ukvCities, __('City'), $citySelected, false); $inputs .= wf_Selector('streetreportstreet', $ukvStreets, __('Street'), $streetSelected, false); $inputs .= wf_Submit(__('Show')); $form = wf_Form('', 'POST', $inputs, 'glamour'); show_window(__('Streets report'), $form); if (wf_CheckPost(array('streetreportcity', 'streetreportstreet')) or wf_CheckGet(array('rc', 'rs'))) { //set form data if (wf_CheckPost(array('streetreportcity', 'streetreportstreet'))) { $citySearch = $_POST['streetreportcity']; $streetSearch = $_POST['streetreportstreet']; } //or printable report if (wf_CheckGet(array('rc', 'rs'))) { $citySearch = $_GET['rc']; $streetSearch = $_GET['rs']; } if (!empty($this->users)) { $counter = 0; $cells = wf_TableCell(__('Contract'), '10%'); $cells .= wf_TableCell(__('Full address'), '31%'); $cells .= wf_TableCell(__('Real Name'), '30%'); $cells .= wf_TableCell(__('Tariff'), '15%'); $cells .= wf_TableCell(__('Cash'), '7%'); $cells .= wf_TableCell(__('Status'), '7%'); $rows = wf_TableRow($cells, 'row1'); foreach ($this->users as $io => $eachUser) { if ($eachUser['city'] == $citySearch and $eachUser['street'] == $streetSearch) { $cells = wf_TableCell($eachUser['contract']); $fullAddress = $this->userGetFullAddress($eachUser['id']); $profileLink = wf_Link(self::URL_USERS_PROFILE . $eachUser['id'], web_profile_icon() . ' ', false, ''); $cells .= wf_TableCell($profileLink . $fullAddress); $cells .= wf_TableCell($eachUser['realname']); $cells .= wf_TableCell($this->tariffs[$eachUser['tariffid']]['tariffname']); $cells .= wf_TableCell($eachUser['cash']); $cells .= wf_TableCell(web_bool_led($eachUser['active'], true)); $rows .= wf_TableRow($cells, 'row3'); $counter++; } } $result = wf_TableBody($rows, '100%', '0', 'sortable'); $result .= __('Total') . ': ' . $counter; if (wf_CheckGet(array('printable'))) { $this->reportPrintable($citySearch . ' / ' . $streetSearch, $result); } else { $printlink = wf_Link(self::URL_REPORTS_MGMT . 'reportStreets&rc=' . $citySearch . '&rs=' . $streetSearch . '&printable=true', wf_img('skins/icon_print.png', __('Print')), false, ''); show_window($citySearch . ' / ' . $streetSearch . ' ' . $printlink, $result); } } else { show_window(__('Result'), __('Any users found')); } } }
$tsSheetCreateResult = $salary->timesheetCreate(); if ($tsSheetCreateResult == 0) { //succeful creation rcms_redirect('?module=salary_timesheets'); } else { if ($tsSheetCreateResult == 1) { //date duplicate show_error(__('Timesheets with that date already exist')); } } } $tsCf = $salary->timesheetCreateForm(); if ($tsCf) { $timesheetsControls = wf_modal(web_add_icon() . ' ' . __('Create'), __('Create') . ' ' . __('Timesheet'), $tsCf, 'ubButton', '800', '600'); show_window('', $timesheetsControls); if (!wf_CheckGet(array('showdate'))) { //render available timesheets list by date show_window(__('Timesheets'), $salary->timesheetsListRender('?module=salary_timesheets')); } else { //saving changes for single timesheet row if (wf_CheckPost(array('edittimesheetid'))) { $salary->timesheetSaveChanges(); rcms_redirect('?module=salary_timesheets&showdate=' . $_GET['showdate']); } //render timesheet by date (edit form) show_window(__('Timesheet') . ' ' . $_GET['showdate'], $salary->timesheetEditForm($_GET['showdate'])); show_window('', wf_Link('?module=salary_timesheets', __('Back'), false, 'ubButton')); } } else { show_warning(__('No available workers for timesheets')); }
} break; case 'document': switch ($action) { case 'download': if (wf_CheckGet(array('id'))) { $id = vf($_GET['id'], 3); if (method_exists($obj, $runtime['METHOD']['DCMNTSDWNLD'])) { $obj->{$runtime}['METHOD']['DCMNTSDWNLD']($id); } } else { rcms_redirect($obj::URL_HOME); } break; case 'delete': if (wf_CheckGet(array('id'))) { $id = vf($_GET['id'], 3); if (method_exists($obj, $runtime['METHOD']['DCMNTSDLT'])) { $obj->{$runtime}['METHOD']['DCMNTSDLT']($id); } } else { rcms_redirect($obj::URL_HOME); } break; default: // Переадресация на главную стр. модуля при попытке доступа // к несуществующему обработчику $_GET['action']: rcms_redirect($obj::URL_HOME); break; } break;
{ $result = web_UserArrayShower($this->frozen); return $result; } /* * renders form for date selecting * * @return string */ public function dateForm() { $inputs = wf_DatePickerPreset('date', $this->interval); $inputs .= __('By date') . ' '; $inputs .= wf_Submit(__('Show')); $inputs .= ' ' . wf_Link("?module=report_autofreeze&showfrozen=true", __('Currently frozen'), false, 'ubButton'); $result = wf_Form("", 'POST', $inputs, 'glamour'); return $result; } } $datePush = wf_CheckPost(array('date')) ? $dateSelector = $_POST['date'] : ($dateSelector = ''); $autoFreezeReport = new ReportAutoFreeze($dateSelector); if (!wf_CheckGet(array('showfrozen'))) { show_window('', $autoFreezeReport->dateForm()); show_window(__('Autofreeze report'), $autoFreezeReport->render()); } else { show_window('', wf_Link('?module=report_autofreeze', __('Back'), false, 'ubButton')); show_window(__('Currently frozen'), $autoFreezeReport->renderFrozen()); } } else { show_error(__('You cant control this module')); }