Comments (3)
This seems to be a good idea. I will think on this and how to implement if I have enough time. There are some minor conceptual changes in the way the api works.
Is there any official documentation on the dyndns2 protocol?
from pdnsmanager.
not really i can send you some code i wrote to make it work, i used codeigniter for it, it was pretty strait forward let me upload the code i have
from pdnsmanager.
`<?php defined('BASEPATH') OR exit('No direct script access allowed');
class Nic extends CI_Controller
{
public function index()
{
$this->checkip();
}
public function checkip()
{
header("Content-Type: text/plain");
print $_SERVER['REMOTE_ADDR'];
}
public function update()
{
if (!isset($_SERVER['PHP_AUTH_USER']))
{
header('WWW-Authenticate: Basic realm="DYNDNS"');
header('HTTP/1.0 401 Unauthorized');
exit;
}
$data = new stdClass();
$data->username = $_SERVER['PHP_AUTH_USER'];
$data->password = $_SERVER['PHP_AUTH_PW'];
$data->hostname = explode(',', $this->input->get('hostname'));
$data->ip = ( $this->input->get('myip') !== null ) ? $this->input->get('myip') : $this->input->ip_address() ;
$user_data = $this->db->select('user_id')
->where('username', $data->username)
->where('password', $data->password)
->get('remote_users');
if($user = $user_data->row())
{
foreach($data->hostname as $hostname)
{
$check_record = $this->db->select('record_id')
->from('records')
->join('xref_users_records', 'records.id = xref_users_records.record_id')
->where('records.name', $hostname)
->where('xref_users_records.user_id', $user->user_id)
->get();
if($record_data = $check_record->row())
{
$record = new stdClass();
$record->content = $data->ip;
$this->db->where('id', $record_data->record_id);
$this->db->update('records', $record);
$log = new stdClass();
$log->user = $data->username;
$log->record = $hostname;
$log->ip_address = $data->ip;
$log->timestamp = date('Y-m-d H:i:s');
$this->db->insert('xref_logs', $log);
print "good " . $data->ip;
}
else
{
print "nohost";
exit();
}
}
}
else
{
print "badauth";
exit();
}
}
}
`
from pdnsmanager.
Related Issues (20)
- How do I reset password via the database? HOT 4
- Password manager: button "Login" disabled HOT 6
- Default TTL is 24 hours - is it possible to change that? HOT 2
- Consider opening a Liberapay account HOT 1
- PDNS manager LDAP configuration not working HOT 1
- Flexible DB Backend would be great (supporting sqlite for small instances)? HOT 1
- Upgrading to 1.2.1 to current... HOT 1
- change_date column is dropped since powerdns 4.2.0 HOT 1
- Install - fails HOT 24
- LDAP / AD Support HOT 1
- email field leads to validation errors
- pdnsutil check-zone HOT 2
- OTP support feature request
- Input validation issue HOT 5
- Remove RewriteRules HOT 1
- Documentation for v1.x HOT 2
- Need a way to edit records.auth column thru the WebUI
- main page not working !!!! HOT 3
- Error with main*.js HOT 1
- Is this project still alive ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdnsmanager.