From 594b2648431c073829a1f24fd3af80925f872d55 Mon Sep 17 00:00:00 2001 From: Benjamin Sonntag Date: Thu, 30 Aug 2012 10:16:05 +0000 Subject: [PATCH] adding squirrelmail to the index of the panel --- .gitattributes | 1 + bureau/admin/index.php | 12 +++-- debian/alternc-squirrelmail.dirs | 1 + squirrelmail/Makefile | 2 + squirrelmail/class/m_squirrelmail.php | 65 +++++++++++++++++++++++++++ 5 files changed, 77 insertions(+), 4 deletions(-) create mode 100644 squirrelmail/class/m_squirrelmail.php diff --git a/.gitattributes b/.gitattributes index 44c28da6..ad537a53 100644 --- a/.gitattributes +++ b/.gitattributes @@ -502,6 +502,7 @@ selenium/20120826-alternc-panel-testsuite.html -text selenium/README -text selenium/alternc.domain-local-mail-tld.html -text squirrelmail/Makefile -text +squirrelmail/class/m_squirrelmail.php -text squirrelmail/squirrelmail-install -text squirrelmail/templates/apache2/squirrelmail.conf -text squirrelmail/templates/javascript-common/javascript-common.conf -text diff --git a/bureau/admin/index.php b/bureau/admin/index.php index ee6a3ee4..f1aeaaf4 100644 --- a/bureau/admin/index.php +++ b/bureau/admin/index.php @@ -83,10 +83,14 @@ if (!$_SERVER[HTTPS]) { - -

- - +invoke("hook_admin_webmail"); +foreach($res as $r) if ($r!==false) echo $r; + +?> diff --git a/debian/alternc-squirrelmail.dirs b/debian/alternc-squirrelmail.dirs index 92c5bf73..bf5ebd28 100644 --- a/debian/alternc-squirrelmail.dirs +++ b/debian/alternc-squirrelmail.dirs @@ -4,3 +4,4 @@ etc/alternc/templates/apache2 etc/alternc/templates/javascript-common etc/squirrelmail usr/lib/alternc/install.d +var/alternc/bureau/class diff --git a/squirrelmail/Makefile b/squirrelmail/Makefile index bb305d66..51589ab2 100644 --- a/squirrelmail/Makefile +++ b/squirrelmail/Makefile @@ -27,3 +27,5 @@ install: install -m 750 squirrelmail-install $(DESTDIR)/usr/lib/alternc/install.d/ # domaintype template: install -m 644 templates/apache2/squirrelmail.conf $(DESTDIR)/etc/alternc/templates/apache2/squirrelmail.conf + # Desktop files + install -o 1999 -g 1999 -m 644 class/m_squirrelmail.php $(DESTDIR)/var/alternc/bureau/class/ diff --git a/squirrelmail/class/m_squirrelmail.php b/squirrelmail/class/m_squirrelmail.php new file mode 100644 index 00000000..0347c818 --- /dev/null +++ b/squirrelmail/class/m_squirrelmail.php @@ -0,0 +1,65 @@ +query("SELECT * FROM subdomaines s WHERE s.domaine='".addslashes($dompart)."' AND s.type='squirrelmail';"); + if ($db->next_record()) { + $domain=$db->Record; + return "

"._("To read your mail in a browser, click here to use the Squirrelmail Webmail")."

\n"; + } + $i++; + } while (strpos($dompart,'.')!==false); + + // not found: search for a webmail in the admin user account + $db->query("SELECT * FROM subdomaines s WHERE s.compte=2000 AND s.type='squirrelmail';"); + if ($db->next_record()) { + $domain=$db->Record; + return "

"._("To read your mail in a browser, click here to use the Squirrelmail Webmail")."

\n"; + } + + } + +} /* Class Squirrelmail */ + + + + +