Added rdp:// and fixed port update

- Although the port isn't used while testing a website, changing it prevents confusion.
- It seems like rdp:// was supported, but starting a url with it wasn't...
pull/629/head
TimZ99 2018-08-29 23:34:45 +02:00
parent b49659f49a
commit 0b7d77f801
No known key found for this signature in database
GPG Key ID: 4D8268DC68E8339D
1 changed files with 3 additions and 3 deletions

View File

@ -278,15 +278,15 @@ class ServerController extends AbstractServerController {
'telegram' => in_array($_POST['telegram'], array('yes', 'no')) ? $_POST['telegram'] : 'no', 'telegram' => in_array($_POST['telegram'], array('yes', 'no')) ? $_POST['telegram'] : 'no',
); );
// make sure websites start with http:// // make sure websites start with http://
if ($clean['type'] == 'website' && substr($clean['ip'], 0, 4) != 'http') { if ($clean['type'] == 'website' && substr($clean['ip'], 0, 4) != 'http' && substr($clean['ip'], 0, 3) != 'rdp') {
$clean['ip'] = 'http://'.$clean['ip']; $clean['ip'] = 'http://'.$clean['ip'];
} }
// validate the lot // validate the lot
$server_validator = new \psm\Util\Server\ServerValidator($this->db); $server_validator = new \psm\Util\Server\ServerValidator($this->db);
// format port from http/s url // format port from http, https or rdp url
if ($clean['type'] == 'website' && empty($clean['port'])) { if ($clean['type'] == 'website') {
$tmp = parse_url($clean["ip"]); $tmp = parse_url($clean["ip"]);
if (isset($tmp["port"])) { if (isset($tmp["port"])) {
$clean["port"] = $tmp["port"]; $clean["port"] = $tmp["port"];