2011-02-17 08:23:13 +00:00
|
|
|
<?php
|
|
|
|
|
2011-02-17 20:22:21 +00:00
|
|
|
/** Allow using Adminer inside a frame (disables ClickJacking protection)
|
2011-02-17 08:23:13 +00:00
|
|
|
* @author Jakub Vrana, http://www.vrana.cz/
|
|
|
|
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
|
|
|
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
|
|
|
|
*/
|
|
|
|
class AdminerFrames {
|
2011-02-17 20:22:21 +00:00
|
|
|
var $sameOrigin;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @param bool allow running from the same origin only
|
|
|
|
*/
|
|
|
|
function AdminerFrames($sameOrigin = false) {
|
|
|
|
$this->sameOrigin = $sameOrigin;
|
|
|
|
}
|
2011-02-17 08:23:13 +00:00
|
|
|
|
|
|
|
function headers() {
|
2011-02-17 20:22:21 +00:00
|
|
|
if ($this->sameOrigin) {
|
|
|
|
header("X-Frame-Options: SameOrigin");
|
|
|
|
}
|
2011-02-17 08:23:13 +00:00
|
|
|
header("X-XSS-Protection: 0");
|
2011-02-17 20:22:21 +00:00
|
|
|
return true;
|
2011-02-17 08:23:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|