mirror of
https://github.com/YunoHost-Apps/phpmyadmin_ynh.git
synced 2024-09-03 19:56:46 +02:00
use ynh access control
This commit is contained in:
parent
94e6536dac
commit
7934b07082
3 changed files with 5 additions and 9 deletions
|
@ -10,13 +10,6 @@
|
|||
* @package PhpMyAdmin
|
||||
*/
|
||||
|
||||
$ynh_admin_user = 'YNH_ADMIN_USER';
|
||||
if ($_SERVER['PHP_AUTH_USER'] != $ynh_admin_user)
|
||||
{
|
||||
header('Location: https://YNH_DOMAIN/ynhsso');
|
||||
exit;
|
||||
}
|
||||
|
||||
/*
|
||||
* This is needed for cookie based authentication to encrypt password in
|
||||
* cookie
|
||||
|
|
|
@ -43,11 +43,12 @@ sudo yunohost app setting phpmyadmin mysqlpwd -v $db_pwd
|
|||
# Configuration
|
||||
echo "Configuring application..."
|
||||
sed -i "s@YNH_DOMAIN@$domain@g" ../conf/config.inc.php
|
||||
sed -i "s@YNH_ADMIN_USER@$admin_user@g" ../conf/config.inc.php
|
||||
sed -i "s@YNH_PMA_USER@$db_user@g" ../conf/config.inc.php
|
||||
sed -i "s@YNH_PMA_PASSWORD@$db_pwd@g" ../conf/config.inc.php
|
||||
sed -i "s@YNH_MYSQL_ROOT_PASSWORD@$(sudo cat /etc/yunohost/mysql)@g" ../conf/config.inc.php
|
||||
sudo cp ../conf/config.inc.php $final_path
|
||||
|
||||
sudo yunohost app addaccess phpmyadmin -u $admin_user
|
||||
sudo yunohost app setting phpmyadmin admin_user -v $admin_user
|
||||
|
||||
# Files owned by root, www-data can just read
|
||||
|
|
|
@ -27,12 +27,14 @@ db_pwd=$(sudo yunohost app setting phpmyadmin mysqlpwd)
|
|||
# Configuration
|
||||
echo "Configuring application..."
|
||||
sed -i "s@YNH_DOMAIN@$domain@g" ../conf/config.inc.php
|
||||
sed -i "s@YNH_ADMIN_USER@$admin_user@g" ../conf/config.inc.php
|
||||
sed -i "s@YNH_PMA_USER@$db_user@g" ../conf/config.inc.php
|
||||
sed -i "s@YNH_PMA_PASSWORD@$db_pwd@g" ../conf/config.inc.php
|
||||
sed -i "s@YNH_MYSQL_ROOT_PASSWORD@$(sudo cat /etc/yunohost/mysql)@g" ../conf/config.inc.php
|
||||
sudo cp ../conf/config.inc.php $final_path
|
||||
|
||||
sudo yunohost app addaccess phpmyadmin -u $admin_user
|
||||
sudo yunohost app setting phpmyadmin admin_user -v $admin_user
|
||||
|
||||
# Files owned by root, www-data can just read
|
||||
echo "Setting permission..."
|
||||
sudo chown -R root: $final_path
|
||||
|
|
Loading…
Reference in a new issue