/** * @return object returns the arguments for the page */ function init_args() { $args = new stdClass(); $bPostBack = sizeof($_POST); $source = $bPostBack ? "POST" : "GET"; $iParams = array("doAction" => array($source, tlInputParameter::STRING_N, 0, 50), "id" => array($source, tlInputParameter::INT_N), "keyword" => array($source, tlInputParameter::STRING_N, 0, 100), "notes" => array($source, tlInputParameter::STRING_N)); $pParams = I_PARAMS($iParams); $args = new stdClass(); $args->doAction = $pParams["doAction"]; $args->keyword_id = $pParams["id"]; $args->keyword = $pParams["keyword"]; $args->notes = $pParams["notes"]; if ($args->doAction == "edit") { $_SESSION['s_keyword_id'] = $args->keyword_id; } else { if ($args->doAction == "do_update") { $args->keyword_id = $_SESSION['s_keyword_id']; } } $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; $args->testproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; // BUGID 4066 - take care of proper escaping when magic_quotes_gpc is enabled $_REQUEST = strings_stripSlashes($_REQUEST); return $args; }
function init_args() { $_REQUEST = strings_stripSlashes($_REQUEST); $args = new stdClass(); $source = sizeof($_POST) ? "POST" : "GET"; $iParams = array("doAction" => array($source, tlInputParameter::STRING_N, 0, 50), "id" => array($source, tlInputParameter::INT_N), "testcase" => array($source, tlInputParameter::STRING_N, 0, 100), "step" => array($source, tlInputParameter::STRING_N, 0, 50), "product" => array($source, tlInputParameter::STRING_N, 0, 100), "script" => array($source, tlInputParameter::STRING_N, 0, 50), "comment" => array($source, tlInputParameter::STRING_N)); $pParams = I_PARAMS($iParams); $args->doAction = $pParams["doAction"]; $args->issue_id = $pParams["id"]; $args->testcase = $pParams["testcase"]; $args->step = $pParams["step"]; $args->product = $pParams["product"]; $args->script = $pParams["script"]; $args->comment = $pParams["comment"]; if ($args->doAction == "edit") { $_SESSION['issue_id'] = $args->issue_id; } else { if ($args->doAction == "do_update") { $args->issue_id = $_SESSION['issue_id']; } } $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; $args->testproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; $args->currentUser = $_SESSION['currentUser']; return $args; }
/** * * */ function init_args(&$dbHandler) { $args = new stdClass(); $_REQUEST = strings_stripSlashes($_REQUEST); $source = sizeof($_POST) ? "POST" : "GET"; $iParams = array("doAction" => array($source, tlInputParameter::STRING_N, 0, 50), "id" => array($source, tlInputParameter::INT_N), "name" => array($source, tlInputParameter::STRING_N, 0, 100), "notes" => array($source, tlInputParameter::STRING_N)); $pParams = I_PARAMS($iParams); $args->doAction = $pParams["doAction"]; $args->platform_id = $pParams["id"]; $args->name = $pParams["name"]; $args->notes = $pParams["notes"]; // why we need this logic ???? if ($args->doAction == "edit") { $_SESSION['platform_id'] = $args->platform_id; } else { if ($args->doAction == "do_update") { $args->platform_id = $_SESSION['platform_id']; } } $args->currentUser = $_SESSION['currentUser']; $args->tproject_name = ''; $args->tproject_id = isset($_REQUEST['tproject_id']) ? intval($_REQUEST['tproject_id']) : 0; if ($args->tproject_id > 0) { $treeMgr = new tree($dbHandler); $dummy = $treeMgr->get_node_hierarchy_info($args->tproject_id); $args->tproject_name = $dummy['name']; } return $args; }
/** * * @return object returns the arguments of the page */ function init_args() { $args = new stdClass(); $iParams = array("exec_id" => array("GET", tlInputParameter::INT_N), "bug_id" => array("GET", tlInputParameter::STRING_N, 0, config_get('field_size')->bug_id)); $pParams = I_PARAMS($iParams, $args); $args->tproject_id = isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']; return $args; }
/** * * @return object returns the arguments of the page */ function init_args() { global $g_bugInterface; $iParams = array("exec_id" => array("GET", tlInputParameter::INT_N), "bug_id" => array("GET", tlInputParameter::STRING_N, 0, $g_bugInterface->getBugIDMaxLength())); $args = new stdClass(); $pParams = I_PARAMS($iParams, $args); return $args; }
/** * @return object returns the arguments for the page */ function init_args() { $iParams = array("id" => array("GET", tlInputParameter::INT_N), "tableName" => array("GET", tlInputParameter::STRING_N, 0, 250), "title" => array("POST", tlInputParameter::STRING_N, 0, 250)); $args = new stdClass(); I_PARAMS($iParams, $args); $args->bPostBack = sizeof($_POST); return $args; }
/** * * @return object returns the arguments of the page */ function init_args() { $iParams = array("startDate" => array("POST", tlInputParameter::STRING_N, 0, 10), "endDate" => array("POST", tlInputParameter::STRING_N, 0, 10), "doAction" => array("POST", tlInputParameter::STRING_N, 0, 100), "object_id" => array("REQUEST", tlInputParameter::INT_N), "object_type" => array("REQUEST", tlInputParameter::STRING_N, 0, 15), "logLevel" => array("POST", tlInputParameter::ARRAY_INT), "testers" => array("REQUEST", tlInputParameter::ARRAY_INT)); $args = new stdClass(); I_PARAMS($iParams, $args); $args->currentUser = $_SESSION['currentUser']; return $args; }
function init_args() { $iParams = array("rolename" => array("POST", tlInputParameter::STRING_N, 0, 100), "roleid" => array("REQUEST", tlInputParameter::INT_N), "doAction" => array("REQUEST", tlInputParameter::STRING_N, 0, 100), "notes" => array("POST", tlInputParameter::STRING_N), "grant" => array("POST", tlInputParameter::ARRAY_STRING_N)); $args = new stdClass(); $pParams = I_PARAMS($iParams, $args); $args->basehref = $_SESSION['basehref']; return $args; }
function init_args() { $iParams = array("doAction" => array("GET", tlInputParameter::STRING_N, 0, 50), "export_filename" => array("POST", tlInputParameter::STRING_N, 0, 255), "exportType" => array("POST", tlInputParameter::STRING_N, 0, 255)); $args = new stdClass(); $pParams = I_PARAMS($iParams, $args); $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; $args->testproject_name = $_SESSION['testprojectName']; return $args; }
/** * * @return object returns the arguments of the page */ function init_args() { $iParams = array("startDate" => array("POST", tlInputParameter::STRING_N, 0, 10), "endDate" => array("POST", tlInputParameter::STRING_N, 0, 10), "doAction" => array("POST", tlInputParameter::STRING_N, 0, 100), "object_id" => array("REQUEST", tlInputParameter::INT_N), "object_type" => array("REQUEST", tlInputParameter::STRING_N, 0, 15), "logLevel" => array("POST", tlInputParameter::ARRAY_INT), "testers" => array("REQUEST", tlInputParameter::ARRAY_INT)); $args = new stdClass(); I_PARAMS($iParams, $args); // take care of proper escaping when magic_quotes_gpc is enabled $_REQUEST = strings_stripSlashes($_REQUEST); $args->currentUser = $_SESSION['currentUser']; return $args; }
/** * * @return object returns the arguments of the page */ function init_args() { global $g_bugInterface; $iParams = array("exec_id" => array("GET", tlInputParameter::INT_N), "bug_id" => array("GET", tlInputParameter::STRING_N, 0, $g_bugInterface->getBugIDMaxLength())); $args = new stdClass(); $pParams = I_PARAMS($iParams, $args); // BUGID 4066 - take care of proper escaping when magic_quotes_gpc is enabled $_REQUEST = strings_stripSlashes($_REQUEST); return $args; }
/** * @return object returns the arguments for the page */ function init_args() { $iParams = array("id" => array("GET", tlInputParameter::INT_N), "tableName" => array("GET", tlInputParameter::STRING_N, 0, 250), "title" => array("POST", tlInputParameter::STRING_N, 0, 250)); $args = new stdClass(); I_PARAMS($iParams, $args); // BUGID 4066 - take care of proper escaping when magic_quotes_gpc is enabled $_REQUEST = strings_stripSlashes($_REQUEST); $args->bPostBack = sizeof($_POST); return $args; }
/** * * @return object returns the arguments of the page */ function init_args() { $iParams = array("exec_id" => array("GET", tlInputParameter::INT_N), "bug_id" => array("POST", tlInputParameter::STRING_N), "tproject_id" => array("REQUEST", tlInputParameter::INT_N), "tcversion_id" => array("REQUEST", tlInputParameter::INT_N), "user_action" => array("REQUEST", tlInputParameter::STRING_N)); $args = new stdClass(); I_PARAMS($iParams, $args); if ($args->exec_id) { $_SESSION['bugAdd_execID'] = $args->exec_id; } else { $args->exec_id = isset($_SESSION['bugAdd_execID']) ? $_SESSION['bugAdd_execID'] : 0; } return $args; }
function init_args() { $_REQUEST = strings_stripSlashes($_REQUEST); $args = new stdClass(); $source = sizeof($_POST) ? "POST" : "GET"; $iParams = array("doAction" => array($source, tlInputParameter::STRING_N, 0, 50)); $pParams = I_PARAMS($iParams); $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; $args->testproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; $args->currentUser = $_SESSION['currentUser']; return $args; }
/** * * @return object returns the arguments of the page */ function init_args($bugInterface) { $iParams = array("exec_id" => array("GET", tlInputParameter::INT_N), "bug_id" => array("POST", tlInputParameter::STRING_N, 0, $bugInterface->getBugIDMaxLength())); $args = new stdClass(); I_PARAMS($iParams, $args); if ($args->exec_id) { $_SESSION['bugAdd_execID'] = $args->exec_id; } else { $args->exec_id = isset($_SESSION['bugAdd_execID']) ? $_SESSION['bugAdd_execID'] : 0; } return $args; }
/** * * @return object returns the arguments of the page */ function init_args($bugInterface) { $iParams = array("exec_id" => array("GET", tlInputParameter::INT_N), "bug_id" => array("POST", tlInputParameter::STRING_N, 0, $bugInterface->getBugIDMaxLength())); $args = new stdClass(); I_PARAMS($iParams, $args); // BUGID 4066 - take care of proper escaping when magic_quotes_gpc is enabled $_REQUEST = strings_stripSlashes($_REQUEST); if ($args->exec_id) { $_SESSION['bugAdd_execID'] = $args->exec_id; } else { $args->exec_id = isset($_SESSION['bugAdd_execID']) ? $_SESSION['bugAdd_execID'] : 0; } return $args; }
function init_args() { $iParams = array("firstName" => array("POST", tlInputParameter::STRING_N, 0, 30), "lastName" => array("REQUEST", tlInputParameter::STRING_N, 0, 30), "emailAddress" => array("REQUEST", tlInputParameter::STRING_N, 0, 100), "locale" => array("POST", tlInputParameter::STRING_N, 0, 10), "oldpassword" => array("POST", tlInputParameter::STRING_N, 0, 32), "newpassword" => array("POST", tlInputParameter::STRING_N, 0, 32), "doAction" => array("POST", tlInputParameter::STRING_N, 0, 15, null, 'checkDoAction')); $pParams = I_PARAMS($iParams); $args = new stdClass(); $args->user = new stdClass(); $args->user->firstName = $pParams["firstName"]; $args->user->lastName = $pParams["lastName"]; $args->user->emailAddress = $pParams["emailAddress"]; $args->user->locale = $pParams["locale"]; $args->oldpassword = $pParams["oldpassword"]; $args->newpassword = $pParams["newpassword"]; $args->doAction = $pParams["doAction"]; $args->userID = isset($_SESSION['currentUser']) ? $_SESSION['currentUser']->dbID : 0; return $args; }
/** * @return object returns the arguments for the page */ function init_args(&$dbHandler) { $args = new stdClass(); $_REQUEST = strings_stripSlashes($_REQUEST); $source = sizeof($_POST) ? "POST" : "GET"; $iParams = array("doAction" => array($source, tlInputParameter::STRING_N, 0, 50), "id" => array($source, tlInputParameter::INT_N), "keyword" => array($source, tlInputParameter::STRING_N, 0, 100), "notes" => array($source, tlInputParameter::STRING_N), "tproject_id" => array($source, tlInputParameter::INT_N)); $pParams = I_PARAMS($iParams); $args = new stdClass(); $args->doAction = $pParams["doAction"]; $args->keyword_id = $pParams["id"]; $args->keyword = $pParams["keyword"]; $args->notes = $pParams["notes"]; $args->tproject_name = ''; if (($args->tproject_id = $pParams["tproject_id"]) > 0) { $treeMgr = new tree($dbHandler); $dummy = $treeMgr->get_node_hierarchy_info($args->tproject_id); $args->tproject_name = $dummy['name']; } return $args; }
/** * @return object returns the arguments for the page */ function init_args() { $args = new stdClass(); $bPostBack = sizeof($_POST); $source = $bPostBack ? "POST" : "GET"; $iParams = array("doAction" => array($source, tlInputParameter::STRING_N, 0, 50), "id" => array($source, tlInputParameter::INT_N), "keyword" => array($source, tlInputParameter::STRING_N, 0, 100), "notes" => array($source, tlInputParameter::STRING_N)); $pParams = I_PARAMS($iParams); $args = new stdClass(); $args->doAction = $pParams["doAction"]; $args->keyword_id = $pParams["id"]; $args->keyword = $pParams["keyword"]; $args->notes = $pParams["notes"]; if ($args->doAction == "edit") { $_SESSION['s_keyword_id'] = $args->keyword_id; } else { if ($args->doAction == "do_update") { $args->keyword_id = $_SESSION['s_keyword_id']; } } $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; $args->testproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; return $args; }
function init_args() { $args = new stdClass(); $source = sizeof($_POST) ? "POST" : "GET"; $iParams = array("doAction" => array($source, tlInputParameter::STRING_N, 0, 50), "id" => array($source, tlInputParameter::INT_N), "name" => array($source, tlInputParameter::STRING_N, 0, 100), "notes" => array($source, tlInputParameter::STRING_N)); $pParams = I_PARAMS($iParams); $args->doAction = $pParams["doAction"]; $args->platform_id = $pParams["id"]; $args->name = $pParams["name"]; $args->notes = $pParams["notes"]; // why we need this logic ???? if ($args->doAction == "edit") { $_SESSION['platform_id'] = $args->platform_id; } else { if ($args->doAction == "do_update") { $args->platform_id = $_SESSION['platform_id']; } } $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; $args->testproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; $args->currentUser = $_SESSION['currentUser']; return $args; }
/** * * */ function init_args() { $_REQUEST = strings_stripSlashes($_REQUEST); $args = new stdClass(); $source = sizeof($_POST) ? "POST" : "GET"; $iParams = array("doAction" => array($source, tlInputParameter::STRING_N, 0, 50), "id" => array($source, tlInputParameter::INT_N), "name" => array($source, tlInputParameter::STRING_N, 0, 100), "supportl3" => array($source, tlInputParameter::INT_N), "isboxswitch" => array($source, tlInputParameter::INT_N), "linespeed" => array($source, tlInputParameter::INT_N), "affirm2devicegroup" => array($source, tlInputParameter::INT_N), "affirm3devicegroup" => array($source, tlInputParameter::INT_N), "functiondevicegroup" => array($source, tlInputParameter::INT_N), "performance_id" => array($source, tlInputParameter::INT_N), "notes" => array($source, tlInputParameter::STRING_N)); $pParams = I_PARAMS($iParams); $args->doAction = $pParams["doAction"]; $args->platform_id = $pParams["id"]; $args->name = $pParams["name"]; $args->notes = $pParams["notes"]; // why we need this logic ???? if ($args->doAction == "edit") { $_SESSION['platform_id'] = $args->platform_id; } else { if ($args->doAction == "do_update") { $args->platform_id = $_SESSION['platform_id']; } } $args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; $args->testproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; $args->currentUser = $_SESSION['currentUser']; return $args; }
/** * Fetches the input parameters from POST * * @param string $source name of the source to fetch could be "POST", "GET", "REQUEST" * @param array $paramInfo generic array about the parameter see examples below of usage * @param object $args an optional object to which each parameter is added as a property * * @return array returns the array with the fetched parameter, keys are the same as in $paramInfo */ function GPR_PARAMS($source, $paramInfo, &$args = null) { foreach ($paramInfo as $pName => &$info) { array_unshift($info, $source); } return I_PARAMS($paramInfo, $args); }
/** * Does what init_args() usually does in scripts: Reads the user input * from request ($_GET and $_POST). Then it modifies configuration, * settings and filters according to that user input. * While the implementation here loads generic input (unrelated to choice of * test case or requirements for the tree), it will be extended by * child classes to load input specific for requirements and test cases. */ protected function init_args() { $this->args = new stdClass(); $this->args->basehref = $_SESSION['basehref']; // get user's data $this->user = $_SESSION['currentUser']; $this->args->user_id = $this->user->dbID; $this->args->user_name = $this->user->getDisplayName(); $this->args->testproject_id = isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : 0; if ($this->args->testproject_id <= 0) { $msg = "Class: " . __CLASS__ . " - Method: " . __FUNCTION__ . " :: Test project ID <= 0 "; throw new Exception($msg); } $tree_mgr = new tree($this->db); $dummy = $tree_mgr->get_node_hierarchy_info($this->args->testproject_id); $this->args->testproject_name = $dummy['name']; $this->args->testplan_name = ''; if ($this->args->testplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : 0) { $dummy = $tree_mgr->get_node_hierarchy_info($this->args->testplan_id); $this->args->testplan_name = $dummy['name']; } unset($tree_mgr); $params = array(); $params['setting_refresh_tree_on_action'] = array("POST", tlInputParameter::CB_BOOL); $params['hidden_setting_refresh_tree_on_action'] = array("POST", tlInputParameter::INT_N); I_PARAMS($params, $this->args); // was a filter reset requested? $this->args->reset_filters = false; if (isset($_REQUEST['btn_reset_filters'])) { $this->args->reset_filters = true; // mark filter reset in args $this->do_filtering = false; // mark that no filtering has to be done after reset } // what filter mode has been chosen? $this->args->simple_filter_mode = isset($_REQUEST[self::SIMPLE_FILTER_BUTTON_LABEL]) ? true : false; $this->args->advanced_filter_mode = isset($_REQUEST[self::ADVANCED_FILTER_BUTTON_LABEL]) ? true : false; }
/** * * */ function initEnv(&$dbHandler) { $uaWhiteList = array(); $uaWhiteList['elements'] = array('link', 'create', 'doCreate', 'add_note'); $uaWhiteList['lenght'] = array(); foreach ($uaWhiteList['elements'] as $xmen) { $uaWhiteList['lenght'][] = strlen($xmen); } $user_action['maxLengh'] = max($uaWhiteList['lenght']); $user_action['minLengh'] = min($uaWhiteList['lenght']); $iParams = array("exec_id" => array("GET", tlInputParameter::INT_N), "bug_id" => array("REQUEST", tlInputParameter::STRING_N), "tproject_id" => array("REQUEST", tlInputParameter::INT_N), "tplan_id" => array("REQUEST", tlInputParameter::INT_N), "tcversion_id" => array("REQUEST", tlInputParameter::INT_N), "bug_notes" => array("POST", tlInputParameter::STRING_N), "issueType" => array("POST", tlInputParameter::INT_N), "issuePriority" => array("POST", tlInputParameter::INT_N), "artifactComponent" => array("POST", tlInputParameter::ARRAY_INT), "artifactVersion" => array("POST", tlInputParameter::ARRAY_INT), "user_action" => array("REQUEST", tlInputParameter::STRING_N, $user_action['minLengh'], $user_action['maxLengh'])); $args = new stdClass(); I_PARAMS($iParams, $args); if ($args->exec_id) { $_SESSION['bugAdd_execID'] = intval($args->exec_id); } else { $args->exec_id = intval(isset($_SESSION['bugAdd_execID']) ? $_SESSION['bugAdd_execID'] : 0); } $args->user = $_SESSION['currentUser']; $gui = new stdClass(); switch ($args->user_action) { case 'create': case 'doCreate': $gui->pageTitle = lang_get('create_issue'); break; case 'add_note': $gui->pageTitle = lang_get('add_issue_note'); break; case 'link': default: $gui->pageTitle = lang_get('title_bug_add'); break; } $gui->msg = ''; $gui->bug_summary = ''; $gui->tproject_id = $args->tproject_id; $gui->tplan_id = $args->tplan_id; $gui->tcversion_id = $args->tcversion_id; $gui->user_action = $args->user_action; $gui->bug_id = $args->bug_id; $gui->issueType = $args->issueType; $gui->issuePriority = $args->issuePriority; $gui->artifactVersion = $args->artifactVersion; $gui->artifactComponent = $args->artifactComponent; // ----------------------------------------------------------------------- // Special processing list($itObj, $itCfg) = getIssueTracker($dbHandler, $args, $gui); // Second access to user input $bug_summary['minLengh'] = 1; $bug_summary['maxLengh'] = $itObj->getBugSummaryMaxLength(); $inputCfg = array("bug_summary" => array("POST", tlInputParameter::STRING_N, $bug_summary['minLengh'], $bug_summary['maxLengh'])); I_PARAMS($inputCfg, $args); $args->bug_id = trim($args->bug_id); switch ($args->user_action) { case 'create': if ($args->bug_id == '' && $args->exec_id > 0) { $map = get_execution($dbHandler, $args->exec_id); $args->bug_notes = $map[0]['notes']; } break; case 'doCreate': case 'add_note': case 'link': default: break; } $gui->bug_notes = $args->bug_notes = trim($args->bug_notes); $args->basehref = $_SESSION['basehref']; $tables = tlObjectWithDB::getDBTables(array('testplans')); $sql = ' SELECT api_key FROM ' . $tables['testplans'] . ' WHERE id=' . intval($args->tplan_id); $rs = $dbHandler->get_recordset($sql); $args->tplan_apikey = $rs[0]['api_key']; return array($args, $gui, $itObj, $itCfg); }
protected function init_args(&$dbHandler) { // some common user input is already read in parent class parent::init_args($dbHandler); // add settings and filters to parameter info array for request parsers $params = array(); foreach ($this->all_settings as $name => $info) { if (is_array($info)) { $params[$name] = $info; } } foreach ($this->all_filters as $name => $info) { if (is_array($info)) { $params[$name] = $info; } } I_PARAMS($params, $this->args); }
function init_args(&$dbHandler, $cfgObj) { $args = new stdClass(); $_REQUEST = strings_stripSlashes($_REQUEST); // Settings and Filters that we put on session to create some // sort of persistent scope, because we have had issues when passing this info // using GET mode (size limits) // // we get info about build_id, platform_id, etc ... getSettingsAndFilters($args); manageCookies($args, $cfgObj); // need to comunicate with left frame, will do via $_SESSION and form_token if (($args->treeFormToken = isset($_REQUEST['form_token']) ? $_REQUEST['form_token'] : 0) > 0) { // do not understand why this do not works OK // $_SESSION[$args->treeFormToken]['loadExecDashboard'] = false; $_SESSION['loadExecDashboard'][$args->treeFormToken] = false; } if (is_null($args->refreshTree)) { $args->refreshTree = isset($_REQUEST['refresh_tree']) ? intval($_REQUEST['refresh_tree']) : 0; } $args->assignTask = isset($_REQUEST['assignTask']) ? 1 : 0; $args->createIssue = isset($_REQUEST['createIssue']) ? 1 : 0; $args->copyIssues = isset($_REQUEST['copyIssues']) ? 1 : 0; $args->tc_id = null; $args->tsuite_id = null; $args->user = $_SESSION['currentUser']; $args->user_id = intval($args->user->dbID); $args->id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; $args->caller = isset($_REQUEST['caller']) ? $_REQUEST['caller'] : 'exec_feature'; $args->reload_caller = false; $args->doExec = isset($_REQUEST['execute_cases']) ? 1 : 0; $args->doDelete = isset($_REQUEST['do_delete']) ? $_REQUEST['do_delete'] : 0; $args->doMoveNext = isset($_REQUEST['move2next']) ? $_REQUEST['move2next'] : 0; $args->doMovePrevious = isset($_REQUEST['move2previous']) ? $_REQUEST['move2previous'] : 0; $args->moveTowards = $args->doMoveNext ? 'forward' : ($args->doMovePrevious ? 'backward' : null); // can be a list, will arrive via form POST $args->tc_versions = isset($_REQUEST['tc_version']) ? $_REQUEST['tc_version'] : null; $key2loop = array('level' => '', 'status' => null, 'statusSingle' => null, 'do_bulk_save' => 0, 'save_results' => 0, 'save_and_next' => 0, 'save_and_exit' => 0); foreach ($key2loop as $key => $value) { $args->{$key} = isset($_REQUEST[$key]) ? $_REQUEST[$key] : $value; } // See details on: "When nullify filter_status - 20080504" in this file if ($args->level == 'testcase' || is_null($args->filter_status) || !is_array($args->filter_status) && trim($args->filter_status) == '') { $args->filter_status = null; } else { // 20130306 - franciscom // This (without the strlen() check) generated issue 5541: When "Result" filter is used ... // at least when result DIFFERENT that NOT RUN is used on filter // // 20120616 - franciscom // some strange thing to investigate, seems that unserialize is invoked // under the hood when getting data from $_REQUEST, then this piece // of code not only will be useless BUT WRONG, because will try // to unserialize something that IS NOT SERIALIZED!!!! // After TICKET 6651, may be need to limit size of $args->filter_status if (is_string($args->filter_status) && strlen($args->filter_status) > 1) { $args->filter_status = json_decode($args->filter_status); } } switch ($args->level) { case 'testcase': $args->tc_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null; if (!is_null($args->tc_versions)) { $args->tc_id = current($args->tc_versions); $args->id = $args->tc_id; $args->version_id = key($args->tc_versions); } $args->tsuite_id = null; break; case 'testsuite': $args->tsuite_id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : null; $args->tc_id = null; break; } $args->tsuitesInBranch = null; if (!is_null($args->tsuite_id)) { // will get all test suites in this branch, in order to limit amount of data returned // by functions/method that collect linked tcversions // THIS COLLECT ONLY FIRST LEVEL UNDER test suite, do not do deep search // Need to understand is still needed $tsuite_mgr = new testsuite($dbHandler); $xx = $tsuite_mgr->get_children($args->tsuite_id, array('details' => 'id')); $ldx = count($xx); $xx[$ldx] = $args->tsuite_id; $args->tsuitesInBranch = $xx; unset($tsuite_mgr); } // TICKET 5630: Test Results by direct link ... $args->tplan_id = intval(isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID']); $args->tproject_id = intval(isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID']); if ($args->tproject_id <= 0) { $tree_mgr = new tree($dbHandler); $dm = $tree_mgr->get_node_hierarchy_info($args->tplan_id); $args->tproject_id = $dm['parent_id']; } // Do this only on single execution mode // get issue tracker config and object to manage TestLink - BTS integration $args->itsCfg = null; $its = null; $tproject_mgr = new testproject($dbHandler); $info = $tproject_mgr->get_by_id($args->tproject_id); unset($tproject_mgr); $bug_summary['minLengh'] = 1; $bug_summary['maxLengh'] = 1; if ($args->issue_tracker_enabled = $info['issue_tracker_enabled']) { $it_mgr = new tlIssueTracker($dbHandler); $its = $it_mgr->getInterfaceObject($args->tproject_id); $bug_summary['maxLengh'] = $its->getBugSummaryMaxLength(); $args->itsCfg = $it_mgr->getLinkedTo($args->tproject_id); unset($it_mgr); } $inputCfg = array("bug_notes" => array("POST", tlInputParameter::STRING_N), "issueType" => array("POST", tlInputParameter::INT_N), "issuePriority" => array("POST", tlInputParameter::INT_N), "artifactComponent" => array("POST", tlInputParameter::ARRAY_INT), "artifactVersion" => array("POST", tlInputParameter::ARRAY_INT)); $inputCfg["bug_summary"] = array("POST", tlInputParameter::STRING_N); if (!$args->do_bulk_save) { $inputCfg["bug_summary"][2] = $bug_summary['minLengh']; $inputCfg["bug_summary"][3] = $bug_summary['maxLengh']; } I_PARAMS($inputCfg, $args); $args->basehref = $_SESSION['basehref']; return array($args, $its); }
/** * Does what init_args() usually does in scripts: Reads the user input * from request ($_GET and $_POST). Then it modifies configuration, * settings and filters according to that user input. * While the implementation here loads generic input (unrelated to choice of * test case or requirements for the tree), it will be extended by * child classes to load input specific for requirements and test cases. */ protected function init_args() { $this->args = new stdClass(); $this->args->basehref = $_SESSION['basehref']; // get user's data $this->user = $_SESSION['currentUser']; $this->args->user_id = $this->user->dbID; $this->args->user_name = $this->user->getDisplayName(); $this->args->testproject_id = isset($_SESSION['testprojectID']) ? $_SESSION['testprojectID'] : 0; $this->args->testproject_name = isset($_SESSION['testprojectName']) ? $_SESSION['testprojectName'] : 0; $params = array(); // 20100803 - asimon - corrected error in parameter initializing $params['setting_refresh_tree_on_action'] = array("POST", tlInputParameter::CB_BOOL); $params['hidden_setting_refresh_tree_on_action'] = array("POST", tlInputParameter::INT_N); I_PARAMS($params, $this->args); // was a filter reset requested? $this->args->reset_filters = false; if (isset($_REQUEST['btn_reset_filters'])) { $this->args->reset_filters = true; // mark filter reset in args $this->do_filtering = false; // mark that no filtering has to be done after reset } // what filter mode has been chosen? $this->args->simple_filter_mode = isset($_REQUEST[self::SIMPLE_FILTER_BUTTON_LABEL]) ? true : false; $this->args->advanced_filter_mode = isset($_REQUEST[self::ADVANCED_FILTER_BUTTON_LABEL]) ? true : false; }
/** * Does what init_args() usually does in all scripts: Reads the user input * from request ($_GET and $_POST). * Later configuration, settings and filters get modified according to that user input. */ protected function init_args() { // some common user input is already read in parent class parent::init_args(); // add settings and filters to parameter info array for request parsers $params = array(); foreach ($this->all_settings as $name => $info) { if (is_array($info)) { $params[$name] = $info; } } // Do first get, to have info that can change config I_PARAMS($params, $this->args); if ($this->args->advanced_filter_mode) { switch ($this->mode) { case 'plan_add_mode': $this->all_filters['filter_workflow_status'] = array("POST", tlInputParameter::ARRAY_INT); $this->all_filters['filter_importance'] = array("POST", tlInputParameter::ARRAY_INT); break; } } foreach ($this->all_filters as $name => $info) { if (is_array($info)) { $params[$name] = $info; } } I_PARAMS($params, $this->args); $type = 'filter_keywords_filter_type'; $this->args->{$type} = isset($_REQUEST[$type]) ? trim($_REQUEST[$type]) : 'Or'; $extra_keys = array('filter_result_result', 'filter_result_method', 'filter_result_build'); foreach ($extra_keys as $ek) { $this->args->{$ek} = isset($_REQUEST[$ek]) ? $_REQUEST[$ek] : null; } $this->args->{'filter_assigned_user_include_unassigned'} = isset($_REQUEST['filter_assigned_user_include_unassigned']) ? 1 : 0; // got session token sent by form or do we have to generate a new one? $sent_token = null; $this->args->form_token = null; if (isset($_REQUEST['form_token'])) { $sent_token = $_REQUEST['form_token']; } if (!is_null($sent_token) && isset($_SESSION[$this->mode][$sent_token])) { // sent token is valid $this->form_token = $sent_token; $this->args->form_token = $sent_token; } else { $this->generate_form_token(); } // "feature" is needed for plan and edit modes $this->args->feature = isset($_REQUEST['feature']) ? trim($_REQUEST['feature']) : null; $doLog = false; switch ($this->mode) { case 'plan_mode': switch ($this->args->feature) { case 'planUpdateTC': case 'test_urgency': case 'tc_exec_assignment': break; default: $doLog = true; break; } break; case 'edit_mode': switch ($this->args->feature) { case 'edit_tc': case 'keywordsAssign': case 'assignReqs': break; default: $doLog = true; break; } break; } if ($doLog) { tLog(__CLASS__ . ' :: Mode:' . $this->mode . ' - Wrong or missing GET argument: feature', 'ERROR'); exit; } }
/** * * */ function initArgsIssueOnSteps(&$argsObj, $bugSummaryProp) { $arrayOfInt = array("POST", tlInputParameter::ARRAY_INT); $cfg = array("issueBodyForStep" => array("POST", tlInputParameter::ARRAY_STRING_N), "issueTypeForStep" => $arrayOfInt, "issuePriorityForStep" => $arrayOfInt); $cfg["issueSummaryForStep"] = array("POST", tlInputParameter::ARRAY_STRING_N); // hmm this MAGIC needs to be commented if (!$argsObj->do_bulk_save) { $cfg["issueSummaryForStep"][2] = $bugSummaryProp['minLengh']; $cfg["issueSummaryForStep"][3] = $bugSummaryProp['maxLengh']; } I_PARAMS($cfg, $argsObj); // Special $sk = array('issueForStep', 'artifactComponentForStep', 'artifactVersionForStep'); foreach ($sk as $kt) { $argsObj->{$kt} = null; if (isset($_REQUEST[$kt])) { $argsObj->{$kt} = $_REQUEST[$kt]; } } }
/** * Does what init_args() usually does in all scripts: Reads the user input * from request ($_GET and $_POST). Later configuration, * settings and filters get modified according to that user input. */ protected function init_args() { // some common user input is already read in parent class parent::init_args(); // add settings and filters to parameter info array for request parsers $params = array(); foreach ($this->all_settings as $name => $info) { if (is_array($info)) { $params[$name] = $info; } } foreach ($this->all_filters as $name => $info) { if (is_array($info)) { $params[$name] = $info; } } I_PARAMS($params, $this->args); $type = 'filter_keywords_filter_type'; $this->args->{$type} = isset($_REQUEST[$type]) ? trim($_REQUEST[$type]) : 'Or'; $extra_keys = array('filter_result_result', 'filter_result_method', 'filter_result_build'); foreach ($extra_keys as $ek) { $this->args->{$ek} = isset($_REQUEST[$ek]) ? $_REQUEST[$ek] : null; } $this->args->{'filter_assigned_user_include_unassigned'} = isset($_REQUEST['filter_assigned_user_include_unassigned']) ? 1 : 0; // got session token sent by form or do we have to generate a new one? $sent_token = null; $this->args->form_token = null; if (isset($_REQUEST['form_token'])) { // token got sent $sent_token = $_REQUEST['form_token']; } if (!is_null($sent_token) && isset($_SESSION[$this->mode][$sent_token])) { // sent token is valid $this->form_token = $sent_token; $this->args->form_token = $sent_token; } else { $this->generate_form_token(); } // "feature" is needed for plan and edit modes $this->args->feature = isset($_REQUEST['feature']) ? trim($_REQUEST['feature']) : null; switch ($this->mode) { case 'plan_mode': switch ($this->args->feature) { case 'planUpdateTC': case 'test_urgency': case 'tc_exec_assignment': // feature OK break; default: // feature not OK tLog("Wrong or missing GET argument 'feature'.", 'ERROR'); exit; break; } break; case 'edit_mode': switch ($this->args->feature) { case 'edit_tc': case 'keywordsAssign': case 'assignReqs': // feature OK break; default: // feature not OK tLog("Wrong or missing GET argument 'feature'.", 'ERROR'); exit; break; } break; } }