Esempio n. 1
0
 public function render()
 {
     $cells = wf_TableCell(__('Login'));
     $cells .= wf_TableCell(__('Address'));
     $cells .= wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell(__('IP'));
     $cells .= wf_TableCell(__('Tariff'));
     $cells .= wf_TableCell(__('Traffic'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($this->data)) {
         $allrealnames = zb_UserGetAllRealnames();
         $alladdress = zb_AddressGetFulladdresslist();
         foreach ($this->data as $io => $each) {
             $loginLink = wf_Link("?module=userprofile&username="******"' . $each['traffic'] . '"');
             $actionLinks = wf_Link('?module=pl_traffdetails&username='******'login'], wf_img('skins/icon_stats.gif', __('Detailed stats')), false, '');
             $actionLinks .= wf_link('?module=dstatedit&username='******'login'], web_edit_icon(), false, '');
             $cells .= wf_TableCell($actionLinks);
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $result = wf_TableBody($rows, '100%', '0', 'sortable');
     return $result;
 }
Esempio n. 2
0
<?php

if ($system->checkForRight('STGNEWADMIN')) {
    if (!isset($_POST['registration_form'])) {
        show_window(__('Administrator registration'), rcms_parse_module_template('user-profile.tpl', array('mode' => 'registration_form', 'fields' => $system->data['apf'])));
        show_window('', wf_Link('?module=permissions', __('Back'), true, 'ubButton'));
    }
    if (isset($_POST['registration_form'])) {
        if (wf_CheckPost(array('username', 'nickname', 'password', 'confirmation', 'email'))) {
            $system->registerUser($_POST['username'], $_POST['nickname'], @$_POST['password'], @$_POST['confirmation'], $_POST['email'], $_POST['userdata']);
            $system->updateUser($_POST['username'], $_POST['nickname'], $_POST['password'], $_POST['confirmation'], $_POST['email'], $_POST['userdata']);
            stg_putlogevent('ADMREG {' . $_POST['username'] . '}');
            show_window(__('Administrator registered'), wf_link('?module=permissions&edit=' . $_POST['username'], __('His permissions you can setup via corresponding module'), true, 'ubButton'));
        } else {
            show_error(__('No all of required fields is filled'));
            show_window('', wf_Link('?module=adminreg', __('Back'), true, 'ubButton'));
        }
    }
} else {
    show_error(__('Access denied'));
}
Esempio n. 3
0
/**
 * Renders list of all previous user tasks by all time
 * 
 * @param string $login
 * 
 * @return string
 */
function ts_PreviousUserTasksRender($login)
{
    $result = '';
    $userTasks = array();
    $telepathyTasks = array();
    $telepathy = new Telepathy(false, true);
    if (!empty($login)) {
        $alljobtypes = ts_GetAllJobtypes();
        $allemployee = ts_GetActiveEmployee();
        $query = "SELECT * from `taskman` ORDER BY `id` DESC;";
        $rawTasks = simple_queryall($query);
        if (!empty($rawTasks)) {
            $result .= wf_tag('hr');
            foreach ($rawTasks as $io => $each) {
                if ($each['login'] == $login) {
                    $userTasks[$each['id']] = $each;
                }
                //address guessing
                if ($telepathy->getLogin($each['address']) == $login) {
                    if (!isset($userTasks[$each['id']])) {
                        $userTasks[$each['id']] = $each;
                        $telepathyTasks[$each['id']] = $each['id'];
                    }
                }
            }
            if (!empty($userTasks)) {
                foreach ($userTasks as $io => $each) {
                    $telepathyFlag = isset($telepathyTasks[$each['id']]) ? wf_tag('sup') . wf_tag('abbr', false, '', 'title="' . __('telepathically guessed') . '"') . '(?)' . wf_tag('abbr', true) . wf_tag('sup', true) : '';
                    $taskColor = $each['status'] ? 'donetask' : 'undone';
                    $result .= wf_tag('div', false, $taskColor, 'style="width:400px;"');
                    $taskdata = $each['startdate'] . ' - ' . @$alljobtypes[$each['jobtype']] . ', ' . @$allemployee[$each['employee']] . ' ' . $telepathyFlag;
                    $result .= wf_link('?module=taskman&edittask=' . $each['id'], wf_img('skins/icon_edit.gif')) . ' ' . $taskdata;
                    $result .= wf_tag('div', true);
                }
            }
        }
    }
    return $result;
}
Esempio n. 4
0
                 $keys = array('cash', 'login');
                 $titles = array('tariff', "Comment", 'Mac ONU', "Credited", "Cash", 'Login');
                 $alldata = simple_queryall($query);
                 web_ReportDebtorsShowPrintable($titles, $keys, $alldata, '1', '1', '1');
             }
         }
     }
 }
 if ($action == 'usersearch') {
     if (cfr('CITYUSERSEARCH')) {
         show_window(__('User search'), $perCityAction->CitySelector($admin, $action));
         if (isset($_GET['citysearch'])) {
             $cityId = $_GET['citysearch'];
             if ($perCityAction->CheckRigts($cityId, $admin)) {
                 $perCityAction->LoadAllData('', $cityId, 'usersearch');
                 $report_name = __('Search results') . wf_link(PerCityAction::MODULE_NAME . "&action=usersearch&printable=true&citysel={$cityId}", wf_img("skins/printer_small.gif"));
                 show_window(__($report_name), $perCityAction->PerCityDataShow());
             } else {
                 show_error(__('You cant control this module'));
             }
         }
         if (isset($_GET['printable'])) {
             $City = $_GET['citysel'];
             $query = "SELECT `login` FROM `address` WHERE `aptid` IN (SELECT `id` FROM `apt` WHERE `buildid` IN (SELECT `id` FROM `build` WHERE `streetid` IN (SELECT `id` FROM `street` WHERE `cityid`='" . $City . "')))";
             $keys = array('login');
             $titles = array('tariff', 'Comment', 'MAC ONU', 'Credited', 'Login');
             $alldata = simple_queryall($query);
             web_ReportCityShowPrintable($titles, $keys, $alldata, '1', '1', '1');
         }
     }
 }
Esempio n. 5
0
 /**
  * Renders complex users assign forms or something like that.
  * 
  * @return void
  */
 public function reportComplexAssign()
 {
     $nologinUsers = array();
     $ukvContracts = array();
     $inetContracts = array();
     $contractCfId = '';
     //updating inet login if required
     if (wf_CheckPost(array('assignComplexLogin', 'assignComplexUkvId'))) {
         $updateUserId = vf($_POST['assignComplexUkvId'], 3);
         $updateInetLogin = $_POST['assignComplexLogin'];
         if ($this->users[$updateUserId]['inetlogin'] != $updateInetLogin) {
             simple_update_field('ukv_users', 'inetlogin', $updateInetLogin, "WHERE `id`='" . $updateUserId . "';");
             log_register('UKV USER ((' . $updateUserId . ')) ASSIGN INETLOGIN `' . $updateInetLogin . '`');
             rcms_redirect(self::URL_REPORTS_MGMT . 'reportComplexAssign');
         }
     }
     $allInetUsers = zb_UserGetAllStargazerDataAssoc();
     $allAddress = zb_AddressGetFulladdresslistCached();
     $allRealNames = zb_UserGetAllRealnames();
     //preparing ukv users
     if (!empty($this->users)) {
         foreach ($this->users as $io => $each) {
             if (empty($each['inetlogin'])) {
                 $nologinUsers[$each['id']] = $each;
                 $ukvContracts[$each['contract']] = $each['id'];
             }
         }
     }
     //getting complex contract CF id
     if (!empty($this->altCfg['COMPLEX_CFIDS'])) {
         $cfDataRaw = $this->altCfg['COMPLEX_CFIDS'];
         $cfData = explode(',', $cfDataRaw);
         $contractCfId = isset($cfData[0]) ? vf($cfData[0], 3) : '';
     }
     //prepare cf logins=>contract pairs
     if (!empty($contractCfId)) {
         $query = "SELECT `login`,`content` from `cfitems` WHERE `typeid`='" . $contractCfId . "' AND `content` IS NOT NULL;";
         $rawCfs = simple_queryall($query);
         if (!empty($rawCfs)) {
             foreach ($rawCfs as $io => $each) {
                 $inetContracts[$each['login']] = $each['content'];
             }
         }
     }
     //rendering main form
     if (!empty($inetContracts)) {
         $cells = wf_TableCell(__('Full address'));
         $cells .= wf_TableCell(__('Real Name'));
         $cells .= wf_TableCell(__('Tariff'));
         $cells .= wf_TableCell(__('Contract'));
         $cells .= wf_TableCell(__('Login'));
         $cells .= wf_TableCell(__('Full address'));
         $cells .= wf_TableCell(__('Real Name'));
         $cells .= wf_TableCell(__('Actions'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($inetContracts as $login => $contract) {
             if (isset($allInetUsers[$login])) {
                 if (!empty($contract)) {
                     @($ukvUserId = $ukvContracts[$contract]);
                     if (!empty($ukvUserId)) {
                         if (isset($nologinUsers[$ukvUserId])) {
                             $ukvRealname = @$this->users[$ukvUserId]['realname'];
                             $inetRealname = @$allRealNames[$login];
                             $ukvAddress = $this->userGetFullAddress($ukvUserId);
                             $inetAddress = @$allAddress[$login];
                             $catvLink = wf_link(self::URL_USERS_PROFILE . $ukvUserId, web_profile_icon() . ' ' . $ukvAddress);
                             $cells = wf_TableCell($catvLink);
                             $cells .= wf_TableCell($ukvRealname);
                             $cells .= wf_TableCell(@$this->tariffs[$this->users[$ukvUserId]['tariffid']]['tariffname']);
                             $cells .= wf_TableCell($contract);
                             $profileLink = wf_Link('?module=userprofile&username='******' ' . $login, false);
                             $cells .= wf_TableCell($profileLink);
                             $cells .= wf_TableCell($inetAddress);
                             $cells .= wf_TableCell($inetRealname);
                             $assignInputs = wf_HiddenInput('assignComplexLogin', $login);
                             $assignInputs .= wf_HiddenInput('assignComplexUkvId', $ukvUserId);
                             $assignInputs .= wf_Submit(__('Assign'));
                             $assignContols = wf_Form('', 'POST', $assignInputs, '');
                             $cells .= wf_TableCell($assignContols);
                             $rowclass = 'row3';
                             //coloring results
                             if (!empty($ukvRealname) and !empty($inetRealname)) {
                                 $ukvNameTmp = explode(' ', $ukvRealname);
                                 $inetNameTmp = explode(' ', $inetRealname);
                                 if (@$ukvNameTmp[0] == @$inetNameTmp[0]) {
                                     $rowclass = 'ukvassignnamerow';
                                 }
                                 if (!empty($inetAddress) and !empty($ukvAddress)) {
                                     if ($inetAddress == $ukvAddress and @$ukvNameTmp[0] == @$inetNameTmp[0]) {
                                         $rowclass = 'ukvassignaddrrow';
                                     }
                                 }
                             }
                             $rows .= wf_TableRow($cells, $rowclass);
                         }
                     }
                 }
             }
         }
         $result = wf_TableBody($rows, '100%', 0, 'sortable');
         show_window(__('Assign UKV users to complex profiles'), $result);
     }
 }