Files
adminer/plugins/frames.php

35 lines
1.1 KiB
PHP
Raw Normal View History

2011-02-17 09:23:13 +01:00
<?php
2025-04-07 16:32:57 +02:00
/** Allow using Adminer inside a frame
2015-09-08 09:23:25 -07:00
* @link https://www.adminer.org/plugins/#use
2017-02-27 13:43:33 +01:00
* @author Jakub Vrana, https://www.vrana.cz/
2018-01-14 11:03:54 +01:00
* @license https://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
* @license https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
2011-02-17 09:23:13 +01:00
*/
2025-04-07 16:32:57 +02:00
class AdminerFrames extends Adminer\Plugin {
2025-03-11 07:21:13 +01:00
protected $sameOrigin;
2025-02-21 13:53:18 +01:00
2011-02-17 21:22:21 +01:00
/**
2025-03-28 07:06:34 +01:00
* @param bool $sameOrigin allow running from the same origin only
2011-02-17 21:22:21 +01:00
*/
2025-04-08 13:14:32 +02:00
function __construct($sameOrigin = false) {
2011-02-17 21:22:21 +01:00
$this->sameOrigin = $sameOrigin;
}
2025-02-21 13:53:18 +01:00
2011-02-17 09:23:13 +01:00
function headers() {
2011-02-17 21:22:21 +01:00
if ($this->sameOrigin) {
header("X-Frame-Options: SameOrigin");
} elseif (function_exists('header_remove')) {
header_remove("X-Frame-Options");
2011-02-17 21:22:21 +01:00
}
2011-02-17 09:23:13 +01:00
}
protected $translations = array(
'cs' => array('' => 'Dovolí pracovat Admineru uvnitř rámu'),
'de' => array('' => 'Erlauben Sie die Verwendung von Adminer innerhalb eines Frames'),
'pl' => array('' => 'Zezwalaj na używanie Adminera wewnątrz ramki'),
'ro' => array('' => 'Permiteți utilizarea Adminer în interiorul unui cadru'),
'ja' => array('' => 'フレーム内での Adminer 利用を許可'),
);
2011-02-17 09:23:13 +01:00
}