Dynamic DNS

Discussion in 'Developers' Forum' started by omry, Sep 17, 2008.

  1. FFH

    FFH New Member

    Hi Till, The user does exist and username and password is absolutely correct.
    I have setup a test environment for this, I am really keen to get this working. Any help greatly appreciated.
    Here is the code, you can see I have applied your update already.

    PHP:
    <?php
    $user 
    $_GET['user'];
    $pass $_GET['pass'];
    $ip = isset($_GET['ip']) ? isset($_GET['ip']) : $_SERVER['REMOTE_ADDR'];
    $domain = !empty($_GET['domain']) ? $_GET['domain'] : error(500"missing domain");

    require_once(
    '../../../lib/config.inc.php');
    require_once(
    '../../../lib/classes/auth.inc.php');
    require_once(
    '../../../lib/app.inc.php');

    global 
    $app;
    $ip       $app->db->quote($ip);
    $user     $app->db->quote($user);
    $pass     $app->db->quote($pass);
    $domain   $app->db->quote($domain);

    $sql "SELECT * FROM sys_user WHERE USERNAME = '$user' and ( PASSWORT = '".md5($pass)."' or PASSWORT = password('$pass') )";
    $app->db->show_error_messages true;
    $dbuser $app->db->queryOneRecord($sql);
    if (
    $dbuser === falseerror(403"authentication failed");
    $groups $dbuser['groups'];

    $id $app->db->queryOneRecord("SELECT id FROM dns_rr WHERE name = '$domain' AND type = 'A' AND sys_groupid IN ($groups)");
    if (
    $id === falseerror(404"DNS record not found");
    $id $id['id'];
    $app->db->datalogUpdate('dns_rr'"data = '$ip'"'id'$id);

    function 
    error($code$msg)
    {
        
    header("HTTP/1.0 $code $msg");
        echo 
    $msg;
        die();
    }
    ?>
     
    Last edited: Dec 7, 2017

Share This Page