Author |
|
omarraja Newbie

Joined: 21 April 2008
Online Status: Offline Posts: 1
|
Posted: 21 April 2008 at 9:55am | IP Logged
|
|
|
Hi,
I just uploaded the MailBee Webmail Lite script (PHP) and I followed all the steps... I get the following error message :
The web-server has no permission to write into the settings file
or
settings file not exists
/settings/settings.xml
or
Language file (English.php) not exists
What could be the problem
Thanks for helping
|
Back to Top |
|
|
Andrew AfterLogic Support

Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 22 April 2008 at 12:04am | IP Logged
|
|
|
This error means exactly what it says.
In most cases, it happens because the system account web server process is running under doesn't have permission to write into the WebMail data folder.
The installation manual contains instructions on assigning correct permissions. If you followed those instructions, but it still doesn't work, please try to grant "Full Control" permission to "Everyone" user account (or 666 permission for all files inside the data folder and 777 for the data folder and all its subfolders in case of Linux) to the data folder and all its subfolders and files.
Best regards,
Andrew
|
Back to Top |
|
|
celsojr Newbie


Joined: 30 April 2008 Location: Brazil
Online Status: Offline Posts: 2
|
Posted: 30 April 2008 at 12:25pm | IP Logged
|
|
|
Open the class_settings.php file and change:
<?php
if (!defined('WM_ROOTPATH')) define('WM_ROOTPATH', (dirname(__FILE__).'/'));
if (!defined('IS_SETTINGS_REQUIRE'))
{
if (file_exists(WM_ROOTPATH.'inc_settings_path.php'))
{
require_once('inc_settings_pat h.php');
define('IS_SETTINGS_REQUIRE', 1);
}
else
{
exit('<font color="red">Can\'t find <b>inc_settings_path.php</b> file</font>');
}
}
$dataPath = isset($dataPath) ? str_replace('\\', '/', rtrim(trim($dataPath), '/\\')) : '';
if ($dataPath)
{
$dPath = str_replace('\\', '/', realpath($dataPath));
}
define('INI_DIR', isset($dPath) ? $dPath : $dataPath);
require_once(WM_ROOTPATH.'comm on/class_xmldocument.php');
require_once(WM_ROOTPATH.'comm on/class_convertutils.php');
define('LOG_PATH', 'logs');
define('DEFAULT_DATEFORMAT', 'default');
define('MAILPROTOCOL_POP3', 0);
define('MAILPROTOCOL_WMSERVER' , 2);
class Settings
{
/**
* @var string
*/
var $WindowTitle;
/**
* @var string
*/
var $AdminPassword;
/**
* @var int
*/
var $IncomingMailProtocol = MAILPROTOCOL_POP3;
/**
* @var string
*/
var $IncomingMailServer;
/**
* @var int
*/
var $IncomingMailPort;
/**
* @var string
*/
var $OutgoingMailServer;
/**
* @var int
*/
var $OutgoingMailPort;
/**
* @var bool
*/
var $ReqSmtpAuth;
/**
* @var bool
*/
var $AllowAdvancedLogin;
/**
* @var int
*/
var $HideLoginMode;
/**
* @var string
*/
var $DefaultDomainOptional;
/**
* @var bool
*/
var $ShowTextLabels;
/**
* @var bool
*/
var $AutomaticCorrectLoginSettings;
/**
* @var bool
*/
var $EnableLogging;
/**
* @var bool
*/
var $AllowAjax;
/**
* @var int
*/
var $MailsPerPage;
/**
* @var bool
*/
var $EnableAttachmentSizeLimit;
/**
* @var long
*/
var $AttachmentSizeLimit;
/**
* @var bool
*/
var $EnableMailboxSizeLimit;
/**
* @var long
*/
var $MailboxSizeLimit;
/**
* @var short
*/
var $DefaultTimeZone;
/**
* @var string
*/
var $DefaultUserCharset;
/**
* @var string
*/
var $DefaultSkin;
/**
* @var string
*/
var $DefaultLanguage;
/**
* @var int
*/
var $ViewMode;
/**
* @var bool
*/
var $EnableWmServer = false;
/**
* @var bool
*/
var $isLoad = false;
/**
* @var bool
*/
var $_langIsInclude = false;
/**
* @static
* @return Settings
*/
function &CreateInstance()
{
static $instance;
if (!is_object($instance))
{
$instance = new Settings(null);
}
return $instance;
}
/**
* @access private
*/
function Settings($param = true)
{
if (!is_null($param))
{
die(CA NT_CALL_CONSTRUCTOR);
}
$xmlDocument = &new XmlDocument();
if ($xmlDocument->LoadFromFile(WM_ROOTPATH . '/settings/settings.xml'))
{
$this- >isLoad = true;
$this- >_loadFromXML($xmlDocument->XmlRoot);
}
}
/**
* @return bool
*/
function IncludeLang()
{
if (!$this->isLoad)
{
return false;
}
if ($this->_langIsInclude)
{
return true;
}
if (file_exists(WM_ROOTPATH.'/lang/'.$this->DefaultLanguage. '.php'))
{
include_once(WM_ROOTPATH.'/lang/'.$this->DefaultLanguage. '.php');
$this->_langIsInclude = true;
}
elseif (file_exists(WM_ROOTPATH.'/lang/English.php'))
{
include_once(WM_ROOTPATH.'/lang/English.php');
$this->_langIsInclude = true;
}
return $this->_langIsInclude;
}
/**
* @access private
* @param XmlDomNode $xmlTree
*/
function _loadFromXML(&$xmlTree)
{
foreach ($xmlTree->Children as $node)
{
switch ($node->TagName)
{
case 'WindowTitle':
$this->WindowTitle = ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'AdminPassword':
$this->AdminPassword = ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'IncomingMailProtocol':
$this->IncomingMailProtocol = (int) MAILPROTOCOL_POP3;
break;
case 'IncomingMailServer':
$this->IncomingMailServer = ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'IncomingMailPort':
$this->IncomingMailPort = (int) ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'OutgoingMailServer':
$this->OutgoingMailServer = ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'OutgoingMailPort':
$this->OutgoingMailPort = (int) ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'ReqSmtpAuth':
$this->ReqSmtpAuth = (bool) $node->Value;
break;
case 'AllowAdvancedLogin':
$this->AllowAdvancedLogin = (bool) $node->Value;
break;
case 'HideLoginMode':
$this->HideLoginMode = (int) ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'DefaultDomainOptional':
$this->DefaultDomainOptional = ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'ShowTextLabels':
$this->ShowTextLabels = (bool) $node->Value;
break;
case 'AutomaticCorrectLoginSettings':
$this->AutomaticCorrectLoginSettings = (bool) $node->Value;
break;
case 'EnableLogging':
$this->EnableLogging = (bool) $node->Value;
break;
case 'AllowAjax':
$this->AllowAjax = (bool) $node->Value;
break;
case 'MailsPerPage':
$this->MailsPerPage = (int) ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'EnableAttachmentSizeLimit':
$this->EnableAttachmentSizeLimit = (bool) $node->Value;
break;
case 'AttachmentSizeLimit':
$this->AttachmentSizeLimit = (int) ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'EnableMailboxSizeLimit':
$this->EnableMailboxSizeLimit = (bool) $node->Value;
break;
case 'MailboxSizeLimit':
$this->MailboxSizeLimit = (int) ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'DefaultTimeZone':
$this->DefaultTimeZone = ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'DefaultUserCharset':
$this->DefaultUserCharset = ConvertUtils::GetCodePageName($node->Value);
break;
case 'DefaultSkin':
$this->DefaultSkin = ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'DefaultLanguage':
$this->DefaultLanguage = ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'ViewMode':
$this->ViewMode = (int) ConvertUtils::WMBackHtmlSpecialChars($node->Value);
break;
case 'EnableWmServer':
$this->EnableWmServer = false;
break;
}
}
}
/**
* @return bool
*/
function SaveToXml()
{
$xmlDocument =& new XmlDocument();
$xmlDocument ->CreateElement('Settings');
$xmlDocument ->XmlRoot->AppendAttribute('xmlns:xsd', 'http://www.w3.org/2001/XMLSchema');
$xmlDocument ->XmlRoot->AppendAttribute('xmlns:xsi', 'http://www.w3.org/2001/XMLSchema-instance');
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('WindowTitle', ConvertUtils::WMHtmlSpecialChars($this->WindowTitle)));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('AdminPassword', ConvertUtils::WMHtmlSpecialChars($this->AdminPassword)));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('IncomingMailServer', ConvertUtils::WMHtmlSpecialChars($this->IncomingMailServe r)));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('IncomingMailPort', (int) $this->IncomingMailPort));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('OutgoingMailServer', ConvertUtils::WMHtmlSpecialChars($this->OutgoingMailServe r)));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('OutgoingMailPort', (int) $this->OutgoingMailPort));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('ReqSmtpAuth', (int) $this->ReqSmtpAuth));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('AllowAdvancedLogin', (int) $this->AllowAdvancedLogin));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('HideLoginMode', (int) $this->HideLoginMode));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('DefaultDomainOptional', ConvertUtils::WMHtmlSpecialChars($this->DefaultDomainOpti onal)));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('ShowTextLabels', (int)$this->ShowTextLabels));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('AutomaticCorrectLoginSettings', (int) $this->AutomaticCorrectLoginSettings));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('EnableLogging', (int) $this->EnableLogging));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('AllowAjax', (int) $this->AllowAjax));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('MailsPerPage', (int) $this->MailsPerPage));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('EnableAttachmentSizeLimit', (int) $this->EnableAttachmentSizeLimit));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('AttachmentSizeLimit', ConvertUtils::WMHtmlSpecialChars($this->AttachmentSizeLim it)));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('EnableMailboxSizeLimit', (int) $this->EnableMailboxSizeLimit));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('MailboxSizeLimit', ConvertUtils::WMHtmlSpecialChars($this->MailboxSizeLimit) ));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('DefaultTimeZone', ConvertUtils::WMHtmlSpecialChars($this->DefaultTimeZone)) );
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('DefaultUserCharset', ConvertUtils::GetCodePageNumber($this->DefaultUserCharset )));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('DefaultSkin', ConvertUtils::WMHtmlSpecialChars($this->DefaultSkin)));
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('DefaultLanguage', ConvertUtils::WMHtmlSpecialChars($this->DefaultLanguage)) );
$xmlDocument ->XmlRoot->AppendChild(new XmlDomNode('ViewMode', (int) $this->ViewMode));
return $xmlDocument->SaveToFile(INI_DIR . '/settings/settings.xml');
}
}
?>
|
Back to Top |
|
|
Andrew AfterLogic Support

Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 04 May 2008 at 6:38am | IP Logged
|
|
|
This doesn't fix anything. WM_ROOTPATH is path to the web folder of WebMail installation, INI_DIR is path to the data folder.
In the original source code, settings are loaded from the data folder. That's the place where they should be stored. Your fix causes loading settings from the web folder. The web folder is intended for keeping source code, not data, not settings. Looks like you placed all contents of the data folder inside the web folder, so this fix works for you. Even if so, it's not necessary to modify the source code, it's enough to specify correct path in inc_settings_path.php file.
We don't recommend you to deploy the data folder in a place accessible from web for security reasons. MailBee WebMail has two folders web and data. The web folder contains the source code and should be accessible from web, while the data folder contains settings, temporary data, private information, etc. Web server process doesn't require permission to write into the web folder, but it must be allowed to write into the data folder.
Even if you place contents of the data folder into the web folder and apply this fix, it'll work for reading settings, but saving won't work.
Best regards,
Andrew
|
Back to Top |
|
|