Completed
Pull Request — develop (#7)
by Peter
01:58
created

update.php (1 issue)

Labels
Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Affenrakete;
4
5
/**
6
 * INWX DDNS Manager
7
 *
8
 * @author Peter Siemer <[email protected]>
9
 * @license https://opensource.org/licenses/GPL-3.0 GNU Public License
10
 * @link https://affenrakete.de
11
 *
12
 */
13
header('Content-type: text/plain; charset=utf-8'); // Set UFT-8 Header
14
15
require_once('./includes/ddns.php');
16
require_once('./vendor/autoload.php');
17
18
define("DEBUG", false);
19
define("OUTPUT", true);
20
21
if (DEBUG) {
22
    error_reporting(-1);
23
    ini_set("display_errors", 1);
24
}
25
26
$input['domain'] = filter_has_var(INPUT_GET, 'domain') ? filter_input(INPUT_GET, 'domain', FILTER_VALIDATE_REGEXP, ['options' => ['regexp' => '/(?!.{253})((?!-)[A-Za-z0-9-]{1,63}(?<!-)\.){1,126}+[A-Za-z]{2,6}/']]) : null;
27
$input['password'] = filter_has_var(INPUT_GET, 'password') ? filter_input(INPUT_GET, 'password') : null;
28
$input['ipv4'] = filter_has_var(INPUT_GET, 'ipv4') ? filter_input(INPUT_GET, 'ipv4', FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) : null;
29
$input['ipv6'] = filter_has_var(INPUT_GET, 'ipv6') ? filter_input(INPUT_GET, 'ipv6', FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) : null;
30
31
$ddns = new DDNS($input['domain'], $input['password']);
32
33
if($ddns->inwxLogin()) {
34
    if($ddns->inwxGetNameserverInfo()) {
35
        $dnns->inwxSetNameserverInfo($input['ipv4'], 'ipv4');
36
        $dnns->inwxSetNameserverInfo($input['ipv6'], 'ipv6');
37
    }
38
}
39
if(OUTPUT){
40
    $ddns->returnStatus();
0 ignored issues
show
The method returnStatus() does not seem to exist on object<Affenrakete\DDNS>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
41
}
42
$ddns->inwxLogout();
43