function auth_login($username)
{
    # check users project rights
    $auth_return_code = auth_verify_user_settings($username);
    if ($auth_return_code == NO_DEFAULT_PROJ || $auth_return_code == NO_USER_RIGHTS) {
        error_report_show("login.php", $auth_return_code);
        exit;
    }
    session_initialize();
    session_setLogged_in(TRUE);
    session_set_application_details(user_get_default_project_name($username), $username);
}
if (!empty($pm)) {
    $project_name = project_get_name($project_id);
} else {
    error_report_show('login.php', PROJECT_NOT_EXISTS);
}
if (!user_has_rights($project_id, $s_user_id, USER)) {
    error_report_show('login.php', NO_RIGHTS_TO_VIEW_PROJECT);
}
if (!test_id_exists($project_id, $test_id)) {
    error_report_show('login.php', TEST_NOT_EXISTS);
}
session_set_new_project_name($project_name);
session_reset_project();
session_initialize();
session_setLogged_in(TRUE);
session_set_application_details($project_name, session_get_username());
$s_user_properties = session_get_user_properties();
$s_project_properties = session_get_project_properties();
$s_show_options = session_get_show_options();
$s_test_details = session_set_properties("test", $_GET);
$teststep_display_options = session_set_display_options("test_steps", $_POST);
$s_user_id = $s_user_properties['user_id'];
$s_username = $s_user_properties['username'];
$s_tempest_admin = $s_user_properties['tempest_admin'];
$s_project_rights = $s_user_properties['project_rights'];
$s_delete_rights = $s_user_properties['delete_rights'];
$s_email = $s_user_properties['email'];
$order_by = $teststep_display_options['order_by'];
$order_dir = $teststep_display_options['order_dir'];
#$project_name           = $s_project_properties['project_name'];
#$project_id				= $s_project_properties['project_id'];