-
Notifications
You must be signed in to change notification settings - Fork 9
/
omero_actions.php
67 lines (53 loc) · 1.8 KB
/
omero_actions.php
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
// This file is part of the Huygens Remote Manager
// Copyright and license notice: see license.txt
// This is for the 'OMERO Data' button.
use hrm\OmeroConnection;
if ($omero_transfers && !$_SESSION['user']->isAdmin()) {
if ( $browse_folder == "src" ) {
$file_buttons[] = "omeroImport";
} else {
$file_buttons[] = "omeroExport";
}
}
// If the 'OMERO Data' button gets pressed we'll instantiate the class.
if (isset($_POST['omeroCheckCredentials'])) {
if (!isset($_SESSION['omeroConnection'])) {
if (isset($_POST['omeroUser']) ) {
$omeroUser = $_POST['omeroUser'];
} else {
$omeroUser = '';
}
if (isset($_POST['omeroPass']) ) {
$omeroPass = $_POST['omeroPass'];
} else {
$omeroPass = '';
}
$omeroConnection = new OmeroConnection( $omeroUser, $omeroPass );
if ($omeroConnection->loggedIn) {
$_SESSION['omeroConnection'] = $omeroConnection;
} else {
$message = "Logging into OMERO failed, please try again!";
}
}
}
// If an instance of the Omero class exists and 'Import' gets pressed.
if (isset($_POST['importFromOmero'])) {
$message = $_SESSION['fileserver']->importFromOmero();
} else if (isset($_POST['update'])) {
if ( $browse_folder == "src" ) {
$_SESSION['fileserver']->resetFiles();
} else {
$_SESSION['fileserver']->resetDestFiles();
}
}
// If an instance of the Omero class exists and 'Export' gets pressed.
if (isset($_POST['exportToOmero'])) {
$message = $_SESSION['fileserver']->exportToOmero();
} else if (isset($_POST['update'])) {
if ( $browse_folder == "src" ) {
$_SESSION['fileserver']->resetFiles();
} else {
$_SESSION['fileserver']->resetDestFiles();
}
}