forked from poweradmin/poweradmin
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'poweradmin/master'
- Loading branch information
Showing
663 changed files
with
39,698 additions
and
708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"description": "A web-based control panel for PowerDNS.", | ||
"name": "poweradmin/poweradmin", | ||
"type": "project", | ||
"homepage": "http://www.poweradmin.org", | ||
"license": "GPL-3.0", | ||
"support": { | ||
"issues": "https://github.com/poweradmin/poweradmin/issues", | ||
"wiki": "https://github.com/poweradmin/poweradmin/wiki", | ||
"irc": "irc://irc.oftc.net/poweradmin", | ||
"source": "https://github.com/poweradmin/poweradmin" | ||
}, | ||
"require": { | ||
"php": ">=5.5.0", | ||
"twig/twig": "~1.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Poweradmin\\": "vendor/poweradmin/" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
class RecordLog { | ||
|
||
private $record_prior; | ||
private $record_after; | ||
|
||
private $record_changed = false; | ||
|
||
public function log_prior($rid) { | ||
$this->record_prior = $this->getRecord($rid); | ||
} | ||
|
||
public function log_after($rid) { | ||
$this->record_after = $this->getRecord($rid); | ||
} | ||
|
||
private function getRecord($rid) { | ||
return get_record_from_id($rid); | ||
} | ||
|
||
public function has_changed(array $record) { | ||
// Arrays are assigned by copy. | ||
// Copy arrays to avoid side effects caused by unset(). | ||
$record_copy = $record; | ||
$record_prior_copy = $this->record_prior; | ||
|
||
// Don't compare the 'change_date' | ||
unset($record_copy["change_date"]); | ||
unset($record_prior_copy["change_date"]); | ||
|
||
// PowerDNS only searches for lowercase records | ||
$record_copy['name'] = strtolower($record_copy['name']); | ||
$record_prior_copy['name'] = strtolower($record_prior_copy['name']); | ||
|
||
// Quotes are special for SPF and TXT | ||
$type = $record_prior_copy['type']; | ||
if ($type == "SPF" || $type == "TXT") { | ||
$record_prior_copy['content'] = trim($record_prior_copy['content'], '"'); | ||
$record_copy['content'] = trim($record_copy['content'], '"'); | ||
} | ||
|
||
// Make $record_copy and $record_prior_copy compatible | ||
$record_copy['id'] = $record_copy['rid']; | ||
$record_copy['domain_id'] = $record_copy['zid']; | ||
unset($record_copy['zid']); | ||
unset($record_copy['rid']); | ||
|
||
// Do the comparison | ||
$this->record_changed = ($record_copy != $record_prior_copy); | ||
return $this->record_changed; | ||
} | ||
|
||
public function write() { | ||
log_info(sprintf('client_ip:%s user:%s operation:edit_record' | ||
. ' old_record_type:%s old_record:%s old_content:%s old_ttl:%s old_priority:%s' | ||
. ' record_type:%s record:%s content:%s ttl:%s priority:%s', | ||
$_SERVER['REMOTE_ADDR'], $_SESSION["userlogin"], | ||
$this->record_prior['type'], $this->record_prior['name'], | ||
$this->record_prior['content'], $this->record_prior['ttl'], $this->record_prior['prio'], | ||
$this->record_after['type'], $this->record_after['name'], | ||
$this->record_after['content'], $this->record_after['ttl'], $this->record_after['prio'])); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.