if (count($_POST) > 0) { $uid = preg_replace('/[^0-9\\_]/', '', _INPUT("UID")); $service = preg_replace('/[^A-Za-z]/', '', _INPUT("SERVICE")); $version = preg_replace('/[^0-9\\.]/', '', _INPUT("VERSION")); if ($version != '') { # Adding dash to version $version = '-' . $version; } $wwwroot .= $service . $version . "/"; //include $htdocs.$service.$version."/header.html"; # Header file # INCLUDE STANDARD HTML HEADER $CGE = new CGE(); // Load the Class # INCLUDE CGE MENU # Format is: ServerName, "(Link/Path.html, 'NameOfLink'),(Link/Path.html, 'NameOfLink')" $CGE->std_header("", "(" . $wwwroot . "instructions.php,'Instructions'),(" . $wwwroot . "output.php,'Output'),(" . $wwwroot . "abstract.php,'Article abstract')"); // Print the Menu if ($uid != "" and $service != "") { $fullPath = "/panfs1/cge-servers/" . $service . "/" . $service . $version . "/IO/" . $uid . "/final_output/" . $service . ".out.gz"; #echo $fullPath; readgzfile($fullPath); } $CGE->Piwik(15); // Printing Piwik codes!! # INCLUDE STANDARD FOOTER # First a simple headline like: "Support" # Then a list of emails like this: "('Scientific problems','foo','*****@*****.**'),('Technical problems','bar','*****@*****.**')" $CGE->standard_foot("Support", "('Technical problems','Martin Thomsen','*****@*****.**')"); //include $htdocs.$service.$version."/footer.html"; # Footer file } else { #HTML form to submit UID and pick service from list
* 'edit' -> Allows the users to edit and delete their profile * 'show' -> Allows the users to see their profile details * 'pend_create' -> Waiting page while the user activates the profile * 'pend_delete' -> Waiting page while the user confirms the profile deletion * 'pend_delete' -> Waiting page while the user confirms the profile deletion */ $domain = 'https://cge.cbs.dtu.dk'; $serviceRoot = "/srv/www/htdocs/services/"; # STANDARD CBS PAGE TEMPLATES, always include this file include_once '/srv/www/php-lib/cge_std_tools.php'; // Including CGE_std clases and functions // Load the CGE class (title, meta_tags, banner_path, css_paths, js_paths) '' is default $CGE = new CGE('Sample Overview', '<base href="' . $domain . '" target="_blank">', '', '/tools_new/client/platform/styles/isolate_manager.css', '/tools_new/client/platform/scripts/isolate_manager.js'); # CGE MENU # Format is: ServerName, "(Link/Path.html, 'NameOfLink'),(Link/Path.html, 'NameOfLink')" $CGE->std_header("Sample Overview", "(/tools_new/client/platform/sample/,'Home'),(/services/,'Services'),(/services/cge/index.php,'Batch Upload'),(/services/CGEpipeline-1.0/map.php,'MapViewer')", FALSE); // Print the Menu // REQUIRE THE USER TO LOGIN if ($CGE->user_is_logged_in()) { $ACTION = _INPUT("action"); if ($ACTION == "edit") { // SHOW EDITING FORM $iid = _INPUT("iid"); ?> <!-- START OF CONTENT --> <div id='edit'> <button onclick="delete_isolate(<?php echo $iid; ?> );location.href=window.location.pathname;">Delete sample</button> <h3>Sample files: <span id='files' style='color:grey;'>No files were found!</span></h3>
################################################################################ # CGE SERVICES # ################################################################################ # CONFIG VARIABLE $serviceRoot = "/srv/www/htdocs/services/"; # STANDARD CBS PAGE TEMPLATES, always include this file include_once '/var/www/php/cge_std-2.0.php'; // Including CGE_std clases and functions // $domain = 'https://cge.cbs.dtu.dk'; $meta_headers = "<base href=/>"; $banner = ''; // '' is default = red CGE banner $java_scripts = ''; $styles_heets = ''; $CGE = new CGE('CGE Server', $meta_headers, $banner, $styles_heets, $java_scripts); $CGE->std_header("File-Sharing Upload", "(/all.php,'Upload'),(/files.php,'Download')", FALSE); if (substr($_SERVER['REMOTE_ADDR'], 0, 3) == '10.') { $cbsUser = TRUE; } else { $cbsUser = FALSE; } // phpInfo(); // REQUIRE THE USER TO LOGIN if ($CGE->user_is_logged_in()) { ?> <!-- START INDHOLD --> <style type="text/css"> .pad{padding-left: 30px;} </style> <!--
// Load the Class function runLink($service, $version, $runid, $name) { $str = "<tr><td valign='middle' height='5'><form action='/cge/show_result.php' method='POST'>"; $str .= " <input type='hidden' name='UID' value='{$runid}'>"; $str .= " <input type='hidden' name='SERVICE' value='{$service}'>"; $str .= " <input type='hidden' name='VERSION' value='{$version}'>"; $str .= " <input type='submit' value='{$name}'>"; $str .= "</form></td></tr>\n"; return $str; } $serviceRoot = "/srv/www/htdocs/services/" . $service . "-" . $version . "/"; #SERVICE ROOT # CGE MENU # Format is: ServerName, "(Link/Path.html, 'NameOfLink'),(Link/Path.html, 'NameOfLink')" $CGE->std_header("User Overview", "(./,'User Home'),(/services/,'Services')", FALSE); // Print the Menu ?> <!-- START CONTENT --> <style type="text/css"> table, tr, td { margin: 0px; padding: 0px; text-align: center; vertical-align: middle; position:relative; } </style> <div id='userinfo' style='width:1024px;float:left;'> <!-- USER INFO -->
* 'edit' -> Allows the users to edit and delete their profile * 'show' -> Allows the users to see their profile details * 'pend_create' -> Waiting page while the user activates the profile * 'pend_delete' -> Waiting page while the user confirms the profile deletion * 'pend_delete' -> Waiting page while the user confirms the profile deletion */ $domain = 'https://cge.cbs.dtu.dk'; $serviceRoot = "/srv/www/htdocs/services/"; # STANDARD CBS PAGE TEMPLATES, always include this file include_once '/srv/www/php-lib/cge_std-2.0.php'; // Including CGE_std clases and functions // Load the CGE class (title, meta_tags, banner_path, css_paths, js_paths) '' is default $CGE = new CGE('Isolate Overview', '<base href="' . $domain . '" target="_blank">', '', '/cge/user/isolate/css/isolate_manager.css', '/cge/user/isolate/js/isolate_manager.js'); # CGE MENU # Format is: ServerName, "(Link/Path.html, 'NameOfLink'),(Link/Path.html, 'NameOfLink')" $CGE->std_header("Isolate Overview", "(/cge/user/login/user_manager.php?action=show,'User Home'),(/services/,'Services'),(/services/cge/batch.php,'Batch Upload'),(/services/cge/map.php,'MapViewer')", FALSE); // Print the Menu //function runLink($service, $version, $runid, $name){ // $str = "<tr><td valign='middle' height='5'><form action='../show_result.php' method='POST'>"; // $str .= " <input type='hidden' name='UID' value='$runid'>"; // $str .= " <input type='hidden' name='SERVICE' value='$service'>"; // $str .= " <input type='hidden' name='VERSION' value='$version'>"; // $str .= " <input type='submit' value='$name'>"; // $str .= "</form></td></tr>\n"; // return $str; //} $ACTION = _INPUT("action"); if ($ACTION == "edit") { // SHOW EDITING FORM $iid = _INPUT("iid"); ?>
*/ // $domain = 'https://cge.cbs.dtu.dk'; $domain = ''; // $meta_headers = "<base href='$domain'>"; $serviceRoot = "/srv/www/htdocs/services/"; error_reporting(E_ALL); ini_set('error_log', '/srv/www/htdocs/services/error_log'); ini_set('log_errors', 'true'); # STANDARD CBS PAGE TEMPLATES, always include this file include_once '/var/www/php/cge_std-2.0.php'; // Including CGE_std clases and functions // Load the CGE class (title, meta_tags, banner_path, css_paths, js_paths) '' is default $CGE = new CGE('CGE User-pages', "", '', '', "/cge/user/login/js/user_manager.js,/cge/user/login/js/user_actuator.js"); # CGE MENU # Format is: ServerName, "(Link/Path.html, 'NameOfLink'),(Link/Path.html, 'NameOfLink')" $CGE->std_header("User Overview", "(/cge/user/login/user_manager.php?action=show,'User Home'),(/services/,'Services')", FALSE); // Print the Menu //function _INPUT($name){ // // QUERY HANDLER: Used to get form elements and queries in a simple manner // // AUTHOR: Martin Thomsen // // USAGE: $form_text = _INPUT('form_text_name'); // if ($_SERVER['REQUEST_METHOD'] == 'POST' and isset($_POST[$name])) // return strip_tags($_POST[$name]); // elseif ($_SERVER['REQUEST_METHOD'] == 'GET' and isset($_GET[$name])) // return strip_tags($_GET[$name]); // else return NULL; //} $ACTION = _INPUT("action"); if ($ACTION == "create") { // SHOW CREATION FORM ?>
function respond($status, $DATA, $EXIT = false, $template = false, $human = false) { /* Tools Paths */ //global $CGE; $domain = ''; $toolspath = '/tools_new/client/platform'; if ($template == true) { // Load the CGE Class :: ARGUMENTS=($title, $meta, $banner,$css,$js) $CGE = new CGE('CGE Server', '<base href="' . $domain . '">', '/images/cge_buttons/banner.gif', '', ''); // CGE MENU $CGE->std_header("CGE Server", "({$toolspath}/user_settings.php,'User Home'),(/services/,'Services'),({$toolspath}/isolate_manager.php,'Sample Overview'),({$toolspath}/map.php,'Map')"); // Print the Menu } if ($human == true) { /* PRINTING THE HUMAN RESPONSE */ // REQUIRE THE USER TO LOGIN if (isset($CGE)) { if ($CGE->user_is_logged_in()) { // Write Message echo "<br><table style='margin:auto;'><tr><th>Server Response</th><th>Message</th></tr><tr><td style='text-align:center;'>{$status}</td><td>" . str_replace("\n", "<br>", $DATA['MESSAGE']) . "</td></tr></table>"; } } else { echo "<br><table style='margin:auto;'><tr><th>Server Response</th><th>Message</th></tr><tr><td style='text-align:center;'>{$status}</td><td>" . str_replace("\n", "<br>", $DATA['MESSAGE']) . "</td></tr></table>"; } } else { /* PRINTING THE XML RESPONSE */ $xml = new SimpleXMLElement('<XML/>'); $xml->addChild('STATUS', $status); arr2xml($DATA, $xml); print $xml->asXML(); } if ($template == true) { // TRACK USER TRAFIC $CGE->Piwik(14); # STANDARD FOOTER $CGE->standard_foot("Support", "('Technical problems','CGE Support','cgehelp')"); } if ($EXIT == true) { exit; } }