[Web, Dovecot] Add sieve and pop3 to protocol access for app passwords
This commit is contained in:
@@ -32,6 +32,8 @@ function app_passwd($_action, $_data = null) {
|
||||
$dav_access = (in_array('dav_access', $protocols)) ? 1 : 0;
|
||||
$smtp_access = (in_array('smtp_access', $protocols)) ? 1 : 0;
|
||||
$eas_access = (in_array('eas_access', $protocols)) ? 1 : 0;
|
||||
$pop3_access = (in_array('pop3_access', $protocols)) ? 1 : 0;
|
||||
$sieve_access = (in_array('sieve_access', $protocols)) ? 1 : 0;
|
||||
$domain = mailbox('get', 'mailbox_details', $username)['domain'];
|
||||
if (empty($domain)) {
|
||||
$_SESSION['return'][] = array(
|
||||
@@ -66,8 +68,8 @@ function app_passwd($_action, $_data = null) {
|
||||
);
|
||||
return false;
|
||||
}
|
||||
$stmt = $pdo->prepare("INSERT INTO `app_passwd` (`name`, `mailbox`, `domain`, `password`, `imap_access`, `smtp_access`, `eas_access`, `dav_access`, `active`)
|
||||
VALUES (:app_name, :mailbox, :domain, :password, :imap_access, :smtp_access, :eas_access, :dav_access, :active)");
|
||||
$stmt = $pdo->prepare("INSERT INTO `app_passwd` (`name`, `mailbox`, `domain`, `password`, `imap_access`, `smtp_access`, `eas_access`, `dav_access`, `pop3_access`, `sieve_access`, `active`)
|
||||
VALUES (:app_name, :mailbox, :domain, :password, :imap_access, :smtp_access, :eas_access, :dav_access, :pop3_access, :sieve_access, :active)");
|
||||
$stmt->execute(array(
|
||||
':app_name' => $app_name,
|
||||
':mailbox' => $username,
|
||||
@@ -77,6 +79,8 @@ function app_passwd($_action, $_data = null) {
|
||||
':smtp_access' => $smtp_access,
|
||||
':eas_access' => $eas_access,
|
||||
':dav_access' => $dav_access,
|
||||
':pop3_access' => $pop3_access,
|
||||
':sieve_access' => $sieve_access,
|
||||
':active' => $active
|
||||
));
|
||||
$_SESSION['return'][] = array(
|
||||
@@ -99,12 +103,16 @@ function app_passwd($_action, $_data = null) {
|
||||
$dav_access = (in_array('dav_access', $protocols)) ? 1 : 0;
|
||||
$smtp_access = (in_array('smtp_access', $protocols)) ? 1 : 0;
|
||||
$eas_access = (in_array('eas_access', $protocols)) ? 1 : 0;
|
||||
$pop3_access = (in_array('pop3_access', $protocols)) ? 1 : 0;
|
||||
$sieve_access = (in_array('sieve_access', $protocols)) ? 1 : 0;
|
||||
}
|
||||
else {
|
||||
$imap_access = $is_now['imap_access'];
|
||||
$smtp_access = $is_now['smtp_access'];
|
||||
$dav_access = $is_now['dav_access'];
|
||||
$eas_access = $is_now['eas_access'];
|
||||
$pop3_access = $is_now['pop3_access'];
|
||||
$sieve_access = $is_now['sieve_access'];
|
||||
}
|
||||
$active = (isset($_data['active'])) ? intval($_data['active']) : $is_now['active'];
|
||||
}
|
||||
@@ -152,6 +160,8 @@ function app_passwd($_action, $_data = null) {
|
||||
`smtp_access` = :smtp_access,
|
||||
`eas_access` = :eas_access,
|
||||
`dav_access` = :dav_access,
|
||||
`pop3_access` = :pop3_access,
|
||||
`sieve_access` = :sieve_access,
|
||||
`active` = :active
|
||||
WHERE `id` = :id");
|
||||
$stmt->execute(array(
|
||||
@@ -161,6 +171,8 @@ function app_passwd($_action, $_data = null) {
|
||||
':smtp_access' => $smtp_access,
|
||||
':eas_access' => $eas_access,
|
||||
':dav_access' => $dav_access,
|
||||
':pop3_access' => $pop3_access,
|
||||
':sieve_access' => $sieve_access,
|
||||
':active' => $active,
|
||||
':id' => $id
|
||||
));
|
||||
|
Reference in New Issue
Block a user