refactoring

This commit is contained in:
Roland Gruber 2020-02-15 21:43:08 +01:00
parent 59e9635e90
commit 0f8fb1e146
1 changed files with 4 additions and 4 deletions

View File

@ -354,14 +354,14 @@ class imapAccess extends baseModule {
} }
$prefix = $this->getMailboxPrefix(); $prefix = $this->getMailboxPrefix();
$user = $this->getAdminUser(); $adminUser = $this->getAdminUser();
if (isset($_POST['ImapAdminPassword']) && isset($_POST['enterPasswordButton'])) { if (isset($_POST['ImapAdminPassword']) && isset($_POST['enterPasswordButton'])) {
$errors = $this->doLogin(); $errors = $this->doLogin();
} }
$password = $this->getAdminPassword(); $adminPassword = $this->getAdminPassword();
try { try {
$client = $this->connect($user, $password); $client = $this->connect($adminUser, $adminPassword);
$this->extractUserAndEmail(); $this->extractUserAndEmail();
$email_domain = substr(strstr($this->email, '@'), 1); $email_domain = substr(strstr($this->email, '@'), 1);
@ -372,7 +372,7 @@ class imapAccess extends baseModule {
else { else {
$root = $prefix . $this->getSep() . $this->user; $root = $prefix . $this->getSep() . $this->user;
try { try {
$client->setACL($root, $user, array('rights' => 'c', 'action' => 'add')); $client->setACL($root, $adminUser, array('rights' => 'c', 'action' => 'add'));
$client->deleteMailbox($root); $client->deleteMailbox($root);
} }
catch (Exception $e) { catch (Exception $e) {