refactoring
This commit is contained in:
parent
c0e1e026d8
commit
59e9635e90
|
@ -226,18 +226,18 @@ class imapAccess extends baseModule {
|
||||||
$prefix = $this->getMailboxPrefix();
|
$prefix = $this->getMailboxPrefix();
|
||||||
|
|
||||||
$email_domain = substr(strstr($this->email, '@'), 1);
|
$email_domain = substr(strstr($this->email, '@'), 1);
|
||||||
$password = $this->getAdminPassword(); // check for password for fall back mechanism
|
$adminPassword = $this->getAdminPassword(); // check for password for fall back mechanism
|
||||||
if (!isset($_SESSION['imapAdmPass']) && !isset($password)) {
|
if (!isset($_SESSION['imapAdmPass']) && !isset($adminPassword)) {
|
||||||
return $this->display_html_password();
|
return $this->display_html_password();
|
||||||
}
|
}
|
||||||
|
|
||||||
$return->addLabel(new htmlOutputText(_('Email address')));
|
$return->addLabel(new htmlOutputText(_('Email address')));
|
||||||
$return->addField(new htmlOutputText($this->email));
|
$return->addField(new htmlOutputText($this->email));
|
||||||
|
|
||||||
$user = $this->getAdminUser();
|
$adminUser = $this->getAdminUser();
|
||||||
$password = $this->getAdminPassword();
|
$adminPassword = $this->getAdminPassword();
|
||||||
try {
|
try {
|
||||||
$client = $this->connect($user, $password);
|
$client = $this->connect($adminUser, $adminPassword);
|
||||||
}
|
}
|
||||||
catch (LAMException $e) {
|
catch (LAMException $e) {
|
||||||
return $this->display_html_password(new htmlStatusMessage('ERROR', $e->getTitle(), $e->getMessage()));
|
return $this->display_html_password(new htmlStatusMessage('ERROR', $e->getTitle(), $e->getMessage()));
|
||||||
|
@ -635,11 +635,11 @@ class imapAccess extends baseModule {
|
||||||
*/
|
*/
|
||||||
function doLogin() {
|
function doLogin() {
|
||||||
$errors = array();
|
$errors = array();
|
||||||
$user = $this->getAdminUser();
|
$adminUser = $this->getAdminUser();
|
||||||
if (isset($_POST['ImapAdminPassword']) && $_POST['ImapAdminPassword'] != "") {
|
if (isset($_POST['ImapAdminPassword']) && $_POST['ImapAdminPassword'] != "") {
|
||||||
$password = $_POST['ImapAdminPassword'];
|
$adminPassword = $_POST['ImapAdminPassword'];
|
||||||
try {
|
try {
|
||||||
$client = $this->connect($user, $password);
|
$client = $this->connect($adminUser, $adminPassword);
|
||||||
$_SESSION['imapAdmPass'] = lamEncrypt($_POST['ImapAdminPassword']);
|
$_SESSION['imapAdmPass'] = lamEncrypt($_POST['ImapAdminPassword']);
|
||||||
$client->logout();
|
$client->logout();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue