/** * Actually creates the new aggregate in the database */ function doSaveCreate() { global $data, $lang, $_reload_browser; // Check inputs if (trim($_REQUEST['name']) == '') { doCreate($lang['straggrneedsname']); return; } else { if (trim($_REQUEST['basetype']) == '') { doCreate($lang['straggrneedsbasetype']); return; } else { if (trim($_REQUEST['sfunc']) == '') { doCreate($lang['straggrneedssfunc']); return; } else { if (trim($_REQUEST['stype']) == '') { doCreate($lang['straggrneedsstype']); return; } } } } $status = $data->createAggregate($_REQUEST['name'], $_REQUEST['basetype'], $_REQUEST['sfunc'], $_REQUEST['stype'], $_REQUEST['ffunc'], $_REQUEST['initcond'], $_REQUEST['sortop'], $_REQUEST['aggrcomment']); if ($status == 0) { $_reload_browser = true; doDefault($lang['straggrcreated']); } else { doCreate($lang['straggrcreatedbad']); } }
/** * Actually creates the new schema in the database */ function doSaveCreate() { global $data, $lang, $_reload_browser; // Check that they've given a name if ($_POST['formName'] == '') { doCreate($lang['strschemaneedsname']); } else { $status = $data->createSchema($_POST['formName'], $_POST['formAuth'], $_POST['formComment']); if ($status == 0) { $_reload_browser = true; doDefault($lang['strschemacreated']); } else { doCreate($lang['strschemacreatedbad']); } } }
} if (!isNull($_GET['to'])) { $to = preg_match($pathRegEx, $_GET['to']) ? null : $_GET['to']; $toHTML = htmlspecialchars($to); $toURL = escape($to); } /** perform requested action **/ if ($do) { switch ($do) { case 'login': exit(doLogin($_POST['pwd'])); case 'logout': exit(doLogout()); case 'create': token_check(); exit(doCreate($_POST['file'], $_POST['folder'], $path)); case 'upload': token_check(); exit(doUpload($path)); case 'chmod': token_check(); exit(doChmod($subject, $path, $_POST['mod'])); case 'extract': token_check(); exit(doExtract($subject, $path)); case 'readFile': exit(doReadFile($subject, $path)); case 'rename': token_check(); exit(doRename($subject, $path)); case 'delete':
/** * Actually creates the new tablespace in the cluster */ function doSaveCreate() { global $data; global $lang; // Check data if (trim($_POST['formSpcname']) == '') { doCreate($lang['strtablespaceneedsname']); } elseif (trim($_POST['formLoc']) == '') { doCreate($lang['strtablespaceneedsloc']); } else { // Default comment to blank if it isn't set if (!isset($_POST['formComment'])) { $_POST['formComment'] = null; } $status = $data->createTablespace($_POST['formSpcname'], $_POST['formOwner'], $_POST['formLoc'], $_POST['formComment']); if ($status == 0) { doDefault($lang['strtablespacecreated']); } else { doCreate($lang['strtablespacecreatedbad']); } } }
$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; $gui->buttonCfg = $op->buttonCfg; $gui->mgt_view_events = $_SESSION['currentUser']->hasRight($db, "mgt_view_events", $args->tproject_id, $args->tplan_id); $gui->editorType = $editorCfg['type']; $smarty = new TLSmarty(); renderGui($smarty, $args, $tplan_mgr, $templateCfg, $of, $gui);
if (isset($_GET['subject']) && !isNull($_GET['subject'])) { $subject = str_replace('/', null, $_GET['subject']); $subjectURL = escape($subject); $subjectHTML = htmlspecialchars($subject); } switch ($do) { case 'login': exit(doLogin()); case 'logout': exit(doLogout()); case 'shell': nonce_check(); exit(shell_exec($_POST['cmd'])); case 'create': nonce_check(); exit(doCreate($_POST['f_name'], $_GET['f_type'], $path)); case 'upload': nonce_check(); exit(doUpload($path)); case 'chmod': nonce_check(); exit(doChmod($subject, $path, $_POST['mod'])); case 'extract': nonce_check(); exit(doExtract($subject, $path)); case 'readFile': exit(doReadFile($subject, $path)); case 'rename': nonce_check(); exit(doRename($subject, $path)); case 'delete':
/** * Actually creates the new domain in the database */ function doSaveCreate() { global $data, $lang; if (!isset($_POST['domcheck'])) { $_POST['domcheck'] = ''; } // Check that they've given a name and a definition if ($_POST['domname'] == '') { doCreate($lang['strdomainneedsname']); } else { $status = $data->createDomain($_POST['domname'], $_POST['domtype'], $_POST['domlength'], $_POST['domarray'] != '', isset($_POST['domnotnull']), $_POST['domdefault'], $_POST['domcheck']); if ($status == 0) { doDefault($lang['strdomaincreated']); } else { doCreate($lang['strdomaincreatedbad']); } } }
/** * Actually creates the new view in the database */ function doSaveCreate() { global $data, $lang, $_reload_browser; // Default tablespace to null if it isn't set if (!isset($_POST['formSpc'])) { $_POST['formSpc'] = null; } // Default comment to blank if it isn't set if (!isset($_POST['formComment'])) { $_POST['formComment'] = null; } // Default collate to blank if it isn't set if (!isset($_POST['formCollate'])) { $_POST['formCollate'] = null; } // Default ctype to blank if it isn't set if (!isset($_POST['formCType'])) { $_POST['formCType'] = null; } // Check that they've given a name and a definition if ($_POST['formName'] == '') { doCreate($lang['strdatabaseneedsname']); } else { $status = $data->createDatabase($_POST['formName'], $_POST['formEncoding'], $_POST['formSpc'], $_POST['formComment'], $_POST['formTemplate'], $_POST['formCollate'], $_POST['formCType']); if ($status == 0) { $_reload_browser = true; doDefault($lang['strdatabasecreated']); } else { doCreate($lang['strdatabasecreatedbad']); } } }
/** * Actually creates the new type in the database */ function doSaveCreate() { global $data; global $lang; // Check that they've given a name and a length. // Note: We're assuming they've given in and out functions here // which might be unwise... if ($_POST['typname'] == '') { doCreate($lang['strtypeneedsname']); } elseif ($_POST['typlen'] == '') { doCreate($lang['strtypeneedslen']); } else { $status = $data->createType($_POST['typname'], $_POST['typin'], $_POST['typout'], $_POST['typlen'], $_POST['typdef'], $_POST['typelem'], $_POST['typdelim'], isset($_POST['typbyval']), $_POST['typalign'], $_POST['typstorage']); if ($status == 0) { doDefault($lang['strtypecreated']); } else { doCreate($lang['strtypecreatedbad']); } } }
/** * Actually creates the new group in the database */ function doSaveCreate() { global $data; global $lang; if (!isset($_POST['members'])) { $_POST['members'] = array(); } // Check form vars if (trim($_POST['name']) == '') { doCreate($lang['strgroupneedsname']); } else { $status = $data->createGroup($_POST['name'], $_POST['members']); if ($status == 0) { doDefault($lang['strgroupcreated']); } else { doCreate($lang['strgroupcreatedbad']); } } }
testlinkInitPage($db, false, false, "checkRights"); $templateCfg = templateConfiguration(); $args = init_args(); $op = new stdClass(); $op->user_feedback = ''; $highlight = initialize_tabsmenu(); $actionOperation = array('create' => 'doCreate', 'edit' => 'doUpdate', 'doCreate' => 'doCreate', 'doUpdate' => 'doUpdate', 'resetPassword' => 'doUpdate'); switch ($args->doAction) { case "edit": $highlight->edit_user = 1; $user = new tlUser($args->user_id); $user->readFromDB($db); break; case "doCreate": $highlight->create_user = 1; $op = doCreate($db, $args); $user = $op->user; $templateCfg->template = $op->template; break; case "doUpdate": $highlight->edit_user = 1; $sessionUserID = $_SESSION['currentUser']->dbID; $op = doUpdate($db, $args, $sessionUserID); $user = $op->user; break; case "resetPassword": $highlight->edit_user = 1; $user = new tlUser($args->user_id); $user->readFromDB($db); $op = createNewPassword($db, $args, $user); break;
/** * Actually creates the new role in the database */ function doSaveCreate() { global $data, $lang; if (!isset($_POST['memberof'])) { $_POST['memberof'] = array(); } if (!isset($_POST['members'])) { $_POST['members'] = array(); } if (!isset($_POST['adminmembers'])) { $_POST['adminmembers'] = array(); } // Check data if ($_POST['formRolename'] == '') { doCreate($lang['strroleneedsname']); } else { if ($_POST['formPassword'] != $_POST['formConfirm']) { doCreate($lang['strpasswordconfirm']); } else { $status = $data->createRole($_POST['formRolename'], $_POST['formPassword'], isset($_POST['formSuper']), isset($_POST['formCreateDB']), isset($_POST['formCreateRole']), isset($_POST['formInherits']), isset($_POST['formCanLogin']), $_POST['formConnLimit'], $_POST['formExpires'], $_POST['memberof'], $_POST['members'], $_POST['adminmembers']); if ($status == 0) { doDefault($lang['strrolecreated']); } else { doCreate($lang['strrolecreatedbad']); } } } }
$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']; if (trim($gui->release_date) == '') { $gui->release_date = '0000-00-00'; } renderGui($smarty, $args, $tplan_mgr, $templateCfg, $of, $gui); /*
include_once $basedir . '/lib/DBEngine.class.php'; include_once $basedir . '/lib/Template.class.php'; @session_start(); // Start the session $failed = false; $t = new Template('phpScheduleIt ' . translate('Setup'), 1); $t->printHTMLHeader(); doPrintHeader(); if (checkConfig()) { if (isset($_POST['login'])) { setVars(); doLogin(); } else { if (isset($_POST['create'])) { $db = dbConnect(); doCreate(); doFinish(); } else { doPrintForm(); } } } $t->printHTMLFooter(); /** * Prints html header * @param none */ function doPrintHeader() { global $conf; ?>
/** * Displays a screen where they can enter a new table */ function doCreate($msg = '') { global $data, $misc; global $lang; if (!isset($_REQUEST['stage'])) { $_REQUEST['stage'] = 1; $default_with_oids = $data->getDefaultWithOid(); if ($default_with_oids == 'off') { $_REQUEST['withoutoids'] = 'on'; } } if (!isset($_REQUEST['name'])) { $_REQUEST['name'] = ''; } if (!isset($_REQUEST['fields'])) { $_REQUEST['fields'] = ''; } if (!isset($_REQUEST['tblcomment'])) { $_REQUEST['tblcomment'] = ''; } if (!isset($_REQUEST['spcname'])) { $_REQUEST['spcname'] = ''; } switch ($_REQUEST['stage']) { case 1: // Fetch all tablespaces from the database if ($data->hasTablespaces()) { $tablespaces = $data->getTablespaces(); } $misc->printTrail('schema'); $misc->printTitle($lang['strcreatetable'], 'pg.table.create'); $misc->printMsg($msg); echo "<form action=\"tables.php\" method=\"post\">\n"; echo "<table>\n"; echo "\t<tr>\n\t\t<th class=\"data left required\">{$lang['strname']}</th>\n"; echo "\t\t<td class=\"data\"><input name=\"name\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"", htmlspecialchars($_REQUEST['name']), "\" /></td>\n\t</tr>\n"; echo "\t<tr>\n\t\t<th class=\"data left required\">{$lang['strnumcols']}</th>\n"; echo "\t\t<td class=\"data\"><input name=\"fields\" size=\"5\" maxlength=\"{$data->_maxNameLen}\" value=\"", htmlspecialchars($_REQUEST['fields']), "\" /></td>\n\t</tr>\n"; echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['stroptions']}</th>\n"; echo "\t\t<td class=\"data\"><label for=\"withoutoids\"><input type=\"checkbox\" id=\"withoutoids\" name=\"withoutoids\"", isset($_REQUEST['withoutoids']) ? ' checked="checked"' : '', " />WITHOUT OIDS</label></td>\n\t</tr>\n"; // Tablespace (if there are any) if ($data->hasTablespaces() && $tablespaces->recordCount() > 0) { echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strtablespace']}</th>\n"; echo "\t\t<td class=\"data1\">\n\t\t\t<select name=\"spcname\">\n"; // Always offer the default (empty) option echo "\t\t\t\t<option value=\"\"", $_REQUEST['spcname'] == '' ? ' selected="selected"' : '', "></option>\n"; // Display all other tablespaces while (!$tablespaces->EOF) { $spcname = htmlspecialchars($tablespaces->fields['spcname']); echo "\t\t\t\t<option value=\"{$spcname}\"", $tablespaces->fields['spcname'] == $_REQUEST['spcname'] ? ' selected="selected"' : '', ">{$spcname}</option>\n"; $tablespaces->moveNext(); } echo "\t\t\t</select>\n\t\t</td>\n\t</tr>\n"; } echo "\t<tr>\n\t\t<th class=\"data left\">{$lang['strcomment']}</th>\n"; echo "\t\t<td><textarea name=\"tblcomment\" rows=\"3\" cols=\"32\">", htmlspecialchars($_REQUEST['tblcomment']), "</textarea></td>\n\t</tr>\n"; echo "</table>\n"; echo "<p><input type=\"hidden\" name=\"action\" value=\"create\" />\n"; echo "<input type=\"hidden\" name=\"stage\" value=\"2\" />\n"; echo $misc->form; echo "<input type=\"submit\" value=\"{$lang['strnext']}\" />\n"; echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" /></p>\n"; echo "</form>\n"; break; case 2: global $lang; // Check inputs $fields = trim($_REQUEST['fields']); if (trim($_REQUEST['name']) == '') { $_REQUEST['stage'] = 1; doCreate($lang['strtableneedsname']); return; } elseif ($fields == '' || !is_numeric($fields) || $fields != (int) $fields || $fields < 1) { $_REQUEST['stage'] = 1; doCreate($lang['strtableneedscols']); return; } $types = $data->getTypes(true, false, true); $types_for_js = array(); $misc->printTrail('schema'); $misc->printTitle($lang['strcreatetable'], 'pg.table.create'); $misc->printMsg($msg); echo "<script src=\"tables.js\" type=\"text/javascript\"></script>"; echo "<form action=\"tables.php\" method=\"post\">\n"; // Output table header echo "<table>\n"; echo "\t<tr><th colspan=\"2\" class=\"data required\">{$lang['strcolumn']}</th><th colspan=\"2\" class=\"data required\">{$lang['strtype']}</th>"; echo "<th class=\"data\">{$lang['strlength']}</th><th class=\"data\">{$lang['strnotnull']}</th>"; echo "<th class=\"data\">{$lang['struniquekey']}</th><th class=\"data\">{$lang['strprimarykey']}</th>"; echo "<th class=\"data\">{$lang['strdefault']}</th><th class=\"data\">{$lang['strcomment']}</th></tr>\n"; for ($i = 0; $i < $_REQUEST['fields']; $i++) { if (!isset($_REQUEST['field'][$i])) { $_REQUEST['field'][$i] = ''; } if (!isset($_REQUEST['length'][$i])) { $_REQUEST['length'][$i] = ''; } if (!isset($_REQUEST['default'][$i])) { $_REQUEST['default'][$i] = ''; } if (!isset($_REQUEST['colcomment'][$i])) { $_REQUEST['colcomment'][$i] = ''; } echo "\t<tr>\n\t\t<td>", $i + 1, ". </td>\n"; echo "\t\t<td><input name=\"field[{$i}]\" size=\"16\" maxlength=\"{$data->_maxNameLen}\" value=\"", htmlspecialchars($_REQUEST['field'][$i]), "\" /></td>\n"; echo "\t\t<td>\n\t\t\t<select name=\"type[{$i}]\" id=\"types{$i}\" onchange=\"checkLengths(this.options[this.selectedIndex].value,{$i});\">\n"; // Output any "magic" types foreach ($data->extraTypes as $v) { $types_for_js[strtolower($v)] = 1; echo "\t\t\t\t<option value=\"", htmlspecialchars($v), "\"", isset($_REQUEST['type'][$i]) && $v == $_REQUEST['type'][$i] ? ' selected="selected"' : '', ">", $misc->printVal($v), "</option>\n"; } $types->moveFirst(); while (!$types->EOF) { $typname = $types->fields['typname']; $types_for_js[$typname] = 1; echo "\t\t\t\t<option value=\"", htmlspecialchars($typname), "\"", isset($_REQUEST['type'][$i]) && $typname == $_REQUEST['type'][$i] ? ' selected="selected"' : '', ">", $misc->printVal($typname), "</option>\n"; $types->moveNext(); } echo "\t\t\t</select>\n\t\t\n"; if ($i == 0) { // only define js types array once $predefined_size_types = array_intersect($data->predefined_size_types, array_keys($types_for_js)); $escaped_predef_types = array(); // the JS escaped array elements foreach ($predefined_size_types as $value) { $escaped_predef_types[] = "'{$value}'"; } echo "<script type=\"text/javascript\">predefined_lengths = new Array(" . implode(",", $escaped_predef_types) . ");</script>\n\t</td>"; } // Output array type selector echo "\t\t<td>\n\t\t\t<select name=\"array[{$i}]\">\n"; echo "\t\t\t\t<option value=\"\"", isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '' ? ' selected="selected"' : '', "></option>\n"; echo "\t\t\t\t<option value=\"[]\"", isset($_REQUEST['array'][$i]) && $_REQUEST['array'][$i] == '[]' ? ' selected="selected"' : '', ">[ ]</option>\n"; echo "\t\t\t</select>\n\t\t</td>\n"; echo "\t\t<td><input name=\"length[{$i}]\" id=\"lengths{$i}\" size=\"10\" value=\"", htmlspecialchars($_REQUEST['length'][$i]), "\" /></td>\n"; echo "\t\t<td><input type=\"checkbox\" name=\"notnull[{$i}]\"", isset($_REQUEST['notnull'][$i]) ? ' checked="checked"' : '', " /></td>\n"; echo "\t\t<td style=\"text-align: center\"><input type=\"checkbox\" name=\"uniquekey[{$i}]\"" . (isset($_REQUEST['uniquekey'][$i]) ? ' checked="checked"' : '') . " /></td>\n"; echo "\t\t<td style=\"text-align: center\"><input type=\"checkbox\" name=\"primarykey[{$i}]\" " . (isset($_REQUEST['primarykey'][$i]) ? ' checked="checked"' : '') . " /></td>\n"; echo "\t\t<td><input name=\"default[{$i}]\" size=\"20\" value=\"", htmlspecialchars($_REQUEST['default'][$i]), "\" /></td>\n"; echo "\t\t<td><input name=\"colcomment[{$i}]\" size=\"40\" value=\"", htmlspecialchars($_REQUEST['colcomment'][$i]), "\" />\n\t\t\t\t\t\t<script type=\"text/javascript\">checkLengths(document.getElementById('types{$i}').value,{$i});</script>\n\t\t\t\t\t\t</td>\n\t</tr>\n"; } echo "</table>\n"; echo "<p><input type=\"hidden\" name=\"action\" value=\"create\" />\n"; echo "<input type=\"hidden\" name=\"stage\" value=\"3\" />\n"; echo $misc->form; echo "<input type=\"hidden\" name=\"name\" value=\"", htmlspecialchars($_REQUEST['name']), "\" />\n"; echo "<input type=\"hidden\" name=\"fields\" value=\"", htmlspecialchars($_REQUEST['fields']), "\" />\n"; if (isset($_REQUEST['withoutoids'])) { echo "<input type=\"hidden\" name=\"withoutoids\" value=\"true\" />\n"; } echo "<input type=\"hidden\" name=\"tblcomment\" value=\"", htmlspecialchars($_REQUEST['tblcomment']), "\" />\n"; if (isset($_REQUEST['spcname'])) { echo "<input type=\"hidden\" name=\"spcname\" value=\"", htmlspecialchars($_REQUEST['spcname']), "\" />\n"; } echo "<input type=\"submit\" value=\"{$lang['strcreate']}\" />\n"; echo "<input type=\"submit\" name=\"cancel\" value=\"{$lang['strcancel']}\" /></p>\n"; echo "</form>\n"; break; case 3: global $data, $lang, $_reload_browser; if (!isset($_REQUEST['notnull'])) { $_REQUEST['notnull'] = array(); } if (!isset($_REQUEST['uniquekey'])) { $_REQUEST['uniquekey'] = array(); } if (!isset($_REQUEST['primarykey'])) { $_REQUEST['primarykey'] = array(); } if (!isset($_REQUEST['length'])) { $_REQUEST['length'] = array(); } // Default tablespace to null if it isn't set if (!isset($_REQUEST['spcname'])) { $_REQUEST['spcname'] = null; } // Check inputs $fields = trim($_REQUEST['fields']); if (trim($_REQUEST['name']) == '') { $_REQUEST['stage'] = 1; doCreate($lang['strtableneedsname']); return; } elseif ($fields == '' || !is_numeric($fields) || $fields != (int) $fields || $fields <= 0) { $_REQUEST['stage'] = 1; doCreate($lang['strtableneedscols']); return; } $status = $data->createTable($_REQUEST['name'], $_REQUEST['fields'], $_REQUEST['field'], $_REQUEST['type'], $_REQUEST['array'], $_REQUEST['length'], $_REQUEST['notnull'], $_REQUEST['default'], isset($_REQUEST['withoutoids']), $_REQUEST['colcomment'], $_REQUEST['tblcomment'], $_REQUEST['spcname'], $_REQUEST['uniquekey'], $_REQUEST['primarykey']); if ($status == 0) { $_reload_browser = true; doDefault($lang['strtablecreated']); } elseif ($status == -1) { $_REQUEST['stage'] = 2; doCreate($lang['strtableneedsfield']); return; } else { $_REQUEST['stage'] = 2; doCreate($lang['strtablecreatedbad']); return; } break; default: echo "<p>{$lang['strinvalidparam']}</p>\n"; } }
/** * Actually creates the new trigger in the database */ function doSaveCreate() { global $data; global $lang; // Check that they've given a name and a definition if ($_POST['formFunction'] == '') { doCreate($lang['strtriggerneedsfunc']); } elseif ($_POST['formTriggerName'] == '') { doCreate($lang['strtriggerneedsname']); } elseif ($_POST['formEvent'] == '') { doCreate(); } else { $status = $data->createTrigger($_POST['formTriggerName'], $_POST['table'], $_POST['formFunction'], $_POST['formExecTime'], $_POST['formEvent'], $_POST['formFrequency'], $_POST['formTriggerArgs']); if ($status == 0) { doDefault($lang['strtriggercreated']); } else { doCreate($lang['strtriggercreatedbad']); } } }
/** * Actually creates the new view in the database */ function doSaveCreate() { global $data, $lang, $_reload_browser; // Check that they've given a name and a definition if ($_POST['formView'] == '') { doCreate($lang['strviewneedsname']); } elseif ($_POST['formDefinition'] == '') { doCreate($lang['strviewneedsdef']); } else { $status = $data->createView($_POST['formView'], $_POST['formDefinition'], false, $_POST['formComment']); if ($status == 0) { $_reload_browser = true; doDefault($lang['strviewcreated']); } else { doCreate($lang['strviewcreatedbad']); } } }
// id from login if (strlen(trim($args->login)) > 0) { $args->user_id = tlUser::doesUserExist($db, $args->login); } if (is_null($args->user_id) || intval($args->user_id) <= 0) { // need to manage some sort of error message $gui->op->status = tl::ERROR; $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);
/** * Actually creates the new report in the database */ function doSaveCreate() { global $reportsdb, $lang; if (!isset($_POST['report_name'])) { $_POST['report_name'] = ''; } if (!isset($_POST['db_name'])) { $_POST['db_name'] = ''; } if (!isset($_POST['descr'])) { $_POST['descr'] = ''; } if (!isset($_POST['report_sql'])) { $_POST['report_sql'] = ''; } // Check that they've given a name and a definition if ($_POST['report_name'] == '') { doCreate($lang['strreportneedsname']); } elseif ($_POST['report_sql'] == '') { doCreate($lang['strreportneedsdef']); } else { $status = $reportsdb->createReport($_POST['report_name'], $_POST['db_name'], $_POST['descr'], $_POST['report_sql'], isset($_POST['paginate'])); if ($status == 0) { doDefault($lang['strreportcreated']); } else { doCreate($lang['strreportcreatedbad']); } } }
/** * Actually creates the new function in the database */ function doSaveCreate() { global $data, $lang; $fnlang = strtolower($_POST['formLanguage']); if ($fnlang == 'c') { $def = array($_POST['formObjectFile'], $_POST['formLinkSymbol']); } else { if ($fnlang == 'internal') { $def = $_POST['formLinkSymbol']; } else { $def = $_POST['formDefinition']; } } $szJS = ''; echo "<script src=\"functions.js\" type=\"text/javascript\"></script>"; echo "<script type=\"text/javascript\">" . buildJSData() . '</script>'; if (!empty($_POST['formArgName'])) { $szJS = buildJSRows(buildFunctionArguments($_POST)); } else { $szJS = "<script type=\"text/javascript\" src=\"functions.js\">noArgsRebuild(addArg());</script>"; } $cost = isset($_POST['formCost']) ? $_POST['formCost'] : null; if ($cost == '' || !is_numeric($cost) || $cost != (int) $cost || $cost < 0) { $cost = null; } $rows = isset($_POST['formRows']) ? $_POST['formRows'] : null; if ($rows == '' || !is_numeric($rows) || $rows != (int) $rows) { $rows = null; } // Check that they've given a name and a definition if ($_POST['formFunction'] == '') { doCreate($lang['strfunctionneedsname'], $szJS); } elseif ($fnlang != 'internal' && !$def) { doCreate($lang['strfunctionneedsdef'], $szJS); } else { // Append array symbol to type if chosen $status = $data->createFunction($_POST['formFunction'], empty($_POST['nojs']) ? buildFunctionArguments($_POST) : $_POST['formArguments'], $_POST['formReturns'] . $_POST['formArray'], $def, $_POST['formLanguage'], $_POST['formProperties'], $_POST['formSetOf'] == 'SETOF', $cost, $rows, $_POST['formComment'], false); if ($status == 0) { doDefault($lang['strfunctioncreated']); } else { doCreate($lang['strfunctioncreatedbad'], $szJS); } } }
/** * Actually creates the new user in the database */ function doSaveCreate() { global $data; global $lang; // Check data if ($_POST['formUsername'] == '') { doCreate($lang['struserneedsname']); } else { if ($_POST['formPassword'] != $_POST['formConfirm']) { doCreate($lang['strpasswordconfirm']); } else { $status = $data->createUser($_POST['formUsername'], $_POST['formPassword'], isset($_POST['formCreateDB']), isset($_POST['formSuper']), $_POST['formExpires'], array()); if ($status == 0) { doDefault($lang['strusercreated']); } else { doCreate($lang['strusercreatedbad']); } } } }
$templateCfg->template = $templateCfg->default_template; $user_feedback = ''; $operation_descr = ''; break; case 'edit': $op = edit($args, $cfield_mgr); $gui->cfield = $op->cf; $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;
case 'create': $templateCfg->template = $templateCfg->default_template; $user_feedback = ''; $operation_descr = ''; break; case 'edit': $op = edit($args, $cfield_mgr); $gui->cfield = $op->cf; $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': $op = doCreate($_REQUEST, $cfield_mgr); $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;
$args = init_args($tproject_mgr, $_REQUEST, $session_tproject_id); $gui = initializeGui($db, $args); $of = web_editor('notes', $_SESSION['basehref'], $editorCfg); $status_ok = 1; switch ($args->doAction) { case 'create': $template = $templateCfg->default_template; $ui = create($args, $tproject_mgr); $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':
} $width = 0; if (SUPPORT_UPLOAD) { if (isset($HTTP_POST_VARS["width"]) && is_numeric($HTTP_POST_VARS["width"])) { $width = (int) $HTTP_POST_VARS["width"]; } } // parse and clean the Path cleanPath($path); ?> <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <?php // if CREATE is supported AND this is CREATE ... if (SUPPORT_CREATE && !strcasecmp($action, "create")) { // ... create the Folder doCreate($folder); } else { if (SUPPORT_DELETE && !strcasecmp($action, "delete")) { // ... delete the Folder/File doDelete($file); } else { if (SUPPORT_UPLOAD && !strcasecmp($action, "upload")) { // ... upload the Image doUpload(basename($name), $width, $height, $aspect); } } } // list the Path doList(); // emit the HTML echo "<script language=\"javascript\">\n";