function lockBot($session) { global $debug; if (getSingle("SELECT restbots.lock FROM restbots WHERE restbots.session = '{$session}'") == 1) { return false; } if ($debug) { logMessage('rest', 3, "Locking session {$session}"); } if (doUpdate("UPDATE restbots SET restbots.lock = 1, restbots.timestamp = null WHERE restbots.session = '{$session}'") == 1) { return true; } else { return false; } }
doUpdate(array("0" => "maxCharField", "1" => "maxCharMsg"), 1); break; case 'security': doUpdate(array("0" => "floodTime", "1" => "moderateMsg", "2" => "autoCensor", "3" => "checkEmail", "4" => "checkCaptcha", "5" => "reCaptcha", "6" => "reCaptchapubk", "7" => "reCaptchaprvk", "8" => "debug"), 1); break; case 'languages': doUpdate(array("0" => "guestbookLang", "1" => "adminLang"), 1); break; case 'visualeffects': doUpdate(array("0" => "guestbookTheme", "1" => "mobileTheme", "2" => "pagesFormat", "3" => "numPostsPerPage", "4" => "dateFormat", "5" => "timezone"), 1); break; case 'gboffline': doUpdate(array("0" => "offline", "1" => "offlineMessage"), 1); break; case 'image': doUpdate(array("0" => "resizeImg", "1" => "imgWidth", "2" => "imgHeight"), 1); break; default: } if ($errorField != '') { echo "<div class=\"msgError\">{$errorField}</div>"; } } function showTableRow($name, $type, $var = '') { global $lang; global $config; $row = '<tr><td>' . $lang['' . $name . ''] . '</td>'; switch ($type) { case 'yesno': $row .= '<td><select name="' . $name . '">';
* Created by PhpStorm. * User: Michael Oehlhof * Date: 11.10.15 * Time: 14:17 */ //ini_set('max_execution_time', 0); //ini_set('implicit_flush', 1); //ob_implicit_flush(1); initOutput(); // Get the POST parameter and execute the appropriate action $cmd = $_POST['cmd']; $parameter = $_POST['parameter']; showForm(); switch ($cmd) { case 'update': doUpdate(); break; case 'reset': doReset(); break; case 'review': doReview($parameter); break; case 'unittest-master': doUnitTest('dev-master'); break; case 'unittest-review': doUnitTest('review'); break; default: }
$assignRolesFor = $args->featureType; $target->testprojectID = $args->featureID > 0 ? $args->featureID : null; $featureMgr =& $tprojectMgr; break; case "testplan": $gui->highlight->assign_users_tplan = 1; $gui->roles_updated = lang_get("test_plan_user_roles_updated"); $gui->not_for_you = lang_get("testplan_roles_assign_disabled"); $assignRolesFor = $args->featureType; $target->testprojectID = $args->testprojectID; $featureMgr =& $tplanMgr; break; } if ($args->featureID && $args->doUpdate && $featureMgr) { if (checkRightsForUpdate($db, $args->user, $args->testprojectID, $args->featureType, $args->featureID)) { doUpdate($db, $args, $featureMgr); if ($gui->user_feedback == '') { $gui->user_feedback = $gui->roles_updated; } } } // -------------------------------------------------------------------------- // Important: // Must be done here after having done update, to get current information $gui->users = tlUser::getAll($db, "WHERE active=1", null, null, tlUser::TLOBJ_O_GET_DETAIL_MINIMUM); checkSessionValid($db); $args->user = $_SESSION['currentUser']; // -------------------------------------------------------------------------- switch ($assignRolesFor) { case 'testproject': $info = getTestProjectEffectiveRoles($db, $tprojectMgr, $args, $gui->users);
$of->Value = getItemTemplateContents('build_template', $of->InstanceName, $args->notes); switch ($args->do_action) { case 'edit': $op = edit($args, $build_mgr, $date_format_cfg); $gui->closed_on_date = $args->closed_on_date; $of->Value = $op->notes; break; case 'create': $op = create($args); $gui->closed_on_date = $args->closed_on_date; break; case 'do_delete': $op = doDelete($args, $build_mgr); break; case 'do_update': $op = doUpdate($args, $build_mgr, $tplan_mgr, $date_format_cfg); $of->Value = $op->notes; $templateCfg->template = $op->template; break; case 'do_create': $op = doCreate($args, $build_mgr, $tplan_mgr, $date_format_cfg); $of->Value = $op->notes; $templateCfg->template = $op->template; break; } // BUGID 3716 $dummy = null; $gui->release_date = isset($op->status_ok) && $op->status_ok && $args->release_date != "" ? localize_dateOrTimeStamp(null, $dummy, 'date_format', $args->release_date) : $args->release_date_original; $gui->closed_on_date = $args->closed_on_date; $gui->operation_descr = $op->operation_descr; $gui->user_feedback = $op->user_feedback;
<?php // this file just takes requests from the links the system has emailed out as pending. // they are in response to on_demand sheduling. // this needs to be super secure. fix! require_once 'functions.inc.php'; // validate!!! fix $uid = $_GET['uid']; $decision = $_GET['approved']; $handle = openPendingFile("r"); while ($line = fgets($handle)) { if ($uid == $line . substr(0, $uid . length())) { $data = explode(',', $line); // if approved if ($decision = 'y') { require_once 'monket-calendar/monket-cal-update.php'; // fix? doUpdate("", $data[1], $data[2], $data[4], $data[5], $data[6]); } else { // TODO: // send email to student notifying them of the rejection } // the event was either added or declined. return success. return true; } }
/** * do database insert */ function doInsert() { /* refill menu from post data */ /* $this->menu->setMenuValues($_POST); */ /* now test the menu values */ if ($this->prepareForInsert()) { /* then get the data into the query */ $iq = new InsertQuery($this->dbConn, $this->relation); $iq->setKeyColumns($this->keyColumns); $cnames = $this->menu->getColumnNames(); // echo '<br> columnNames'.bvar_dump($cnames).'<br>'; $arr = $this->menu->getColumnValues($cnames); if ($this->isTransactional) { $arr['trans_id'] = $this->dbConn->createTransactionId(); } $iq->setSubmitvalueSet($arr); $iq->setUpdateSet($arr); // echo '<span style="color:red">'.bvar_dump($this->menu).'</span>'; if ($iq->areKeyColumnsSet()) { /* allow insert */ $query = $iq->getQuery(); $this->dbMessage .= 'insert query' . $query; //echo $query; $result = doUpdate($this->dbConn, $query, $this->dbMessage); if ($result < 0) { $this->dbMessage .= 'STE: Insert Failed with query ' . $query . ' db says: ' . $this->dbMessage; $this->dbConn->Execute("ROLLBACK"); } else { $this->dbMessage .= ' added ' . $result . ' record(s) '; $this->dbConn->transactionEnd(); } } else { $this->dbMessage .= 'DB ERROR: Insert failed.<br>Not all keyColumns have been set'; $this->dbConn->Execute("ROLLBACK"); } } }
$gui->cfield_is_used = $op->cf_is_used; $gui->cfield_is_linked = $op->cf_is_linked; $gui->linked_tprojects = $op->linked_tprojects; $user_feedback = $op->user_feedback; $operation_descr = $op->operation_descr; break; case 'do_add': case 'do_add_and_assign': $op = doCreate($_REQUEST, $cfield_mgr, $args); $gui->cfield = $op->cf; $user_feedback = $op->user_feedback; $templateCfg->template = $op->template; $operation_descr = ''; break; case 'do_update': $op = doUpdate($_REQUEST, $args, $cfield_mgr); $gui->cfield = $op->cf; $user_feedback = $op->user_feedback; $operation_descr = $op->operation_descr; $templateCfg->template = $op->template; break; case 'do_delete': $op = doDelete($args, $cfield_mgr); $user_feedback = $op->user_feedback; $operation_descr = $op->operation_descr; $templateCfg->template = $op->template; $do_control_combo_display = 0; break; } if ($do_control_combo_display) { $keys2loop = $cfield_mgr->get_application_areas();
include_once "utils.inc"; include_once "ste.php"; $navTitle = "Peerweb testscript " . $PHP_SELF . " on DB " . $db_name; $page = new PageContainer(); $page->setTitle('Menu'); //$dbConn->setSqlAutoLog(true); $ste = new SimpleTableEditor($dbConn, $page); $ste->setFormAction($PHP_SELF); $ste->setRelation('menu'); $ste->setMenuName('menu'); $ste->setKeyColumns(array('menu_name', 'relation_name')); $ste->setNameExpression("rtrim(menu_name,' ')||', '||rtrim(relation_name,' ')"); $ste->setOrderList(array('menu_name', 'relation_name')); $ste->setFormTemplate('templates/menu.html'); $ste->setListRowTemplate(array('menu_name', 'relation_name')); $page_opening = "Menu"; $nav = new Navigation($tutor_navtable, basename($PHP_SELF), $page_opening); $page->addBodyComponent($nav); if (isset($_POST['Insert'])) { /* try to insert menu,column_names into menu_items */ $menu_name = $_POST['menu_name']; $relation_name = $_POST['relation_name']; $sql = "insert into menu_item (menu_name,column_name,edit_type,capability,item_length) select '{$menu_name}' as menu_name, column_name," . " 'T' as edit_type, 32767 as capability, character_maximum_length" . " from information_schema.columns where table_name='{$relation_name}'"; $dbMessage = ''; $result = doUpdate($dbConn, $sql, $dbMessage); $page->addBodyComponent(new Component("<fieldset><legend>Create menu_items</legend>\n" . $dbMessage . "\n</fieldset>\n")); } $ste->render(); $page->addBodyComponent(new Component('<!-- db_name=$db_name $Id: menu.php 1723 2014-01-03 08:34:59Z hom $ -->')); $page->addBodyComponent(new Component('<a href="tets.php">tets</a>' . $PHP_SELF)); $page->show();
doPrintHeader(); if (checkConfig()) { if (isset($_POST['login'])) { setVars(); doLogin(); } else { if (isset($_POST['update'])) { $db = dbConnect(); $version = determineVersion(); if (version_compare($version, "1.0.0") == -1) { echo '<h5>' . translate('phpScheduleIt Update is only available for versions 1.0.0 or later') . '</h5>'; } else { if (version_compare($version, "1.2.0") == 0) { echo '<h5>' . translate('phpScheduleIt is already up to date') . '</h5>'; } else { doUpdate($version); } } doFinish(); } else { doPrintForm(); } } } $t->printHTMLFooter(); /** * Prints html header * @param none */ function doPrintHeader() {
$of->Value = getItemTemplateContents('build_template', $of->InstanceName, $args->notes); switch ($args->do_action) { case 'edit': $op = edit($args, $build_mgr); $gui->closed_on_date = $args->closed_on_date; $of->Value = $op->notes; break; case 'create': $op = create($args); $gui->closed_on_date = $args->closed_on_date; break; case 'do_delete': $op = doDelete($args, $build_mgr); break; case 'do_update': $op = doUpdate($args, $build_mgr, $tplan_mgr); $of->Value = $op->notes; $templateCfg->template = $op->template; break; case 'do_create': $op = doCreate($args, $build_mgr, $tplan_mgr); $of->Value = $op->notes; $templateCfg->template = $op->template; break; } $gui->release_date = $args->release_date; $gui->operation_descr = $op->operation_descr; $gui->user_feedback = $op->user_feedback; $gui->buttonCfg = $op->buttonCfg; $gui->mgt_view_events = $_SESSION['currentUser']->hasRight($db, "mgt_view_events"); $gui->editorType = $editorCfg['type'];
$actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate', 'resetPassword' => 'doUpdate'); switch ($args->doAction) { case "edit": $gui->highlight->edit_user = 1; $gui->user = new tlUser($args->user_id); $gui->user->readFromDB($db); break; case "doCreate": $gui->highlight->create_user = 1; $gui->op = doCreate($db, $args); $gui->user = $gui->op->user; $templateCfg->template = $gui->op->template; break; case "doUpdate": $gui->highlight->edit_user = 1; $gui->op = doUpdate($db, $args, $_SESSION['currentUser']->dbID); $gui->user = $gui->op->user; break; case "resetPassword": $gui->highlight->edit_user = 1; $gui->user = new tlUser($args->user_id); $gui->user->readFromDB($db); $gui->op = createNewPassword($db, $args, $gui->user); break; case "create": default: $gui->highlight->create_user = 1; $gui->user = new tlUser(); break; } $gui->user_feedback = $gui->op->user_feedback;
function doUpdateAll($force = FALSE) { global $manifest, $cache, $cliDir; $xml = simplexml_load_file("{$manifest}"); $me = getOption(array('username', TRUE)); foreach ($xml as $w) { $dir = trim(`"{$cliDir}/packal.sh" getDir "{$w->bundle}" 2> /dev/null`); if ($dir === "FALSE") { continue; } if ("{$w->author}" == "{$me}") { continue; } if (file_exists("{$dir}/packal/package.xml")) { $wf = simplexml_load_file("{$dir}/packal/package.xml"); $wf->updated += 120; // Compensation for time in the generated packages. if ("{$w->version}" != "{$wf->version}") { $updatable[] = array((string) $w->name, (string) $wf->version, (string) $w->version, (string) $w->bundle); } } else { if ($force == FALSE) { continue; } $updatable[] = array((string) $w->name, "Forced Update", (string) $w->version, (string) $w->bundle); } } if (!isset($updatable) || !count($updatable > 0)) { return FALSE; } foreach ($updatable as $u) { doUpdate($u[3]); } }
require_once require_web_editor($editorCfg['type']); testlinkInitPage($db, false, false, "checkRights"); $gui = new stdClass(); $templateCfg = templateConfiguration(); $tcase_mgr = new testcase($db); $args = init_args(); $gui->exec_id = $args->exec_id; $gui->tcversion_id = $args->tcversion_id; $gui->tplan_id = $args->tplan_id; $gui->tproject_id = $args->tproject_id; $owebeditor = web_editor('notes', $args->basehref, $editorCfg); switch ($args->doAction) { case 'edit': break; case 'doUpdate': doUpdate($db, $args, $tcase_mgr, $_REQUEST); break; } $map = get_execution($db, $args->exec_id); $owebeditor->Value = $map[0]['notes']; $gui->cfields_exec = $tcase_mgr->html_table_of_custom_field_inputs($args->tcversion_id, null, 'execution', '_cf', $args->exec_id, $args->tplan_id, $args->tproject_id); $gui->notes = $owebeditor->CreateHTML(); $gui->editorType = $editorCfg['type']; $smarty = new TLSmarty(); $smarty->assign('gui', $gui); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); function doUpdate(&$db, &$args, &$tcaseMgr, &$request) { updateExecutionNotes($db, $args->exec_id, $args->notes); $cfield_mgr = new cfield_mgr($db); $cfield_mgr->execution_values_to_db($request, $args->tcversion_id, $args->exec_id, $args->tplan_id);
$tplan_mgr = new testplan($db); $tcase_mgr = new testcase($db); $templateCfg = templateConfiguration(); $args = init_args($tplan_mgr); checkRights($db, $_SESSION['currentUser'], $args); $gui = initializeGui($db, $args, $tplan_mgr, $tcase_mgr); $keywordsFilter = null; if (is_array($args->keyword_id)) { $keywordsFilter = new stdClass(); $keywordsFilter->items = $args->keyword_id; $keywordsFilter->type = $gui->keywordsFilterType->selected; } switch ($args->doAction) { case "doUpdate": case "doBulkUpdateToLatest": $gui->user_feedback = doUpdate($db, $args); break; default: break; } $out = null; $gui->show_details = 0; $gui->operationType = 'standard'; $gui->hasItems = 0; switch ($args->level) { case 'testcase': $out = processTestCase($db, $args, $keywordsFilter, $tplan_mgr); break; case 'testsuite': $out = processTestSuite($db, $args, $keywordsFilter, $tplan_mgr, $tcase_mgr); break;
$gui->op->user_feedback = sprintf(lang_get('login_does_not_exist'), $args->login); } else { $user = new tlUser(intval($args->user_id)); $user->readFromDB($db); } break; case "doCreate": $highlight->create_user = 1; $gui->op = doCreate($db, $args); $user = $gui->op->user; $templateCfg->template = $gui->op->template; break; case "doUpdate": $highlight->edit_user = 1; $sessionUserID = $_SESSION['currentUser']->dbID; $gui->op = doUpdate($db, $args, $sessionUserID); $user = $gui->op->user; break; case "resetPassword": $highlight->edit_user = 1; $user = new tlUser($args->user_id); $user->readFromDB($db); $passwordSendMethod = config_get('password_reset_send_method'); $gui->op = createNewPassword($db, $args, $user, $passwordSendMethod); break; case "create": default: $highlight->create_user = 1; $user = new tlUser(); break; }
**/ require_once '../../config.inc.php'; require_once 'common.php'; require_once 'exec.inc.php'; require_once "web_editor.php"; $editorCfg = getWebEditorCfg('execution'); require_once require_web_editor($editorCfg['type']); testlinkInitPage($db); $templateCfg = templateConfiguration(); $args = init_args(); $owebeditor = web_editor('notes', $_SESSION['basehref'], $editorCfg); switch ($args->doAction) { case 'edit': break; case 'doUpdate': doUpdate($db, $args); break; } $map = get_execution($db, $args->exec_id); $owebeditor->Value = $map[0]['notes']; $smarty = new TLSmarty(); $smarty->assign('notes', $owebeditor->CreateHTML()); $smarty->assign('editorType', $editorCfg['type']); $smarty->display($templateCfg->template_dir . $templateCfg->default_template); /* function: args : returns: */ function doUpdate(&$dbHandler, &$argsObj)
/** * @param App $a */ function admin_page_remoteupdate_post(&$a) { // this function should be called via ajax post if (!is_site_admin()) { return; } if (x($_POST, 'remotefile') && $_POST['remotefile'] != "") { $remotefile = $_POST['remotefile']; $ftpdata = x($_POST['ftphost']) ? $_POST : false; doUpdate($remotefile, $ftpdata); } else { echo "No remote file to download. Abort!"; } killme(); }
function createEvent($uid, $calendar, $eventStart, $eventEnd, $eventText, $class, $attendee, $categories) { require_once(BASE_PATH . 'monket-cal/monket-cal-update.php'); $result = doUpdate($uid, $calendar, $eventStart, $eventEnd, $eventText, $class, $attendee, $categories); if (strpos($result, "success") != 0) return false; $professor = infoForCalendar($calendar); // the writing of this email should probably be done in a function // send email to scheduler $body = "A meeting has been scheduled.\n"; $body .= $professor['name'] . " will be meeting with " . $name . "\n"; $body .= "on " . date("l", $startTime) . " the " . date("d", $startTime) . " of " . date("F", $startTime) . "\n"; $body .= "at " . date("g:i a", $startTime) . "\n"; $body .= "\nThis meeting was scheduled via zona-cal"; if (!sendEmail($email, "Meeting Scheduled", $body)) return false; // send email to professor if (!sendEmail($professor['email'], "Meeting Scheduled", $body)) return false; return $body; }
$gui->testprojects = $ui->testprojects; break; case 'edit': $template = $templateCfg->default_template; $ui = edit($args, $tproject_mgr); break; case 'doCreate': $op = doCreate($args, $tproject_mgr); $template = $op->status_ok ? null : $templateCfg->default_template; $ui = $op->ui; $status_ok = $op->status_ok; $user_feedback = $op->msg; $reloadType = $op->reloadType; break; case 'doUpdate': $op = doUpdate($args, $tproject_mgr, $session_tproject_id); $template = $op->status_ok ? null : $templateCfg->default_template; $ui = $op->ui; $status_ok = $op->status_ok; $user_feedback = $op->msg; $reloadType = $op->reloadType; break; case 'doDelete': $op = doDelete($args, $tproject_mgr, $session_tproject_id); $status_ok = $op->status_ok; $user_feedback = $op->msg; $reloadType = $op->reloadType; break; case 'setActive': case 'setInactive': case 'enableRequirements':
break; case 'doCreate': $op = doCreate($args, $tprojectMgr); $template = $op->status_ok ? null : $templateCfg->default_template; $ui = $op->ui; $status_ok = $op->status_ok; $gui->user_feedback = $op->msg; $gui->reloadType = $op->reloadType; if ($status_ok && $gui->contextTprojectID == 0) { // before this action there were ZERO test project on system // need to update context $gui->contextTprojectID = $op->id; } break; case 'doUpdate': $op = doUpdate($args, $tprojectMgr, $args->contextTprojectID); $template = $op->status_ok ? null : $templateCfg->default_template; $ui = $op->ui; $status_ok = $op->status_ok; $gui->user_feedback = $op->msg; $gui->reloadType = $op->reloadType; break; case 'doDelete': $op = doDelete($args, $tprojectMgr, $args->contextTprojectID); $status_ok = $op->status_ok; $gui->user_feedback = $op->msg; $gui->reloadType = $op->reloadType; $gui->contextTprojectID = $op->contextTprojectID; break; case 'toggleActive': case 'togglePublic':