From 100be1aa67d90be1bb58f5a51fb5273bc364984f Mon Sep 17 00:00:00 2001
From: pedro_morgan <pedro_morgan@ispconfig3>
Date: Sun, 19 Aug 2007 01:02:55 -0400
Subject: [PATCH] Minor tweaks to login
---
server/plugins-enabled/getmail_plugin.inc.php | 15 ++++++++++++---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/server/plugins-enabled/getmail_plugin.inc.php b/server/plugins-enabled/getmail_plugin.inc.php
index cc18d2d..0e4d279 100644
--- a/server/plugins-enabled/getmail_plugin.inc.php
+++ b/server/plugins-enabled/getmail_plugin.inc.php
@@ -34,7 +34,7 @@
var $class_name = 'getmail_plugin';
- var $getmail_config_dir = '/etc/getmail';
+ var $getmail_config_dir = '';
/*
This function is called when the plugin is loaded
@@ -51,6 +51,8 @@
$app->plugins->registerEvent('mail_get_update','getmail_plugin','update');
$app->plugins->registerEvent('mail_get_delete','getmail_plugin','delete');
+
+
}
function insert($event_name,$data) {
@@ -62,6 +64,11 @@
function update($event_name,$data) {
global $app, $conf;
+
+ // load the server specific configuration options for getmail
+ $app->uses("getconf");
+ $getmail_config = $app->getconf->get_server_config($conf["server_id"], 'getmail');
+ $this->getmail_config_dir = $getmail_config["getmail_config_dir"];
// Check if the config directory exists.
if(!is_dir($this->getmail_config_dir)) {
@@ -79,7 +86,7 @@
}
- if($data["new"]["source_active"] == 'y') {
+ if($data["new"]["active"] == 'y') {
// Open master template
$tpl = file_get_contents($conf["rootpath"].'/conf/getmail.conf.master');
@@ -101,11 +108,13 @@
$tpl = str_replace('{SERVER}',$data["new"]["source_server"],$tpl);
$tpl = str_replace('{USERNAME}',$data["new"]["source_username"],$tpl);
$tpl = str_replace('{PASSWORD}',$data["new"]["source_password"],$tpl);
- $tpl = str_replace('{DESTINATION}',$data["new"]["source_destination"],$tpl);
+ $tpl = str_replace('{DESTINATION}',$data["new"]["destination"],$tpl);
// Write the config file.
file_put_contents($config_file_path,$tpl);
$app->log("Writing Getmail config file: $config_file_path",LOGLEVEL_DEBUG);
+ exec("chmod 400 $config_file_path");
+ exec("chown getmail $config_file_path");
unset($tpl);
unset($config_file_path);
--
Gitblit v1.9.1