# You should have received a copy of the GNU Affero General Public License # along with this file. If not, see <http://www.gnu.org/licenses/>. # # }}} # include "defs.php3"; # # Only known and logged in users can do this. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # # Verify page arguments # $optargs = OptionalPageArguments("sortby", PAGEARG_STRING); # # Standard Testbed Header # PAGEHEADER("Emulab Site List"); if (!($isadmin || OPSGUY() || STUDLY())) { USERERROR("Cannot view site list.", 1); } if (!isset($sortby)) { $sortby = "created"; } $sortclause = ""; if ($sortby == "created") { $sortclause = "order by created"; } elseif ($sortby == "urn") { $sortclause = "order by urn";
include "defs.php3"; include_once "template_defs.php"; require "Sajax.php"; sajax_init(); sajax_export("Show", "GraphChange"); # # Only known and logged in users ... # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # # Verify page arguments # $reqargs = RequiredPageArguments("template", PAGEARG_TEMPLATE); $optargs = OptionalPageArguments("action", PAGEARG_STRING, "show", PAGEARG_STRING, "confirmed", PAGEARG_STRING); if (!($experiment = $template->GetExperiment())) { TBERROR("Could not find experiment object for template!", 1); } # Need these below $guid = $template->guid(); $vers = $template->vers(); $pid = $template->pid(); $eid = $template->eid(); $tid = $template->tid(); $exptidx = $experiment->idx(); $unix_gid = $experiment->UnixGID(); $this_url = CreateURL("template_show", $template); $project = $template->GetProject(); $unix_pid = $project->unix_gid(); #
# # This file is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # This file is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public # License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this file. If not, see <http://www.gnu.org/licenses/>. # # }}} # require "defs.php3"; # # Verify page arguments. # $optargs = OptionalPageArguments("submit", PAGEARG_STRING, "query", PAGEARG_STRING); if (!isset($query) || $query == "Search Documentation") { $query = ""; } else { $query = urldecode($query); $query = preg_replace("/[\\ ]+/", "+", $query); } header("Location: http://wiki.emulab.net/@@search?SearchableText={$query}"); ?>
# # Copyright (c) 2009 University of Utah and the Flux Group. # # {{{EMULAB-LICENSE # # This file is part of the Emulab network testbed software. # # This file is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # This file is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public # License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this file. If not, see <http://www.gnu.org/licenses/>. # # }}} # include "../defs.php3"; include "usermap.php"; $optargs = OptionalPageArguments("fullscreen", PAGEARG_BOOLEAN); if (isset($fullscreen)) { draw_usermap($USERMAP_TYPE_FULLSCREEN); } else { draw_usermap($USERMAP_TYPE_NORMAL); }
# include "defs.php3"; include_once "geni_defs.php"; include "table_defs.php"; # # # Only known and logged in users allowed. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); $defaultsearchstring = 'Search CM for URN or IP or MAC'; # # Verify Page Arguments. # $optargs = OptionalPageArguments("showtype", PAGEARG_STRING, "query", PAGEARG_STRING); $showtypes = array(); if (isset($query) && $query != $defaultsearchstring) { $showtypes[] = "cm"; } elseif (!isset($showtype)) { $showtypes[] = "cm"; $showtypes[] = "sa"; $showtypes[] = "ch"; } else { if (!($showtype == "sa" || $showtype == "cm" || $showtype == "ch")) { USERERROR("Improper argument: showtype={$showtype}", 1); } $showtypes[] = $showtype; } # # Standard Testbed Header
$session_errorhandler = 'handle_error'; function handle_error($message, $death) { SPITERROR(400, $message); } # # Must be SSL, even though we do not require an account login. # if (!isset($SSL_PROTOCOL)) { SPITERROR(400, "Must use https:// to access this page!"); } # # Verify page arguments. # $reqargs = RequiredPageArguments("image", PAGEARG_IMAGE, "access_key", PAGEARG_STRING); $optargs = OptionalPageArguments("stamp", PAGEARG_INTEGER); # # A cleanup function to keep the child from becoming a zombie, since # the script is terminated, but the children are left to roam. # $fp = 0; function SPEWCLEANUP() { global $fp; if (!$fp || !connection_aborted()) { exit; } pclose($fp); exit; } set_time_limit(0);
# # This file is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public # License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this file. If not, see <http://www.gnu.org/licenses/>. # # }}} # require "defs.php3"; # # Verify page arguments. # $optargs = OptionalPageArguments("printable", PAGEARG_BOOLEAN); if (!isset($printable)) { $printable = 0; } # # Standard Testbed Header # if (!$printable) { PAGEHEADER("Emulab Copyright Notice"); } if ($printable) { # # Need to spit out some header stuff. # echo "<html>\n <head>\n <title>Copyright Notice</title>\n \t <link rel='stylesheet' href='tbstyle-plain.css' type='text/css'>\n </head>\n <body>\n"; } else {
define("WASTATUS_IPADDRINUSE", 105); define("WASTATUS_MUSTUSESSL", 106); define("WASTATUS_OTHER", 199); # # Spit back a text message we can display to the user on the console # of the node running the checkin. We could return an http error, but # that would be of no help to the user on the other side. # function SPITSTATUS($status) { header("Content-Type: text/plain"); echo "emulab_status={$status}\n"; } # Required arguments $reqargs = RequiredPageArguments("IP", PAGEARG_STRING, "privkey", PAGEARG_STRING); $optargs = OptionalPageArguments("hostname", PAGEARG_STRING); # Must use https, if (!isset($_SERVER["SSL_PROTOCOL"])) { SPITSTATUS(WASTATUS_MUSTUSESSL); return; } if (!preg_match('/^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$/', $IP) || !preg_match('/^[\\w]+$/', $privkey) || isset($hostname) && !preg_match('/^[-\\w\\.]+$/', $hostname)) { SPITSTATUS(WASTATUS_INVALIDARGS); return; } # # Make sure this is a valid privkey before we invoke the backend. # $query_result = DBQueryFatal("select IP from widearea_nodeinfo where privkey='{$privkey}'"); if (!mysql_num_rows($query_result)) { SPITSTATUS(WASTATUS_BADPRIVKEY);
SPITFORM($formfields, $errors); PAGEFOOTER(); die(""); } # # Only known and logged in users can begin experiments. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # Does not return if this a request. include "showlogfile_sup.php3"; # # Verify page arguments. # $optargs = OptionalPageArguments("view_style", PAGEARG_STRING, "beginexp", PAGEARG_STRING, "formfields", PAGEARG_ARRAY, "nsref", PAGEARG_INTEGER, "guid", PAGEARG_INTEGER, "copyid", PAGEARG_INTEGER); # # Handle pre-defined view styles # unset($view); if (isset($view_style) && $view_style == "plab") { $view['hide_proj'] = $view['hide_group'] = $view['hide_swap'] = $view['hide_preload'] = $view['hide_batch'] = $view['hide_linktest'] = $view['quiet'] = $view['plab_ns_message'] = $view['plab_descr'] = 1; } include "beginexp_form.php3"; # Need this below; $idleswaptimeout = TBGetSiteVar("idle/threshold"); $autoswap_max = TBGetSiteVar("general/autoswap_max"); # # See what projects the uid can create experiments in. Must be at least one. # $projlist = $this_user->ProjectAccessList($TB_PROJECT_CREATEEXPT);
# # }}} # include "defs.php3"; include_once "template_defs.php"; # # Only known and logged in users. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # # Verify page arguments. # $reqargs = RequiredPageArguments("instance", PAGEARG_INSTANCE); $optargs = OptionalPageArguments("canceled", PAGEARG_BOOLEAN, "referrer", PAGEARG_STRING, "confirmed", PAGEARG_BOOLEAN); $template = $instance->GetTemplate(); if (isset($canceled) && $canceled) { header("Location: " . CreateURL("template_show", $template)); return; } # Need these below. $guid = $template->guid(); $vers = $template->vers(); $pid = $template->pid(); $eid = $instance->eid(); $iid = $instance->id(); $unix_gid = $template->UnixGID(); $exptidx = $instance->exptidx(); $project = $template->GetProject(); $unix_pid = $project->unix_gid();
# along with this file. If not, see <http://www.gnu.org/licenses/>. # # }}} # require "defs.php3"; # # # Only known and logged in users allowed. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # # Verify Page Arguments. # $optargs = OptionalPageArguments("resource", PAGEARG_STRING, "getdata", PAGEARG_BOOLEAN); # if you change any of the resource queries, you must change these arrays! $resources = array("project", "experiment", "user", "nodetype"); $fields = array(); $fields["project"] = array("pcs" => array("type" => "size", "data" => "count"), "exps" => array("type" => "color", "data" => "count")); $fields["experiment"] = array("pcs" => array("type" => "size", "data" => "count"), "idle" => array("type" => "color", "data" => "time"), "duration" => array("type" => "color", "data" => "time")); $fields["user"] = array("pcs" => array("type" => "size", "data" => "count"), "exps" => array("type" => "color", "data" => "count")); $fields["nodetype"] = array("experiment" => array("type" => "multi", "data" => "text"), "pcs" => array("type" => "size", "data" => "count"), "idle" => array("type" => "color", "data" => "time"), "duration" => array("type" => "color", "data" => "time")); $defResource = "experiment"; $defColorField = "idle"; # resource queries $queries = array(); $queries["project"] = "select r.pid as project,count(r.node_id) as pcs," . " count(distinct r.eid) as exps" . " from reserved as r" . " left join nodes as n on r.node_id=n.node_id" . " left join node_types as nt on n.type=nt.type" . " left join experiments as e on (r.pid=e.pid and r.eid=e.eid)" . " where nt.class='pc'" . " and !(r.pid='emulab-ops' and e.noswap_reason='System Experiment')" . " group by r.pid order by pcs desc"; $queries["experiment"] = "select concat_ws(' / ',r.pid,r.eid) as experiment," . " count(r.node_id) as pcs," . " min(unix_timestamp(now()) - unix_timestamp(greatest(na.last_tty_act,na.last_net_act,na.last_cpu_act,na.last_ext_act))) as idle," . " max(unix_timestamp(now()) - unix_timestamp(e.expt_swapped)) as duration" . " from reserved as r" . " left join nodes as n on r.node_id=n.node_id" . " left join node_types as nt on n.type=nt.type" . " left join node_activity as na on r.node_id=na.node_id" . " left join experiments as e on (r.pid=e.pid and r.eid=e.eid)" . " where nt.class='pc'" . " and !(r.pid='emulab-ops' and e.noswap_reason='System Experiment')" . " group by r.pid,r.eid order by pcs desc"; $queries["user"] = "******" . " count(distinct e.eid) as exps" . " from reserved as r" . " left join nodes as n on r.node_id=n.node_id" . " left join node_types as nt on n.type=nt.type" . " left join experiments as e on (r.pid=e.pid and r.eid=e.eid)" . " left join users as u on e.swapper_idx=u.uid_idx" . " where nt.class='pc'" . " and !(r.pid='emulab-ops' and e.noswap_reason='System Experiment')" . " group by (u.uid) order by pcs desc"; $queries["nodetype"] = "select n.type as nodetype," . " concat_ws(' / ',r.pid,r.eid) as experiment," . " count(distinct r.node_id) as pcs," . " min(unix_timestamp(now()) - unix_timestamp(greatest(na.last_tty_act,na.last_net_act,na.last_cpu_act,na.last_ext_act))) as idle," . " (unix_timestamp(now()) - unix_timestamp(e.expt_swapped)) as duration" . " from reserved as r" . " left join experiments as e on (r.pid=e.pid and r.eid=e.eid)" . " left join nodes as n on r.node_id=n.node_id" . " left join node_types as nt on n.type=nt.type" . " left join node_activity as na on r.node_id=na.node_id" . " where nt.class='pc'" . " group by n.type,r.pid,r.eid order by n.type,pcs desc";
# along with this file. If not, see <http://www.gnu.org/licenses/>. # # }}} # include "defs.php3"; include_once "template_defs.php"; # # Only known and logged in users. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # # Verify page arguments. # $optargs = OptionalPageArguments("instance", PAGEARG_INSTANCE, "template", PAGEARG_TEMPLATE, "canceled", PAGEARG_BOOLEAN, "confirmed", PAGEARG_BOOLEAN, "referrer", PAGEARG_STRING, "runidx", PAGEARG_INTEGER, "tag", PAGEARG_STRING, "overwrite", PAGEARG_BOOLEAN, "spew", PAGEARG_BOOLEAN); # # An instance might be a current or historical. If its a template, use # the underlying experiment of the template. # if (isset($instance)) { $template = $instance->GetTemplate(); } elseif (!isset($template)) { PAGEARGERROR("Must provide a template or an instance to export"); } if (isset($canceled) && $canceled) { if (isset($instance)) { header("Location: " . CreateURL("template_show", $template)); } else { header("Location: " . CreateURL("template_show", $instance)); }
# include "defs.php3"; include_once "node_defs.php"; # # Only known and logged in users can do this. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); if (!$isadmin && !STUDLY()) { USERERROR("You are not allowed to view this page!", 1); } # # Verify page arguments. # $optargs = OptionalPageArguments("type", PAGEARG_STRING); # # Standard Testbed Header # PAGEHEADER("Node Control Center"); $query_result = DBQueryFatal("select n.inception,util.*, " . " UNIX_TIMESTAMP(now())-UNIX_TIMESTAMP(n.inception) as age " . " from node_utilization as util " . "left join nodes as n on n.node_id=util.node_id " . "left join node_types as t on t.type=n.type " . "where n.inception is not null and t.class='pc' and " . " role='testnode'" . "order BY priority"); if (mysql_num_rows($query_result) == 0) { echo "<center>Oops, no nodes to show you!</center>"; PAGEFOOTER(); exit; } echo "<center>\n <table id='nodetable' align=center cellpadding=2 border=1>\n <thead class='sort'>\n <tr>\n <th>Node ID</th>\n <th>Inception Date</th>\n <th align=center>Age<br>(seconds)</th>\n <th align=center>Free<br>(seconds)</th>\n <th align=center>Free<br>(percent)</th>\n <th align=center>Alloc<br>(seconds)</th>\n <th align=center>Alloc<br>(percent)</th>\n <th align=center>Down<br>(seconds)</th>\n <th align=center>Down<br>(percent)</th>\n </tr>\n </thead>\n"; while ($row = mysql_fetch_array($query_result)) { $node_id = $row["node_id"]; $inception = $row["inception"]; $age = $row["age"];
# This file is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public # License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this file. If not, see <http://www.gnu.org/licenses/>. # # }}} # require "defs.php3"; # # Verify page arguments. # $reqargs = RequiredPageArguments("user", PAGEARG_USER, "key", PAGEARG_STRING); $optargs = OptionalPageArguments("redirected", PAGEARG_BOOLEAN); if (!$PORTAL_ENABLE) { USERERROR("No Portal", 1); } # # Need this extra redirect so that the cookies get set properly. # if (!isset($redirected) || $redirected == 0) { $uri = $_SERVER['REQUEST_URI'] . "&redirected=1"; header("Location: https://{$WWWHOST}" . $uri); return; } # # Check the login table for the user, and see if the key is really # the md5 of the login hash. If so, do a login. #
# # }}} # include "defs.php3"; include_once "template_defs.php"; # # Only known and logged in users. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # # Verify page arguments. # $reqargs = RequiredPageArguments("instance", PAGEARG_INSTANCE); $optargs = OptionalPageArguments("canceled", PAGEARG_BOOLEAN, "confirmed", PAGEARG_BOOLEAN); $template = $instance->GetTemplate(); # Canceled operation redirects back to template page. if (isset($canceled) && $canceled) { header("Location: " . CreateURL("template_show", $template)); return; } # Need these below. $guid = $template->guid(); $vers = $template->vers(); $pid = $template->pid(); $eid = $instance->eid(); $unix_gid = $template->UnixGID(); $project = $template->GetProject(); $unix_pid = $project->unix_gid(); #
# include "defs.php3"; include_once "template_defs.php"; include_once "form_defs.php"; # # Only known and logged in users can look at experiments. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $uid_idx = $this_user->uid_idx(); $isadmin = ISADMIN(); # # Verify page arguments. # $reqargs = RequiredPageArguments("template", PAGEARG_TEMPLATE); $optargs = OptionalPageArguments("search", PAGEARG_STRING, "prevsearch", PAGEARG_STRING, "addclause", PAGEARG_STRING, "formfields", PAGEARG_ARRAY); # # Standard Testbed Header after argument checking. # PAGEHEADER("Template Search"); # Need these below. $guid = $template->guid(); $vers = $template->vers(); # # Check permission. # if (!$template->AccessCheck($this_user, $TB_EXPT_READINFO)) { USERERROR("You do not have permission to view experiment template " . "{$guid}/{$vers}!", 1); } # # We display the info for all versions of the template.
# include "defs.php3"; include_once "geni_defs.php"; include "table_defs.php"; # # # Only known and logged in users allowed. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); $searchbox = "user/slice urn or slice uuid or date"; # # Verify Page Arguments. # $optargs = OptionalPageArguments("searchfor", PAGEARG_STRING, "search", PAGEARG_STRING, "slice_uuid", PAGEARG_STRING, "ch", PAGEARG_BOOLEAN, "index", PAGEARG_INTEGER); if (!isset($index)) { $index = 0; } if (!isset($searchfor)) { $searchfor = $searchbox; } if (!isset($ch)) { $ch = 0; } # # Standard Testbed Header # PAGEHEADER("Geni History"); if (!($isadmin || STUDLY())) { USERERROR("You do not have permission to view Geni slice list!", 1);
include "defs.php3"; include_once "template_defs.php"; require "Sajax.php"; sajax_init(); sajax_export("ModifyAnno"); # # Only known and logged in users ... # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # # Verify page arguments. # $reqargs = RequiredPageArguments("instance", PAGEARG_INSTANCE); $optargs = OptionalPageArguments("showhidden", PAGEARG_BOOLEAN); $template = $instance->GetTemplate(); # Need these below. $guid = $template->guid(); $vers = $template->vers(); $pid = $template->pid(); $eid = $instance->eid(); # Default to not showing hidden if (!isset($showhidden)) { $showhidden = 0; } if (!$template->AccessCheck($this_user, $TB_EXPT_READINFO)) { USERERROR("You do not have permission to view experiment template " . "{$guid}/{$version}!", 1); } # # For the Sajax Interface
# along with this file. If not, see <http://www.gnu.org/licenses/>. # # }}} # include "defs.php3"; # # Only known and logged in users. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # # Verify page arguments. # $reqargs = RequiredPageArguments("experiment", PAGEARG_EXPERIMENT); $optargs = OptionalPageArguments("showevents", PAGEARG_BOOLEAN); # Need these below. $pid = $experiment->pid(); $eid = $experiment->eid(); # # Verify permission. # if (!$experiment->AccessCheck($this_user, $TB_EXPT_READINFO)) { USERERROR("Not enough permission to view experiment {$pid}/{$eid}", 1); } $output = array(); $retval = 0; if (isset($showevents) && $showevents) { $flags = "-v"; } else { # Show event summary and firewall info.
# your option) any later version. # # This file is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public # License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this file. If not, see <http://www.gnu.org/licenses/>. # # }}} # require "defs.php3"; require "node_defs.php"; $reqargs = RequiredPageArguments("ip", PAGEARG_STRING); $optargs = OptionalPageArguments("privkey", PAGEARG_STRING, "check", PAGEARG_BOOLEAN, "os", PAGEARG_STRING, "os_version", PAGEARG_STRING, "distro", PAGEARG_STRING, "distro_version", PAGEARG_STRING, "arch", PAGEARG_STRING, "env", PAGEARG_STRING); # # The point of this page is to figure out what osconfig scripts # the node ought to execute, and return them in a tarball. We attempt to # cache the tarballs as much as possible and only rebuild when necessary. # # NOTE! This page is only accessible over SSL, but it is only "secure" for # widearea nodes (which provide a privkey). Local connections are not secure # at all -- eventually this could move to tmcc. And when you get down to it, # the widearea privkeys are not well protected. Consequently, NO PRIVATE DATA # should go into these scripts. There should not be a need for that, anyway. # This is meant to be an operator mechanism, not a user mechanism, and it is # not meant for private data, just client-side config stuff. # # # Constraints that we satisfy. Note that different constraint types are ANDed;
# Only known and logged in users. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $uid_idx = $this_user->uid_idx(); $isadmin = ISADMIN(); # # Verify feature is enabled # if (!$PUBSUPPORT) { USERERROR("Publication support not enabled."); } # # Verify page arguments. # $optargs = OptionalPageArguments("submit", PAGEARG_STRING, "idx", PAGEARG_INTEGER, "formfields", PAGEARG_ARRAY); # # Standard Testbed Header # PAGEHEADER("Submit Publication"); $also_required = array(); $also_required['article'] = array('conf', 'month'); $typelist = array('article', 'phd thesis', 'masters thesis', 'bachelors thesis', 'techreport', 'unpublished', 'talk', 'software', 'service'); $submit_url = isset($idx) ? CreateURL("submitpub", 'idx', $idx) : CreateURL("submitpub"); # # Make Month List # $monthlist = array(); $query_result = DBQueryFatal("select * from emulab_pubs_month_map order by display_order"); while ($r = mysql_fetch_array($query_result)) { $monthlist[$r['month']] = $r['month_name'];
# # }}} # include "defs.php3"; include_once "template_defs.php"; # # Only known and logged in users can look at experiments. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # # Verify page arguments. # $reqargs = RequiredPageArguments("template", PAGEARG_TEMPLATE); $optargs = OptionalPageArguments("expand", PAGEARG_INTEGER); if (!isset($expand)) { $expand = 0; } # # Standard Testbed Header after argument checking. # PAGEHEADER("Experiment Template History"); # # Check permission. # if (!$template->AccessCheck($this_user, $TB_EXPT_READINFO)) { USERERROR("You do not have permission to view experiment template " . "{$guid}/{$version}!", 1); } echo $template->PageHeader(); echo "<br><br>\n";
# under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or (at # your option) any later version. # # This file is distributed in the hope that it will be useful, but WITHOUT # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public # License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this file. If not, see <http://www.gnu.org/licenses/>. # # }}} # include "defs.php3"; $optargs = OptionalPageArguments("confirmed", PAGEARG_BOOLEAN, "description", PAGEARG_STRING, "referrer", PAGEARG_STRING); $this_user = CheckLogin($check_status); $referrer = isset($referrer) ? $referrer : $_SERVER['HTTP_REFERER']; $referrer = urlencode($referrer); # # Standard Testbed Header # PAGEHEADER("Page Not Working Properly!"); if ($this_user) { if (!isset($confirmed)) { echo "<center>"; echo "Are you sure you want to report a problem with:<br>\n <b>{$referrer}</b><br><br>"; echo "<form action='pagenotworking.php' method=get>"; echo "<b>Please tell us briefly what is wrong ...</b>\n"; echo "<br>\n"; echo "<textarea name=description rows=10 cols=80></textarea><br>\n";
include "defs.php3"; include_once "template_defs.php"; # # No PAGEHEADER since we spit out a Location header later. See below. # # # Only known and logged in users. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # # Verify page arguments # $reqargs = RequiredPageArguments("action", PAGEARG_STRING); $optargs = OptionalPageArguments("template", PAGEARG_TEMPLATE, "submit", PAGEARG_STRING, "metadata", PAGEARG_METADATA, "metadata_type", PAGEARG_STRING, "referrer", PAGEARG_STRING, "formfields", PAGEARG_ARRAY); # Need these below. $guid = $template->guid(); $vers = $template->vers(); $pid = $template->pid(); $unix_gid = $template->UnixGID(); $project = $template->GetProject(); $unix_pid = $project->unix_gid(); # # Spit the form out using the array of data. # function SPITFORM($action, $formfields, $errors) { global $template, $metadata, $referrer; global $metadata_type; $template_guid = $template->guid();
# include "defs.php3"; # # Only known and logged in users can do this. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); if (!$isadmin) { USERERROR("You do not have permission to access this page!", 1); } # # Verify form arguments. # $reqargs = RequiredPageArguments("project", PAGEARG_PROJECT); $optargs = OptionalPageArguments("submit", PAGEARG_STRING, "message", PAGEARG_ANYTHING); $pid = $project->pid(); PAGEHEADER("Resend Project Approval Message"); # # Form to allow text input. # function SPITFORM($project, $message, $errors) { global $this_user; $message = CleanString($message); if ($errors) { echo "<table class=nogrid\n align=center border=0 cellpadding=6 cellspacing=0>\n <tr>\n <th align=center colspan=2>\n <font size=+1 color=red>\n Oops, please fix the following errors! \n </font>\n </td>\n </tr>\n"; while (list($name, $message) = each($errors)) { # XSS prevention. $message = CleanString($message); echo "<tr>\n <td align=right>\n <font color=red>{$name}: </font></td>\n <td align=left>\n <font color=red>{$message}</font></td>\n </tr>\n";
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public # License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this file. If not, see <http://www.gnu.org/licenses/>. # # }}} # include "pub_defs.php"; # # Only known and logged in users. # $this_user = CheckLoginOrDie(); $uid_idx = $this_user->uid_idx(); $isadmin = ISADMIN(); $optargs = OptionalPageArguments("showdeleted", PAGEARG_BOOLEAN); PAGEHEADER("Deleted Publications"); ?> <p>To undelete a publication simply edit it again and unclick "Mark As Deleted"</p> <?php $where_clause = ''; $deleted_clause = '`deleted`'; if ($isadmin) { $where_clause = '1'; } else { $where_clause = "(`owner` = {$uid_idx} or `last_edit_by` = {$uid_idx})"; } $query_result = GetPubs($where_clause, $deleted_clause); echo MakeBibList($this_user, $isadmin, $query_result);
include_once "template_defs.php"; # # No PAGEHEADER since we spit out a Location header later. See below. # # # Only known and logged in users. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # This will not return if its a sajax request. include "showlogfile_sup.php3"; # # Verify page arguments. # $optargs = OptionalPageArguments("create", PAGEARG_STRING, "formfields", PAGEARG_ARRAY); # # Spit the form out using the array of data. # function SPITFORM($formfields, $errors) { global $TBDB_PIDLEN, $TBDB_GIDLEN, $TBDB_EIDLEN, $TBDOCBASE; global $projlist; global $TBVALIDDIRS_HTML; global $WIKIDOCURL; PAGEHEADER("Create an Experiment Template"); if ($errors) { echo "<table class=nogrid\n align=center border=0 cellpadding=6 cellspacing=0>\n <tr>\n <th align=center colspan=2>\n <font size=+1 color=red>\n Oops, please fix the following errors! \n </font>\n </td>\n </tr>\n"; while (list($name, $message) = each($errors)) { # XSS prevention. $message = CleanString($message);
# # # Capture script errors and report back to user. # function SPITERROR($message = "", $death = 1) { header("Content-type: image/gif"); readfile("coming-soon-thumb.gif"); } $session_interactive = 0; $session_errorhandler = 'SPITERROR'; # # Verify page arguments. # $reqargs = RequiredPageArguments("template", PAGEARG_TEMPLATE); $optargs = OptionalPageArguments("zoom", PAGEARG_STRING); if (isset($zoom)) { if ($zoom != "in" && $zoom != "out") { PAGEARGERROR("Invalid characters in zoom factor!"); } } function SPITGRAPH($template) { $data = NULL; if ($template->GraphImage($data) != 0 || $data == NULL || $data == "") { SPITERROR(); } else { header("Content-type: image/png"); echo "{$data}"; } }
# include "defs.php3"; # # Only admin users ... # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); if (!$isadmin) { USERERROR("You do not have permission to change login names!", 1); } # # Verify page/form arguments. # $reqargs = RequiredPageArguments("target_user", PAGEARG_USER); $optargs = OptionalPageArguments("submit", PAGEARG_STRING, "new_uid", PAGEARG_STRING); $target_uid = $target_user->uid(); $target_idx = $target_user->uid_idx(); if ($target_user->status() != TBDB_USERSTATUS_UNAPPROVED) { USERERROR("The user {$target_uid} must be " . "unapproved (but verified) to change!", 1); } function SPITFORM($target_user, $new_uid, $error) { global $TBDB_UIDLEN; $target_uid = $target_user->uid(); $target_webid = $target_user->webid(); $new_uid = CleanString($new_uid); # # Standard Testbed Header. # PAGEHEADER("Change login UID for user");
# # Only known and logged in users. # $this_user = CheckLoginOrDie(); $uid = $this_user->uid(); $isadmin = ISADMIN(); # This will not return if its a sajax request. include "showlogfile_sup.php3"; # Used below unset($parameter_xmlfile); $deletexmlfile = 0; # # Verify page arguments. # $reqargs = RequiredPageArguments("instance", PAGEARG_INSTANCE); $optargs = OptionalPageArguments("action", PAGEARG_STRING, "exprun", PAGEARG_STRING, "parameters", PAGEARG_ARRAY, "formfields", PAGEARG_ARRAY); $template = $instance->GetTemplate(); # Need these below. $guid = $template->guid(); $vers = $template->vers(); $pid = $template->pid(); $eid = $instance->eid(); $unix_gid = $template->UnixGID(); $exptidx = $instance->exptidx(); $experiment = $instance->GetExperiment(); $project = $template->GetProject(); $unix_pid = $project->unix_gid(); if (!$template->AccessCheck($this_user, $TB_EXPT_MODIFY)) { USERERROR("You do not have permission to export in template " . "{$guid}/{$vers}!", 1); } #