Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/configure
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ virtual_dom_groups:
d.domain_id = g.domain_id and g.enabled = '1' and \
g.name = '${quote_mysql:$local_part}'}}} \
{$sender_address} \
{${lookup mysql{select u.username \
{${lookup mysql{select concat_ws('@', u.localpart, d.domain) \
from domains d, groups g, group_contents c, users u \
where d.enabled = '1' and d.domain = '${quote_mysql:$domain}' and \
d.domain_id = g.domain_id and g.name = '${quote_mysql:$local_part}' and \
Expand All @@ -710,7 +710,7 @@ virtual_dom_groups:
d.domain_id = u.domain_id and u.enabled = '1' \
and u.username = '${quote_mysql:$sender_address}' }}}}
data = ${lookup mysql{ \
select u.username \
select concat_ws('@', u.localpart, d.domain) \
from domains d, groups g, group_contents c, users u \
where d.enabled = '1' and \
d.domain = '${quote_mysql:$domain}' and \
Expand Down
4 changes: 2 additions & 2 deletions docs/debian-conf.d/router/250_vexim_virtual_domains
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ virtual_dom_groups:
d.domain_id = g.domain_id and g.enabled = '1' and \
g.name = '${quote_mysql:$local_part}'}}} \
{$sender_address} \
{${lookup mysql{select u.username \
{${lookup mysql{select concat_ws('@', u.localpart, d.domain) \
from domains d, groups g, group_contents c, users u \
where d.enabled = '1' and d.domain = '${quote_mysql:$domain}' and \
d.domain_id = g.domain_id and g.name = '${quote_mysql:$local_part}' and \
Expand All @@ -104,7 +104,7 @@ virtual_dom_groups:
d.domain_id = u.domain_id and u.enabled = '1' \
and u.username = '${quote_mysql:$sender_address}' }}}}
data = ${lookup mysql{ \
select u.username \
select concat_ws('@', u.localpart, d.domain) \
from domains d, groups g, group_contents c, users u \
where d.enabled = '1' and \
d.domain = '${quote_mysql:$domain}' and \
Expand Down
8 changes: 4 additions & 4 deletions vexim/admingroupchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class="textfield">
<tr>
<td colspan="2">
<?php
$query = "SELECT u.realname, u.username, u.enabled, c.member_id
$query = "SELECT u.realname, u.localpart, u.enabled, c.member_id
FROM users u, group_contents c
WHERE u.user_id=c.member_id and c.group_id=:group_id
ORDER BY u.enabled desc, u.realname asc";
Expand Down Expand Up @@ -106,7 +106,7 @@ class="textfield">
</a>
</td>
<td><?php echo $row['realname']; ?></td>
<td><?php echo $row['username']; ?></td>
<td><?php echo $row['localpart'].'@'.$_SESSION['domain']; ?></td>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if joining the query with the domains table and using the domain name from that table wouldn't be a better idea.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what I thought at a first time, but later I saw that it's only allowed to add users in the same domain as the group and that we already have that domain name in $_SESSION["domain"] as it's already used in the same file in https://github.com/ultreia-es/vexim2/blob/dafd10b/vexim/admingroupchange.php#L45 so there is no need to add more tables to SQL query.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that makes sense. Thanks!

<td>
<?php
if($row['enabled']='1') {
Expand Down Expand Up @@ -143,7 +143,7 @@ class="textfield">
<select name="usertoadd">
<option selected value=""></option>
<?php
$query = "SELECT realname, username, user_id FROM users
$query = "SELECT realname, localpart, user_id FROM users
WHERE enabled='1' AND domain_id=:domain_id AND type!='fail'
ORDER BY realname, username, type desc";
$sth = $dbh->prepare($query);
Expand All @@ -152,7 +152,7 @@ class="textfield">
?>
<option value="<?php echo $row['user_id'];
?>"><?php echo $row['realname'];
?>(<?php echo $row['username']; ?>)</option>
?> (<?php echo $row['localpart'].'@'.$_SESSION['domain']; ?>)</option>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here as well.

<?php
}
?>
Expand Down