fix display of email addresses for users other than admin

unfortunately, $id is a principal_id, not a user_no - these match only
for admin. Similar changes will be necessary for adding and updating an
email address.

changing the "primary" address does not work and may need some thought
wrt/ UNIQUE

the 'usr' table is actually from AWL, and no-one has done any schema
management there yet; however there's precedent in davical's
dba/patches/1.1.4.sql that that was just upgraded from davical...
This commit is contained in:
Florian Schlichting 2021-02-05 17:50:05 +08:00
parent 0a6d34a929
commit 097b415b42

View File

@ -594,8 +594,8 @@ function email_browser() {
$browser->SetOrdering( 'email', 'A' );
$browser->SetJoins( "usr_emails " );
$browser->SetWhere( 'user_no = '.$id );
$browser->SetJoins( "usr_emails LEFT JOIN dav_principal USING(user_no)" );
$browser->SetWhere( 'principal_id = '.$id );
if ( $c->enable_row_linking ) {
$browser->RowFormat( '<tr onMouseover="LinkHref(this,1);" title="'.translate('Click to edit email').'" class="r%d">', '</tr>', '#even' );