-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsubmit.php
More file actions
33 lines (32 loc) · 1 KB
/
Copy pathsubmit.php
File metadata and controls
33 lines (32 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?PHP
include 'header.php';
include 'language.php';
include 'clusters.php';
$uname=$_SESSION['uname'];
$admin=$_SESSION['admin'];
$pword=$_SESSION['password'];
$setenvdir = 'export CB_ENVDIR='.$_SESSION['mycluster']['env'].';';
$cmdPrefix = 'export OLWD='.$pword.';source ./env.sh;'.$setenvdir.'cmd/runas '.$uname;
$cmdExt = $_SESSION['ext'];
$app= isset($_GET['app']) ? $_GET['app'] : '';
if ($app == '')
header ("Location: login.php");
if (isset($_SESSION['geometry']))
$geometry = ' -geometry '.$_SESSION['geometry'];
else
$geometry = '';
include('apps/'.$app.'_sub.php');
$ret = sscanf($res[0], "Job %d has been submitted");
if (!is_int($ret[0]))
$ret = sscanf($res[0], "Job <%d> is submitted");
if (is_int($ret[0])) {
$jobid=$ret[0];
if (strpos ($cmd, "vnc") !== false
|| strpos ($cmd, "dcv") != false
|| strpos ($cmd, "jupyter") != false)
$_SESSION['j'.strval($jobid)] = 'y';
header("Location: job.php?jobid=".$jobid."&idx=0");
die();
}
include('submitted.php');
?>