diff --git a/api/src/Mail/Account.php b/api/src/Mail/Account.php index 924861f62a..a64053d8aa 100644 --- a/api/src/Mail/Account.php +++ b/api/src/Mail/Account.php @@ -96,7 +96,10 @@ use addressbook_merge; // should go to Contacts\Merge */ class Account implements \ArrayAccess { - const APP = 'emailadmin'; + /** + * App tables belong to + */ + const APP = 'api'; /** * Table with mail-accounts */ @@ -903,8 +906,8 @@ class Account implements \ArrayAccess } $access = false; - // emailadmin has all rights - if (isset($GLOBALS['egw_info']['user']['apps']['emailadmin'])) + // Admin app has all rights + if (isset($GLOBALS['egw_info']['user']['apps']['admin'])) { $access = true; $reason = 'user is EMailAdmin'; @@ -1150,7 +1153,7 @@ class Account implements \ArrayAccess if (!($data['acc_id'] > 0)) { // set not set values which, are NOT NULL and therefore would give an SQL error - $td = self::$db->get_table_definitions('emailadmin', self::TABLE); + $td = self::$db->get_table_definitions('api', self::TABLE); foreach($td['fd'] as $col => $def) { if (!isset($data[$col]) && $def['nullable'] === false && !isset($def['default'])) diff --git a/api/src/Mail/Credentials.php b/api/src/Mail/Credentials.php index 4c209c7e85..03d281e193 100644 --- a/api/src/Mail/Credentials.php +++ b/api/src/Mail/Credentials.php @@ -25,8 +25,17 @@ use EGroupware\Api; */ class Credentials { - const APP = 'emailadmin'; + /** + * App tables belong to + */ + const APP = 'api'; + /** + * Name of credentials table + */ const TABLE = 'egw_ea_credentials'; + /** + * Join to check account is user-editable + */ const USER_EDITABLE_JOIN = 'JOIN egw_ea_accounts ON egw_ea_accounts.acc_id=egw_ea_credentials.acc_id AND acc_user_editable='; /** @@ -378,7 +387,7 @@ class Credentials $old_mcrypt = null; foreach(self::$db->select(self::TABLE, self::TABLE.'.*', array( 'account_id' => $data['account_id'] - ),__LINE__, __FILE__, false, '', 'emailadmin', 0, self::USER_EDITABLE_JOIN.self::$db->quote(true, 'bool')) as $row) + ),__LINE__, __FILE__, false, '', self::APP, 0, self::USER_EDITABLE_JOIN.self::$db->quote(true, 'bool')) as $row) { if (!isset($old_mcrypt)) { diff --git a/api/src/Mail/Notifications.php b/api/src/Mail/Notifications.php index 5d7ef1b092..a9f2d1d521 100644 --- a/api/src/Mail/Notifications.php +++ b/api/src/Mail/Notifications.php @@ -21,7 +21,13 @@ use EGroupware\Api; */ class Notifications { - const APP = 'emailadmin'; + /** + * App tables belong to + */ + const APP = 'api'; + /** + * Name of credentials table + */ const TABLE = 'egw_ea_notifications'; /** diff --git a/api/src/Mail/Smtp/Sql.php b/api/src/Mail/Smtp/Sql.php index 7a1130a671..06c4e47bd7 100644 --- a/api/src/Mail/Smtp/Sql.php +++ b/api/src/Mail/Smtp/Sql.php @@ -45,7 +45,7 @@ class Sql extends Mail\Smtp /** * Name of app our table belongs to */ - const APP = 'emailadmin'; + const APP = 'api'; /** * Values for mail_type column *