sed script of alternc.install now have a fixed name + squirrelmail-install script is using the template system to handle /etc/squirrelmail/alternc-changepass.conf.
This commit is contained in:
parent
de4ff858c2
commit
373157ebc8
|
@ -548,8 +548,8 @@ selenium/20120826-alternc-panel-testsuite.html -text
|
|||
selenium/README -text
|
||||
selenium/alternc.domain-local-mail-tld.html -text
|
||||
squirrelmail/Makefile -text
|
||||
squirrelmail/alternc-changepass/change.php -text
|
||||
squirrelmail/alternc-changepass/setup.php -text
|
||||
squirrelmail/alternc_changepass/change.php -text
|
||||
squirrelmail/alternc_changepass/setup.php -text
|
||||
squirrelmail/class/m_squirrelmail.php -text
|
||||
squirrelmail/squirrelmail-install -text
|
||||
squirrelmail/templates/apache2/squirrelmail.conf -text
|
||||
|
|
|
@ -178,7 +178,7 @@ PUBLIC_IP_BEGIN=$(echo $PUBLIC_IP|cut -c 1)
|
|||
|
||||
# XXX: I assume this is secure if /tmp is sticky (+t)
|
||||
# we should have a better way to deal with templating, of course.
|
||||
SED_SCRIPT=`mktemp`
|
||||
SED_SCRIPT="/tmp/alternc.install.sedscript"
|
||||
cat > $SED_SCRIPT <<EOF
|
||||
s\\%%hosting%%\\$HOSTING\\;
|
||||
s\\%%fqdn%%\\$FQDN\\;
|
||||
|
|
|
@ -30,4 +30,4 @@ install:
|
|||
# Desktop files
|
||||
install -o 1999 -g 1999 -m 644 class/m_squirrelmail.php $(DESTDIR)/var/alternc/bureau/class/
|
||||
# Squirrelmail Change Password Plugin
|
||||
install -m 644 alternc-changepass/setup.php alternc-changepass/change.php $(DESTDIR)/usr/share/squirrelmail/plugins/alternc-changepass/
|
||||
install -m 644 alternc_changepass/setup.php alternc_changepass/change.php $(DESTDIR)/usr/share/squirrelmail/plugins/alternc_changepass/
|
||||
|
|
|
@ -27,10 +27,32 @@ then
|
|||
echo "Installing Squirrelmail Templates ..."
|
||||
cp -f /etc/alternc/templates/squirrelmail/avelsieve-config.php /etc/alternc/templates/squirrelmail/apache.conf /etc/squirrelmail/
|
||||
cp -f /etc/alternc/templates/javascript-common/javascript-common.conf /etc/javascript-common/
|
||||
if [ -e /etc/alternc/templates/squirrelmail/alternc-changepass.conf ]; then
|
||||
CONFIG_FILES="$CONFIG_FILES squirrelmail/alternc-changepass.conf"
|
||||
fi
|
||||
|
||||
LOGIN="2000_squirrelmail"
|
||||
PASSWORD="`perl -e 'print map{("a".."z","A".."Z",0..9)[int(rand(62))]}(1..10)'`"
|
||||
|
||||
# Add new variables to the sed script ...
|
||||
SED_SCRIPT="/tmp/alternc.install.sedscript"
|
||||
cat >> $SED_SCRIPT <<EOF
|
||||
s\\%%squirrelmail-login%%\\$LOGIN\\;
|
||||
s\\%%squirrelmail-password%%\\$PASSWORD\\;
|
||||
EOF
|
||||
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'@'%';"
|
||||
echo " Done"
|
||||
|
||||
echo "Setting squirrelmail domaintype"
|
||||
mysql_query "INSERT IGNORE INTO domaines_type (name ,description ,target ,entry ,compatibility ,enable ,only_dns ,need_dns ,advanced )VALUES ('squirrelmail','Squirrelmail Webmail access', 'NONE', '%SUB% IN A @@PUBLIC_IP@@', 'txt', 'ALL', '0', '0', '0');"
|
||||
echo " Done"
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
<?php
|
||||
// This is the configuration file of AlternC-changepass plugin for Squirrelmail
|
||||
define("ALTERNC_CHANGEPASS_LOC","/var/alternc");
|
||||
define("ALTERNC_CHANGEPASS_MYSQL_HOST","localhost");
|
||||
define("ALTERNC_CHANGEPASS_MYSQL_USER","2000_squirrelmail");
|
||||
define("ALTERNC_CHANGEPASS_MYSQL_PASSWORD","een3ooCi");
|
||||
define("ALTERNC_CHANGEPASS_MYSQL_DB","alternc");
|
||||
// It is overwritten by alternc.install (precisely in squirrelmail-install subscript)
|
||||
|
||||
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_DB","%%dbname%%");
|
||||
|
||||
?>
|
Loading…
Reference in New Issue