diff --git a/.htaccess b/.htaccess new file mode 100644 index 0000000..f1f4595 --- /dev/null +++ b/.htaccess @@ -0,0 +1,4 @@ +RewriteCond %{HTTP:X-Forwarded-Proto} !https +RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} + +FallbackResource /index.php \ No newline at end of file diff --git a/admin.php b/admin.php new file mode 100644 index 0000000..8c28103 --- /dev/null +++ b/admin.php @@ -0,0 +1,64 @@ +_kyseloConfig = $config; + } + + function name() { + // custom name in title and heading + return 'Stela admin'; + } + + function permanentLogin($i = false) { + // key used for permanent login + return md5($this->_kyseloConfig['secret']); + } + + function credentials() { + // server, username and password for connecting to database + return array('', '', ''); + } + + function databases($Jc = true) { + return array($this->_kyseloConfig['database']); + } + + function login($login, $password) { + // validate user submitted credentials + return ($login == 'admin' && md5($password) == $this->_kyseloConfig['adminer_password']); + } + + function loginForm() { + ?> + +
" autocapitalize="off"> +
+
+ + + + + \n"; + echo checkbox("auth[permanent]", 1, $_COOKIE["adminer_permanent"], lang('Permanent login')) . "\n"; + } + } + + + if (!file_exists(__DIR__ . '/config.php')) { + die("ERROR: Stela not installed."); + } + + $config = require 'config.php'; + + return new KyseloAdmin($config); +} + +include "./adminer.php"; \ No newline at end of file diff --git a/adminer.php b/adminer.php new file mode 100644 index 0000000..f828639 --- /dev/null +++ b/adminer.php @@ -0,0 +1,2041 @@ +$W){unset($tg[$y][$fe]);if(is_array($W)){$tg[$y][stripslashes($fe)]=$W;$tg[]=&$tg[$y][stripslashes($fe)];}else$tg[$y][stripslashes($fe)]=($Xc?$W:stripslashes($W));}}}}function +bracket_escape($u,$Pa=false){static$vi=array(':'=>':1',']'=>':2','['=>':3','"'=>':4');return +strtr($u,($Pa?array_flip($vi):$vi));}function +min_version($bj,$Ee="",$i=null){global$h;if(!$i)$i=$h;$oh=$i->server_info;if($Ee&&preg_match('~([\d.]+)-MariaDB~',$oh,$A)){$oh=$A[1];$bj=$Ee;}return(version_compare($oh,$bj)>=0);}function +charset($h){return(min_version("5.5.3",0,$h)?"utf8mb4":"utf8");}function +script($zh,$ui="\n"){return"$zh$ui";}function +script_src($Oi){return"\n";}function +nonce(){return' nonce="'.get_nonce().'"';}function +target_blank(){return' target="_blank" rel="noreferrer noopener"';}function +h($P){return +str_replace("\0","�",htmlspecialchars($P,ENT_QUOTES,'utf-8'));}function +nl_br($P){return +str_replace("\n","
",$P);}function +checkbox($B,$Y,$gb,$me="",$vf="",$lb="",$ne=""){$H="".($vf?script("qsl('input').onclick = function () { $vf };",""):"");return($me!=""||$lb?"$H".h($me)."":$H);}function +optionlist($Af,$ih=null,$Ti=false){$H="";foreach($Af +as$fe=>$W){$Bf=array($fe=>$W);if(is_array($W)){$H.='';$Bf=$W;}foreach($Bf +as$y=>$X)$H.=''.h($X);if(is_array($W))$H.='';}return$H;}function +html_select($B,$Af,$Y="",$uf=true,$ne=""){if($uf)return"".(is_string($uf)?script("qsl('select').onchange = function () { $uf };",""):"");$H="";foreach($Af +as$y=>$X)$H.="";return$H;}function +select_input($Ka,$Af,$Y="",$uf="",$fg=""){$Zh=($Af?"select":"input");return"<$Zh$Ka".($Af?">