Пример #1
0
        $hpid = $_SESSION['edit_ID'];
    } else {
        unset($_SESSION['edit_ID']);
        $_SESSION['edit'] = '_no_';
        Header('Location: users.php');
        die;
    }
    if (isset($_SESSION['user_name'])) {
        $dmn_user_name = $_SESSION['user_name'];
    } else {
        unset($_SESSION['user_name']);
        $_SESSION['edit'] = '_no_';
        Header('Location: users.php');
        die;
    }
    if (check_ruser_data($tpl, '_yes_')) {
        // Save data to db
        update_data_in_db($hpid);
    }
} else {
    // Get user id that come for edit
    if (isset($_GET['edit_id'])) {
        $hpid = $_GET['edit_id'];
    }
    load_user_data_page($hpid);
    $_SESSION['edit_ID'] = $hpid;
    $tpl->assign('MESSAGE', "");
}
gen_edituser_page($tpl);
$tpl->parse('PAGE', 'page');
$tpl->prnt();
Пример #2
0
$theme_color = $cfg['USER_INITIAL_THEME'];
$tpl->assign(array('TR_ADD_USER_PAGE_TITLE' => tr('VHCS - User/Add user'), 'THEME_COLOR_PATH' => "../themes/{$theme_color}", 'THEME_CHARSET' => tr('encoding'), 'VHCS_LICENSE' => $cfg['VHCS_LICENSE'], 'ISP_LOGO' => get_logo($_SESSION['user_id'])));
/*
 *
 * static page messages.
 *
 */
gen_reseller_menu($tpl);
gen_logged_from($tpl);
$timestamp = time();
$genpas = substr(md5($timestamp), 0, 6);
$tpl->assign(array('TR_ADD_USER' => tr('Add user'), 'TR_CORE_DATA' => tr('Core data'), 'TR_USERNAME' => tr('Username'), 'TR_PASSWORD' => tr('Password'), 'TR_REP_PASSWORD' => tr('Password(repeat)'), 'TR_DMN_IP' => tr('Domain IP'), 'TR_USREMAIL' => tr('Email'), 'TR_ADDITIONAL_DATA' => tr('Additional data'), 'TR_CUSTOMER_ID' => tr('Customer ID'), 'TR_FIRSTNAME' => tr('First name'), 'TR_LASTNAME' => tr('Last name'), 'TR_COMPANY' => tr('Company'), 'TR_POST_CODE' => tr('Zip/Postal code'), 'TR_CITY' => tr('City'), 'TR_COUNTRY' => tr('Country'), 'TR_STREET1' => tr('Street 1'), 'TR_STREET2' => tr('Street 2'), 'TR_MAIL' => tr('Email'), 'TR_PHONE' => tr('Phone'), 'TR_FAX' => tr('Fax'), 'TR_BTN_ADD_USER' => tr('Add user'), 'TR_ADD_ALIASES' => tr('Add other domains to this account'), 'VL_USR_PASS' => $genpas, 'VL_USR_PASS_REP' => $genpas));
init_in_values();
// Process the action ...
if (isset($_POST['uaction']) && "rau3_nxt" === $_POST['uaction'] && !isset($_SESSION['step_two_data'])) {
    if (check_ruser_data($tpl, '_no_')) {
        add_user_data($_SESSION['user_id']);
    }
} else {
    unset($_SESSION['step_two_data']);
    gen_empty_data();
    $tpl->assign('MESSAGE', "");
}
gen_au3_page($tpl);
gen_page_message($tpl);
$tpl->parse('PAGE', 'page');
$tpl->prnt();
if (isset($cfg['DUMP_GUI_DEBUG'])) {
    dump_gui_debug();
}
//unset_messages();
Пример #3
0
    }
    redirectTo('users.php');
}
/***********************************************************************************************************************
 * Main
 */
// Include core library
require 'imscp-lib.php';
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptStart);
/** @var $cfg iMSCP_Config_Handler_File */
$cfg = iMSCP_Registry::get('config');
check_login('reseller');
if (isset($_REQUEST['edit_id'])) {
    $adminId = intval($_GET['edit_id']);
    $tpl = new iMSCP_pTemplate();
    $tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'reseller/user_edit.tpl', 'page_message' => 'layout', 'ip_entry' => 'page'));
    $tpl->assign(array('TR_PAGE_TITLE' => tr('Reseller / Customers / Overview / Edit Customer'), 'TR_CORE_DATA' => tr('Core data'), 'TR_USERNAME' => tr('Username'), 'TR_PASSWORD' => tr('Password'), 'TR_REP_PASSWORD' => tr('Repeat password'), 'TR_USREMAIL' => tr('Email'), 'TR_ADDITIONAL_DATA' => tr('Additional data'), 'TR_CUSTOMER_ID' => tr('Customer ID'), 'TR_FIRSTNAME' => tr('First name'), 'TR_LASTNAME' => tr('Last name'), 'TR_COMPANY' => tr('Company'), 'TR_POST_CODE' => tr('Zip'), 'TR_CITY' => tr('City'), 'TR_STATE' => tr('State/Province'), 'TR_COUNTRY' => tr('Country'), 'TR_STREET1' => tr('Street 1'), 'TR_STREET2' => tr('Street 2'), 'TR_PHONE' => tr('Phone'), 'TR_FAX' => tr('Fax'), 'TR_GENDER' => tr('Gender'), 'TR_MALE' => tr('Male'), 'TR_FEMALE' => tr('Female'), 'TR_UNKNOWN' => tr('Unknown'), 'EDIT_ID' => $adminId, 'TR_UPDATE' => tr('Update'), 'TR_SEND_DATA' => tr('Send new login data')));
    reseller_loadUserData($adminId);
    if (isset($_POST['uaction']) && $_POST['uaction'] === 'save_changes' && check_ruser_data(true)) {
        reseller_updateUserData($adminId);
        // Save data to db
    }
    generateNavigation($tpl);
    reseller_generatePage($tpl);
    generatePageMessage($tpl);
    $tpl->parse('LAYOUT_CONTENT', 'page');
    iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptEnd, array('templateEngine' => $tpl));
    $tpl->prnt();
} else {
    showBadRequestErrorPage();
}
Пример #4
0
$email = $customerId = $firstName = $lastName = $firm = $zip = $city = $state = $country = $street1 = $street2 = '';
$phone = $mail = $fax = $domainIp = '';
$gender = 'U';
if (!getPreviousStepData()) {
    set_page_message(tr('Data were altered. Please try again.'), 'error');
    unsetMessages();
    redirectTo('user_add1.php');
}
$phpini = iMSCP_PHPini::getInstance();
$phpini->loadResellerPermissions($_SESSION['user_id']);
// Load reseller PHP permissions
$phpini->loadClientPermissions();
// Load client default PHP permissions
$phpini->loadDomainIni();
// Load domain default PHP configuration options
if (isset($_POST['uaction']) && 'user_add3_nxt' == $_POST['uaction'] && !isset($_SESSION['step_two_data'])) {
    if (check_ruser_data()) {
        addCustomer();
    }
} else {
    unset($_SESSION['step_two_data']);
}
$tpl = new iMSCP_pTemplate();
$tpl->define_dynamic(array('layout' => 'shared/layouts/ui.tpl', 'page' => 'reseller/user_add3.tpl', 'page_message' => 'layout', 'ip_entry' => 'page', 'alias_feature' => 'page'));
$tpl->assign(array('TR_PAGE_TITLE' => tr('Reseller / Customers / Add Customer - Next Step'), 'TR_ADD_USER' => tr('Add user'), 'TR_CORE_DATA' => tr('Core data'), 'TR_USERNAME' => tr('Username'), 'TR_PASSWORD' => tr('Password'), 'TR_REP_PASSWORD' => tr('Repeat password'), 'TR_DOMAIN_IP' => tr('Domain IP'), 'TR_USREMAIL' => tr('Email'), 'TR_ADDITIONAL_DATA' => tr('Additional data'), 'TR_CUSTOMER_ID' => tr('Customer ID'), 'TR_FIRSTNAME' => tr('First name'), 'TR_LASTNAME' => tr('Last name'), 'TR_GENDER' => tr('Gender'), 'TR_MALE' => tr('Male'), 'TR_FEMALE' => tr('Female'), 'TR_UNKNOWN' => tr('Unknown'), 'TR_COMPANY' => tr('Company'), 'TR_POST_CODE' => tr('Zip'), 'TR_CITY' => tr('City'), 'TR_STATE_PROVINCE' => tr('State/Province'), 'TR_COUNTRY' => tr('Country'), 'TR_STREET1' => tr('Street 1'), 'TR_STREET2' => tr('Street 2'), 'TR_MAIL' => tr('Email'), 'TR_PHONE' => tr('Phone'), 'TR_FAX' => tr('Fax'), 'TR_BTN_ADD_USER' => tr('Add user')));
generateNavigation($tpl);
generatePage($tpl);
generatePageMessage($tpl);
$tpl->parse('LAYOUT_CONTENT', 'page');
iMSCP_Events_Aggregator::getInstance()->dispatch(iMSCP_Events::onResellerScriptEnd, array('templateEngine' => $tpl));
$tpl->prnt();