allow access to edit view for all users and if they don't have the privileges will have an error on save/delete/etc

This commit is contained in:
Pau Capó 2022-02-25 20:35:00 +01:00
parent 141686a136
commit 6e6f270df4
3 changed files with 14 additions and 7 deletions

View file

@ -1,10 +1,18 @@
<?php
$adminer = dirname(__FILE__).'/adminer.php';
$adminer = dirname( __FILE__ ) . '/adminer.php';
$new = @file_get_contents('https://www.adminer.org/latest-en.php');
$new = @file_get_contents( 'https://www.adminer.org/latest-en.php' );
if ($new)
file_put_contents($adminer, $new);
if ( $new ) {
file_put_contents( $adminer, custom_fix( $new ) );
}
header('Location: ./');
header( 'Location: ./' );
function custom_fix( $content ) {
$content = str_replace( '"privileges"=>array_flip(preg_split(\'~, *~\',$J["Privileges"])),', '"privileges"=>array_flip(["select","insert","update","references"]),', $content );
return $content;
}