This class handle roundcube's webmail hook the main panel page to add a link to the webmail.
More...
This class handle roundcube's webmail hook the main panel page to add a link to the webmail.
Definition at line 30 of file m_roundcube.php.
◆ hook_admin_webmail()
m_roundcube::hook_admin_webmail |
( |
| ) |
|
Hook called by the homepage or the /webmail link to redirect the user to a known webmail url.
the variable 'webmail_redirect' tells which webmail has the priority.
- Returns
- string the URL of the webmail
Definition at line 38 of file m_roundcube.php.
42 if (!empty($_SERVER[
"HTTP_HOST"])) {
44 $expl=explode(
".",$_SERVER[
"HTTP_HOST"],
$i);
45 if (count($expl)>=2) {
46 list(
$host,$dompart)=$expl;
48 $db->query(
"SELECT * FROM sub_domaines s WHERE s.domaine=? AND s.type='roundcube';",array($dompart));
49 if (
$db->next_record()) {
51 return "http://".$domain[
"sub"].(($domain[
"sub"])?
".":
"").$domain[
"domaine"];
55 }
while (strpos($dompart,
'.')!==
false);
59 $db->query(
"SELECT * FROM sub_domaines s WHERE s.compte=2000 AND s.type='roundcube';");
60 if (
$db->next_record()) {
62 return "http://".$domain[
"sub"].(($domain[
"sub"])?
".":
"").$domain[
"domaine"];
References $db, $domain, $host, and $i.
◆ hook_mail_delete_for_real()
m_roundcube::hook_mail_delete_for_real |
( |
|
$mail_id, |
|
|
|
$fullmail |
|
) |
| |
Hook called when an email is REALLY deleted (by the cron, not just in the panel)
- Parameters
-
- Returns
- false|null
Definition at line 74 of file m_roundcube.php.
80 include_once(
"/etc/roundcube/debian-db.php");
81 if (! isset($dbtype)) {
83 $msg->raise(
'Error',
"roundcube::hook_mail_delete_for_real",_(
"Problem: missing var in Debian Roundcube configuration file"));
89 $rcdb =
"sqlite:///$basepath/$dbname?mode=0640";
90 $dbh =
new PDO(
"sqlite:/$basepath/$dbname");
93 if ($dbport !=
'') $dbport=
":$dbport";
94 if ($dbserver ==
'') $dbserver=
"localhost";
95 $dbh=
new PDO(
"$dbtype:host=$dbserver;dbname=$dbname;dbport=$dbport", $dbuser, $dbpass);
96 #$rcdb = "$dbtype:$dbuser:$dbpass@$dbserver$dbport/$dbname";
100 $stmt =
$dbh->prepare(
"SELECT user_id FROM users WHERE username = ?;");
101 $req=$stmt->execute(array($fullmail));
104 foreach ( $stmt->fetchAll() as
$t ) {
105 if (empty(
$t[
'user_id'])) continue ;
106 $rcuser_id=
$t[
'user_id'];
108 $dbh->prepare(
"DELETE from contactgroupmembers where contactgroup_id in (select contactgroup_id from contactgroups where user_id = ?) ; ")->execute(array($rcuser_id));
109 $dbh->prepare(
"DELETE from contactgroups where user_id = ? ; ")->execute(array($rcuser_id));
110 $dbh->prepare(
"DELETE from contacts where user_id = ? ; ")->execute(array($rcuser_id));
111 $dbh->prepare(
"DELETE from identities where user_id = ? ; ")->execute(array($rcuser_id));
112 $dbh->prepare(
"DELETE from users where user_id = ? ; ")->execute(array($rcuser_id));
foreach($domaines_user as $domaine) $t
References $dbh, $msg, and $t.
The documentation for this class was generated from the following file: