Skip to content
Snippets Groups Projects
Commit 31dfdf6c authored by Leif Andersson's avatar Leif Andersson
Browse files

Ändrade plats för listorna xxx.dis

parent d1d5e3de
No related branches found
No related tags found
No related merge requests found
...@@ -175,9 +175,11 @@ EOS; ...@@ -175,9 +175,11 @@ EOS;
public static function setMailLists() { public static function setMailLists() {
global $gCms; if (!isset($gCms)) exit; global $gCms; if (!isset($gCms)) exit;
$config =& $gCms->GetConfig();
$maildir = $config['root_path'] . '/uploads/mailinglists';
$db = AddressDB::getDB(); $db = AddressDB::getDB();
$groups = self::getGroupList(); $groups = self::getGroupList();
if(!is_dir(self::$maildir)) mkdir(self::$maildir,'0755',true); //if(!is_dir(self::$maildir)) mkdir(self::$maildir,'0755',true);
foreach ($groups as $group) { foreach ($groups as $group) {
$pos = strrpos($group->Gruppnamn, '.dis'); $pos = strrpos($group->Gruppnamn, '.dis');
if ($pos === false) continue; if ($pos === false) continue;
...@@ -191,7 +193,7 @@ EOS; ...@@ -191,7 +193,7 @@ EOS;
} }
if (count($epost) > 0) { if (count($epost) > 0) {
// echo '<pre>'; print_r($epost); echo '</pre>'; // echo '<pre>'; print_r($epost); echo '</pre>';
$filename = self::$maildir . '/' . $group->Gruppnamn; $filename = $maildir . '/' . $group->Gruppnamn;
$file = fopen($filename,'w'); $file = fopen($filename,'w');
if ($file === false) die('Cannot write '.$filename); if ($file === false) die('Cannot write '.$filename);
foreach ($epost as $line) fwrite($file,$line.PHP_EOL); foreach ($epost as $line) fwrite($file,$line.PHP_EOL);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment