/**
 * Returns XHTML / CSS formatted string for login form.<br>
 * The CSS classes used are:
 * <ul>
 * <li>div.login_form : container for login box</li>
 * <li>div.login_form div.login_row : container for label + input field or button</li>
 * <li>div.login_form div.login_row span.label : container for input label</li>
 * <li>div.login_form div.login_row span.formw : container for input form</li>
 * </ul>
 * @param faction String action attribute
 * @param fid String form ID attribute
 * @param fmethod String method attribute (get/post)
 * @param fenctype String enctype attribute
 * @param username String user name
 * @param password String password
 * @param isize int enctype input fields horizontal size
 * @return XHTML string for login form
 */
function F_loginForm($faction, $fid, $fmethod, $fenctype, $username, $password, $isize = 20)
{
    global $l;
    require_once '../config/tce_config.php';
    require_once '../../shared/config/tce_user_registration.php';
    $str = '';
    $str .= '<div class="container">' . K_NEWLINE;
    if (K_USRREG_ENABLED) {
        $str .= '<small><a href="../../public/code/tce_user_registration.php" title="' . $l['t_user_registration'] . '">' . $l['w_user_registration_link'] . '</a></small>' . K_NEWLINE;
    }
    $str .= '<div class="tceformbox">' . K_NEWLINE;
    $str .= '<form action="' . $faction . '" method="' . $fmethod . '" id="' . $fid . '" enctype="' . $fenctype . '">' . K_NEWLINE;
    // user name
    $str .= getFormRowTextInput('xuser_name', $l['w_username'], $l['h_login_name'], '', $username, '', 255, false, false, false, '');
    // password
    $str .= getFormRowTextInput('xuser_password', $l['w_password'], $l['h_password'], '', '', '', 255, false, false, true, '');
    // buttons
    $str .= '<div class="row">' . K_NEWLINE;
    // the following field is used to check if form has been submitted
    $str .= '<input type="submit" name="login" id="login" value="' . $l['w_login'] . '" title="' . $l['h_login_button'] . '" />' . K_NEWLINE;
    $str .= '<input type="hidden" name="logaction" id="logaction" value="login" />' . K_NEWLINE;
    $str .= '</div>' . K_NEWLINE;
    $str .= '</form>' . K_NEWLINE;
    $str .= '</div>' . K_NEWLINE;
    $str .= '<div class="pagehelp">' . $l['hp_login'] . '</div>' . K_NEWLINE;
    $str .= '</div>' . K_NEWLINE;
    return $str;
}
/**
 * Returns XHTML / CSS formatted string for login form.<br>
 * The CSS classes used are:
 * <ul>
 * <li>div.login_form : container for login box</li>
 * <li>div.login_form div.login_row : container for label + input field or button</li>
 * <li>div.login_form div.login_row span.label : container for input label</li>
 * <li>div.login_form div.login_row span.formw : container for input form</li>
 * </ul>
 * @param faction String action attribute
 * @param fid String form ID attribute
 * @param fmethod String method attribute (get/post)
 * @param fenctype String enctype attribute
 * @param username String user name
 * @return XHTML string for login form
 */
function F_loginForm($faction, $fid, $fmethod, $fenctype, $username)
{
    global $l;
    require_once '../config/tce_config.php';
    require_once '../../shared/config/tce_user_registration.php';
    $str = '';
    $str .= '<div class="container">' . K_NEWLINE;
    if (K_USRREG_ENABLED) {
        $str .= '<small><a href="../../public/code/tce_user_registration.php" title="' . $l['t_user_registration'] . '">' . $l['w_user_registration_link'] . '</a></small>' . K_NEWLINE;
    }
    $str .= '<div class="tceformbox">' . K_NEWLINE;
    $str .= '<form action="' . $faction . '" method="' . $fmethod . '" id="' . $fid . '" enctype="' . $fenctype . '">' . K_NEWLINE;
    // user name
    $str .= getFormRowTextInput('xuser_name', $l['w_username'], $l['h_login_name'], '', $username, '', 255, false, false, false, '');
    // password
    $str .= getFormRowTextInput('xuser_password', $l['w_password'], $l['h_password'], '', '', '', 255, false, false, true, '');
    // One Time Password code (OTP)
    if (K_OTP_LOGIN) {
        $str .= getFormRowTextInput('xuser_otpcode', $l['w_otpcode'], $l['h_otpcode'], '', '', '', 255, false, false, true, '');
    }
    if (defined('K_PASSWORD_RESET') and K_PASSWORD_RESET) {
        // print a link to password reset page
        $str .= '<div class="row">' . K_NEWLINE;
        $str .= '<span class="formw"><a href="../../public/code/tce_password_reset.php" title="' . $l['h_reset_password'] . '" style="font-size:90%;">' . $l['w_forgot_password'] . '</a></span>' . K_NEWLINE;
        $str .= '</div>' . K_NEWLINE;
    }
    // buttons
    $str .= '<div class="row">' . K_NEWLINE;
    $str .= '<input type="submit" name="login" id="login" value="' . $l['w_login'] . '" title="' . $l['h_login_button'] . '" />' . K_NEWLINE;
    // the following field is used to check if the form has been submitted
    $str .= '<input type="hidden" name="logaction" id="logaction" value="login" />' . K_NEWLINE;
    $str .= '</div>' . K_NEWLINE;
    $str .= '</form>' . K_NEWLINE;
    $str .= '</div>' . K_NEWLINE;
    $str .= '<div class="pagehelp">' . $l['hp_login'] . '</div>' . K_NEWLINE;
    $str .= '</div>' . K_NEWLINE;
    return $str;
}
Esempio n. 3
0
            if (!($r = F_db_query($sql, $db))) {
                F_display_db_error(false);
            } else {
                F_print_error('MESSAGE', $l['m_password_updated']);
            }
        }
        break;
    default:
        break;
}
//end of switch
echo '<div class="container">' . K_NEWLINE;
echo '<div class="gsoformbox">' . K_NEWLINE;
echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_editor">' . K_NEWLINE;
echo getFormRowTextInput('currentpassword', $l['w_current_password'], $l['h_password'], '', '', '', 255, false, false, true, '');
echo getFormRowTextInput('newpassword', $l['w_new_password'], $l['h_password'], ' (' . $l['d_password_lenght'] . ')', '', '^([a-zA-Z0-9]{8,32})$', 255, false, false, true, '');
echo getFormRowTextInput('newpassword_repeat', $l['w_new_password'], $l['h_password_repeat'], ' (' . $l['w_repeat'] . ')', '', '', 255, false, false, true, '');
echo '<div class="row">' . K_NEWLINE;
F_submit_button('update', $l['w_update'], $l['h_update']);
// comma separated list of required fields
echo '<input type="hidden" name="ff_required" id="ff_required" value="currentpassword,newpassword,newpassword_repeat" />' . K_NEWLINE;
echo '<input type="hidden" name="ff_required_labels" id="ff_required_labels" value="' . htmlspecialchars($l['w_current_password'] . ',' . $l['w_new_password'] . ',' . $l['w_new_password'], ENT_COMPAT, $l['a_meta_charset']) . '" />' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo '</form>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo '<div class="pagehelp">' . $l['hp_user_change_password'] . '</div>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
require_once dirname(__FILE__) . '/tce_page_footer.php';
//============================================================+
// END OF FILE
//============================================================+
Esempio n. 4
0
    echo getFormRowTextInput('user_regnumber', $l['w_regcode'], $l['h_regcode'], '', $user_regnumber, '', 255, false, false, false, showRequiredField($regfields['user_regnumber']));
}
if ($regfields['user_firstname']) {
    echo getFormRowTextInput('user_firstname', $l['w_firstname'], $l['h_firstname'], '', $user_firstname, '', 255, false, false, false, showRequiredField($regfields['user_firstname']));
}
if ($regfields['user_lastname']) {
    echo getFormRowTextInput('user_lastname', $l['w_lastname'], $l['h_lastname'], '', $user_lastname, '', 255, false, false, false, showRequiredField($regfields['user_lastname']));
}
if ($regfields['user_birthdate']) {
    echo getFormRowTextInput('user_birthdate', $l['w_birth_date'], $l['h_birth_date'] . ' ' . $l['w_date_format'], '', $user_birthdate, '', 10, true, false, false, showRequiredField($regfields['user_birthdate']));
}
if ($regfields['user_birthplace']) {
    echo getFormRowTextInput('user_birthplace', $l['w_birth_place'], $l['h_birth_place'], '', $user_birthplace, '', 255, false, false, false, showRequiredField($regfields['user_birthplace']));
}
if ($regfields['user_ssn']) {
    echo getFormRowTextInput('user_ssn', $l['w_fiscal_code'], $l['h_fiscal_code'], '', $user_ssn, '', 255, false, false, false, showRequiredField($regfields['user_ssn']));
}
if ($regfields['user_groups']) {
    echo '<div class="row">' . K_NEWLINE;
    echo '<span class="label">' . K_NEWLINE;
    echo '<label for="user_groups">' . $l['w_groups'] . '</label>' . K_NEWLINE;
    echo showRequiredField($regfields['user_groups']);
    echo '</span>' . K_NEWLINE;
    echo '<span class="formw">' . K_NEWLINE;
    echo '<select name="user_groups[]" id="user_groups" size="5" multiple="multiple">' . K_NEWLINE;
    $sql = 'SELECT *
		FROM ' . K_TABLE_GROUPS . '
		ORDER BY group_name';
    if ($r = F_db_query($sql, $db)) {
        while ($m = F_db_fetch_array($r)) {
            echo '<option value="' . $m['group_id'] . '"';
Esempio n. 5
0
        echo ' ' . htmlspecialchars($m['subject_name'], ENT_NOQUOTES, $l['a_meta_charset']) . '&nbsp;</option>' . K_NEWLINE;
        $countitem++;
    }
    if ($countitem == 1) {
        echo '<option value="0">&nbsp;</option>' . K_NEWLINE;
    }
} else {
    echo '</select></span></div>' . K_NEWLINE;
    F_display_db_error();
}
echo '</select>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo getFormNoscriptSelect('selectrecord');
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('subject_name', $l['w_name'], $l['h_subject_name'], '', $subject_name, '', 255, false, false, false, '');
echo '<div class="row">' . K_NEWLINE;
echo '<span class="label">' . K_NEWLINE;
echo '<label for="subject_description">' . $l['w_description'] . '</label>' . K_NEWLINE;
echo '<br />' . K_NEWLINE;
echo '<a href="#" title="' . $l['h_preview'] . '" class="xmlbutton" onclick="previewWindow=window.open(\'tce_preview_tcecode.php?tcexamcode=\'+encodeURIComponent(document.getElementById(\'form_subjecteditor\').subject_description.value),\'previewWindow\',\'dependent,height=500,width=500,menubar=no,resizable=yes,scrollbars=yes,status=no,toolbar=no\'); return false;">' . $l['w_preview'] . '</a>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '<span class="formw" style="border:1px solid #808080;">' . K_NEWLINE;
echo '<textarea cols="50" rows="5" name="subject_description" id="subject_description" onselect="FJ_update_selection(document.getElementById(\'form_subjecteditor\').subject_description)" title="' . $l['h_subject_description'] . '"';
if (K_ENABLE_VIRTUAL_KEYBOARD) {
    echo ' class="keyboardInput"';
}
echo '>' . htmlspecialchars($subject_description, ENT_NOQUOTES, $l['a_meta_charset']) . '</textarea>' . K_NEWLINE;
echo '<br />' . K_NEWLINE;
echo tcecodeEditorTagButtons('form_subjecteditor', 'subject_description');
echo '</span>' . K_NEWLINE;
Esempio n. 6
0
    while ($m = F_db_fetch_array($r)) {
        echo '<option value="' . $m['test_id'] . '"';
        if ($m['test_id'] == $test_id) {
            echo ' selected="selected"';
        }
        echo '>' . substr($m['test_begin_time'], 0, 10) . ' ' . htmlspecialchars($m['test_name'], ENT_NOQUOTES, $l['a_meta_charset']) . '</option>' . K_NEWLINE;
    }
} else {
    F_display_db_error();
}
echo '</select>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo getFormNoscriptSelect('selectcategory');
echo getFormRowTextInput('startdate', $l['w_time_begin'], $l['w_time_begin'] . ' ' . $l['w_datetime_format'], '', $startdate, '', 19, false, true, false);
echo getFormRowTextInput('enddate', $l['w_time_end'], $l['w_time_end'] . ' ' . $l['w_datetime_format'], '', $enddate, '', 19, false, true, false);
echo '<div class="row">' . K_NEWLINE;
echo '<span class="label">' . K_NEWLINE;
echo '<label for="group_id">' . $l['w_group'] . '</label>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '<span class="formw">' . K_NEWLINE;
echo '<select name="group_id" id="group_id" size="0" onchange="document.getElementById(\'form_resultallusers\').submit()">' . K_NEWLINE;
$sql = 'SELECT * FROM ' . K_TABLE_GROUPS . ', ' . K_TABLE_USERGROUP . ' WHERE usrgrp_group_id=group_id AND usrgrp_user_id=' . $user_id . '';
if ($test_id > 0) {
    $sql .= ' AND group_id IN (' . $test_group_ids . ')';
}
$sql .= ' ORDER BY group_name';
if ($r = F_db_query($sql, $db)) {
    echo '<option value="0"';
    if ($group_id == 0) {
        echo ' selected="selected"';
Esempio n. 7
0
                echo '<strong><a href="index.php" title="' . $l['h_index'] . '">' . $l['h_index'] . ' &gt;</a></strong>' . K_NEWLINE;
                echo '</div>' . K_NEWLINE;
                require_once 'tce_page_footer.php';
                exit;
            }
        }
        break;
    default:
        break;
}
//end of switch
echo '<div class="container">' . K_NEWLINE;
echo '<div class="tceformbox">' . K_NEWLINE;
echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_editor">' . K_NEWLINE;
echo getFormRowTextInput('user_email', $l['w_new_email'], $l['h_email'], '', '', '^([a-zA-Z0-9_\\.\\-]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$', 255, false, false, false, '');
echo getFormRowTextInput('user_email_repeat', $l['w_new_email'], $l['h_email'], ' (' . $l['w_repeat'] . ')', '', '', 255, false, false, false, '');
echo getFormRowTextInput('currentpassword', $l['w_password'], $l['h_password'], '', '', '', 255, false, false, true, '');
echo '<div class="row">' . K_NEWLINE;
F_submit_button('update', $l['w_update'], $l['h_update']);
// comma separated list of required fields
echo '<input type="hidden" name="ff_required" id="ff_required" value="user_email,user_email_repeat" />' . K_NEWLINE;
echo '<input type="hidden" name="ff_required_labels" id="ff_required_labels" value="' . htmlspecialchars($l['w_email'] . ',' . $l['w_email'], ENT_COMPAT, $l['a_meta_charset']) . '" />' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo '</form>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo '<div class="pagehelp">' . $l['hp_user_change_email'] . '</div>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
require_once dirname(__FILE__) . '/tce_page_footer.php';
//============================================================+
// END OF FILE
//============================================================+
        echo ' ' . htmlspecialchars($m['module_name'], ENT_NOQUOTES, $l['a_meta_charset']) . '&nbsp;</option>' . K_NEWLINE;
        $countitem++;
    }
    if ($countitem == 1) {
        echo '<option value="0">&nbsp;</option>' . K_NEWLINE;
    }
} else {
    echo '</select></span></div>' . K_NEWLINE;
    F_display_db_error();
}
echo '</select>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo getFormNoscriptSelect('selectrecord');
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('module_name', $l['w_name'], $l['h_module_name'], '', $module_name, '', 255, false, false, false, '');
echo '<div class="row">' . K_NEWLINE;
echo '<span class="label">' . K_NEWLINE;
echo '<label for="module_user_id">' . $l['w_owner'] . '</label>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '<span class="formw">' . K_NEWLINE;
if ($_SESSION['session_user_level'] >= K_AUTH_ADMINISTRATOR) {
    echo '<select name="module_user_id" id="module_user_id" size="0" title="' . $l['h_module_owner'] . '">' . K_NEWLINE;
    $sql = 'SELECT user_id, user_lastname, user_firstname, user_name FROM ' . K_TABLE_USERS . ' WHERE (user_level>5) ORDER BY user_lastname, user_firstname, user_name';
    if ($r = F_db_query($sql, $db)) {
        while ($m = F_db_fetch_array($r)) {
            echo '<option value="' . $m['user_id'] . '"';
            if ($m['user_id'] == $module_user_id) {
                echo ' selected="selected"';
            }
            echo '>' . htmlspecialchars('(' . $m['user_name'] . ') ' . $m['user_lastname'] . ' ' . $m['user_firstname'] . '', ENT_NOQUOTES, $l['a_meta_charset']) . '</option>' . K_NEWLINE;
Esempio n. 9
0
echo '</div>' . K_NEWLINE;
echo getFormNoscriptSelect('selectrecord');
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('user_name', $l['w_username'], $l['h_login_name'], '', $user_name, '', 255, false, false, false);
echo getFormRowTextInput('user_email', $l['w_email'], $l['h_usered_email'], '', $user_email, '^([a-zA-Z0-9_\\.\\-]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$', 255, false, false, false);
echo getFormRowTextInput('newpassword', $l['w_password'], $l['h_password'], ' (' . $l['d_password_lenght'] . ')', '', '^([a-zA-Z0-9]{8,32})$', 255, false, false, true);
echo getFormRowTextInput('newpassword_repeat', $l['w_password'], $l['h_password_repeat'], ' (' . $l['w_repeat'] . ')', '', '', 255, false, false, true);
echo getFormRowFixedValue('user_regdate', $l['w_regdate'], $l['h_regdate'], '', $user_regdate);
echo getFormRowFixedValue('user_ip', $l['w_ip'], $l['h_ip'], '', $user_ip);
echo getFormRowSelectBox('user_level', $l['w_level'], $l['h_level'], '', $user_level, array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10));
echo getFormRowTextInput('user_regnumber', $l['w_regcode'], $l['h_regcode'], '', $user_regnumber, '', 255, false, false, false);
echo getFormRowTextInput('user_firstname', $l['w_firstname'], $l['h_firstname'], '', $user_firstname, '', 255, false, false, false);
echo getFormRowTextInput('user_lastname', $l['w_lastname'], $l['h_lastname'], '', $user_lastname, '', 255, false, false, false);
echo getFormRowTextInput('user_birthdate', $l['w_birth_date'], $l['h_birth_date'] . ' ' . $l['w_date_format'], '', $user_birthdate, '', 10, true, false, false);
echo getFormRowTextInput('user_birthplace', $l['w_birth_place'], $l['h_birth_place'], '', $user_birthplace, '', 255, false, false, false);
echo getFormRowTextInput('user_ssn', $l['w_fiscal_code'], $l['h_fiscal_code'], '', $user_ssn, '', 255, false, false, false);
echo '<div class="row">' . K_NEWLINE;
echo '<span class="label">' . K_NEWLINE;
echo '<label for="user_groups">' . $l['w_groups'] . '</label>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '<span class="formw">' . K_NEWLINE;
echo '<select name="user_groups[]" id="user_groups" size="5" multiple="multiple">' . K_NEWLINE;
$sql = 'SELECT * FROM ' . K_TABLE_GROUPS . ' ORDER BY group_name';
if ($r = F_db_query($sql, $db)) {
    while ($m = F_db_fetch_array($r)) {
        echo '<option value="' . $m['group_id'] . '"';
        if (!F_isAuthorizedEditorForGroup($m['group_id'])) {
            echo ' style="text-decoration:line-through;"';
        }
        if (F_isUserOnGroup($user_id, $m['group_id'])) {
            echo ' selected="selected"';
Esempio n. 10
0
                F_display_db_error();
            }
        }
    }
}
echo '<div class="container">' . K_NEWLINE;
echo '<div class="tceformbox">' . K_NEWLINE;
echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_editor">' . K_NEWLINE;
echo F_select_datacenter($dcn_id, $datacenter_data, false);
echo F_select_suite($dcn_id, $sts_id, $suite_data, true);
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('sts_name', $l['w_name'], $l['h_suite_name'], '', $sts_name, '', 255, false, false, false, '');
echo getFormRowTextBox('sts_description', $l['w_description'], $l['h_suite_description'], $sts_description, false, '');
echo getFormRowTextInput('sts_floor', $l['w_floor'], $l['h_suite_floor'], '', $sts_floor, '', 255, false, false, false, '');
echo getFormRowTextInput('sts_width', $l['w_width'], $l['h_suite_width'], '[# ' . $l['w_racks'] . ']', $sts_width, '', 255, false, false, false, '');
echo getFormRowTextInput('sts_height', $l['w_height'], $l['h_suite_height'], '[# ' . $l['w_racks'] . ']', $sts_height, '', 255, false, false, false, '');
// -----------------------------------------------------------------------------
// group permissions
echo '<fieldset class="subset" style="text-align:left;">' . K_NEWLINE;
echo '<legend>' . $l['t_permissions'] . '</legend>' . K_NEWLINE;
echo F_groupsPermsSelector($perms, false);
echo '</fieldset>' . K_NEWLINE;
// -----------------------------------------------------------------------------
echo '<div class="row">' . K_NEWLINE;
// show buttons by case
if (isset($sts_id) and $sts_id > 0) {
    if ($userlevel >= K_AUTH_ADMINISTRATOR or ($perms & 4) > 0) {
        echo '<span style="background-color:#999999;">';
        echo '<input type="checkbox" name="confirmupdate" id="confirmupdate" value="1" title="confirm &rarr; update" />';
        F_submit_button('update', $l['w_update'], $l['h_update']);
        echo '</span>';
Esempio n. 11
0
                }
            } else {
                F_display_db_error();
            }
        }
    }
}
echo '<div class="container">' . K_NEWLINE;
echo '<div class="tceformbox">' . K_NEWLINE;
echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_editor">' . K_NEWLINE;
echo F_select_datacenter($dcn_id, $data, true);
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('dcn_name', $l['w_name'], $l['h_datacenter_name'], '', $dcn_name, '', 255, false, false, false, '');
echo getFormRowTextBox('dcn_description', $l['w_description'], $l['h_datacenter_description'], $dcn_description, false, '');
echo getFormRowTextInput('dcn_website_url', $l['w_website'], $l['h_website_url'], '', $dcn_website_url, '', 255, false, false, false, '');
echo getFormRowTextInput('dcn_map_url', $l['w_map_url'], $l['h_map_url'], '', $dcn_map_url, '', 255, false, false, false, '');
// -----------------------------------------------------------------------------
// group permissions
echo '<fieldset class="subset" style="text-align:left;">' . K_NEWLINE;
echo '<legend>' . $l['t_permissions'] . '</legend>' . K_NEWLINE;
echo F_groupsPermsSelector($perms, false);
echo '</fieldset>' . K_NEWLINE;
// -----------------------------------------------------------------------------
echo '<div class="row">' . K_NEWLINE;
// show buttons by case
if (isset($dcn_id) and $dcn_id > 0) {
    if ($userlevel >= K_AUTH_ADMINISTRATOR or ($perms & 4) > 0) {
        echo '<span style="background-color:#999999;">';
        echo '<input type="checkbox" name="confirmupdate" id="confirmupdate" value="1" title="confirm &rarr; update" />';
        F_submit_button('update', $l['w_update'], $l['h_update']);
        echo '</span>';
Esempio n. 12
0
    }
}
echo '<div class="container">' . K_NEWLINE;
echo '<div class="tceformbox">' . K_NEWLINE;
echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_editor">' . K_NEWLINE;
echo F_select_datacenter($dcn_id, $datacenter_data, false);
echo F_select_suite($dcn_id, $sts_id, $suite_data, false);
echo F_select_rack($dcn_id, $sts_id, $rck_id, $rack_data, $rack_pos, $rack_name, true);
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('rck_name', $l['w_name'], $l['h_rack_name'], '', $rck_name, '', 255, false, false, false, '');
echo getFormRowTextBox('rck_description', $l['w_description'], $l['h_rack_description'], $rck_description, false, '');
echo getFormRowTextInput('rck_label', $l['w_label'], $l['h_rack_label'], '', $rck_label, '', 255, false, false, false, '');
echo getFormRowTextInput('rck_tag', $l['w_tag'], $l['h_rack_tag'], '', $rck_tag, '', 255, false, false, false, '');
echo getFormRowTextInput('rck_height', $l['w_height'], $l['h_rack_height'], '', $rck_height, '', 255, false, false, false, '');
echo getFormRowTextInput('rck_position_x', $l['w_position_x'], $l['h_rack_pos_x'], '', $rck_position_x, '', 255, false, false, false, '');
echo getFormRowTextInput('rck_position_y', $l['w_position_y'], $l['h_rack_pos_y'], '', $rck_position_y, '', 255, false, false, false, '');
// -----------------------------------------------------------------------------
// group permissions
echo '<fieldset class="subset" style="text-align:left;">' . K_NEWLINE;
echo '<legend>' . $l['t_permissions'] . '</legend>' . K_NEWLINE;
echo F_groupsPermsSelector($perms, false);
echo '</fieldset>' . K_NEWLINE;
// -----------------------------------------------------------------------------
echo '<div class="row">' . K_NEWLINE;
// show buttons by case
if (isset($rck_id) and $rck_id > 0) {
    if ($userlevel >= K_AUTH_ADMINISTRATOR or ($perms & 4) > 0) {
        echo '<span style="background-color:#999999;">';
        echo '<input type="checkbox" name="confirmupdate" id="confirmupdate" value="1" title="confirm &rarr; update" />';
        F_submit_button('update', $l['w_update'], $l['h_update']);
        echo '</span>';
Esempio n. 13
0
}
echo '</select>' . K_NEWLINE;
// manufacturers selection popup
$jsaction = 'selectWindow=window.open(\'tce_select_manuf_popup.php?cid=mnf_id\', \'selectWindow\', \'dependent, height=600, width=800, menubar=no, resizable=yes, scrollbars=yes, status=no, toolbar=no\');return false;';
echo '<a href="#" onclick="' . $jsaction . '" class="xmlbutton" title="' . $l['w_select'] . '">...</a>';
echo '</span>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo getFormNoscriptSelect('selectrecord');
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('mnf_name', $l['w_name'], $l['h_manufacturer_name'], '', $mnf_name, '', 255, false, false, false, '');
echo getFormRowTextInput('mnf_url', $l['w_url'], $l['h_manufacturer_url'], '', $mnf_url, '', 255, false, false, false, '');
echo getFormRowTextBox('mnf_description', $l['w_description'], $l['h_manufacturer_description'], $mnf_description, false, '');
// editor for MAC prefixes
$k = 0;
foreach ($macs as $k => $v) {
    echo getFormRowTextInput('mac_' . $k, $l['w_mac'] . ' ' . ($k + 1), $l['h_manufacturer_mac'], '', $v, '^([A-F0-9]{6})$', 6, false, false, false, '');
}
echo '<input type="hidden" name="max_macs" id="max_macs" value="' . $k . '" />' . K_NEWLINE;
echo '<div class="row">' . K_NEWLINE;
// show buttons by case
if (isset($mnf_id) and $mnf_id > 0) {
    echo '<span style="background-color:#999999;">';
    echo '<input type="checkbox" name="confirmupdate" id="confirmupdate" value="1" title="confirm &rarr; update" />';
    F_submit_button('update', $l['w_update'], $l['h_update']);
    echo '</span>';
    F_submit_button('delete', $l['w_delete'], $l['h_delete']);
} else {
    F_submit_button('add', $l['w_add'], $l['h_add']);
}
F_submit_button('clear', $l['w_clear'], $l['h_clear']);
// comma separated list of required fields
Esempio n. 14
0
/**
 * Returns XHTML / CSS formatted page string to insert the test password.<br>
 * The CSS classes used are:
 * <ul>
 * <li>div.login_form : container for login box</li>
 * <li>div.login_form div.login_row : container for label + input field or button</li>
 * <li>div.login_form div.login_row span.label : container for input label</li>
 * <li>div.login_form div.login_row span.formw : container for input form</li>
 * </ul>
 * @param faction String action attribute
 * @param fid String form ID attribute
 * @param fmethod String method attribute (get/post)
 * @param fenctype String enctype attribute
 * @param test_id int ID of the test
 * @return XHTML string for login form
 */
function F_testLoginForm($faction, $fid, $fmethod, $fenctype, $test_id)
{
    global $l;
    require_once '../config/tce_config.php';
    $str = '';
    $str .= '<div class="container">' . K_NEWLINE;
    $str .= '<div class="tceformbox">' . K_NEWLINE;
    $str .= '<form action="' . $faction . '" method="' . $fmethod . '" id="' . $fid . '" enctype="' . $fenctype . '">' . K_NEWLINE;
    // test password
    $str .= getFormRowTextInput('xtest_password', $l['w_test_password'], $l['h_test_password'], '', '', '', 255, false, false, true, '');
    // buttons
    $str .= '<div class="row">' . K_NEWLINE;
    $str .= '<input type="submit" name="login" id="login" value="' . $l['w_login'] . '" title="' . $l['h_login_button'] . '" />' . K_NEWLINE;
    // the following field is used to check if the form has been submitted
    $str .= '<input type="hidden" name="testpswaction" id="testpswaction" value="login" />' . K_NEWLINE;
    $str .= '<input type="hidden" name="testid" id="testid" value="' . intval($test_id) . '" />' . K_NEWLINE;
    $str .= '</div>' . K_NEWLINE;
    $str .= '</form>' . K_NEWLINE;
    $str .= '</div>' . K_NEWLINE;
    $str .= '<div class="pagehelp">' . $l['hp_test_password'] . '</div>' . K_NEWLINE;
    $str .= '</div>' . K_NEWLINE;
    return $str;
}
Esempio n. 15
0
echo '<div class="tceformbox">' . K_NEWLINE;
echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_editor">' . K_NEWLINE;
// *** selection filter ***
echo '<fieldset class="subset" style="text-align:left;">' . K_NEWLINE;
echo '<legend>' . $l['w_selection filter'] . '</legend>' . K_NEWLINE;
echo F_select_datacenter($dcn_id, $datacenter_data, true);
echo F_select_suite($dcn_id, $sts_id, $suite_data, true);
echo F_select_multiple_racks($dcn_id, $sts_id, $rck_ids);
echo F_select_multiple_object_types($obt_ids);
echo F_get_user_selectbox($l['w_owner'], $obj_owner_id, 'obj_owner_id');
echo F_get_user_selectbox($l['w_tenant'], $obj_tenant_id, 'obj_tenant_id');
echo getFormRowTextInput('keywords', $l['w_keywords'], $l['w_search_keywords'], '', $keywords, '', 255, false, false, false, '');
echo '</fieldset>' . K_NEWLINE;
echo '<fieldset class="subset" style="text-align:left;">' . K_NEWLINE;
echo '<legend>' . $l['w_options'] . '</legend>' . K_NEWLINE;
echo getFormRowTextInput('exclude', $l['w_exclude'], $l['h_exclude_pattern'], '[i.e.: user password license child connection permissions object capacity]', $exclude, '', 255, false, false, false, '');
echo getFormRowSelectBox('format_type', $l['w_format'], $l['h_export_format'], '', $format_type, $format_types, '');
echo '</fieldset>' . K_NEWLINE;
// export button
echo '<div class="row">' . K_NEWLINE;
F_submit_button('generate', $l['w_export'], $l['w_export_data']);
echo '</div>' . K_NEWLINE;
echo '<div class="row">' . K_NEWLINE;
echo '&nbsp;' . K_NEWLINE;
// comma separated list of required fields
echo '<input type="hidden" name="ff_required" id="ff_required" value="" />' . K_NEWLINE;
echo '<input type="hidden" name="ff_required_labels" id="ff_required_labels" value="" />' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo '</form>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo '<div class="pagehelp">' . $l['hp_export_data'] . '</div>' . K_NEWLINE;
Esempio n. 16
0
/**
 * Return an HTML code containing form fields to filter data
 * @param $dcn_id (int) Datacenter ID.
 * @param $sts_id (int) Suite ID.
 * @param $rck_id (int) Rack ID.
 * @param $obt_id (int) Object ID.
 * @param $obj_owner_id (int) Owner ID.
 * @param $obj_tenant_id (int) Tenant ID.
 * @param $keywords (string) Keywords.
 * @return html code
 */
function F_getDataFilter($dcn_id = 0, $sts_id = 0, $rck_id = 0, $obt_id = 0, $obj_owner_id = 0, $obj_tenant_id = 0, $keywords = 0)
{
    global $l, $db;
    require_once '../config/tce_config.php';
    require_once 'tce_functions_user_select.php';
    $out = '';
    $out .= '<fieldset class="subset" style="text-align:left;">' . K_NEWLINE;
    $out .= '<legend>' . $l['w_selection filter'] . '</legend>' . K_NEWLINE;
    $out .= F_select_datacenter($dcn_id, $datacenter_data, true);
    $out .= F_select_suite($dcn_id, $sts_id, $suite_data, true);
    $out .= F_select_rack($dcn_id, $sts_id, $rck_id, $rack_data, $rack_pos, $rack_name, true);
    $out .= F_select_object_type($obt_id, true);
    $out .= F_get_user_selectbox($l['w_owner'], $obj_owner_id, 'obj_owner_id');
    $out .= F_get_user_selectbox($l['w_tenant'], $obj_tenant_id, 'obj_tenant_id');
    $out .= getFormRowTextInput('keywords', $l['w_keywords'], $l['w_search_keywords'], '', $keywords, '', 255, false, false, false, '');
    // generate button
    $out .= '<div class="row">';
    $out .= '<input type="submit" name="filter" id="filter" value="' . $l['w_filter'] . '" title="' . $l['h_filter_objects'] . '" />';
    $out .= '</div>' . K_NEWLINE;
    $out .= '</fieldset>' . K_NEWLINE;
    return $out;
}
Esempio n. 17
0
    echo '<span class="label">' . K_NEWLINE;
    echo '<label for="tsubset_difficulty">' . $l['w_question_difficulty'] . '</label>' . K_NEWLINE;
    echo '</span>' . K_NEWLINE;
    echo '<span class="formw">' . K_NEWLINE;
    echo '<select name="tsubset_difficulty" id="tsubset_difficulty" size="0" title="' . $l['h_question_difficulty'] . '">' . K_NEWLINE;
    for ($i = 0; $i <= K_QUESTION_DIFFICULTY_LEVELS; ++$i) {
        echo '<option value="' . $i . '"';
        if ($i == $tsubset_difficulty) {
            echo ' selected="selected"';
        }
        echo '>' . $i . '</option>' . K_NEWLINE;
    }
    echo '</select>' . K_NEWLINE;
    echo '</span>' . K_NEWLINE;
    echo '</div>' . K_NEWLINE;
    echo getFormRowTextInput('tsubset_answers', $l['w_num_answers'], $l['h_num_answers'], '', $tsubset_answers, '^([0-9]*)$', 20, false, false, false);
    echo '<div class="row">' . K_NEWLINE;
    echo '<span class="label">&nbsp;</span>' . K_NEWLINE;
    echo '<span class="formw">' . K_NEWLINE;
    F_submit_button("addquestion", $l['w_add_questions'], $l['h_add_questions']);
    echo '</span>' . K_NEWLINE;
    echo '</div>' . K_NEWLINE;
    echo '<div class="rowl" title="' . $l['h_subjects'] . '">' . K_NEWLINE;
    echo '<br />' . K_NEWLINE;
    echo '<div class="preview">' . K_NEWLINE;
    $subjlist = '';
    $sql = 'SELECT * FROM ' . K_TABLE_TEST_SUBJSET . '
		WHERE tsubset_test_id=\'' . $test_id . '\'
		ORDER BY tsubset_id';
    if ($r = F_db_query($sql, $db)) {
        while ($m = F_db_fetch_array($r)) {
Esempio n. 18
0
        echo '&nbsp;</option>' . K_NEWLINE;
        $countitem++;
    }
    if ($countitem == 1) {
        echo '<option value="0">&nbsp;</option>' . K_NEWLINE;
    }
} else {
    echo '</select></span></div>' . K_NEWLINE;
    F_display_db_error();
}
echo '</select>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo getFormNoscriptSelect('selectrecord');
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('ssl_name', $l['w_name'], $l['w_name'], '', $ssl_name, '', 255, false, false, false, '');
if (!isset($ssl_id) or $ssl_id <= 0) {
    echo '<div class="row">' . K_NEWLINE;
    echo '<span class="label">' . K_NEWLINE;
    echo '<label for="userfile">' . $l['w_upload_file'] . '</label>' . K_NEWLINE;
    echo '</span>' . K_NEWLINE;
    echo '<span class="formw">' . K_NEWLINE;
    echo '<input type="hidden" name="MAX_FILE_SIZE" value="' . K_MAX_UPLOAD_SIZE . '" />' . K_NEWLINE;
    echo '<input type="file" name="userfile" id="userfile" size="20" title="' . $l['h_upload_file'] . '" />' . K_NEWLINE;
    echo '</span>' . K_NEWLINE;
    echo '&nbsp;' . K_NEWLINE;
    echo '</div>' . K_NEWLINE;
}
echo getFormRowCheckBox('ssl_enabled', $l['w_enabled'], $l['h_enabled'], '', 1, $ssl_enabled, false, '');
echo '<div class="row">' . K_NEWLINE;
// show buttons by case
    $max_position = 0;
}
echo '<option value="0">&nbsp;</option>' . K_NEWLINE;
for ($pos = 1; $pos <= $max_position; $pos++) {
    echo '<option value="' . $pos . '"';
    if ($pos == $question_position) {
        echo ' selected="selected"';
    }
    echo '>' . $pos . '</option>' . K_NEWLINE;
}
echo '<option value="' . ($max_position + 1) . '" style="color:#ff0000">' . ($max_position + 1) . '</option>' . K_NEWLINE;
echo '</select>' . K_NEWLINE;
echo '<input type="hidden" name="max_position" id="max_position" value="' . $max_position . '" />' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo getFormRowTextInput('question_timer', $l['w_timer'], $l['h_question_timer'], '[sec]', $question_timer, '^([0-9]*)$', 20, false, false, false, '');
echo getFormRowCheckBox('question_fullscreen', $l['w_fullscreen'], $l['h_question_fullscreen'], '', 1, $question_fullscreen, false, '');
echo getFormRowCheckBox('question_inline_answers', $l['w_inline_answers'], $l['h_question_inline_answers'], '', 1, $question_inline_answers, false, '');
echo getFormRowCheckBox('question_auto_next', $l['w_auto_next'], $l['h_question_auto_next'], '', 1, $question_auto_next, false, '');
echo getFormRowCheckBox('question_enabled', $l['w_enabled'], $l['h_enabled'], '', 1, $question_enabled, false, '');
echo '<div class="row">' . K_NEWLINE;
// show buttons by case
if (isset($question_id) and $question_id > 0) {
    echo '<span style="background-color:#999999;">';
    echo '<input type="checkbox" name="confirmupdate" id="confirmupdate" value="1" title="confirm &rarr; update" />';
    F_submit_button('update', $l['w_update'], $l['h_update']);
    echo '</span>';
}
F_submit_button('add', $l['w_add'], $l['h_add']);
if (isset($question_id) and $question_id > 0) {
    F_submit_button('delete', $l['w_delete'], $l['h_delete']);
Esempio n. 20
0
            F_send_user_reg_email($user_id, $user_email, $user_verifycode);
            F_print_error('MESSAGE', $user_email . ': ' . $l['m_user_verification_sent']);
            echo '<div class="container">' . K_NEWLINE;
            echo '<strong><a href="index.php" title="' . $l['h_index'] . '">' . $l['h_index'] . ' &gt;</a></strong>' . K_NEWLINE;
            echo '</div>' . K_NEWLINE;
            require_once '../code/tce_page_footer.php';
            exit;
        } else {
            F_print_error('ERROR', $l['w_unknown_email']);
        }
    }
}
//end of add
echo '<div class="container">' . K_NEWLINE;
echo '<div class="tceformbox">' . K_NEWLINE;
echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_usereditor">' . K_NEWLINE;
echo '<p>' . $l['d_reset_password'] . '</p>' . K_NEWLINE;
echo getFormRowTextInput('user_email', $l['w_email'], $l['h_usered_email'], '', '', '^([a-zA-Z0-9_\\.\\-]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$', 255, false, false, false, '');
echo '<div class="row">' . K_NEWLINE;
F_submit_button('resetpassword', $l['w_submit'], $l['h_submit']);
// comma separated list of required fields
echo '<input type="hidden" name="ff_required" id="ff_required" value="user_email" />' . K_NEWLINE;
echo '<input type="hidden" name="ff_required_labels" id="ff_required_labels" value="' . $l['w_email'] . '" />' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo '</form>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
require_once '../code/tce_page_footer.php';
//============================================================+
// END OF FILE
//============================================================+
Esempio n. 21
0
        echo '<option value="' . $m['tmp_id'] . '"';
        if ($m['tmp_id'] == $tmp_id) {
            echo ' selected="selected"';
        }
        echo '>' . htmlspecialchars($m['tmp_name'], ENT_NOQUOTES, $l['a_meta_charset']) . '</option>' . K_NEWLINE;
    }
} else {
    echo '</select></span></div>' . K_NEWLINE;
    F_display_db_error();
}
echo '</select>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo getFormNoscriptSelect('selectrecord');
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('tmp_name', $l['w_name'], $l['h_attribute_name'], '', $tmp_name, '', 255, false, false, false, '');
echo getFormRowTextBox('tmp_template', $l['w_template'], $l['h_config_template'], $tmp_template, false, '');
echo '<div class="row">' . K_NEWLINE;
// show buttons by case
if (isset($tmp_id) and $tmp_id > 0) {
    echo '<span style="background-color:#999999;">';
    echo '<input type="checkbox" name="confirmupdate" id="confirmupdate" value="1" title="confirm &rarr; update" />';
    F_submit_button('update', $l['w_update'], $l['h_update']);
    echo '</span>';
    F_submit_button('delete', $l['w_delete'], $l['h_delete']);
} else {
    F_submit_button('add', $l['w_add'], $l['h_add']);
}
F_submit_button('clear', $l['w_clear'], $l['h_clear']);
// comma separated list of required fields
echo '<input type="hidden" name="ff_required" id="ff_required" value="tmp_name" />' . K_NEWLINE;
Esempio n. 22
0
            echo ' selected="selected"';
        }
        echo '>' . htmlspecialchars($m['atb_name'], ENT_NOQUOTES, $l['a_meta_charset']) . '</option>' . K_NEWLINE;
    }
} else {
    echo '</select></span></div>' . K_NEWLINE;
    F_display_db_error();
}
echo '</select>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo getFormNoscriptSelect('selectrecord');
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('atb_name', $l['w_name'], $l['h_attribute_name'], '', $atb_name, '', 255, false, false, false, '');
echo getFormRowSelectBox('atb_type', $l['w_type'], $l['h_attribute_type'], '', $atb_type, $attribute_types, '');
echo getFormRowTextInput('atb_default', $l['w_default'], $l['h_attribute_default'], '', $atb_default, '', 255, false, false, false, '');
echo getFormRowTextBox('atb_description', $l['w_description'], $l['h_attribute_description'], $atb_description, false, '');
echo '<div class="row">' . K_NEWLINE;
// show buttons by case
if (isset($atb_id) and $atb_id > 0) {
    echo '<span style="background-color:#999999;">';
    echo '<input type="checkbox" name="confirmupdate" id="confirmupdate" value="1" title="confirm &rarr; update" />';
    F_submit_button('update', $l['w_update'], $l['h_update']);
    echo '</span>';
    F_submit_button('delete', $l['w_delete'], $l['h_delete']);
} else {
    F_submit_button('add', $l['w_add'], $l['h_add']);
}
F_submit_button('clear', $l['w_clear'], $l['h_clear']);
// comma separated list of required fields
echo '<input type="hidden" name="ff_required" id="ff_required" value="atb_name" />' . K_NEWLINE;
Esempio n. 23
0
        echo '<option value="' . $m['group_id'] . '"';
        if ($m['group_id'] == $group_id) {
            echo ' selected="selected"';
        }
        echo '>' . htmlspecialchars($m['group_name'], ENT_NOQUOTES, $l['a_meta_charset']) . '</option>' . K_NEWLINE;
    }
} else {
    echo '</select></span></div>' . K_NEWLINE;
    F_display_db_error();
}
echo '</select>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo getFormNoscriptSelect('selectrecord');
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('group_name', $l['w_name'], $l['h_group_name'], '', $group_name, '', 255, false, false, false, '');
echo '<div class="row">' . K_NEWLINE;
// show buttons by case
if (isset($group_id) and $group_id > 0) {
    echo '<span style="background-color:#999999;">';
    echo '<input type="checkbox" name="confirmupdate" id="confirmupdate" value="1" title="confirm &rarr; update" />';
    F_submit_button('update', $l['w_update'], $l['h_update']);
    echo '</span>';
    if ($_SESSION['session_user_level'] >= K_AUTH_DELETE_GROUPS) {
        // your account and anonymous user can't be deleted
        F_submit_button('delete', $l['w_delete'], $l['h_delete']);
    }
} else {
    F_submit_button('add', $l['w_add'], $l['h_add']);
}
F_submit_button('clear', $l['w_clear'], $l['h_clear']);
        echo getFormRowTextInput('atb_value', $l['w_value'], $l['w_value'], '', $atb_value, '^([\\+\\-]?[0-9\\.]*)$', 255, false, false, false, '');
        break;
    case 'string':
        echo getFormRowTextInput('atb_value', $l['w_value'], $l['w_value'], '', $atb_value, '', 255, false, false, false, '');
        break;
    case 'text':
        echo getFormRowTextBox('atb_value', $l['w_value'], $l['w_value'], $atb_value, false, '');
        break;
    case 'date':
        echo getFormRowTextInput('atb_value', $l['w_value'], $l['w_value'], '', $atb_value, '', 255, true, false, false, '');
        break;
    case 'datetime':
        echo getFormRowTextInput('atb_value', $l['w_value'], $l['w_value'], '', $atb_value, '', 255, false, true, false, '');
        break;
    case 'password':
        echo getFormRowTextInput('atb_value', $l['w_value'], $l['w_value'], '', $atb_value, '', 255, false, false, true, '');
        break;
}
echo '</fieldset>' . K_NEWLINE;
// display selected objects with checkboxes for selection
if ($filtered === true) {
    echo F_getSelectedObject($dcn_id, $sts_id, $rck_id, $obt_id, $obj_owner_id, $obj_tenant_id, $keywords);
    if ($atb_id > 0) {
        // generate button
        echo '<div class="row">' . K_NEWLINE;
        F_submit_button('update', $l['w_update'], $l['h_update']);
        echo '</div>' . K_NEWLINE;
    }
}
echo '<div class="row">' . K_NEWLINE;
echo '&nbsp;' . K_NEWLINE;
Esempio n. 25
0
                    $obt_description = '';
                    $obt_color = '';
                    $obt_virtual = false;
                }
            } else {
                F_display_db_error();
            }
        }
    }
}
echo '<div class="container">' . K_NEWLINE;
echo '<div class="tceformbox">' . K_NEWLINE;
echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_editor">' . K_NEWLINE;
echo F_select_object_type($obt_id, true);
echo '<div class="row"><hr /></div>' . K_NEWLINE;
echo getFormRowTextInput('obt_name', $l['w_name'], $l['h_object_name'], '', $obt_name, '', 255, false, false, false, '');
echo getFormRowTextBox('obt_description', $l['w_description'], $l['h_object_description'], $obt_description, false, '');
// select object attributes
echo '<div class="row">' . K_NEWLINE;
echo '<span class="label">' . K_NEWLINE;
echo '<label for="object_attributes">' . $l['w_attributes'] . '</label>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '<span class="formw">' . K_NEWLINE;
echo '<select name="object_attributes[]" id="object_attributes" size="10" multiple="multiple">' . K_NEWLINE;
$sql = 'SELECT * FROM ' . K_TABLE_ATTRIBUTE_TYPES . ' ORDER BY atb_name';
if ($r = F_db_query($sql, $db)) {
    while ($m = F_db_fetch_array($r)) {
        echo '<option value="' . $m['atb_id'] . '"';
        if (F_isObjectAttribute($obt_id, $m['atb_id'])) {
            echo ' selected="selected"';
            $m['atb_name'] = '* ' . $m['atb_name'];
Esempio n. 26
0
            echo ' style="text-decoration:line-through;"';
        }
        if (F_isUserOnGroup($user_id, $m['group_id'])) {
            echo ' selected="selected"';
            $m['group_name'] = '* ' . $m['group_name'];
        }
        echo '>' . htmlspecialchars($m['group_name'], ENT_NOQUOTES, $l['a_meta_charset']) . '</option>' . K_NEWLINE;
    }
} else {
    echo '</select></span></div>' . K_NEWLINE;
    F_display_db_error();
}
echo '</select>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '</div>' . K_NEWLINE;
echo getFormRowTextInput('user_otpkey', $l['w_otpkey'], $l['h_otpkey'], '', $user_otpkey, '', 255, false, false, false);
// display QR-Code for Google authenticator
if (!empty($user_otpkey)) {
    require_once '../../shared/tcpdf/tcpdf_barcodes_2d.php';
    $host = preg_replace('/[h][t][t][p][s]?[:][\\/][\\/]/', '', K_PATH_HOST);
    $qrcode = new TCPDF2DBarcode('otpauth://totp/' . $user_name . '@' . $host . '?secret=' . $user_otpkey, 'QRCODE,H');
    echo '<div class="row">' . K_NEWLINE;
    echo '<span class="label">' . $l['w_otp_qrcode'] . '</span>' . K_NEWLINE;
    echo '<span class="formw" style="margin:30px 0px 30px 0px;">' . K_NEWLINE;
    echo $qrcode->getBarcodeHTML(6, 6, 'black');
    echo '</span>' . K_NEWLINE;
    echo '</div>' . K_NEWLINE;
}
echo '<div class="row">' . K_NEWLINE;
// show buttons by case
if (isset($user_id) and $user_id > 0) {
Esempio n. 27
0
echo '<div class="tceformbox">' . K_NEWLINE;
echo '<form action="' . $_SERVER['SCRIPT_NAME'] . '" method="post" enctype="multipart/form-data" id="form_usereditor">' . K_NEWLINE;
echo getFormRowTextInput('user_name', $l['w_username'], $l['h_login_name'], '', $user_name, '', 255, false, false, false, showRequiredField($regfields['user_name']));
if (K_USRREG_EMAIL_CONFIRM or $regfields['user_email']) {
    echo getFormRowTextInput('user_email', $l['w_email'], $l['h_usered_email'], '', $user_email, '^([a-zA-Z0-9_\\.\\-]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$', 255, false, false, false, showRequiredField($regfields['user_email']));
}
echo getFormRowTextInput('newpassword', $l['w_password'], $l['h_password'], ' (' . $l['d_password_lenght'] . ')', '', '^([a-zA-Z0-9]{8,32})$', 255, false, false, true, showRequiredField(2));
echo getFormRowTextInput('newpassword_repeat', $l['w_password'], $l['h_password_repeat'], ' (' . $l['w_repeat'] . ')', '', '', 255, false, false, true, showRequiredField(2));
if ($regfields['user_regnumber']) {
    echo getFormRowTextInput('user_regnumber', $l['w_regcode'], $l['h_regcode'], '', $user_regnumber, '', 255, false, false, false, showRequiredField($regfields['user_regnumber']));
}
if ($regfields['user_firstname']) {
    echo getFormRowTextInput('user_firstname', $l['w_firstname'], $l['h_firstname'], '', $user_firstname, '', 255, false, false, false, showRequiredField($regfields['user_firstname']));
}
if ($regfields['user_lastname']) {
    echo getFormRowTextInput('user_lastname', $l['w_lastname'], $l['h_lastname'], '', $user_lastname, '', 255, false, false, false, showRequiredField($regfields['user_lastname']));
}
if ($regfields['user_sshkey']) {
    echo getFormRowTextBox('user_sshkey', $l['w_sshkey'], $l['h_sshkey'], $user_sshkey, false, showRequiredField($regfields['user_sshkey']));
}
if ($regfields['user_groups']) {
    echo '<div class="row">' . K_NEWLINE;
    echo '<span class="label">' . K_NEWLINE;
    echo '<label for="user_groups">' . $l['w_groups'] . '</label>' . K_NEWLINE;
    echo showRequiredField($regfields['user_groups']);
    echo '</span>' . K_NEWLINE;
    echo '<span class="formw">' . K_NEWLINE;
    echo '<select name="user_groups[]" id="user_groups" size="5" multiple="multiple">' . K_NEWLINE;
    $sql = 'SELECT *
		FROM ' . K_TABLE_GROUPS . '
		ORDER BY group_name';
Esempio n. 28
0
            echo getFormRowTextInput($afield, $m['atb_name'], $m['atb_description'], '', ${$afield}, '^([\\+\\-]?[0-9\\.]*)$', 255, false, false, false, '');
            break;
        case 'string':
            echo getFormRowTextInput($afield, $m['atb_name'], $m['atb_description'], '', ${$afield}, '', 255, false, false, false, '');
            break;
        case 'text':
            echo getFormRowTextBox($afield, $m['atb_name'], $m['atb_description'], ${$afield}, false, '');
            break;
        case 'date':
            echo getFormRowTextInput($afield, $m['atb_name'], $m['atb_description'], '', ${$afield}, '', 255, true, false, false, '');
            break;
        case 'datetime':
            echo getFormRowTextInput($afield, $m['atb_name'], $m['atb_description'], '', ${$afield}, '', 255, false, true, false, '');
            break;
        case 'password':
            echo getFormRowTextInput($afield, $m['atb_name'], $m['atb_description'], '', ${$afield}, '', 255, false, false, true, '');
            break;
    }
}
echo '</fieldset>' . K_NEWLINE;
// *** position
echo '<fieldset class="subset" style="text-align:left;">' . K_NEWLINE;
echo '<legend>' . $l['w_position'] . '</legend>' . K_NEWLINE;
// rack ID
echo '<div class="row">' . K_NEWLINE;
echo '<span class="label">' . K_NEWLINE;
echo '<label for="loc_rack_id">' . $l['w_rack'] . '</label>' . K_NEWLINE;
echo '</span>' . K_NEWLINE;
echo '<span class="formw">' . K_NEWLINE;
echo '<select name="loc_rack_id" id="loc_rack_id" size="0">' . K_NEWLINE;
echo '<option value="0" style="background-color:#009900;color:white;"';