Skip to content

Instantly share code, notes, and snippets.

@ijortengab
Created January 6, 2019 16:57
Show Gist options
  • Save ijortengab/94c32fac8aa23f4a67d70b33e1e7a9d7 to your computer and use it in GitHub Desktop.
Save ijortengab/94c32fac8aa23f4a67d70b33e1e7a9d7 to your computer and use it in GitHub Desktop.
Hack ISPConfig agar redirect ke halaman login Roundcube yang sudah auto populate username by URL
<?php
// Direktori: /usr/local/ispconfig/interface/lib
$conf['webmail_url'] = 'https://webmail.example.com';
--- webmailer.php 2018-08-17 23:22:58.000000000 +0700
+++ /usr/local/ispconfig/interface/web/mail/webmailer.php 2019-01-06 23:52:38.709839771 +0700
@@ -48,6 +48,13 @@
if ($serverId == 0){
die ("No E-Mail - Server found!");
}
+// Direktori: /usr/local/ispconfig/interface/web/mail/
+// Referensi: https://github.com/roundcube/roundcubemail/issues/4208
+$test = $app->db->queryOneRecord("SELECT email FROM mail_user WHERE mailuser_id = ?", $emailId);
+if (isset($test['email'])) {
+ header('Location: ' . $conf['webmail_url'] . '/?_user=' . $test['email']);
+ exit;
+}
$serverData = $app->db->queryOneRecord("SELECT server_name FROM server WHERE server_id = ?", $serverId);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment