|
7 | 7 | */ |
8 | 8 |
|
9 | 9 | // base location of new webCAT installation |
10 | | -define("WEBCAT_LOCATION", "https://localhost/"); |
| 10 | +define("WEBCAT_LOCATION", "https://cat.bio.informatik.uni-rostock.de/"); |
11 | 11 | // location to redirect to, with trailing slash and history endpoint path |
12 | | -define("REDIRECT_LOCATION", WEBCAT_LOCATION . "/rest/history/"); |
13 | | -// Show information page first and not directly redirect via HTTP header |
14 | | -define("SHOW_INFO_PAGE", true); |
| 12 | +define("REDIRECT_LOCATION", WEBCAT_LOCATION . "rest/history/"); |
15 | 13 |
|
16 | 14 | // path of the current workspace |
17 | 15 | define("COOKIE_PATH", "combinearchiveweba"); |
|
22 | 20 |
|
23 | 21 | // ---------------------------------------------------------------------------- |
24 | 22 |
|
25 | | -$success = false; |
26 | | -$redirect_url = WEBCAT_LOCATION; |
| 23 | +$migrate_url = WEBCAT_LOCATION; |
| 24 | +$redirect_url = WEBCAT_LOCATION . substr($_SERVER['REQUEST_URI'], 1); |
27 | 25 |
|
28 | 26 | if( isset($_COOKIE[COOKIE_HISTORY]) and $_COOKIE[COOKIE_HISTORY] != "" ) { |
29 | 27 | // history cookie is set -> decode it |
|
45 | 43 | } |
46 | 44 | } |
47 | 45 |
|
48 | | - $redirect_url = REDIRECT_LOCATION . implode(",", $result); |
49 | | - $success = true; |
50 | | - if( !SHOW_INFO_PAGE ) { |
51 | | - header("Location", $redirect_url); |
52 | | - exit(); |
53 | | - } |
| 46 | + $migrate_url = REDIRECT_LOCATION . implode(",", $result); |
| 47 | +} |
| 48 | +else { |
| 49 | + // redirect directly to new page, using the proper endpoint, since no cookie was set. |
| 50 | + header("Location", $redirect_url); |
| 51 | + exit(); |
54 | 52 | } |
55 | 53 | ?><!DOCTYPE html> |
56 | 54 | <html lang="en-us"> |
|
62 | 60 | html, body { margin: 0; padding: 0; width: 100%; height: 100%; background-color: #CCC; color: black; font: 1em normal "Verdana","Arial","Georgia",sans-serif; text-align: center;} |
63 | 61 | a { text-decoration: underline; color: #A00; } |
64 | 62 | a:hover { text-decoration: none !important; } |
65 | | - .frame { width: 570px; height: 100%; margin: 0 auto; padding: 2em 5px; text-align: left; background-color: #EEE; border: 1px solid #AAA; border-style: none solid none solid; } |
| 63 | + .frame { width: 570px; height: 100%; margin: 0 auto; padding: 0 5px; text-align: left; background-color: #EEE; border: 1px solid #AAA; border-style: none solid none solid; } |
66 | 64 | .content { } |
67 | | - h1 { width: 100%; font 1.5em bold; line-height: 1.05em; margin-bottom: 2em; } |
68 | | - p, div.ws-list { margin-bottom: 3em; padding: 0 5px; text-align: justify; } |
69 | | - p.button { text-align: center; } |
70 | | - a.button { display: box; padding: 0.5em 1em; color: #FFF; background-color: #0D0; text-align: center; vertical-align: center; font: 1.3em bold; text-decoration: none; font-weight: bold; } |
71 | | - a.button:hover { background-color: #090 !important; } |
| 65 | + div.header { padding-top: 2em !important; } |
| 66 | + div.header > h1 { width: 100%; font 1.5em bold; line-height: 1.05em; margin: 0; } |
| 67 | + p, div.text { margin-bottom: 3em; padding: 0 5px; text-align: justify; } |
| 68 | + iframe { width: 100%; height: 3em; border: 1px solid #AAA } |
| 69 | + div.button { margin-bottom: 3em; padding: 0 5px; text-align: center; } |
| 70 | + a.button { display: box; padding: 0.5em 1em; color: #FFF; text-align: center; vertical-align: center; font: 1.3em bold; text-decoration: none; font-weight: bold; } |
| 71 | + a.ok { background-color: #0D0; } |
| 72 | + a.ok:hover { background-color: #090 !important; } |
| 73 | + a.warn { background-color: #c68523 } |
| 74 | + a.warn:hover { background-color: #915f15 !important; } |
72 | 75 | </style> |
73 | 76 | </head> |
74 | 77 |
|
75 | 78 | <body> |
76 | 79 | <div class="frame"> |
77 | 80 | <div class="content"> |
78 | | - <h1>This webCAT instance moved!</h1> |
79 | | - |
| 81 | + <div class="text header"> |
| 82 | + <h1>This webCAT instance moved!</h1> |
| 83 | + </div> |
80 | 84 | <p class="explain"> |
81 | | - This <a href="http://sems.uni-rostock.de/cat" target="_blank">webCAT</a> instance move to a new domain. |
82 | | - <?php if( $success ) { ?> |
83 | | - To ensure you can still access your pressures workspaces and archives |
84 | | - you can migrate the history cookie, which contains all the workspace IDs. To do so please click on the button down below. |
85 | | - <?php } else { ?> |
86 | | - It does not seem, that you do not had any workspaces stored at this place. So you can just click at the button below to |
87 | | - access webCAT at the new domain. |
88 | | - <?php } ?> |
89 | | - |
| 85 | + This <a href="http://sems.uni-rostock.de/cat" target="_blank">webCAT</a> instance move to <a href="<?php echo(WEBCAT_LOCATION); ?>" target="_blank"><?php echo(parse_url(WEBCAT_LOCATION, PHP_URL_HOST)); ?></a>. |
| 86 | + To ensure you can still access your pressures workspaces and archives, we now try to migrate your workspace history. |
90 | 87 | </p> |
91 | 88 |
|
92 | | - <p class="button"> |
93 | | - <a class="button" href="<?php echo($redirect_url); ?>"><?php echo($success ? "Migrate Workspaces" : "Go to new Instance"); ?></a> |
94 | | - </p> |
| 89 | + <div class="button"> |
| 90 | + <a class="button ok" href="<?php echo($redirect_url); ?>">Go to new Instance</a> |
| 91 | + </div> |
| 92 | + |
| 93 | + <div class="text process"> |
| 94 | + We now attempt to automatically migrate your history... <br /> |
| 95 | + <iframe src="<?php echo($migrate_url); ?>"></iframe> |
| 96 | + <br /> |
| 97 | + If frame above does not show a success message, please try to migrate your workspace history manually by clicking on the button below. This might be necessary, if your browser does not allow iframes. |
| 98 | + </div> |
| 99 | + |
| 100 | + <div class="button"> |
| 101 | + <a class="button warn" href="<?php echo($migrate_url); ?>">Migrate Workspaces Manually</a> |
| 102 | + </div> |
95 | 103 |
|
96 | | - <?php if($success) { ?> |
97 | | - <div class="ws-list"> |
| 104 | + <div class="text ws-list"> |
98 | 105 | Following workspaces were found: |
99 | 106 | <ul> |
100 | 107 | <?php foreach( $result as $entry ) { ?> |
101 | 108 | <li> |
102 | | - <?php echo($names[$entry]); ?><br /> |
| 109 | + <b><?php echo($names[$entry]); ?></b><br /> |
103 | 110 | <code><?php echo($entry); ?></code> |
104 | 111 | </li> |
105 | 112 | <?php } ?> |
106 | 113 | </ul> |
107 | 114 | </div> |
108 | | - <?php } ?> |
109 | 115 | </div> |
110 | 116 | </div> |
111 | 117 | </body> |
|
0 commit comments