1
0
Fork 0
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:
Julien Malik 2014-03-03 22:27:44 +01:00
parent 94e6536dac
commit 7934b07082
3 changed files with 5 additions and 9 deletions

View file

@ -10,13 +10,6 @@
* @package PhpMyAdmin * @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 * This is needed for cookie based authentication to encrypt password in
* cookie * cookie

View file

@ -43,11 +43,12 @@ sudo yunohost app setting phpmyadmin mysqlpwd -v $db_pwd
# Configuration # Configuration
echo "Configuring application..." echo "Configuring application..."
sed -i "s@YNH_DOMAIN@$domain@g" ../conf/config.inc.php 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_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_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 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 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 sudo yunohost app setting phpmyadmin admin_user -v $admin_user
# Files owned by root, www-data can just read # Files owned by root, www-data can just read

View file

@ -27,12 +27,14 @@ db_pwd=$(sudo yunohost app setting phpmyadmin mysqlpwd)
# Configuration # Configuration
echo "Configuring application..." echo "Configuring application..."
sed -i "s@YNH_DOMAIN@$domain@g" ../conf/config.inc.php 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_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_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 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 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 # Files owned by root, www-data can just read
echo "Setting permission..." echo "Setting permission..."
sudo chown -R root: $final_path sudo chown -R root: $final_path