Beispiel #1
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'));
}
Beispiel #2
0
<?php

if (cfr('CREDIT')) {
    if (isset($_GET['username'])) {
        $login = vf($_GET['username']);
        // change credit expire if need
        if (isset($_POST['newcreditexpire'])) {
            $creditexpire = $_POST['newcreditexpire'];
            $billing->setcreditexpire($login, $creditexpire);
            log_register('CHANGE CreditExpire (' . $login . ') ON ' . $creditexpire);
            rcms_redirect("?module=creditexpireedit&username="******"Y-m-d", $current_creditexpire);
        } else {
            $current_creditexpire = __('No');
        }
        $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
        // Edit form construct
        $fieldnames = array('fieldname1' => __('Current credit expire'), 'fieldname2' => __('New credit expire'));
        $fieldkey = 'newcreditexpire';
        $form = web_EditorDateDataForm($fieldnames, $fieldkey, $useraddress, $current_creditexpire);
        $form .= web_UserControls($login);
        show_window(__('Edit credit expire'), $form);
    }
} else {
    show_error(__('You cant control this module'));
}
Beispiel #3
0
function zb_UserGetIP($login)
{
    $userdata = zb_UserGetStargazerData($login);
    $userip = $userdata['IP'];
    return $userip;
}
Beispiel #4
0
<?php

if (cfr('ALWAYSONLINE')) {
    if (isset($_GET['username'])) {
        $login = vf($_GET['username']);
        // change alwaysonline  if need
        if (isset($_POST['newalwaysonline'])) {
            $alwaysonline = $_POST['newalwaysonline'];
            $billing->setao($login, $alwaysonline);
            log_register('CHANGE AlwaysOnline (' . $login . ') ON ' . $alwaysonline);
            rcms_redirect("?module=aoedit&username=" . $login);
        }
        $current_alwaysonline = zb_UserGetStargazerData($login);
        $current_alwaysonline = $current_alwaysonline['AlwaysOnline'];
        $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
        // Edit form construct
        $fieldname = __('Current AlwaysOnline state');
        $fieldkey = 'newalwaysonline';
        $form = web_EditorTrigerDataForm($fieldname, $fieldkey, $useraddress, $current_alwaysonline);
        $form .= web_UserControls($login);
        // show form
        show_window(__('Edit AlwaysOnline'), $form);
    }
} else {
    show_error(__('You cant control this module'));
}
Beispiel #5
0
if (cfr('PASSWORD')) {
    if (isset($_GET['username'])) {
        $login = vf($_GET['username']);
        // change password  if need
        if (isset($_POST['newpassword'])) {
            $password = $_POST['newpassword'];
            if (zb_CheckPasswordUnique($password)) {
                $billing->setpassword($login, $password);
                log_register('CHANGE Password (' . $login . ') ON `' . $password . '`');
                rcms_redirect("?module=passwordedit&username=" . $login);
            } else {
                show_error(__('We do not recommend using the same password for different users. Try another.'));
            }
        }
        $current_password = zb_UserGetStargazerData($login);
        $current_password = $current_password['Password'];
        $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
        // Edit form construct
        $fieldnames = array('fieldname1' => __('Current password'), 'fieldname2' => __('New password'));
        $fieldkey = 'newpassword';
        $form = web_EditorStringDataFormPassword($fieldnames, $fieldkey, $useraddress, $current_password);
        // show form
        show_window(__('Edit password'), $form);
        //check non unique passwords
        $duppasswords = zb_GetNonUniquePasswordUsers();
        if (!empty($duppasswords)) {
            show_window(__('These users have identical passwords'), web_UserArrayShower($duppasswords));
        }
        show_window('', web_UserControls($login));
    }
Beispiel #6
0
 /**
  * Returns user online left days
  * 
  * @param string $login existing users login
  * @param bool   $rawdays show only days count
  * 
  * @return string
  */
 public function getOnlineLeftCount($login, $rawDays = false)
 {
     $userData = zb_UserGetStargazerData($login);
     $balanceExpire = '';
     if (!empty($userData)) {
         $userTariff = $userData['Tariff'];
         $userBalanceRaw = $userData['Cash'];
         $userBalance = $userData['Cash'];
         $tariffData = zb_TariffGetData($userTariff);
         $tariffFee = $tariffData['Fee'];
         $tariffPeriod = isset($tariffData['period']) ? $tariffData['period'] : 'month';
         $daysOnLine = 0;
         if (isset($this->alterConf['SPREAD_FEE'])) {
             if ($this->alterConf['SPREAD_FEE']) {
                 $spreadFee = true;
             } else {
                 $spreadFee = false;
             }
         } else {
             $spreadFee = false;
         }
         if ($userBalance >= 0) {
             if ($tariffFee > 0) {
                 //spread fee
                 if ($spreadFee) {
                     if ($tariffPeriod == 'month') {
                         //monthly period
                         while ($userBalance >= 0) {
                             $daysOnLine++;
                             $dayFee = $tariffFee / date('t', time() + $daysOnLine * 24 * 60 * 60);
                             $userBalance = $userBalance - $dayFee;
                         }
                     } else {
                         //daily period
                         while ($userBalance >= 0) {
                             $daysOnLine++;
                             $userBalance = $userBalance - $tariffFee;
                         }
                     }
                 } else {
                     //non spread fee
                     if ($tariffPeriod == 'month') {
                         //monthly non spread fee
                         while ($userBalance >= 0) {
                             $daysOnLine = $daysOnLine + date('t', time() + $daysOnLine * 24 * 60 * 60) - date('d', time() + $daysOnLine * 24 * 60 * 60) + 1;
                             $userBalance = $userBalance - $tariffFee;
                         }
                     } else {
                         //daily non spread fee
                         while ($userBalance >= 0) {
                             $daysOnLine++;
                             $userBalance = $userBalance - $tariffFee;
                         }
                     }
                 }
                 $daysLabel = $daysOnLine;
                 $dateLabel = date("d.m.Y", time() + $daysOnLine * 24 * 60 * 60);
             } else {
                 $daysLabel = '&infin;';
                 $dateLabel = '&infin;';
             }
             $balanceExpire = wf_tag('span', false, 'alert_info');
             $balanceExpire .= __('Current Cash state') . ': ' . wf_tag('b') . $userBalanceRaw . wf_tag('b', true) . ', ' . __('which should be enough for another');
             $balanceExpire .= ' ' . $daysLabel . ' ' . __('days') . ' ' . __('of service usage') . ' ';
             $balanceExpire .= __('or enought till the') . ' ' . $dateLabel . ' ';
             $balanceExpire .= __('according to the tariff') . ' ' . $userTariff . ' (' . $tariffFee . ' / ' . __($tariffPeriod) . ')';
             $balanceExpire .= wf_tag('span', true);
         } else {
             $balanceExpire = wf_tag('span', false, 'alert_warning') . __('Current Cash state') . ': ' . wf_tag('b') . $userBalanceRaw . wf_tag('b', true);
             $balanceExpire .= ', ' . __('indebtedness') . '!' . ' ' . wf_tag('span', true);
         }
         if ($rawDays) {
             $balanceExpire = $daysOnLine;
         }
     }
     return $balanceExpire;
 }
Beispiel #7
0
/**
 * Shows editing form of express card for some login
 * 
 * @param $login - user login
 * 
 * @return string
 */
function web_ExpressCardEditForm($login)
{
    $contract = zb_UserGetContract($login);
    $allcontractdates = zb_UserContractDatesGetAll();
    $realname = zb_UserGetRealName($login);
    $phone = zb_UserGetPhone($login);
    $mobile = zb_UserGetMobile($login);
    $email = zb_UserGetEmail($login);
    $passportdata = zb_UserPassportDataGet($login);
    $addressdata = zb_AddressGetAptData($login);
    $currentip = zb_UserGetIP($login);
    $mac = zb_MultinetGetMAC($currentip);
    $notes = zb_UserGetNotes($login);
    $stgdata = zb_UserGetStargazerData($login);
    $currenttariff = $stgdata['Tariff'];
    //extracting passport data
    if (!empty($passportdata)) {
        $birthdate = $passportdata['birthdate'];
        $passportnum = $passportdata['passportnum'];
        $passportdate = $passportdata['passportdate'];
        $passportwho = $passportdata['passportwho'];
        $pcity = $passportdata['pcity'];
        $pstreet = $passportdata['pstreet'];
        $pbuild = $passportdata['pbuild'];
        $papt = $passportdata['papt'];
    } else {
        $birthdate = '';
        $passportnum = '';
        $passportdate = '';
        $passportwho = '';
        $pcity = '';
        $pstreet = '';
        $pbuild = '';
        $papt = '';
    }
    ///extracting realname to 3 different fields
    $nm = explode(' ', $realname);
    @($rnm_f = $nm[0]);
    @($rnm_i = $nm[1]);
    @($rnm_o = $nm[2]);
    /*
     * эту формочку нужно поровнять
     */
    $inputs = zb_AjaxLoader() . wf_delimiter();
    $inputs .= __('Contract');
    $inputs .= wf_TextInput('editcontract', '', $contract, false, '10');
    $inputs .= __('Contract date');
    $inputs .= wf_DatePickerPreset('editcontractdate', @$allcontractdates[$contract]);
    $inputs .= wf_delimiter();
    $inputs .= __('Surname');
    $inputs .= wf_TextInput('editsurname', '', $rnm_f, false, '20');
    $inputs .= __('Name');
    $inputs .= wf_TextInput('editname', '', $rnm_i, false, '20');
    $inputs .= __('Patronymic');
    $inputs .= wf_TextInput('editpatronymic', '', $rnm_o, false, '20');
    $inputs .= __('Birth date');
    $inputs .= wf_DatePickerPreset('editbirthdate', $birthdate);
    $inputs .= wf_delimiter();
    $inputs .= __('Passport number');
    $inputs .= wf_TextInput('editpassportnum', '', $passportnum, false, '30');
    $inputs .= __('Date of issue');
    $inputs .= wf_DatePickerPreset('editpassportdate', $passportdate);
    $inputs .= __('Issuing authority');
    $inputs .= wf_TextInput('editpassportwho', '', $passportwho, false, '40');
    $inputs .= wf_delimiter();
    $inputs .= __('Phone');
    $inputs .= wf_TextInput('editphone', '', $phone, false, '20');
    $inputs .= __('Mobile');
    $inputs .= wf_TextInput('editmobile', '', $mobile, false, '20');
    $inputs .= __('email');
    $inputs .= wf_TextInput('editemail', '', $email, false, '20');
    $inputs .= wf_delimiter();
    $inputs .= wf_tag('fieldset');
    //address data form
    $inputs .= __('Address of service') . ' ';
    if (!empty($addressdata)) {
        //if user have existing address - modify form
        $inputs .= web_ExpressAddressAptForm($login);
    } else {
        //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('editpcity', '', $pcity, false, '20');
    $inputs .= __('Street');
    $inputs .= wf_TextInput('editpstreet', '', $pstreet, false, '20');
    $inputs .= __('Build');
    $inputs .= wf_TextInput('editpbuild', '', $pbuild, false, '5');
    $inputs .= __('Apartment');
    $inputs .= wf_TextInput('editpapt', '', $papt, false, '5');
    $inputs .= wf_tag('div', true);
    $inputs .= wf_tag('fieldset', true);
    $inputs .= wf_delimiter();
    $inputs .= __('Tariff');
    $inputs .= web_ExpressTariffSelector('edittariff', $currenttariff);
    $inputs .= __('Service');
    $inputs .= web_ExpressServiceSelector();
    $inputs .= __('IP');
    $inputs .= wf_tag('span', false, '', 'id="dipbox"');
    $inputs .= wf_TextInput('editip', '', $currentip, false, '20');
    $inputs .= wf_tag('span', true);
    $inputs .= __('MAC');
    $inputs .= wf_TextInput('editmac', '', $mac, false, '20');
    $inputs .= wf_delimiter();
    $inputs .= __('Notes');
    $inputs .= wf_TextInput('editnotes', '', $notes, false, '120');
    $inputs .= wf_HiddenInput('expresscardedit', 'true');
    $inputs .= wf_delimiter();
    $inputs .= wf_Submit('Save');
    $expresscardform = wf_Form("", "POST", $inputs, 'expresscard');
    show_window(__('Express card user edit'), $expresscardform);
}
Beispiel #8
0
                 } else {
                     // next month child user tariff change
                     $billing->settariffnm($eachchild, $tariff);
                     log_register('CHANGE TariffNM ' . $eachchild . ' ON ' . $tariff);
                 }
             }
         }
         rcms_redirect("?module=corporate&userlink=" . $userlink . "&control=tariff");
     }
     // end of newtariff checks
 }
 //tariffs end
 if ($_GET['control'] == 'credit') {
     //group credit operations
     $allchildusers = cu_GetAllChildUsers($userlink);
     $current_credit = zb_UserGetStargazerData($parent_login);
     $current_credit = $current_credit['Credit'];
     //construct form
     $creditinputs = wf_TextInput('newcredit', 'New credit', $current_credit, true, '10');
     $creditinputs .= wf_Submit('Save');
     $creditform = wf_Form('', 'POST', $creditinputs, 'glamour');
     show_window(__('Edit credit'), $creditform);
     //if group credit change
     if (isset($_POST['newcredit'])) {
         $credit = vf($_POST['newcredit']);
         //change credit for parent user
         $billing->setcredit($parent_login, $credit);
         log_register('CHANGE Credit ' . $parent_login . ' ON ' . $credit);
         // set credit for all child users
         if (!empty($allchildusers)) {
             foreach ($allchildusers as $eachchild) {
Beispiel #9
0
<?php

if (cfr('PLDHCP')) {
    if (isset($_GET['username'])) {
        $login = $_GET['username'];
        $config = $ubillingConfig->getBilling();
        $alter_conf = $ubillingConfig->getAlter();
        $cat_path = $config['CAT'];
        $grep_path = $config['GREP'];
        $tail_path = $config['TAIL'];
        $sudo_path = $config['SUDO'];
        $leasefile = $alter_conf['NMLEASES'];
        $userdata = zb_UserGetStargazerData($login);
        $user_ip = $userdata['IP'];
        $user_mac = zb_MultinetGetMAC($user_ip);
        show_window(__('Current MAC') . ' ' . $user_mac, '');
        $command = $sudo_path . ' ' . $cat_path . ' ' . $leasefile . ' | ' . $grep_path . ' ' . $user_mac . ' | ' . $tail_path . '  -n 30';
        $output = shell_exec($command);
        if (!empty($output)) {
            $result = '';
            $rowdata = '';
            $allrows = explodeRows($output);
            foreach ($allrows as $eachrow) {
                if (!empty($eachrow)) {
                    $celldata = wf_TableCell($eachrow);
                    $rowdata .= wf_TableRow($celldata, 'row3');
                }
            }
            $result = wf_TableBody($rowdata, '100%', 0);
            show_window(__('User DHCP log'), $result);
        }
Beispiel #10
0
             if (!isset($new_price[$tariff])) {
                 zb_TariffCreateSignupPrice($tariff, 0);
                 $new_price = zb_TariffGetAllSignupPrices();
             }
             if ($new_price[$tariff] >= $has_paid) {
                 $cash = $old_price - $new_price[$tariff];
                 zb_UserChangeSignupPrice($login, $new_price[$tariff]);
                 $billing->addcash($login, $cash);
                 log_register("CHARGE SignupPriceFee(" . $login . ") " . $cash . " ACCORDING TO " . $tariff);
             } else {
                 show_window('', wf_modalOpened(__('Error'), __('You may not setup connection payment less then user has already paid!'), '400', '150'));
             }
         }
     }
 }
 $current_tariff = zb_UserGetStargazerData($login);
 $current_tariff = $current_tariff['Tariff'];
 $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
 //check is user corporate?
 $alter_conf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
 if ($alter_conf['USER_LINKING_ENABLED']) {
     if ($alter_conf['USER_LINKING_TARIFF']) {
         if (cu_IsChild($login)) {
             $allchildusers = cu_GetAllLinkedUsers();
             $parent_link = $allchildusers[$login];
             rcms_redirect("?module=corporate&userlink=" . $parent_link . "&control=tariff");
         }
         if (cu_IsParent($login)) {
             $allparentusers = cu_GetAllParentUsers();
             $parent_link = $allparentusers[$login];
             rcms_redirect("?module=corporate&userlink=" . $parent_link . "&control=tariff");
Beispiel #11
0
 function web_UserEditShowForm($login)
 {
     global $ubillingConfig;
     $alter_conf = $ubillingConfig->getAlter();
     $stgdata = zb_UserGetStargazerData($login);
     $address = zb_UserGetFullAddress($login);
     $realname = zb_UserGetRealName($login);
     $phone = zb_UserGetPhone($login);
     $contract = zb_UserGetContract($login);
     $mobile = zb_UserGetMobile($login);
     $mail = zb_UserGetEmail($login);
     $notes = zb_UserGetNotes($login);
     $ip = $stgdata['IP'];
     $mac = zb_MultinetGetMAC($stgdata['IP']);
     $speedoverride = zb_UserGetSpeedOverride($login);
     $tariff = $stgdata['Tariff'];
     $credit = $stgdata['Credit'];
     $cash = $stgdata['Cash'];
     $password = $stgdata['Password'];
     $aonline = $stgdata['AlwaysOnline'];
     $dstatdisable = $stgdata['DisabledDetailStat'];
     $passive = $stgdata['Passive'];
     $down = $stgdata['Down'];
     $creditexpire = $stgdata['CreditExpire'];
     if ($alter_conf['PASSWORDSHIDE']) {
         $password = __('Hidden');
     }
     if ($speedoverride == '0') {
         $speedoverride = __('No');
     }
     if ($creditexpire > 0) {
         $creditexpire = date("Y-m-d", $creditexpire);
     } else {
         $creditexpire = __('No');
     }
     $cells = wf_TableCell(__('Parameter'));
     $cells .= wf_TableCell(__('Current value'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row2');
     //express card
     if ($alter_conf['CRM_MODE']) {
         $cells = wf_TableCell(__('Express card'));
         $cells .= wf_TableCell('');
         $cells .= wf_TableCell(wf_Link('?module=expresscard&username='******'skins/express.gif') . ' ' . __('Edit')));
         $rows .= wf_TableRow($cells, 'row3');
     }
     //default fields editing
     $cells = wf_TableCell(__('Full address'));
     $cells .= wf_TableCell($address);
     $cells .= wf_TableCell(wf_Link('?module=binder&username='******'skins/icon_build.gif') . ' ' . __('Occupancy')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Password'));
     $cells .= wf_TableCell($password);
     $cells .= wf_TableCell(wf_Link('?module=passwordedit&username='******'skins/icon_key.gif') . ' ' . __('Change') . ' ' . __('password')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell($realname);
     $cells .= wf_TableCell(wf_Link('?module=realnameedit&username='******'skins/icon_user.gif') . ' ' . __('Change') . ' ' . __('Real Name')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Phone'));
     $cells .= wf_TableCell($phone);
     $cells .= wf_TableCell(wf_Link('?module=phoneedit&username='******'skins/icon_phone.gif') . ' ' . __('Change') . ' ' . __('phone')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Mobile'));
     $cells .= wf_TableCell($mobile);
     $cells .= wf_TableCell(wf_Link('?module=mobileedit&username='******'skins/icon_mobile.gif') . ' ' . __('Change') . ' ' . __('mobile')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Contract'));
     $cells .= wf_TableCell($contract);
     $cells .= wf_TableCell(wf_Link('?module=contractedit&username='******'skins/icon_link.gif') . ' ' . __('Change') . ' ' . __('contract')));
     $rows .= wf_TableRow($cells, 'row3');
     if ($alter_conf['CORPS_ENABLED']) {
         $greed = new Avarice();
         $corpsRuntime = $greed->runtime('CORPS');
         if (!empty($corpsRuntime)) {
             $corps = new Corps();
             $corpsCheck = $corps->userIsCorporate($login);
             $cells = wf_TableCell(__('User type'));
             if (cfr('CORPS')) {
                 $corpControls = wf_Link(Corps::URL_USER_MANAGE . $login, wf_img('skins/corporate_small.gif') . ' ' . __('Change') . ' ' . __('user type'));
             } else {
                 $corpControls = '';
             }
             if ($corpsCheck) {
                 $cells .= wf_TableCell(__('Corporate user'));
                 $cells .= wf_TableCell($corpControls);
             } else {
                 $cells .= wf_TableCell(__('Private user'));
                 $cells .= wf_TableCell($corpControls);
             }
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $cells = wf_TableCell(__('Email'));
     $cells .= wf_TableCell($mail);
     $cells .= wf_TableCell(wf_Link('?module=mailedit&username='******'skins/icon_mail.gif') . ' ' . __('Change') . ' ' . __('email')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Tariff'));
     $cells .= wf_TableCell($tariff);
     $cells .= wf_TableCell(wf_Link('?module=tariffedit&username='******'skins/icon_tariff.gif') . ' ' . __('Change') . ' ' . __('tariff')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Speed override'));
     $cells .= wf_TableCell($speedoverride);
     $cells .= wf_TableCell(wf_Link('?module=speededit&username='******'skins/icon_speed.gif') . ' ' . __('Change') . ' ' . __('speed override')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Credit'));
     $cells .= wf_TableCell($credit);
     $cells .= wf_TableCell(wf_Link('?module=creditedit&username='******'skins/icon_credit.gif') . ' ' . __('Change') . ' ' . __('credit limit')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Credit expire'));
     $cells .= wf_TableCell($creditexpire);
     $cells .= wf_TableCell(wf_Link('?module=creditexpireedit&username='******'skins/icon_calendar.gif') . ' ' . __('Change') . ' ' . __('credit expire date')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Balance'));
     $cells .= wf_TableCell($cash);
     $cells .= wf_TableCell(wf_Link('?module=addcash&username='******'#profileending', wf_img('skins/icon_dollar.gif') . ' ' . __('Finance operations')));
     $rows .= wf_TableRow($cells, 'row3');
     if (isset($alter_conf['SIGNUP_PAYMENTS']) && !empty($alter_conf['SIGNUP_PAYMENTS'])) {
         $payment = zb_UserGetSignupPrice($login);
         $paid = zb_UserGetSignupPricePaid($login);
         if ($payment != $paid && $payment > 0) {
             $cells = wf_TableCell(__('Signup paid'));
             $cells .= wf_TableCell(zb_UserGetSignupPricePaid($login) . '/' . zb_UserGetSignupPrice($login));
             $cells .= wf_TableCell(wf_Link('?module=signupprices&username='******'skins/icons/register.png', __('Edit signup price')) . ' ' . __('Edit signup price')));
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $cells = wf_TableCell(__('IP'));
     $cells .= wf_TableCell($ip);
     $cells .= wf_TableCell(wf_Link('?module=pl_ipchange&username='******'skins/icon_ip.gif') . ' ' . __('Change') . ' ' . __('IP')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('MAC'));
     $cells .= wf_TableCell($mac);
     $cells .= wf_TableCell(wf_Link('?module=macedit&username='******'skins/icon_ether.gif') . ' ' . __('Change') . ' ' . __('MAC')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('AlwaysOnline'));
     $cells .= wf_TableCell(web_trigger($aonline));
     $cells .= wf_TableCell(wf_Link('?module=aoedit&username='******'skins/icon_online.gif') . ' ' . __('AlwaysOnline')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Disable detailed stats'));
     $cells .= wf_TableCell(web_trigger($dstatdisable));
     $cells .= wf_TableCell(wf_Link('?module=dstatedit&username='******'skins/icon_stats.gif') . ' ' . __('Disable detailed stats')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('User passive'));
     $cells .= wf_TableCell(web_trigger($passive));
     $cells .= wf_TableCell(wf_Link('?module=passiveedit&username='******'skins/icon_passive.gif') . ' ' . __('User passive')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('User down'));
     $cells .= wf_TableCell(web_trigger($down));
     $cells .= wf_TableCell(wf_Link('?module=downedit&username='******'skins/icon_down.gif') . ' ' . __('User down')));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Passport data'));
     $cells .= wf_TableCell('');
     $cells .= wf_TableCell(wf_Link('?module=pdataedit&username='******'skins/icon_passport.gif') . ' ' . __('Change') . ' ' . __('passport data')));
     $rows .= wf_TableRow($cells, 'row3');
     if ($alter_conf['CONDET_ENABLED']) {
         $conDet = new ConnectionDetails();
         $cells = wf_TableCell(__('Connection details'));
         $cells .= wf_TableCell($conDet->renderData($login));
         $cells .= wf_TableCell(wf_Link('?module=condetedit&username='******'skins/cableseal_small.png') . ' ' . __('Change') . ' ' . __('Connection details')));
         $rows .= wf_TableRow($cells, 'row3');
     }
     //additional comments indication
     if ($alter_conf['ADCOMMENTS_ENABLED']) {
         $adcomments = new ADcomments('USERNOTES');
         $indicatorIcon = ' ' . wf_Link('?module=notesedit&username='******'');
     } else {
         $indicatorIcon = '';
     }
     $cells = wf_TableCell(__('Notes'));
     $cells .= wf_TableCell($notes . $indicatorIcon);
     $cells .= wf_TableCell(wf_Link('?module=notesedit&username='******'skins/icon_note.gif') . ' ' . __('Notes')));
     $rows .= wf_TableRow($cells, 'row3');
     $form = wf_TableBody($rows, '100%', '0');
     show_window(__('Edit user') . ' ' . $address, $form);
     cf_FieldEditor($login);
     show_window('', web_UserControls($login));
 }
Beispiel #12
0
<?php

if (cfr('DSTAT')) {
    if (isset($_GET['username'])) {
        $login = vf($_GET['username']);
        // change dstat  if need
        if (isset($_POST['newdstat'])) {
            $dstat = $_POST['newdstat'];
            $billing->setdstat($login, $dstat);
            log_register('CHANGE dstat (' . $login . ') ON ' . $dstat);
            rcms_redirect("?module=dstatedit&username=" . $login);
        }
        $current_dstat = zb_UserGetStargazerData($login);
        $current_dstat = $current_dstat['DisabledDetailStat'];
        $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
        // Edit form construct
        $fieldname = __('Disable detailed stats');
        $fieldkey = 'newdstat';
        $form = web_EditorTrigerDataForm($fieldname, $fieldkey, $useraddress, $current_dstat);
        $form .= web_UserControls($login);
        // show form
        show_window(__('Edit detailed stats'), $form);
    }
} else {
    show_error(__('You cant control this module'));
}
Beispiel #13
0
<?php

if (cfr('PASSIVE')) {
    if (isset($_GET['username'])) {
        $login = vf($_GET['username']);
        // change passive  if need
        if (isset($_POST['newpassive'])) {
            $passive = $_POST['newpassive'];
            $billing->setpassive($login, $passive);
            log_register('CHANGE Passive (' . $login . ') ON ' . $passive);
            rcms_redirect("?module=passiveedit&username=" . $login);
        }
        $current_passive = zb_UserGetStargazerData($login);
        $current_passive = $current_passive['Passive'];
        $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
        // Edit form construct
        $fieldname = __('Current passive state');
        $fieldkey = 'newpassive';
        $form = web_EditorTrigerDataForm($fieldname, $fieldkey, $useraddress, $current_passive);
        $form .= web_UserControls($login);
        // show form
        show_window(__('Edit passive'), $form);
    }
} else {
    show_error(__('You cant control this module'));
}
Beispiel #14
0
/**
 * Performs an virtual services payments processing
 * 
 * @param int $debug
 * @param bool $log_payment
 * @param bool $charge_frozen
 * 
 * @return void
 */
function zb_VservicesProcessAll($debug = 0, $log_payment = true, $charge_frozen = true)
{
    $frozenUsers = array();
    $query_services = "SELECT * from `vservices` ORDER by `priority` DESC";
    if ($debug) {
        print ">>" . curdatetime() . "\n";
        print ">>Searching virtual services\n";
        print $query_services . "\n";
    }
    $allservices = simple_queryall($query_services);
    if (!empty($allservices)) {
        if ($debug) {
            print ">>Virtual services found!\n";
            print_r($allservices);
        }
        if ($charge_frozen) {
            if ($debug) {
                print '>>Charge fee from frozen users too' . "\n";
            }
        } else {
            if ($debug) {
                print '>>Frozen users will be skipped' . "\n";
            }
            $frozen_query = "SELECT `login` from `users` WHERE `Passive`='1';";
            if ($debug) {
                print $frozen_query . "\n";
            }
            $allFrozen = simple_queryall($frozen_query);
            if (!empty($allFrozen)) {
                foreach ($allFrozen as $ioFrozen => $eachFrozen) {
                    $frozenUsers[$eachFrozen['login']] = $eachFrozen['login'];
                }
                if ($debug) {
                    print_r($frozenUsers);
                }
            }
        }
        foreach ($allservices as $io => $eachservice) {
            $users_query = "SELECT `login` from `tags` WHERE `tagid`='" . $eachservice['tagid'] . "'";
            if ($debug) {
                print ">>Searching users with this services\n";
                print $users_query . "\n";
            }
            $allusers = simple_queryall($users_query);
            if (!empty($allusers)) {
                if ($debug) {
                    print ">>Users found!\n";
                    print_r($allusers);
                }
                foreach ($allusers as $io2 => $eachuser) {
                    if ($debug) {
                        print ">>Processing user:"******"\n";
                    }
                    if ($debug) {
                        print ">>service:" . $eachservice['id'] . "\n";
                        print ">>price:" . $eachservice['price'] . "\n";
                        print ">>processing cashtype:" . $eachservice['cashtype'] . "\n";
                    }
                    if ($eachservice['cashtype'] == 'virtual') {
                        if ($debug) {
                            $current_cash = zb_VserviceCashGet($eachuser['login']);
                            print ">>current cash:" . $current_cash . "\n";
                        }
                        if ($debug != 2) {
                            zb_VserviceCashFee($eachuser['login'], $eachservice['price'], $eachservice['id']);
                        }
                    }
                    if ($eachservice['cashtype'] == 'stargazer') {
                        if ($debug) {
                            $current_cash = zb_UserGetStargazerData($eachuser['login']);
                            $current_cash = $current_cash['Cash'];
                            print ">>current cash:" . $current_cash . "\n";
                        }
                        if ($debug != 2) {
                            $fee = "-" . $eachservice['price'];
                            if ($log_payment) {
                                $method = 'add';
                            } else {
                                $method = 'correct';
                            }
                            if ($charge_frozen) {
                                zb_CashAdd($eachuser['login'], $fee, $method, '1', 'Service:' . $eachservice['id']);
                            } else {
                                if (isset($frozenUsers[$eachuser['login']])) {
                                    if ($debug) {
                                        print '>>user frozen - skipping him' . "\n";
                                    }
                                } else {
                                    zb_CashAdd($eachuser['login'], $fee, $method, '1', 'Service:' . $eachservice['id']);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}