mirror of
https://github.com/YunoHost-Apps/emailpoubelle_ynh.git
synced 2024-09-03 18:26:29 +02:00
Merge pull request #4 from Krakinou/Testing
include SQL correction and nginx correction
This commit is contained in:
commit
bc3f24c8e5
6 changed files with 25 additions and 7 deletions
|
@ -28,7 +28,7 @@ TODO :
|
|||
|
||||
[ ] remove new locale on remove
|
||||
|
||||
[ ] Why the flag don't show??
|
||||
[X] Why the flag don't show??
|
||||
|
||||
[X] Implement Admin panel
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ location YNH_EXAMPLE_PATH {
|
|||
# Path to source
|
||||
alias YNH_EXAMPLE_ALIAS ;
|
||||
# Example PHP configuration
|
||||
index index.php;
|
||||
index www/index.php;
|
||||
try_files $uri $uri/ index.php;
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"fr": "Créez des adresses email jetables qui redirigent les mails vers votre adresse réelle"
|
||||
},
|
||||
"url": "https://framagit.org/kepon/emailPoubellePhp/",
|
||||
"version": "2.0~ynh2",
|
||||
"version": "2.0~ynh3",
|
||||
"license": "Beerware",
|
||||
"maintainer": {
|
||||
"name": "krakinou",
|
||||
|
|
|
@ -74,6 +74,7 @@ ynh_replace_string "Template-exemple" "$domain" $final_path/www/index.php
|
|||
#Temporaire - mettre en config
|
||||
ln -s $final_path/lang/fr $final_path/lang/fr_FR
|
||||
ln -s $final_path/lang/it $final_path/lang/it_IT
|
||||
ln -s $final_path/www/template-exemple $final_path/template-exemple
|
||||
|
||||
|
||||
#===============================================
|
||||
|
@ -121,7 +122,7 @@ sudo newaliases
|
|||
|
||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||
sudo sed -i "s@YNH_EXAMPLE_PATH@$path_url@g" ../conf/nginx.conf
|
||||
sudo sed -i "s@YNH_EXAMPLE_ALIAS@$final_path/www/@g" ../conf/nginx.conf
|
||||
sudo sed -i "s@YNH_EXAMPLE_ALIAS@$final_path/@g" ../conf/nginx.conf
|
||||
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
|
||||
|
||||
# Handle root path, avoid double slash.
|
||||
|
|
|
@ -60,9 +60,16 @@ if [[ $?==0 ]]; then
|
|||
ynh_replace_string "define('ALIASLIMITBYMAIL" "//define('ALIASLIMITBYMAIL" $final_path/conf.php
|
||||
#setting conf file not world-readable (dude, there is a plain-text password !)
|
||||
sudo chmod o-r $final_path/conf.php
|
||||
|
||||
|
||||
fi
|
||||
|
||||
#change nginx.conf as per https://forum.yunohost.org/t/need-help-on-nginx-conf-cannot-access-resources/6342
|
||||
ynh_replace_string "alias $finalpath/www/ ;" "alias $finalpath/ ;" /etc/yunohost/$domain.d/$app.conf
|
||||
ynh_replace_string "index index.php;" "index www/ndex.php;" /etc/yunohost/$domain.d/$app.conf
|
||||
|
||||
#correct template name in index.php
|
||||
ynh_replace_string "Template-exemple" "$domain" $final_path/www/index.php
|
||||
|
||||
#mysqlpwd setting was implemented in ynh2 - check if saved and if not implement
|
||||
db_pass=$(ynh_app_setting_get $app mysqlpwd)
|
||||
if [ -z $db_pass]; then
|
||||
|
@ -83,11 +90,15 @@ cp ../src/README.md $final_path/README.md
|
|||
cp ../src/CHANGELOG.md $final_path/CHANGELOG.md
|
||||
cp ../src/conf-dist.php $final_path/conf-dist.php
|
||||
cp ../conf/index_source.php $final_path/www/index.php
|
||||
|
||||
test -e $final_path/template-exemple
|
||||
if [[ ! $? -eq 0 ]]; then
|
||||
ln -s $final_path/www/template-exemple $final_path/template-exemple
|
||||
fi
|
||||
#Temporaire - mettre en config
|
||||
ln -s $final_path/lang/fr $final_path/lang/fr_FR
|
||||
ln -s $final_path/lang/it $final_path/lang/it_IT
|
||||
|
||||
|
||||
chown -R www-data:www-data $final_path
|
||||
|
||||
#adding php-cli for cron
|
||||
|
|
|
@ -79,7 +79,13 @@ function AjouterAlias($status, $alias,$email, $life, $comment) {
|
|||
die();
|
||||
}
|
||||
UpdateVirtualDB();
|
||||
return $dbco->lastInsertId();
|
||||
if (preg_match('/^sqlite/', DB)) {
|
||||
return $dbco->lastInsertId();
|
||||
} else {
|
||||
$stmt = $dbco->query("SELECT LAST_INSERT_ID()");
|
||||
return $stmt->fetchColumn();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// delete email
|
||||
|
|
Loading…
Reference in a new issue