/** * processing of old user linking with redirects to parent user * * @return string */ protected function getUserLinking() { $result = ''; if ($this->alterCfg['USER_LINKING_ENABLED']) { $alllinkedusers = cu_GetAllLinkedUsers(); if (isset($alllinkedusers[$this->login])) { $parent_login = cu_GetParentUserLogin($alllinkedusers[$this->login]); $result = wf_Link('?module=corporate&userlink=' . $alllinkedusers[$this->login], wf_img('skins/corporate_small.gif') . __('User linked with') . ': ' . @$this->alladdress[$parent_login], false, ''); } } //check is user corporate parent? if ($this->alterCfg['USER_LINKING_ENABLED']) { $allparentusers = cu_GetAllParentUsers(); if (isset($allparentusers[$this->login])) { if ($_GET['module'] != 'corporate' and $_GET['module'] != 'addcash') { rcms_redirect("?module=corporate&userlink=" . $allparentusers[$this->login]); } } } return $result; }
<?php if (cfr('CORPORATE')) { // here we show parent user and his controls if (isset($_GET['userlink'])) { $userlink = $_GET['userlink']; $parent_login = cu_GetParentUserLogin($userlink); $childusers = cu_GetAllChildUsers($userlink); $group_controls = wf_Link('?module=corporate&userlink=' . $userlink . '&control=cash', 'Cash', false, 'ubButton'); $group_controls .= wf_Link('?module=corporate&userlink=' . $userlink . '&control=tariff', 'Tariff', false, 'ubButton'); $group_controls .= wf_Link('?module=corporate&userlink=' . $userlink . '&control=credit', 'Credit', false, 'ubButton'); show_window(__('Group operations'), $group_controls); show_window(__('Linked users'), web_UserArrayShower($childusers)); //show parent user profile by default if (!isset($_GET['control'])) { $profileObj = new UserProfile($parent_login); $default_profile = $profileObj->render(); show_window(__('User profile'), $default_profile); } else { //show controls if ($_GET['control'] == 'cash') { //group cash operations $allchildusers = cu_GetAllChildUsers($userlink); //cash add form construct $cashtypes = zb_CashGetAllCashTypes(); $cashinputs = wf_TextInput('newcash', 'New cash', '', true, 5); $cashinputs .= web_CashTypeSelector() . ' ' . __('Cash type'); $cashinputs .= '<br>'; $cashinputs .= wf_RadioInput('operation', 'Add cash', 'add', false, true); $cashinputs .= wf_RadioInput('operation', 'Correct saldo', 'correct', false, false); $cashinputs .= wf_RadioInput('operation', 'Mock payment', 'mock', false, false);