Ejemplo n.º 1
0
 /**
  * Performs replication of administrators rights to existing user
  * 
  * @global object $system
  * @param string $sourceUser
  * @param string $targetUser
  */
 function zb_PermissionsCopyAdminRights($sourceUser, $targetUser)
 {
     global $system;
     $targetRights = array();
     $rootUser = '';
     $rights = array();
     $system->getRightsForUser($sourceUser, $rights, $root, $level);
     if ($root) {
         $rootUser = 1;
     } else {
         if (!empty($rights)) {
             foreach ($rights as $eachright => $desc) {
                 $targetRights[$eachright] = 'on';
             }
         }
     }
     //writing changes
     if ($system->setRightsForUser($targetUser, $targetRights, $rootUser, '1')) {
         show_window('', __('Rights cloned'));
         log_register("CLONE AdminPermissions FROM {" . $sourceUser . "} TO {" . $targetUser . "}");
         rcms_redirect("?module=permissions&edit=" . $targetUser);
     } else {
         show_error(__('Error occurred'));
     }
 }
Ejemplo n.º 2
0
 function mrst_MassReset()
 {
     global $altcfg, $billing;
     $query = "SELECT `login` from `users`";
     $allusers = zb_UserGetAllStargazerData();
     if (!empty($allusers)) {
         foreach ($allusers as $io => $eachuser) {
             //very shitty hack
             sleep(2);
             $billing->resetuser($eachuser['login']);
             if (!isset($altcfg['MASSRESET_NOLOG'])) {
                 log_register("MASSRESET User (" . $eachuser['login'] . ")");
             }
         }
         //preventing F5
         rcms_redirect("?module=massreset");
     } else {
         show_error(__('Any users found'));
     }
 }
Ejemplo n.º 3
0
 function zb_plfixer($login, $field)
 {
     if ($field == 'emails') {
         zb_UserCreateEmail($login, '');
     }
     if ($field == 'contracts') {
         zb_UserCreateContract($login, '');
     }
     if ($field == 'phones') {
         zb_UserCreatePhone($login, '', '');
     }
     if ($field == 'realname') {
         zb_UserCreateRealName($login, '');
     }
     if ($field == 'userspeeds') {
         zb_UserCreateSpeedOverride($login, '0');
     }
     if ($field == 'nethosts') {
         rcms_redirect("?module=pl_ipchange&username="******"?module=pl_checker&username=" . $login);
 }
Ejemplo n.º 4
0
/**
 * Returns user login by its IP address
 * 
 * @param string $ip
 * @return string
 */
function zbs_UserGetLoginByIp($ip)
{
    $glob_conf = zbs_LoadConfig();
    $query = "SELECT `login` from `users` where `IP`='" . $ip . "'";
    $result = simple_query($query);
    if (!empty($result)) {
        return $result['login'];
    } else {
        if ($glob_conf['auth'] == 'ip') {
            if (isset($glob_conf['authfailredir'])) {
                if (!empty($glob_conf['authfailredir'])) {
                    rcms_redirect($glob_conf['authfailredir']);
                    die('Unknown user');
                } else {
                    die('Unknown user EX_EMPTY_AUTHFAILREDIR');
                }
            } else {
                die('Unknown user EX_NO_AUTHFAILREDIR_DEFINED');
            }
        }
    }
}
Ejemplo n.º 5
0
define('RCMS_ROOT_PATH', './');
include RCMS_ROOT_PATH . 'common.php';
//load files
if (get('download') && $system->checkForRight('GENERAL')) {
    $file = base64_decode(get('download'));
    download_file($file);
}
function rcms_loadAdminLib($lib)
{
    require_once ADMIN_PATH . 'libs/' . $lib . '.php';
}
//------------------------------------------------------------------------------------------------------//
// preparations...
if (post('admin_selected_skin')) {
    setcookie('admin_skin', $_POST['admin_selected_skin'], FOREVER_COOKIE);
    rcms_redirect('');
}
$admin_skin = cookie('admin_skin', 'default');
$admin_skin = cut_text(preg_replace("/[^a-zA-Z]+/", '', $admin_skin));
//only letters
define('ADMIN_SKIN', ADMIN_PATH . 'skins/' . $admin_skin . '/');
$rights =& $system->rights;
$root =& $system->root;
if (!LOGGED_IN) {
    $message = __('Access denied');
    $message .= '<br />
<form method="post" action="">
<input type="hidden" name="login_form" value="1" />
<table cellpadding="2" cellspacing="1" style="width: 100%;">
<tr>
    <td class="row1">' . __('Username') . ':</td>
Ejemplo n.º 6
0
                            if (method_exists($corps, $beggar['BU']['F'])) {
                                $corpAttachControls = $corps->{$beggar}['BU']['F']($login);
                                show_window(__('Private user'), $corpAttachControls);
                            }
                            if (method_exists($corps, $beggar['BU']['AB'])) {
                                $corpAddAttachControls = $corps->{$beggar}['BU']['AB']($login);
                                show_window(__('Create') . ' ' . __('Corporate user'), $corpAddAttachControls);
                            }
                        }
                    }
                }
                if ($route == Corps::URL_SEARCH) {
                    $searchResults = $corps->searchUsersByCorpName($_POST['searchcorpname']);
                    if (!empty($searchResults)) {
                        show_window(__('Search results'), $searchResults);
                    }
                    show_window('', wf_Link('?module=usersearch', __('Back'), false, 'ubButton'));
                }
            } else {
                //default list route
                rcms_redirect(Corps::URL_CORPS_LIST);
            }
        } else {
            show_error(__('No license key available'));
        }
    } else {
        show_error(__('This module is disabled'));
    }
} else {
    show_error(__('Access denied'));
}
Ejemplo n.º 7
0
    if ($_POST['mode'] == 'php' && !$system->checkForRight('GENERAL')) {
        return rcms_showAdminMessage(__('Error occurred') . ': ' . __('You are not administrator of this site'));
    }
    if (!@$articles->saveArticle($b, $a, $_POST['title'], $_POST['source'], $_POST['keywords'], $_POST['sef_desc'], $_POST['description'], $_POST['text'], $_POST['mode'], $_POST['comments'], $time)) {
        rcms_showAdminMessage($articles->last_error);
    } else {
        rcms_showAdminMessage(__('Article saved'));
        sleep(1);
        if (!empty($nb) && $nb != $b) {
            if (!$articles->moveArticle($b, $a, $nb)) {
                rcms_showAdminMessage($articles->last_error);
            } else {
                rcms_showAdminMessage(__('Article moved'));
            }
        } else {
            rcms_redirect(RCMS_ROOT_PATH . '?module=articles&c=' . $c . '&b=' . $b . '&a=' . $a);
        }
    }
}
/******************************************************************************
* Interface                                                                   *
******************************************************************************/
// Show container selector
$frm = new InputForm('', 'post', __('Submit'));
$frm->addrow(__('Select section'), $frm->select_tag('c', $articles->getContainers(2), $c), 'top');
// Show category selector
if (!empty($c) && $c != '#hidden' && $c != '#root') {
    if ($articles->setWorkContainer($c)) {
        $frm->addrow(__('Select category'), $frm->select_tag('b', $articles->getCategories(true, false), $b), 'top');
    } else {
        rcms_showAdminMessage($articles->last_error);
Ejemplo n.º 8
0
 /**
  * shows payments graph for some year
  * 
  * @param string $year year to show
  * 
  * @return void
  */
 protected function paymentsShowGraph($year)
 {
     $months = months_array();
     $year_summ = $this->paymentsGetYearSumm($year);
     $curtime = time();
     $yearPayData = array();
     $cells = wf_TableCell('');
     $cells .= wf_TableCell(__('Month'));
     $cells .= wf_TableCell(__('Payments count'));
     $cells .= wf_TableCell(__('ARPU'));
     $cells .= wf_TableCell(__('Cash'));
     $cells .= wf_TableCell(__('Visual'), '50%');
     $rows = wf_TableRow($cells, 'row1');
     //caching subroutine
     $renewTime = zb_StorageGet('UKVYPD_LAST');
     if (empty($renewTime)) {
         //first usage
         $renewTime = $curtime;
         zb_StorageSet('UKVYPD_LAST', $renewTime);
         $updateCache = true;
     } else {
         //cache time already set
         $timeShift = $curtime - $renewTime;
         if ($timeShift > 3600) {
             //cache update needed
             $updateCache = true;
         } else {
             //load data from cache or init new cache
             $yearPayData_raw = zb_StorageGet('UKVYPD_CACHE');
             if (empty($yearPayData_raw)) {
                 //first usage
                 $emptyCache = array();
                 $emptyCache = serialize($emptyCache);
                 $emptyCache = base64_encode($emptyCache);
                 zb_StorageSet('UKVYPD_CACHE', $emptyCache);
                 $updateCache = true;
             } else {
                 // data loaded from cache
                 $yearPayData = base64_decode($yearPayData_raw);
                 $yearPayData = unserialize($yearPayData);
                 $updateCache = false;
                 //check is current year already cached?
                 if (!isset($yearPayData[$year]['graphs'])) {
                     $updateCache = true;
                 }
                 //check is manual cache refresh is needed?
                 if (wf_CheckGet(array('forcecache'))) {
                     $updateCache = true;
                     rcms_redirect(self::URL_REPORTS_MGMT . 'reportFinance');
                 }
             }
         }
     }
     if ($updateCache) {
         foreach ($months as $eachmonth => $monthname) {
             $month_summ = $this->paymentsGetMonthSumm($year, $eachmonth);
             $paycount = $this->paymentsGetMonthCount($year, $eachmonth);
             $cells = wf_TableCell($eachmonth);
             $cells .= wf_TableCell(wf_Link(self::URL_REPORTS_MGMT . 'reportFinance&month=' . $year . '-' . $eachmonth, rcms_date_localise($monthname)));
             $cells .= wf_TableCell($paycount);
             $cells .= wf_TableCell(@round($month_summ / $paycount, 2));
             $cells .= wf_TableCell(web_roundValue($month_summ, 2));
             $cells .= wf_TableCell(web_bar($month_summ, $year_summ));
             $rows .= wf_TableRow($cells, 'row3');
         }
         $result = wf_TableBody($rows, '100%', '0', 'sortable');
         $yearPayData[$year]['graphs'] = $result;
         //write to cache
         zb_StorageSet('UKVYPD_LAST', $curtime);
         $newCache = serialize($yearPayData);
         $newCache = base64_encode($newCache);
         zb_StorageSet('UKVYPD_CACHE', $newCache);
     } else {
         //take data from cache
         if (isset($yearPayData[$year]['graphs'])) {
             $result = $yearPayData[$year]['graphs'];
             $result .= __('Cache state at time') . ': ' . date("Y-m-d H:i:s", $renewTime) . ' ';
             $result .= wf_Link(self::URL_REPORTS_MGMT . 'reportFinance&forcecache=true', wf_img('skins/icon_cleanup.png', __('Renew')), false, '');
         } else {
             $result = __('Strange exeption');
         }
     }
     show_window(__('Payments by') . ' ' . $year, $result);
 }
Ejemplo n.º 9
0
            $back = wf_Link(SwitchLogin::MODULE_URL, __('Back'), false, 'ubButton');
            show_window('', $back);
        }
        if (isset($_POST['add'])) {
            $params = array('swmodel', 'SwMethod');
            if (wf_CheckPost($params)) {
                $model = $_POST['swmodel'];
                $snmpTemplate = $_POST['snmptemplate'];
                $login = $_POST['SwLogin'];
                $pass = $_POST['SwPass'];
                $method = $_POST['SwMethod'];
                $community = $_POST['RwCommunity'];
                $enable = $_POST['Enable'];
                $swLogin->SwLoginAdd($model, $login, $pass, $method, $community, $enable, $snmpTemplate);
                rcms_redirect(SwitchLogin::MODULE_URL);
            }
        }
        if (isset($_GET['delete'])) {
            $swLogin->SwLoginDelete($_GET['delete']);
            rcms_redirect(SwitchLogin::MODULE_URL);
        }
        if (isset($_POST['edit'])) {
            $swLogin->SwLoginEditQuery($_POST['swmodel'], $_POST['EditSwLogin'], $_POST['EditSwPass'], $_POST['EditConn'], $_POST['EditRwCommunity'], $_POST['EditEnable'], $_POST['snmptemplate'], $_GET['edit']);
            rcms_redirect(SwitchLogin::MODULE_URL);
        }
    } else {
        show_error('You cant control this module');
    }
} else {
    show_error("SWITCH_AUTOCONFIG is disabled");
}
Ejemplo n.º 10
0
                 rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_OUT . '&storageid=' . $_POST['newreservestorageid'] . '&outitemid=' . $_POST['newreserveitemtypeid']);
             } else {
                 show_window('', $creationResult);
             }
         }
         $reservationTitle = __('Reservation') . ' ' . $warehouse->itemtypeGetName($_GET['itemtypeid']) . ' ' . __('from') . ' ' . $warehouse->storageGetName($_GET['storageid']);
         show_window($reservationTitle, $warehouse->reserveCreateForm($_GET['storageid'], $_GET['itemtypeid']));
         $warehouse->{$avidity}['M']['FALL']($warehouse::URL_ME . '&' . $warehouse::URL_OUT . '&storageid=' . $_GET['storageid'] . '&outitemid=' . $_GET['itemtypeid']);
     } else {
         if (wf_CheckGet(array('deletereserve'))) {
             $warehouse->reserveDelete($_GET['deletereserve']);
             rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_RESERVE);
         }
         if (wf_CheckPost(array('editreserveid'))) {
             $warehouse->reserveSave();
             rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_RESERVE);
         }
         show_window(__('Reserved'), $warehouse->reserveRenderList());
         $warehouse->{$avidity}['M']['FALL']($warehouse::URL_ME);
     }
 }
 //viewers
 if (wf_CheckGet(array('viewers'))) {
     if (wf_CheckGet(array('showinid'))) {
         show_window(__('Incoming operation') . ': ' . $_GET['showinid'], $warehouse->incomingView($_GET['showinid']));
         $warehouse->{$avidity}['M']['FALL']($warehouse::URL_ME . '&' . $warehouse::URL_IN);
     }
     if (wf_CheckGet(array('showoutid'))) {
         show_window(__('Outcoming operation') . ': ' . $_GET['showoutid'], $warehouse->outcomingView($_GET['showoutid']));
         $warehouse->{$avidity}['M']['FALL']($warehouse::URL_ME . '&' . $warehouse::URL_OUT);
     }
Ejemplo n.º 11
0
<?php

if (cfr('EMPLOYEE')) {
    if (isset($_GET['username'])) {
        $username = $_GET['username'];
        if (isset($_POST['addjob'])) {
            $date = $_POST['jobdate'];
            $worker_id = $_POST['worker'];
            $jobtype_id = $_POST['jobtype'];
            $job_notes = $_POST['notes'];
            stg_add_new_job($username, $date, $worker_id, $jobtype_id, $job_notes);
            rcms_redirect("?module=jobs&username="******"?module=jobs&username=" . $username);
        }
        stg_show_jobs($username);
        show_window('', web_UserControls($username));
    }
} else {
    show_error(__('Access denied'));
}
?>


Ejemplo n.º 12
0
 }
 //if adding new report
 if (isset($_GET['add'])) {
     if (cfr('REPORTMASTERADM')) {
         web_ReportMasterShowAddForm();
     } else {
         show_error(__('You cant control this module'));
     }
 }
 //and if editing
 if (isset($_GET['edit'])) {
     if (cfr('REPORTMASTERADM')) {
         web_ReportMasterShowEditForm($_GET['edit']);
         if (isset($_POST['editreportname']) and isset($_POST['editsqlquery']) and isset($_POST['editdatakeys']) and isset($_POST['editfieldnames'])) {
             zb_RMEditReport($_GET['edit'], $_POST['editreportname'], $_POST['editsqlquery'], $_POST['editdatakeys'], $_POST['editfieldnames'], $_POST['editaddr'], $_POST['editrnames'], $_POST['editrowcount']);
             rcms_redirect("?module=reportmaster");
         }
     } else {
         show_error(__('You cant control this module'));
     }
 }
 // view reports
 if (isset($_GET['view'])) {
     if (!isset($_GET['printable'])) {
         // natural view
         web_ReportMasterViewReport($_GET['view']);
     } else {
         //or printable
         web_ReportMasterViewReportPrintable($_GET['view']);
     }
 }
Ejemplo n.º 13
0
<?php

if (cfr('DOWN')) {
    if (isset($_GET['username'])) {
        $login = vf($_GET['username']);
        // change down  if need
        if (isset($_POST['newdown'])) {
            $down = $_POST['newdown'];
            $billing->setdown($login, $down);
            log_register('CHANGE Down (' . $login . ') ON ' . $down);
            rcms_redirect("?module=downedit&username=" . $login);
        }
        $current_down = zb_UserGetStargazerData($login);
        $current_down = $current_down['Down'];
        $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
        // Edit form construct
        $fieldname = __('Current Down state');
        $fieldkey = 'newdown';
        $form = web_EditorTrigerDataForm($fieldname, $fieldkey, $useraddress, $current_down);
        $form .= web_UserControls($login);
        // show form
        show_window(__('Edit Down'), $form);
    }
} else {
    show_error(__('You cant control this module'));
}
Ejemplo n.º 14
0
<?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'));
Ejemplo n.º 15
0
                        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'));
            }
        } else {
            show_error(__('No license key available'));
        }
    } else {
        show_error(__('This module is disabled'));
    }
} else {
Ejemplo n.º 16
0
function zb_DirectionDelete($directionid)
{
    $directionid = vf($directionid);
    $query = "DELETE FROM `directions` WHERE `id`='" . $directionid . "'";
    nr_query($query);
    log_register("DELETE TrafficClass " . $directionid);
    rcms_redirect("?module=rules");
}
Ejemplo n.º 17
0
<?php

if (cfr('PLDOCS')) {
    $altcfg = $ubillingConfig->getAlter();
    if ($altcfg['DOCX_SUPPORT']) {
        $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 {
Ejemplo n.º 18
0
 /**
  * Controls post environment and do something object actions when its required
  * 
  * @return void
  */
 protected function commentSaver()
 {
     //detecting return URL
     if (isset($_SERVER['QUERY_STRING'])) {
         $returnUrl = '?' . $_SERVER['QUERY_STRING'];
     } else {
         $returnUrl = '';
         show_error(__('Strange exeption') . ': ' . self::EX_EMPTY_QUERY_STRING);
     }
     ///new comment creation
     if (wf_CheckPost(array('newadcommentstext'))) {
         $this->createComment($_POST['newadcommentstext']);
         if ($returnUrl) {
             rcms_redirect($returnUrl);
         }
     }
     //comment deletion
     if (wf_CheckPost(array('adcommentsdeleteid'))) {
         $this->deleteComment($_POST['adcommentsdeleteid']);
         if ($returnUrl) {
             rcms_redirect($returnUrl);
         }
     }
     //comment editing
     if (wf_CheckPost(array('adcommentsmodifyid', 'adcommentsmodifytext'))) {
         $this->modifyComment($_POST['adcommentsmodifyid'], $_POST['adcommentsmodifytext']);
         if ($returnUrl) {
             rcms_redirect($returnUrl);
         }
     }
 }
Ejemplo n.º 19
0
     // Значение
     $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);
 $cells = wf_TableCell(__('ID'));
 $cells .= wf_TableCell(__('Scenario'));
 $cells .= wf_TableCell(__('Attribute'));
 $cells .= wf_TableCell(__('op'));
 $cells .= wf_TableCell(__('Value'));
 $cells .= wf_TableCell(__('Foreach'));
 $cells .= wf_TableCell(__('Actions'));
 $rows = wf_TableRow($cells, 'row1');
 if (!empty($results)) {
     foreach ($results as $result) {
         $cells = wf_TableCell($result['id']);
Ejemplo n.º 20
0
             * 
             * @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());
    } else {
        show_error(__('Access denied'));
    }
} else {
    show_error(__('This module is disabled'));
Ejemplo n.º 21
0
            $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'));
}
Ejemplo n.º 22
0
 /**
  * Deletes document from database and filesystem and redirects back to
  * documents list of the node
  * 
  * @param type $document_id ID of the deleting document
  * @return type
  */
 public function document_delete($id, $redirect = true)
 {
     // Get info about deleting file:
     $query = "SELECT * FROM `" . self::TABLE_DOCS . "` WHERE `id` = '" . $id . "'";
     $result = simple_query($query);
     // Delete from database if deleted from filesystem:
     if (unlink($result['path'])) {
         $query = "DELETE FROM `" . self::TABLE_DOCS . "` WHERE `id` = '" . $id . "'";
         nr_query($query);
         if ($redirect) {
             $item = empty($result['mark_id']) ? 'line' : 'mark';
             $item_id = empty($result['mark_id']) ? $result['line_id'] : $result['mark_id'];
             rcms_redirect('?module=vols&item=' . $item . '&action=documents&id=' . $item_id);
         }
     }
 }
Ejemplo n.º 23
0
 //if someone editing nas
 if (wf_CheckPost(array('editnastype'))) {
     $targetnas = "WHERE `id` = '" . $nasid . "'";
     $nastype = vf($_POST['editnastype']);
     $nasip = mysql_real_escape_string($_POST['editnasip']);
     $nasname = mysql_real_escape_string($_POST['editnasname']);
     $nasbwdurl = mysql_real_escape_string($_POST['editnasbwdurl']);
     $netid = vf($_POST['networkselect']);
     simple_update_field('nas', 'nastype', $nastype, $targetnas);
     simple_update_field('nas', 'nasip', $nasip, $targetnas);
     simple_update_field('nas', 'nasname', $nasname, $targetnas);
     simple_update_field('nas', 'bandw', $nasbwdurl, $targetnas);
     simple_update_field('nas', 'netid', $netid, $targetnas);
     zb_NasConfigSave();
     log_register("NAS EDIT " . $nasip);
     rcms_redirect("?module=nas&edit=" . $nasid);
 }
 $nasdata = zb_NasGetData($nasid);
 $currentnetid = $nasdata['netid'];
 $currentnasip = $nasdata['nasip'];
 $currentnasname = $nasdata['nasname'];
 $currentnastype = $nasdata['nastype'];
 $currentbwdurl = $nasdata['bandw'];
 $nastypes = array('local' => 'Local NAS', 'rscriptd' => 'rscriptd', 'mikrotik' => 'MikroTik', 'radius' => 'Radius');
 $editinputs = multinet_network_selector($currentnetid) . "<br>";
 $editinputs .= wf_Selector('editnastype', $nastypes, 'NAS type', $currentnastype, true);
 $editinputs .= wf_TextInput('editnasip', 'IP', $currentnasip, true, '15');
 $editinputs .= wf_TextInput('editnasname', 'NAS name', $currentnasname, true, '15');
 $editinputs .= wf_TextInput('editnasbwdurl', 'Bandwidthd URL', $currentbwdurl, true, '25');
 $editinputs .= wf_Submit('Save');
 $editform = wf_Form('', 'POST', $editinputs, 'glamour');
Ejemplo n.º 24
0
             $newStoreAliases = base64_encode($newStoreAliases);
             zb_StorageSet('ASKOZIAPBX_NUMALIAS', $newStoreAliases);
             log_register("ASKOZIAPBX ALIAS ADD `" . $newAliasNum . "` NAME `" . $newAliasName . "`");
             rcms_redirect("?module=askozia&config=true");
         }
         //alias deletion
         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'))) {
Ejemplo n.º 25
0
    function zb_SpeedControlGetOverrideUsers()
    {
        $query = "SELECT `login` from `userspeeds` WHERE `speed` NOT LIKE '0'";
        $alloverrides = simple_queryall($query);
        $result = array();
        if (!empty($alloverrides)) {
            foreach ($alloverrides as $io => $eachoverride) {
                $result[] = $eachoverride;
            }
        }
        return $result;
    }
    function zb_SpeedControlFix($login)
    {
    }
    //fixing speed override
    if (isset($_GET['fix'])) {
        $login = vf($_GET['fix']);
        $speed = 0;
        zb_UserDeleteSpeedOverride($login);
        zb_UserCreateSpeedOverride($login, $speed);
        log_register("SPEEDFIX (" . $login . ")");
        $billing->resetuser($login);
        log_register("RESET User (" . $login . ")");
        rcms_redirect("?module=speedcontrol");
    }
    $alloverrides = zb_SpeedControlGetOverrideUsers();
    show_window(__('Users with speed overrides'), web_UsersLister($alloverrides));
} else {
    show_error(__('You cant control this module'));
}
Ejemplo n.º 26
0
         rcms_redirect('?module=ponizer');
     }
     //assigning ONU with some user
     if (wf_CheckPost(array('assignonulogin', 'assignonuid'))) {
         $pon->onuAssign($_POST['assignonuid'], $_POST['assignonulogin']);
         multinet_rebuild_all_handlers();
         rcms_redirect('?module=ponizer&editonu=' . $_POST['assignonuid']);
     }
     if (!wf_CheckGet(array('editonu'))) {
         if (wf_CheckGet(array('username'))) {
             //try to detect ONU id by user login
             $login = $_GET['username'];
             $userOnuId = $pon->getOnuIdByUser($login);
             //redirecting to assigned ONU
             if ($userOnuId) {
                 rcms_redirect('?module=ponizer&editonu=' . $userOnuId);
             } else {
                 //rendering assign form
                 show_window(__('ONU assign'), $pon->onuAssignForm($login));
             }
         } else {
             //rendering availavle onu LIST
             show_window(__('ONU directory'), $pon->controls() . $pon->renderOnuList());
         }
     } else {
         //show ONU editing interface
         show_window(__('Edit'), $pon->onuEditForm($_GET['editonu']));
     }
 } else {
     show_error(__('You cant control this module'));
 }
Ejemplo n.º 27
0
/**
 * Returns task typical problems editing form
 * 
 * @return string
 */
function ts_TaskProblemsEditForm()
{
    $rawNotes = zb_StorageGet('PROBLEMS');
    //extract old or create new typical problems array
    if (!empty($rawNotes)) {
        $rawNotes = base64_decode($rawNotes);
        $rawNotes = unserialize($rawNotes);
    } else {
        $emptyArray = array();
        $newNotes = serialize($emptyArray);
        $newNotes = base64_encode($newNotes);
        zb_StorageSet('PROBLEMS', $newNotes);
        $rawNotes = $emptyArray;
    }
    //adding and deletion subroutines
    if (wf_CheckPost(array('createtypicalnote'))) {
        $toPush = strip_tags($_POST['createtypicalnote']);
        array_push($rawNotes, $toPush);
        $newNotes = serialize($rawNotes);
        $newNotes = base64_encode($newNotes);
        zb_StorageSet('PROBLEMS', $newNotes);
        log_register('TASKMAN ADD TYPICALPROBLEM');
        rcms_redirect("?module=taskman&probsettings=true");
    }
    if (wf_CheckPost(array('deletetypicalnote', 'typicalnote'))) {
        $toUnset = $_POST['typicalnote'];
        if (($delkey = array_search($toUnset, $rawNotes)) !== false) {
            unset($rawNotes[$delkey]);
        }
        $newNotes = serialize($rawNotes);
        $newNotes = base64_encode($newNotes);
        zb_StorageSet('PROBLEMS', $newNotes);
        log_register('TASKMAN DELETE TYPICALPROBLEM');
        rcms_redirect("?module=taskman&probsettings=true");
    }
    $rows = '';
    $result = wf_Link("?module=taskman", __('Back'), true, 'ubButton');
    if (!empty($rawNotes)) {
        foreach ($rawNotes as $eachNote) {
            $cells = wf_TableCell($eachNote);
            $rows .= wf_TableRow($cells, 'row3');
        }
    }
    $result .= wf_TableBody($rows, '100%', '0', '');
    $result .= wf_delimiter();
    $addinputs = wf_TextInput('createtypicalnote', __('Create'), '', true, '20');
    $addinputs .= wf_Submit(__('Save'));
    $addform = wf_Form("", "POST", $addinputs, 'glamour');
    $result .= $addform;
    $delinputs = ts_TaskTypicalNotesSelector(false);
    $delinputs .= wf_HiddenInput('deletetypicalnote', 'true');
    $delinputs .= wf_Submit(__('Delete'));
    $delform = wf_Form("", "POST", $delinputs, 'glamour');
    $result .= $delform;
    return $result;
}
Ejemplo n.º 28
0
 $switchid = vf($_GET['edit'], 3);
 $switchdata = zb_SwitchGetData($switchid);
 //if someone edit switch
 if (wf_CheckPost(array('editmodel'))) {
     if (cfr('SWITCHESEDIT')) {
         simple_update_field('switches', 'modelid', $_POST['editmodel'], "WHERE `id`='" . $switchid . "'");
         simple_update_field('switches', 'ip', $_POST['editip'], "WHERE `id`='" . $switchid . "'");
         simple_update_field('switches', 'location', $_POST['editlocation'], "WHERE `id`='" . $switchid . "'");
         simple_update_field('switches', 'desc', $_POST['editdesc'], "WHERE `id`='" . $switchid . "'");
         simple_update_field('switches', 'snmp', $_POST['editsnmp'], "WHERE `id`='" . $switchid . "'");
         simple_update_field('switches', 'geo', $_POST['editgeo'], "WHERE `id`='" . $switchid . "'");
         if ($_POST['editparentid'] != $switchid) {
             simple_update_field('switches', 'parentid', $_POST['editparentid'], "WHERE `id`='" . $switchid . "'");
         }
         log_register('SWITCH CHANGE [' . $switchid . ']' . ' IP ' . $_POST['editip'] . " LOC `" . $_POST['editlocation'] . "`");
         rcms_redirect("?module=switches&edit=" . $switchid);
     } else {
         show_error(__('Access denied'));
     }
 }
 //render switch edit form
 show_window(__('Edit switch'), web_SwitchEditForm($switchid));
 //minimap container
 if ($altCfg['SWYMAP_ENABLED']) {
     if (!empty($switchdata['geo'])) {
         show_window(__('Mini-map'), wf_delimiter() . web_SwitchMiniMap($switchdata));
     }
 }
 //downlinks list
 web_SwitchDownlinksList($switchid);
 //additional comments engine
Ejemplo n.º 29
0
            $show_pdf = la_tag('iframe src="' . $url . '" width="600px" height="800px"');
            $show_pdf .= la_tag('iframe', true);
            $inputs = la_CheckInput('custom_agreement', __('I have read text above and agree with terms of use'), FALSE, FALSE);
            $inputs .= la_delimiter();
            $inputs .= la_Submit(__('Order'));
            $show_pdf .= la_Form("", "POST", $inputs);
            show_window(__("You must accept license agreement"), $show_pdf);
        }
        if (isset($_POST['custom_agreement'])) {
            $date = GetFullApplyDate();
            $action = 'tagadd';
            $param = vf($_GET['service'], 3);
            $param = preg_replace('/\\0/s', '', $param);
            $param = strip_tags($param);
            $param = mysql_real_escape_string($param);
            $note = 'Order from userstats';
            if (checkTask($user_login, $action, $param)) {
                createTask($date, $user_login, $action, $param, $note);
            }
            rcms_redirect('?module=adservice&action=add&wait=true');
        }
    }
    if (!isset($_GET['accept'])) {
        show_window(__('Aditional services'), __('You can order aditional services. Available services - listed below.'));
        show_window(__('Aditional services cost'), AdServicesList($serviceCost, $us_config['currency']));
        show_window(__('Order aditional service'), AdServicesSelector($availableServices, $user_login));
        show_window(__('Activated services'), ShowAllOrderedServices($availableServices, $user_login));
    }
} else {
    show_window(__('Sorry'), __('This module is disabled'));
}
Ejemplo n.º 30
0
 /**
  * Cemetery controls 
  * 
  * @return string
  */
 protected function getCemeteryControls()
 {
     $result = '';
     if (isset($this->alterCfg['CEMETERY_ENABLED'])) {
         if ($this->alterCfg['CEMETERY_ENABLED']) {
             $cemetery = new Cemetery();
             //integrated controller
             if (wf_CheckPost(array('cemeterysetasundead'))) {
                 $cemetery->setUndead($_POST['cemeterysetasundead']);
                 rcms_redirect('?module=userprofile&username='******'cemeterysetasdead'))) {
                 $cemetery->setDead($_POST['cemeterysetasdead']);
                 rcms_redirect('?module=userprofile&username='******'skins/dead_icon.png', '', '12', '12'), __('User lifestory'), $cemetery->renderCemeteryLog($this->login));
                 $result = ' / ' . __('Subscriber is not connected') . ' ' . $log;
             } else {
                 $log = wf_modalAuto(wf_img_sized('skins/pigeon_icon.png', '', '12', '12'), __('User lifestory'), $cemetery->renderCemeteryLog($this->login));
                 $result = ' / ' . __('Subscriber is connected') . ' ' . $log;
             }
         }
     }
     return $result;
 }