From 52072b919bc12664b62e54024de7b97dcc749fd7 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Tue, 16 Oct 2012 14:29:36 +0000 Subject: [PATCH] fixing most squirrelmail install script + alternc-changepass plugin --- debian/alternc-squirrelmail.postinst | 8 +++-- squirrelmail/alternc_changepass/change.php | 8 ++--- squirrelmail/alternc_changepass/setup.php | 7 +++- squirrelmail/squirrelmail-install | 34 ++++++++++++++----- .../squirrelmail/alternc-changepass.conf | 2 +- 5 files changed, 42 insertions(+), 17 deletions(-) diff --git a/debian/alternc-squirrelmail.postinst b/debian/alternc-squirrelmail.postinst index a184516d..16a04df2 100644 --- a/debian/alternc-squirrelmail.postinst +++ b/debian/alternc-squirrelmail.postinst @@ -21,8 +21,12 @@ case "$1" in chown -R alternc-squirrelmail:root /var/spool/squirrelmail/attach /var/lib/squirrelmail/data chmod -R 750 /var/spool/squirrelmail/attach /var/lib/squirrelmail/data # Enable the squirrelmail plugin - squirrelmail-configure --remove-plugin alternc-changepass - squirrelmail-configure --install-plugin alternc-changepass + squirrelmail-configure --remove-plugin alternc_changepass + squirrelmail-configure --install-plugin alternc_changepass + echo "**********************************************" + echo "* ALTERNC-SQUIRRELMAIL: *" + echo "* Please run alternc.install to fully deploy *" + echo "**********************************************" ;; esac diff --git a/squirrelmail/alternc_changepass/change.php b/squirrelmail/alternc_changepass/change.php index 7c7396a9..1bd85759 100644 --- a/squirrelmail/alternc_changepass/change.php +++ b/squirrelmail/alternc_changepass/change.php @@ -1,12 +1,12 @@ > $SED_SCRIPT < $SED_SCRIPT < /$file + fi + done + rm -f $SED_SCRIPT + echo " Done" . /usr/lib/alternc/functions.sh echo "giving write access to squirrelmail to the email password ..." - # cf alternc.install for more explanations on this horror : - eval `sed -n -e "/=/{s/ *= *\"\?/='/;s/\"\?\$/'/;s/host/MYSQL_HOST/;s/user/MYSQL_USER/;s/password/MYSQL_PASS/;s/database/MYSQL_DATABASE/;p}" /etc/alternc/my.cnf` # now database host user and password are mysql root account values ;) - mysql_query "GRANT UPDATE (password) ON ${database}.address TO '$LOGIN'@'%' IDENTIFIED BY PASSWORD('$PASSWORD');" - mysql_query "GRANT SELECT ON ${database}.address TO '$LOGIN'@'%';" - mysql_query "GRANT SELECT ON ${database}.domaines TO '$LOGIN'@'%';" + mysql_query "GRANT UPDATE (password) ON ${database}.address TO '${LOGIN}'@'${MYSQL_CLIENT}' IDENTIFIED BY '${PASSWORD}';" + mysql_query "GRANT SELECT ON ${database}.address TO '${LOGIN}'@'${MYSQL_CLIENT}';" + mysql_query "GRANT SELECT ON ${database}.domaines TO '${LOGIN}'@'${MYSQL_CLIENT}';" echo " Done" echo "Setting squirrelmail domaintype" diff --git a/squirrelmail/templates/squirrelmail/alternc-changepass.conf b/squirrelmail/templates/squirrelmail/alternc-changepass.conf index 0d85c512..2c665578 100644 --- a/squirrelmail/templates/squirrelmail/alternc-changepass.conf +++ b/squirrelmail/templates/squirrelmail/alternc-changepass.conf @@ -5,6 +5,6 @@ define("ALTERNC_CHANGEPASS_LOC","%%ALTERNC_LOC%%"); define("ALTERNC_CHANGEPASS_MYSQL_HOST","%%dbhost%%"); define("ALTERNC_CHANGEPASS_MYSQL_USER","%%squirrelmail-login%%"); // 2000_squirrelmail -define("ALTERNC_CHANGEPASS_MYSQL_PASSWORD","%%squirrelmail-pass%%"); // een3ooCi +define("ALTERNC_CHANGEPASS_MYSQL_PASSWORD","%%squirrelmail-password%%"); // een3ooCi define("ALTERNC_CHANGEPASS_MYSQL_DB","%%dbname%%");