function ldap_authenticate($user_id, $password) { $ldap_server = LDAP_SERVER; $ldap_port = LDAP_PORT; $ldap_id = LDAP_ID; $ldap_pwd = LDAP_PWD; $ldap_root_dn = LDAP_DN; $ldap_proto = LDAP_PROTOCOL; //$ldap_user = '******' . $user_id . '))'; $ldap_user = '******' . $user_id . ')'; $ldapconn = ldap_connect($ldap_server, $ldap_port); if (!$ldapconn) { error_report_show("login.php", LDAP_CONNECTION_FAILED); } if (!ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, $ldap_proto)) { error_report_show("login.php", LDAP_CONNECTION_FAILED); } $ldapbind = ldap_bind($ldapconn, $ldap_id, $ldap_pwd); if (!$ldapbind) { error_report_show("login.php", INVALID_LOGIN); } $ldapsearch = ldap_search($ldapconn, $ldap_root_dn, $ldap_user); $ldapentries = ldap_get_entries($ldapconn, $ldapsearch); $authenticated = false; if ($ldapentries) { # Try to authenticate to each until we get a match for ($i = 0; $i < $ldapentries['count']; $i++) { $dn = $ldapentries[$i]['dn']; # Attempt to bind with the DN and password if (@ldap_bind($ldapconn, $dn, $password)) { $authenticated = true; break; } } } ldap_close($ldapconn); ldap_free_result($ldapsearch); return $authenticated; }
<?php # --------------------------------------------------------------------- # rth is a requirement, test, and bugtracking system # Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details #---------------------------------------------------------------------- # ------------------------------------ # Project Add Area Tested Action # # $RCSfile: project_add_area_action.php,v $ $Revision: 1.1.1.1 $ # ------------------------------------ include "./api/include_api.php"; auth_authenticate_user(); $project_id = session_get_project_id(); $redirect_page = 'project_manage_testareatested_page.php'; $proj_properties = session_get_properties("project_manage"); session_validate_form_set($_POST, $redirect_page); if (project_test_area_exists($proj_properties['project_id'], session_validate_form_get_field('area_tested_required'))) { error_report_show($redirect_page, DUPLICATE_TESTAREA); } project_add_area($proj_properties['project_id'], session_validate_form_get_field('area_tested_required')); session_validate_form_reset(); html_print_operation_successful("add_area_tested_page", $redirect_page); # ------------------------------------ # $Log: project_add_area_action.php,v $ # Revision 1.1.1.1 2005/11/30 23:00:57 gth2 # importing initial version - gth # # ------------------------------------
$ids = ""; $version_ids = ""; # if submit from test_page.php if (isset($_POST['mass_req_update']) && isset($_POST['row_req_arr'])) { $field = $_POST['action']; $post_ids = $_POST['row_req_arr']; //print_r($ids); foreach ($post_ids as $req_id => $value) { $version_array = $_POST['row_req_arr'][$req_id]; foreach ($version_array as $vers_id => $vers_val) { $version_ids .= $vers_id . "|"; } $ids .= $req_id . "|"; } } else { error_report_show($redirect_on_error, NO_REQ_SELECTED); } # Trim off last "|" $version_ids = trim($version_ids, "|"); $ids = trim($ids, "|"); switch ($field) { case 'status': $form_title = lang_get('update_req_status'); $possible_values = requirement_get_statuses(); break; case 'assigned_release': $form_title = lang_get('update_req_release'); $possible_values = admin_get_all_release_names($project_id, $blank = true); break; } print "<br>" . NEWLINE;
<?php # --------------------------------------------------------------------- # rth is a requirement, test, and bugtracking system # Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details #---------------------------------------------------------------------- # ------------------------------------ # Project Add Req Doc Type Action # # $RCSfile: project_add_reqfunctionality_action.php,v $ $Revision: 1.1.1.1 $ # ------------------------------------ include "./api/include_api.php"; auth_authenticate_user(); $project_id = session_get_project_id(); $redirect_page = 'project_manage_reqfunctionality_page.php'; $proj_properties = session_get_properties("project_manage"); session_validate_form_set($_POST, $redirect_page); if (project_reqfunctionality_exists($proj_properties['project_id'], session_validate_form_get_field('req_functionality_required'))) { error_report_show($redirect_page, DUPLICATE_REQUIREMENT_FUNCTIONALITY); } project_add_req_functionality($proj_properties['project_id'], session_validate_form_get_field('req_functionality_required')); session_validate_form_reset(); html_print_operation_successful("add_req_functionality_page", $redirect_page); # ------------------------------------ # $Log: project_add_reqfunctionality_action.php,v $ # Revision 1.1.1.1 2005/11/30 23:00:57 gth2 # importing initial version - gth # # ------------------------------------
# rth is a requirement, test, and bugtracking system # Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details #---------------------------------------------------------------------- # ------------------------------------ # Project Add Users Action # # $RCSfile: project_add_machine_action.php,v $ $Revision: 1.1.1.1 $ # ------------------------------------ include "./api/include_api.php"; auth_authenticate_user(); $project_id = session_get_project_id(); $redirect_page = 'project_manage_testmachines_page.php'; $proj_properties = session_get_properties("project_manage"); session_validate_form_set($_POST, $redirect_page); if (project_machine_exists($proj_properties['project_id'], session_validate_form_get_field('machine_name_required'))) { error_report_show($redirect_page, DUPLICATE_MACHINE_NAME); } if (project_ip_address_exists($proj_properties['project_id'], session_validate_form_get_field('machine_ip_required'))) { error_report_show($redirect_page, DUPLICATE_IP_ADDRESS); } project_add_machine($proj_properties['project_id'], session_validate_form_get_field('machine_name_required'), session_validate_form_get_field('machine_location_required'), session_validate_form_get_field('machine_ip_required')); session_validate_form_reset(); html_print_operation_successful("add_machine_page", $redirect_page); # ------------------------------------ # $Log: project_add_machine_action.php,v $ # Revision 1.1.1.1 2005/11/30 23:00:57 gth2 # importing initial version - gth # # ------------------------------------
$project_name = session_validate_form_get_field('project_name_required'); $project_folder_name = str_replace(" ", "", $project_name); $project_description = session_validate_form_get_field('project_description'); $req_docs = FILE_UPLOAD_PATH . $project_folder_name . "_req_docs/"; $test_docs = FILE_UPLOAD_PATH . $project_folder_name . "_test_docs/"; $test_run_docs = FILE_UPLOAD_PATH . $project_folder_name . "_test_run_docs/"; $test_plan_docs = FILE_UPLOAD_PATH . $project_folder_name . "_test_plan_docs/"; $defect_docs = FILE_UPLOAD_PATH . $project_folder_name . "_defect_docs/"; # check username unique if (!is_null(project_get_id($project_name))) { error_report_show($add_page, PROJECT_NOT_UNIQUE); } if (mkdir($req_docs, 0700) && mkdir($test_docs, 0700) && mkdir($test_run_docs, 0700) && mkdir($test_plan_docs, 0700) && mkdir($defect_docs, 0700)) { project_add($project_name, $project_description, $_POST['project_status'], isset($_POST['show_custom_1']) ? "Y" : "N", isset($_POST['show_custom_2']) ? "Y" : "N", isset($_POST['show_custom_3']) ? "Y" : "N", isset($_POST['show_custom_4']) ? "Y" : "N", isset($_POST['show_custom_5']) ? "Y" : "N", isset($_POST['show_custom_6']) ? "Y" : "N", isset($_POST['show_window']) ? "Y" : "N", isset($_POST['show_object']) ? "Y" : "N", isset($_POST['show_memory_stats']) ? "Y" : "N", isset($_POST['show_priority']) ? "Y" : "N", isset($_POST['show_test_input']) ? "Y" : "N", $req_docs, $test_docs, $test_run_docs, $test_plan_docs, $defect_docs); } else { error_report_show($add_page, UNABLE_TO_CREATE_PROJECT_FOLDERS); } // add new project to user settings array_push($_SESSION['s_user_projects'], $project_name); session_validate_form_reset(); html_print_operation_successful("project_add_page", $redirect_page); # ------------------------------------ # $Log: project_add_action.php,v $ # Revision 1.5 2007/02/02 03:26:42 gth2 # make new project appear in the project list box when # a new project is added - gth # # Revision 1.4 2006/12/05 04:57:21 gth2 # Allow users to rename project - gth # # Revision 1.3 2006/10/05 02:42:19 gth2
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); }
function test_import_excel($test_id, $name) { global $db; $ts_tbl = TEST_STEP_TBL; $f_ts_id = TEST_STEP_ID; $f_ts_test_id = TEST_STEP_TEST_ID; $f_ts_step_no = TEST_STEP_NO; $f_ts_action = TEST_STEP_ACTION; $f_ts_input = TEST_STEP_TEST_INPUTS; $f_ts_expected = TEST_STEP_EXPECTED; $f_info_step = TEST_STEP_INFO_STEP; $s_project_properties = session_get_project_properties(); $project_name = $s_project_properties['project_name']; $redirect_on_error = "test_step_import_csv_page.php?test_id={$test_id}"; $uploaded_file = $_FILES[$name]; $file_name = $_FILES[$name]['name']; $file_temp_name = $_FILES[$name]['tmp_name']; $file_size = $_FILES[$name]['size']; /* print"file_name = $file_name<br>"; print"file_temp_name = $uploaded_file[tmp_name]<br>"; print"file_size = $uploaded_file[size]<br>"; */ if ($file_size != '0' && is_uploaded_file($file_temp_name)) { require_once './Excel/reader.php'; // ExcelFile($filename, $encoding); $data = new Spreadsheet_Excel_Reader(); // Set output Encoding. $data->setOutputEncoding('CP1251'); /*** * if you want you can change 'iconv' to mb_convert_encoding: * $data->setUTFEncoder('mb'); * **/ /*** * By default rows & cols indeces start with 1 * For change initial index use: * $data->setRowColOffset(0); * **/ /*** * Some function for formatting output. * $data->setDefaultFormat('%.2f'); * setDefaultFormat - set format for columns with unknown formatting * * $data->setColumnFormat(4, '%.3f'); * setColumnFormat - set format for column (apply only to number fields) * **/ $data->read($uploaded_file['tmp_name']); //error_reporting(E_ALL ^ E_NOTICE); $debug = false; if (!$debug) { $q = "DELETE FROM {$ts_tbl} WHERE {$f_ts_test_id} = '{$test_id}'"; db_query($db, $q); } for ($i = 1; $i <= $data->sheets[0]['numRows']; $i++) { $step_no = ''; $action = ''; $test_input = ''; $expected = ''; $info = ''; //for ($j = 1; $j <= $data->sheets[0]['numCols']; $j++) { //echo "\"".$data->sheets[0]['cells'][$i][1]."\","; /* print"i = $i<br>"; print"j = $j<br>"; */ # Get record from CSV file $step_no = @util_html_special_chars_string($data->sheets[0]['cells'][$i][1]); $action = @util_html_special_chars_string($data->sheets[0]['cells'][$i][2]); $test_input = @util_html_special_chars_string($data->sheets[0]['cells'][$i][3]); $expected = @util_html_special_chars_string($data->sheets[0]['cells'][$i][4]); $info = @util_html_special_chars_string($data->sheets[0]['cells'][$i][5]); # We don't need to insert the column headers if ($i > 1) { # Insert into the Test Set table $q = "\tINSERT INTO {$ts_tbl}\n\t\t\t\t\t\t( {$f_ts_test_id}, {$f_ts_step_no}, {$f_ts_action}, {$f_ts_input}, {$f_ts_expected}, {$f_info_step} )\n\t\t\t\t\tVALUES\n\t\t\t\t\t\t( '{$test_id}', '{$step_no}', '{$action}', '{$test_input}', '{$expected}', '{$info}' )"; if ($debug) { print "{$q};<br>"; } else { db_query($db, $q); } } } # Create a version of the file in Test Doc Version table if the upload was successful if (file_name_exists($test_id, $file_name)) { # Get the manual_test_id from the Manual Test Doc table and add a new file version $manual_test_id = test_get_manual_test_id($test_id, $file_name); file_add_supporting_test_doc_version($file_temp_name, $file_name, $test_id, $manual_test_id, $comments = "", $file_type = ""); } else { # Add a new file file_add_supporting_test_doc($file_temp_name, $file_name, $test_id, $comments = "", $file_type = ""); } } else { # The user tried to upload and empty file error_report_show($redirect_on_error, NO_FILE_SPECIFIED); } }
$testset_id = $s_properties['testset_id']; html_window_title(); html_print_body(); html_page_title($project_name . " - " . lang_get('results_mass_update_page')); html_page_header($db, $project_name); html_print_menu(); html_test_results_menu($db, $page, $project_id, $s_properties); $ids = "" . NEWLINE; # if submit from test_page.php if (isset($_POST['mass_update']) && isset($_POST['row_results_arr'])) { $field = $_POST['action']; foreach ($_POST['row_results_arr'] as $key => $value) { $ids .= $key . ":"; } } else { error_report_show("results_page.php", NO_TESTS_SELECTED); } print "<br>" . NEWLINE; print "<form method=post action={$action_page}>" . NEWLINE; print "<div align=center>" . NEWLINE; print "<table class=width50>" . NEWLINE; print "<tr>" . NEWLINE; print "<td>" . NEWLINE; print "<table class=inner rules=none border=0>" . NEWLINE; print "<tr>" . NEWLINE; print "<td class=form-header-l colspan=2>" . lang_get('update_test_result') . "</td>" . NEWLINE; print "</tr>" . NEWLINE; util_add_spacer(); print "<tr>" . NEWLINE; print "<td class=form-lbl-r>" . lang_get('test_comments') . "</td>" . NEWLINE; print "<td class=left>" . NEWLINE;
$logged_in = session_getLogged_in(); $username = $_POST['uname']; $switch_project = $_POST['login']['switch_project']; $redirect_page = $_POST['login']['page']; $redirect_page_get = $_POST['login']['get']; # If user not logged in, then redirect back to the page they tried to login from # auth_authenticate_user() will display the login forms if (!$logged_in) { html_redirect($redirect_page . "?" . $redirect_page_get); } # Check that $switch_project is not blank and that the user has access rights to the project. # Doing this to check access rights when loggin in from urls that contain the $_GET[project_id] variable. if (!empty($switch_project) && user_has_rights(project_get_id($switch_project), user_get_id($username), USER)) { $new_project_name = $switch_project; } else { error_report_show('login.php', PROJECT_SWITCH_FAILED); } session_set_new_project_name($new_project_name); session_reset_project(); session_initialize(); session_setLogged_in(TRUE); session_set_application_details($new_project_name, session_get_username()); if (isset($_POST['javascript_disabled'])) { session_set_javascript_enabled(false); } else { session_set_javascript_enabled(true); } # redirect to the appropriate page if (!empty($redirect_page)) { html_redirect($redirect_page . "?" . $redirect_page_get); } else {
function file_add_bug_file($upload_file_temp_name, $upload_file_name, $bug_id, $redirect_page) { global $db; $bug_file_tbl = BUG_FILE_TBL; $f_bug_id = BUG_FILE_TBL . "." . BUG_FILE_BUG_ID; $f_uploaded_by = BUG_FILE_TBL . "." . BUG_FILE_UPLOAD_DATE; $f_uploaded_date = BUG_FILE_TBL . "." . BUG_FILE_UPLOAD_BY; $f_display_name = BUG_FILE_TBL . "." . BUG_FILE_DISPLAY_NAME; $f_file_name = BUG_FILE_TBL . "." . BUG_FILE_NAME; $uploaded_by = session_get_username(); $current_date = date("Y-m-d H:i:s"); $project_properties = session_get_project_properties(); $file_upload_dir = $project_properties['defect_upload_path']; # create a unique name for the file using the time function $file_db_name = "BugFile" . time() . "-{$upload_file_name}"; # Throw error if user didn't enter a file name if (!isset($upload_file_temp_name) || !is_uploaded_file($upload_file_temp_name)) { error_report_show($redirect_page, REQUIRED_FIELD_MISSING); } # Insert a record into the bugfile table if the file upload was successful if (move_uploaded_file($upload_file_temp_name, $file_upload_dir . $file_db_name)) { $q = "INSERT INTO {$bug_file_tbl}\n\t\t\t\t( {$f_bug_id}, {$f_uploaded_by}, {$f_uploaded_date}, {$f_display_name}, {$f_file_name})\n\t\t\t VALUES\n\t\t\t\t('{$bug_id}', '{$uploaded_by}', '{$current_date}', '{$upload_file_name}', '{$file_db_name}')"; //print"$q<br>"; db_query($db, $q); } }
# if reset password was successful, send out email with new password details if ($email) { $user_details = user_get_info_by_email($email); $username = $user_details[USER_UNAME]; $url = RTH_URL . "login.php"; $subject = "RTH: Password has been Reset"; $message = "Your RTH password has been reset." . NEWLINE . NEWLINE; $message .= "Username: {$username}" . NEWLINE; $message .= "Password: {$new_password}" . NEWLINE . NEWLINE; $message .= "You may change your password by clicking '" . lang_get('user_link') . "' on the RTH menu." . NEWLINE . NEWLINE; $message .= "Click the following link to login to RTH:" . NEWLINE; $message .= "{$url}"; email_send($recipients = array($email), $subject, $message, $headers = "RTH_Admin"); print lang_get("reset_password"); } else { error_report_show("login.php", ERROR_CANNOT_RESET_PASSWORD); } } print "</div>"; print "<br>"; //auth_authenticate_user(); html_print_footer(); # ------------------------------ # $Log: login_reset_password_action.php,v $ # Revision 1.8 2008/02/05 13:14:48 cryobean # bugfixes # # Revision 1.7 2006/12/05 05:29:20 gth2 # updates for 1.6.1 release # # Revision 1.6 2006/10/11 02:40:24 gth2
<?php # --------------------------------------------------------------------- # rth is a requirement, test, and bugtracking system # Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details #---------------------------------------------------------------------- # ------------------------------------ # Test if Cookies are enabled # # $RCSfile: login_cookie_test.php,v $ $Revision: 1.1.1.1 $ # ------------------------------------ include "./api/include_api.php"; $login_cookie_username = util_get_cookie(USER_COOKIE_NAME, ''); $login_cookie_pwd = util_get_cookie(PWD_COOKIE_NAME, ''); if (empty($login_cookie_username) || empty($login_cookie_pwd)) { error_report_show("login.php", COOKIES_NOT_ENABLED); exit; } html_redirect("main.php"); # ------------------------------ # $Log: login_cookie_test.php,v $ # Revision 1.1.1.1 2005/11/30 23:00:57 gth2 # importing initial version - gth # # ------------------------------
$detail = session_validate_form_get_field('req_detail_required', "", session_use_FCKeditor()); } $req_reason_for_change = session_validate_form_get_field("req_reason_change"); $project_id = $_POST['project_id']; $req_name = session_validate_form_get_field('req_name_required'); $req_area = session_validate_form_get_field('req_area_covered'); $req_type = session_validate_form_get_field('req_type'); $req_rec_or_file = $_POST['req_record_or_file']; $req_version = session_validate_form_get_field('req_version'); $req_status = session_validate_form_get_field('req_status'); $req_priority = session_validate_form_get_field('req_priority'); $req_assigned_to = session_validate_form_get_field('req_assigned_to'); $req_assign_release = session_validate_form_get_field('req_assign_release'); $req_author = session_validate_form_get_field('req_author'); $req_functionality = session_validate_form_get_field('req_functionality'); //$req_untestable = session_validate_form_get_field('chk_untestable'); if (requirement_name_exists($project_id, $req_name)) { error_report_show($add_req_page, DUPLICATE_REQ_NAME); } requirement_add($project_id, $req_name, $req_area, $req_type, $req_rec_or_file, $req_version, $req_status, $req_priority, $uploaded_filename, $detail, $req_reason_for_change, $req_assigned_to, $req_assign_release, $req_author, $req_functionality, $parent_req); session_validate_form_reset(); html_print_operation_successful('req_add_page', "requirement_page.php"); # ------------------------------------ # $Log: requirement_add_action.php,v $ # Revision 1.2 2006/01/09 02:02:14 gth2 # fixing some defects found while writing help file # # Revision 1.1.1.1 2005/11/30 23:00:57 gth2 # importing initial version - gth # # ------------------------------------
$duration = session_validate_form_get_field('test_duration'); $email_ba = session_validate_form_get_field('chk_email_ba_owner'); $email_qa = session_validate_form_get_field('chk_email_qa_owner'); $autopass = session_validate_form_get_field('chk_autopass'); //$steps = session_validate_form_get_field('chk_steps'); //$auto = session_validate_form_get_field('chk_auto'); //is not needed from now on, because of new field "chk_automanu",which validates if step XOR auto is set to YES $performance = session_validate_form_get_field('chk_performance'); $automanu = session_validate_form_get_field('chk_automanu'); $steps = ''; $auto = ''; if (!util_date_isvalid($dateassigned) || !util_date_isvalid($dateexpcomplete) || !util_date_isvalid($dateactcomplete) || !util_date_isvalid($datebasignoff)) { error_report_show("test_add_page.php", INVALID_DATE); } if (test_name_exists($project_id, $testname)) { error_report_show("test_add_page.php", DUPLICATE_TESTNAME); } // Set default values for email_qa_owner and email_ba_owner if ($email_ba == '') { $email_ba = 'N'; } if ($email_qa == '') { $email_qa = 'N'; } // set value of $steps XOR $auto to YES if ($automanu == 'man') { $steps = 'YES'; } else { if ($automanu == 'auto') { $auto = 'YES'; }
<?php # --------------------------------------------------------------------- # rth is a requirement, test, and bugtracking system # Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details #---------------------------------------------------------------------- # ------------------------------------ # Project Manual Doc Type Action # # $RCSfile: project_add_testdoctype_action.php,v $ $Revision: 1.1.1.1 $ # ------------------------------------ include "./api/include_api.php"; auth_authenticate_user(); $project_id = session_get_project_id(); $redirect_page = 'project_manage_testdoctype_page.php'; $proj_properties = session_get_properties("project_manage"); session_validate_form_set($_POST, $redirect_page); if (project_test_doc_type_exists($proj_properties['project_id'], session_validate_form_get_field('test_doc_type_required'))) { error_report_show($redirect_page, DUPLICATE_TEST_DOC_TYPE); } project_add_test_doc_type($proj_properties['project_id'], session_validate_form_get_field('test_doc_type_required')); session_validate_form_reset(); html_print_operation_successful("add_test_doc_type_page", $redirect_page); # ------------------------------------ # $Log: project_add_testdoctype_action.php,v $ # Revision 1.1.1.1 2005/11/30 23:00:57 gth2 # importing initial version - gth # # ------------------------------------
//$auto = session_validate_form_get_field('chk_auto'); $performance = session_validate_form_get_field('chk_performance'); $email = session_validate_form_get_field('email'); $duration = session_validate_form_get_field('test_duration'); $email_ba_owner = session_validate_form_get_field('chk_email_ba_owner'); $email_qa_owner = session_validate_form_get_field('chk_email_qa_owner'); $current_status = session_validate_form_get_field('current_test_status'); $send_email = false; $automanu = session_validate_form_get_field('chk_automanu'); $steps = ''; $auto = ''; if (!util_date_isvalid($dateassigned) || !util_date_isvalid($dateexpcomplete) || !util_date_isvalid($dateactcomplete)) { error_report_show("test_detail_update_page.php", INVALID_DATE); } if (test_name_exists_with_id($project_id, $testname, $test_id)) { error_report_show("test_detail_update_page.php", DUPLICATE_TESTNAME); } // set value of $steps XOR $auto to YES if ($automanu == 'man') { $steps = 'YES'; } else { if ($automanu == 'auto') { $auto = 'YES'; } } // UPDATE TEST test_update_test($test_id, $test_version_id, $testname, $testpurpose, $testcomments, $testpriority, $teststatus, $testareatested, $testtype, $ba_owner, $qa_owner, $tester, $assigned_to, $assigned_by, $dateassigned, $dateexpcomplete, $dateactcomplete, $duration, $autopass, $steps, $auto, $performance, $email_ba_owner, $email_qa_owner); # Email the ba owner or qa owner on status change if ($current_status != $teststatus) { $test_detail = test_get_detail($test_id); if ($email_ba_owner == 'Y' && $test_detail[TEST_BA_OWNER] != '' && $username != $test_detail[TEST_BA_OWNER]) {
$project_id = $project_properties['project_id']; html_window_title(); html_print_body(); html_page_title($project_name . " - " . lang_get('test_mass_update_page')); html_page_header($db, $project_name); html_print_menu(); test_menu_print($page); $ids = ""; # if submit from test_page.php if (isset($_POST['mass_update_btn']) && isset($_POST['row_test_arr'])) { $field = $_POST['action']; foreach ($_POST['row_test_arr'] as $key => $value) { $ids .= $key . ":"; } } else { error_report_show("test_page.php", NO_TESTS_SELECTED); } switch ($field) { case 'man_auto': $form_title = lang_get('update_man_auto'); $possible_values = test_get_man_auto_values(); break; case 'ba_owner': $form_title = lang_get('update_ba_owner'); $possible_values = user_get_baowners_by_project($project_id, $blank = true); break; case 'qa_owner': $form_title = lang_get('update_qa_owner'); $possible_values = user_get_qaowners_by_project($project_id, $blank = true); break; case 'tester':
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details #---------------------------------------------------------------------- # ------------------------------------ # $RCSfile: field_add_action.php,v $ # $Revision $ # ------------------------------------ include "./api/include_api.php"; auth_authenticate_user(); $s_project_properties = session_get_project_properties(); $project_id = $s_project_properties['project_id']; $redirect_page = 'field_add_page.php'; $redirect_on_error = 'field_add_page.php'; $screen_id = session_validate_form_get_field('screen_id'); # Make sure user completed required fields session_validate_form_set($_POST, $redirect_page); # Make sure the screen name doesn't already exist for this project $num = test_field_name_exists(session_validate_form_get_field('field_name_required'), session_validate_form_get_field('screen_id')); if ($num > 0) { error_report_show($redirect_page, DUPLICATE_FIELD_NAME); } test_add_field(session_validate_form_get_field('field_name_required'), session_validate_form_get_field('screen_id'), session_validate_form_get_field('field_desc'), session_validate_form_get_field('field_order'), session_validate_form_get_field('text_box')); session_validate_form_reset(); html_print_operation_successful('field_page', $redirect_page); # ------------------------------------ # $Log: field_add_action.php,v $ # Revision 1.1 2006/05/03 20:18:31 gth2 # no message # # ------------------------------------
# See the README and LICENSE files for details #---------------------------------------------------------------------- # ------------------------------------ # Page name # # $RCSfile: build_edit_action.php,v $ $Revision: 1.2 $ # ------------------------------------ include "./api/include_api.php"; auth_authenticate_user(); #### Change to correct redirect page #### $redirect_page = 'build_page.php'; $edit_page = 'build_edit_page.php'; $s_release_properties = session_set_properties("release"); session_validate_form_set($_POST, $edit_page); if (admin_build_name_exists($s_release_properties['release_id'], session_validate_form_get_field('build_edit_name_required'))) { error_report_show($edit_page, DUPLICATE_BUILD_NAME); } #### Call api function to add/update database passing in form field values #### admin_edit_build(session_validate_form_get_field('build_id'), session_validate_form_get_field('build_edit_name_required'), session_validate_form_get_field('build_edit_date'), session_validate_form_get_field('build_edit_description')); session_validate_form_reset(); html_print_operation_successful('build_page', $redirect_page); # ------------------------------------ # $Log: build_edit_action.php,v $ # Revision 1.2 2008/08/08 11:22:10 peter_thal # disabled update buildname to an existing buildname # test_detail_update_action.php: changed redirect page on error # # Revision 1.1.1.1 2005/11/30 23:00:56 gth2 # importing initial version - gth # # ------------------------------------
# rth is a requirement, test, and bugtracking system # Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details #---------------------------------------------------------------------- # ------------------------------------ # Project Add Users Action # # $RCSfile: project_add_users_action.php,v $ $Revision: 1.2 $ # ------------------------------------ include "./api/include_api.php"; auth_authenticate_user(); $project_id = session_get_project_id(); $redirect_page = 'project_manage_page.php'; $proj_properties = session_get_properties("project_manage"); session_validate_form_set($_POST, $redirect_page); if (!isset($_POST['add_users'])) { error_report_show($redirect_page, REQUIRED_FIELD_MISSING); } project_add_users($proj_properties['project_id'], $_POST['add_users'], $_POST['add_users_rights'], isset($_POST['add_user_delete_rights']) ? "Y" : "N", isset($_POST['add_user_email_testset']) ? "Y" : "N", isset($_POST['add_user_email_discussions']) ? "Y" : "N", isset($_POST['add_user_qa_tester']) ? "Y" : "N", isset($_POST['add_user_ba_tester']) ? "Y" : "N"); session_validate_form_reset(); html_print_operation_successful("add_users_page", $redirect_page . "#users"); # ------------------------------------ # $Log: project_add_users_action.php,v $ # Revision 1.2 2006/02/27 17:26:16 gth2 # added email functionality to bug tracker - gth # # Revision 1.1.1.1 2005/11/30 23:00:57 gth2 # importing initial version - gth # # ------------------------------------
<?php # --------------------------------------------------------------------- # rth is a requirement, test, and bugtracking system # Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details #---------------------------------------------------------------------- # ------------------------------------ # Project Add Req Area Covered Action # # $RCSfile: project_add_reqareacovered_action.php,v $ $Revision: 1.1.1.1 $ # ------------------------------------ include "./api/include_api.php"; auth_authenticate_user(); $project_id = session_get_project_id(); $redirect_page = 'project_manage_reqareacovered_page.php'; $proj_properties = session_get_properties("project_manage"); session_validate_form_set($_POST, $redirect_page); if (project_req_area_covered_exists($proj_properties['project_id'], session_validate_form_get_field('req_area_covered_required'))) { error_report_show($redirect_page, DUPLICATE_AREANAME); } project_add_req_area_covered($proj_properties['project_id'], session_validate_form_get_field('req_area_covered_required')); session_validate_form_reset(); html_print_operation_successful("add_req_area_covered_page", $redirect_page); # ------------------------------------ # $Log: project_add_reqareacovered_action.php,v $ # Revision 1.1.1.1 2005/11/30 23:00:57 gth2 # importing initial version - gth # # ------------------------------------
# # $RCSfile: requirement_change_assigned_release_page.php,v $ $Revision: 1.3 $ # --------------------------------------------------------------------- include "./api/include_api.php"; auth_authenticate_user(); $rows = array(); # if submit from requirements_page.php if (isset($_POST['submit_update'])) { foreach ($_POST as $key => $value) { $exploded_key = explode("_", $key); if ($exploded_key[0] == "row") { $rows[] = $exploded_key[1]; } } if (empty($rows)) { error_report_show("requirement_page.php", NO_REQ_SELECTED); } } # if submit from this page if (isset($_POST['submit_assigned_release'])) { foreach (explode(":", $_POST['req_ids']) as $value) { requirement_version_table_set_field($value, REQ_VERS_ASSIGN_RELEASE, $_POST['assign_release']); } html_print_operation_successful('build_page', "requirement_page.php"); } $req_ids = implode(":", $rows); $page = basename(__FILE__); $project_properties = session_get_project_properties(); $project_name = $project_properties['project_name']; $project_id = $project_properties['project_id']; html_window_title();
# Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details #---------------------------------------------------------------------- # ------------------------------------ # Page name # # $RCSfile: screen_edit_action.php,v $ # $Revision: 1.1 $ # ------------------------------------ include "./api/include_api.php"; auth_authenticate_user(); $s_project_properties = session_get_project_properties(); $project_id = $s_project_properties['project_id']; $redirect_page = 'screen_page.php'; $redirect_on_error = 'screen_edit_page.php'; session_validate_form_set($_POST, $redirect_on_error); # Make sure the screen name doesn't already exist for this project $num = test_screen_name_exists($project_id, session_validate_form_get_field('screen_name_required')); if ($num > 1) { error_report_show($redirect_page, DUPLICATE_SCREEN_NAME); } test_update_screen(session_validate_form_get_field('screen_id'), session_validate_form_get_field('screen_name_required'), session_validate_form_get_field('screen_desc'), session_validate_form_get_field('screen_order')); session_validate_form_reset(); html_print_operation_successful('screen_page', $redirect_page); # ------------------------------------ # $Log: screen_edit_action.php,v $ # Revision 1.1 2006/05/03 20:24:01 gth2 # no message # # ------------------------------------
<?php # --------------------------------------------------------------------- # rth is a requirement, test, and bugtracking system # Copyright (C) 2005 George Holbrook - rth@lists.sourceforge.net # This program is distributed under the terms and conditions of the GPL # See the README and LICENSE files for details #---------------------------------------------------------------------- # ------------------------------------ # Project Add Test Type Action # # $RCSfile: project_add_testtype_action.php,v $ $Revision: 1.1.1.1 $ # ------------------------------------ include "./api/include_api.php"; auth_authenticate_user(); $project_id = session_get_project_id(); $redirect_page = 'project_manage_testtype_page.php'; $proj_properties = session_get_properties("project_manage"); session_validate_form_set($_POST, $redirect_page); if (project_testtype_exists($proj_properties['project_id'], session_validate_form_get_field('testtype_required'))) { error_report_show($redirect_page, DUPLICATE_TESTTYPE_NAME); } project_add_testtype($proj_properties['project_id'], session_validate_form_get_field('testtype_required')); session_validate_form_reset(); html_print_operation_successful("add_testtype_page", $redirect_page); # ------------------------------------ # $Log: project_add_testtype_action.php,v $ # Revision 1.1.1.1 2005/11/30 23:00:57 gth2 # importing initial version - gth # # ------------------------------------
$redirect_page = "test_detail_page.php?test_id={$test_id}&project_id={$project_id}&tab=2"; $redirect_on_error = "test_add_doc_version_page.php?test_id={$test_id}&manual_test_id={$manual_test_id}"; session_validate_form_set($_POST, $redirect_page); # Make sure the user entered a file name $file_temp_name = $_FILES['uploadfile_required']['tmp_name']; $file_name = str_replace(" ", "_", $_FILES['uploadfile_required']['name']); $file_size = $_FILES['uploadfile_required']['size']; # Make sure the user filled in the file name. if (!isset($file_temp_name) || !is_uploaded_file($file_temp_name)) { error_report_show($redirect_on_error, REQUIRED_FIELD_MISSING); } if ($file_size != '0' && is_uploaded_file($file_temp_name)) { //print"manual_test_id = $manual_test_id<br>"; file_add_supporting_test_doc_version($file_temp_name, $file_name, $test_id, $manual_test_id, $comments, $doc_type); } else { error_report_show($redirect_on_error, FAILED_FILE_UPLOAD); } html_print_operation_successful('file_upload_page', $redirect_page); # --------------------------------------------------------------------- # $Log: test_add_doc_version_action.php,v $ # Revision 1.6 2008/08/07 10:57:51 peter_thal # Now blanks are replaced with underscores by adding a new supporting doc # # Revision 1.5 2008/08/05 07:22:33 peter_thal # fixed save bug for comment and doc type field # # Revision 1.4 2008/07/23 14:53:50 peter_thal # delete supporting docs feature added (linux/unix) # # Revision 1.3 2008/07/17 13:54:12 peter_thal # added new feature: test sets status (overview)
function session_validate_form_set($form_vars, $redirect_page = null) { $required_field_empty = false; if (empty($form_vars) && $redirect_page) { error_report_show($redirect_page, REQUIRED_FIELD_MISSING); } else { //$_SESSION['validate_form'] = array(); foreach ($form_vars as $key => $value) { # for multiple select if (is_array($value)) { $_SESSION['validate_form'][$key] = $value; # when not a multiple select } else { //$value = htmlspecialchars($value, ENT_QUOTES); $value = util_strip_slashes($value); $_SESSION['validate_form'][$key] = $value; $trimmed_value = trim($value); if (strpos($key, '_required') && empty($trimmed_value)) { $required_field_empty = true; } } } if ($required_field_empty && $redirect_page) { error_report_show($redirect_page, REQUIRED_FIELD_MISSING); } } }
$test_id = $s_test_details['test_id']; $s_user_properties = session_get_user_properties(); $s_user_id = $s_user_properties['user_id']; $test_name = test_get_name($test_id); #validation of several item existence $pm = project_get_name($project_id); 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'];
$project_properties = session_get_project_properties(); $upload_path = $project_properties['test_upload_path']; $s_user = session_get_user_properties(); $username = $s_user['username']; $test_name = test_get_name($test_id); $comments = session_validate_form_get_field('comments'); $doc_type = session_validate_form_get_field('doc_type'); $upload_file_name = $_FILES['uploadfile']['name']; $_FILES['uploadfile']['name'] = str_replace(" ", "_", $upload_file_name); # ------------------------------------------------ # FILE UPLOAD # ------------------------------------------------ if ($_FILES['uploadfile']['size'] != '0' && is_uploaded_file($_FILES['uploadfile']['tmp_name'])) { file_add_supporting_test_doc($_FILES['uploadfile']['tmp_name'], $_FILES['uploadfile']['name'], $test_id, $comments, $doc_type); } else { error_report_show($redirect_on_error, NO_FILE_SPECIFIED); } html_print_operation_successful('file_upload_page', $redirect_page); # --------------------------------------------------------------------- # $Log: test_detail_new_upload_action.php,v $ # Revision 1.8 2008/08/07 10:57:51 peter_thal # Now blanks are replaced with underscores by adding a new supporting doc # # Revision 1.7 2008/07/23 14:53:50 peter_thal # delete supporting docs feature added (linux/unix) # # Revision 1.6 2008/07/09 07:13:24 peter_thal # added direct linking of test detail by adding project_id link parameter # added automated project switching if necessary # # Revision 1.5 2006/06/30 00:39:46 gth2
$redirect_page_get = $_POST['login']['get']; $page = 'login.php'; if (isset($_POST['uname'])) { $username = $_POST['uname']; #added validation, to avoid sql injection if (!preg_match("/^[a-zA-Z0-9\\.]+\$/", $username)) { error_report_show($page, INVALID_LOGIN); } } else { $username = ''; } if (isset($_POST['pword'])) { $password = $_POST['pword']; #added validation, to avoid sql injection if (!preg_match("/^[a-zA-Z0-9\\.\\-\\*\\+\\?@_]+\$/", $password)) { error_report_show($edit_page, INVALID_LOGIN); } } else { $password = ''; } auth_attempt_login($username, $password); # save login if (isset($_POST['save_login'])) { auth_set_login_cookies($username, $password); } # check for javascript if (isset($_POST['non_javascript_browser'])) { session_set_javascript_enabled(false); } else { session_set_javascript_enabled(true); }