MSD-19
- Changed old configuration to new class for installation - removed old classes
Dieser Commit ist enthalten in:
Ursprung
c0be3ce898
Commit
4a569043a6
18 geänderte Dateien mit 345 neuen und 753 gelöschten Zeilen
|
|
@ -47,12 +47,19 @@ class Bootstrap extends Zend_Application_Bootstrap_Bootstrap
|
|||
*/
|
||||
public function _initConfiguration()
|
||||
{
|
||||
$dynamicConfig = new Msd_Config_Dynamic();
|
||||
$configFile = $dynamicConfig->getParam('configFile', 'mysqldumper.ini');
|
||||
$dynamicConfig = Msd_Registry::getDynamicConfig();
|
||||
if ($dynamicConfig === null) {
|
||||
$dynamicConfig = new Msd_Config_Dynamic();
|
||||
}
|
||||
$configFile = $dynamicConfig->getParam('configFile', 'defaultConfig.ini');
|
||||
Msd_Registry::setConfigFilename($configFile);
|
||||
$config = new Msd_Config(
|
||||
$config = new Msd_Config(
|
||||
'Default',
|
||||
array('directories' => realpath(APPLICATION_PATH . '/../work/config'))
|
||||
array('directories' => array(
|
||||
realpath(APPLICATION_PATH . '/../work/config'),
|
||||
realpath(APPLICATION_PATH . '/configs')
|
||||
)
|
||||
)
|
||||
);
|
||||
$config->load($configFile);
|
||||
Msd_Registry::setConfig($config);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
[general]
|
||||
title = "MySQLDumper"
|
||||
mode = "easy"
|
||||
logMaxsize = "1048576"
|
||||
logUnit = "kb"
|
||||
|
|
@ -7,11 +8,17 @@ maxspeed = "10000"
|
|||
gzip = "y"
|
||||
multipart = "n"
|
||||
multipartSize = ""
|
||||
multipartSizeUnit = "kb"
|
||||
optimize = "n"
|
||||
errorHandling = "s"
|
||||
dbDelete = "n"
|
||||
title = "defaultConfig"
|
||||
|
||||
[dbuser]
|
||||
user = "root"
|
||||
pass = ""
|
||||
host = "localhost"
|
||||
defaultDb = "otrance"
|
||||
port = ""
|
||||
socket = ""
|
||||
|
||||
[autodelete]
|
||||
Activated = "n"
|
||||
|
|
@ -25,8 +32,11 @@ RecipientAddress = ""
|
|||
RecipientName = ""
|
||||
attachBackup = "n"
|
||||
Maxsize = ""
|
||||
MaxsizeUnit = "kb"
|
||||
Program = "php"
|
||||
SendmailCall = ""
|
||||
SMTPHost = ""
|
||||
SMTPPort = ""
|
||||
SMTPUser = ""
|
||||
SMTPPassword = ""
|
||||
|
||||
[ftp]
|
||||
0.use = "n"
|
||||
|
|
@ -38,6 +48,15 @@ Program = "php"
|
|||
0.user = ""
|
||||
0.pass = ""
|
||||
0.dir = "/"
|
||||
1.use = "n"
|
||||
1.timeout = "10"
|
||||
1.passiveMode = "y"
|
||||
1.ssl = "n"
|
||||
1.server = ""
|
||||
1.port = "21"
|
||||
1.user = ""
|
||||
1.pass = ""
|
||||
1.dir = "/"
|
||||
|
||||
[cronscript]
|
||||
perlExtension = "pl"
|
||||
|
|
@ -47,7 +66,7 @@ perlTextOutputComplete = "y"
|
|||
perlFileComment = ""
|
||||
|
||||
[interface]
|
||||
language = "de"
|
||||
language = "en"
|
||||
theme = "msd"
|
||||
notificationWindowPosition = "middleCenter"
|
||||
showServerCaption = "y"
|
||||
|
|
@ -57,15 +76,15 @@ recordsPerPage = "50"
|
|||
sqlbrowserViewMode = "compact"
|
||||
refreshProcesslist = "3"
|
||||
|
||||
[dbuser]
|
||||
host = "localhost"
|
||||
user = "root"
|
||||
pass = ""
|
||||
manual = ""
|
||||
port = ""
|
||||
socket = ""
|
||||
defaultDb = "information_schema"
|
||||
|
||||
[systemDatabases]
|
||||
0 = "mysql"
|
||||
1 = "information_schema"
|
||||
1 = "information_schema"
|
||||
|
||||
[paths]
|
||||
work = "E:\\PHP\\msd2/work/"
|
||||
log = "E:\\PHP\\msd2/work/log"
|
||||
backup = "E:\\PHP\\msd2/work/backup"
|
||||
config = "E:\\PHP\\msd2/work/config"
|
||||
iconPath = "css/msd/icons"
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ class ConfigController extends Msd_Controller_Action
|
|||
*/
|
||||
public function addRecipientCcAction()
|
||||
{
|
||||
$recipientsCc = $this->_config->Param('email.RecipientCc');
|
||||
$recipientsCc = $this->_config->getParam('email.RecipientCc');
|
||||
if ($recipientsCc === null) {
|
||||
$recipientsCc = array();
|
||||
}
|
||||
|
|
@ -286,6 +286,7 @@ class ConfigController extends Msd_Controller_Action
|
|||
sort($ftpConfig);
|
||||
}
|
||||
$this->_config->setParam('ftp', $ftpConfig);
|
||||
//$this->_config->save();
|
||||
}
|
||||
$this->_forward('index');
|
||||
}
|
||||
|
|
@ -410,6 +411,7 @@ class ConfigController extends Msd_Controller_Action
|
|||
$value = $this->_config->getParam($group . '.' . $element);
|
||||
if (is_array($value)) {
|
||||
list (, $key) = explode('.', $element);
|
||||
$value[$key] = isset($value[$key]) ? $value[$key] : '';
|
||||
$subForm->setDefault($element, $value[$key]);
|
||||
} else if ($value !== null) {
|
||||
$subForm->setDefault($element, $value);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@ class IndexController extends Msd_Controller_Action
|
|||
array('message' => 'L_PHP_VERSION_TOO_OLD')
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
$dbo = Msd_Db::getAdapter();
|
||||
$data = Msd_File::getLatestBackupInfo();
|
||||
|
|
@ -265,14 +264,14 @@ class IndexController extends Msd_Controller_Action
|
|||
// if we get here wrong credentials are given
|
||||
$this->view->popUpMessage()
|
||||
->addMessage(
|
||||
'login-message',
|
||||
'L_LOGIN',
|
||||
$user->getAuthMessages(),
|
||||
array(
|
||||
'modal' => true,
|
||||
'dialogClass' => 'error'
|
||||
)
|
||||
);
|
||||
'login-message',
|
||||
'L_LOGIN',
|
||||
$user->getAuthMessages(),
|
||||
array(
|
||||
'modal' => true,
|
||||
'dialogClass' => 'error'
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
$this->view->form = $form;
|
||||
|
|
|
|||
|
|
@ -16,8 +16,22 @@
|
|||
* @package MySQLDumper
|
||||
* @subpackage Controllers
|
||||
*/
|
||||
class InstallController extends Zend_Controller_Action
|
||||
class InstallController extends Msd_Controller_Action
|
||||
{
|
||||
/**
|
||||
* @var Msd_Config
|
||||
*/
|
||||
public $config;
|
||||
/**
|
||||
* @var Msd_DynamicConfig
|
||||
*/
|
||||
public $dynamicConfig;
|
||||
|
||||
/**
|
||||
* @var Msd_Language
|
||||
*/
|
||||
public $lang;
|
||||
|
||||
/**
|
||||
* Init controller
|
||||
*
|
||||
|
|
@ -27,23 +41,28 @@ class InstallController extends Zend_Controller_Action
|
|||
{
|
||||
$layout = Zend_Layout::getMvcInstance();
|
||||
$layout->setLayout('install');
|
||||
$this->version = new Msd_Version();
|
||||
$this->version = new Msd_Version();
|
||||
$_SESSION['msd_install'] = true;
|
||||
if (
|
||||
$this->_request->getActionName() != 'badversion!' &&
|
||||
!$this->version->checkPhpVersion()
|
||||
) {
|
||||
if ($this->_request->getActionName() != 'badversion!' && !$this->version->checkPhpVersion()) {
|
||||
$this->_forward(
|
||||
'badversion',
|
||||
'install',
|
||||
'default',
|
||||
array(
|
||||
'message' => 'L_PHP_VERSION_TOO_OLD'
|
||||
'message' => 'L_PHP_VERSION_TOO_OLD'
|
||||
)
|
||||
);
|
||||
}
|
||||
$config = Msd_Configuration::getInstance('defaultConfig');
|
||||
$config->set('config.interface.theme', 'msd');
|
||||
$this->_config->setParam('interface.theme', 'msd');
|
||||
$this->_config->setParam('paths.iconPath', 'css/msd/icons');
|
||||
$this->_config->setParam('configFile', 'mysqldumper.ini');
|
||||
$this->view->config = $this->_config;
|
||||
$lang = $_SESSION['msd_lang'];
|
||||
if ($lang == '') {
|
||||
$lang = 'en';
|
||||
}
|
||||
$translator = Msd_Language::getInstance();
|
||||
$this->view->lang = $translator->loadLanguage($lang);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -53,31 +72,27 @@ class InstallController extends Zend_Controller_Action
|
|||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
// delete cookie from further installation if present
|
||||
// to not import old values
|
||||
// delete cookie from further installation if present to not import old values
|
||||
if (isset($_SESSION['msd_autologin'])) {
|
||||
setcookie('msd_autologin', null, null, '/');
|
||||
$_SESSION['msd_autologin'] = array();
|
||||
}
|
||||
Zend_Session_Namespace::resetSingleInstance('MySQLDumper');
|
||||
$config = Msd_Configuration::getInstance('defaultConfig', true);
|
||||
$lang = Msd_Language::getInstance();
|
||||
if ($this->_request->isPost()) {
|
||||
$language = $this->_getParam('language');
|
||||
$config->set('config.interface.language', $language);
|
||||
$config->set('dynamic.configFile', 'mysqldumper');
|
||||
$config->set('config.general.title', 'MySQLDumper');
|
||||
$config->saveConfigToSession();
|
||||
$this->_config->setParam('interface.language', $language);
|
||||
$this->_config->setParam('general.title', 'MySQLDumper');
|
||||
$this->_config->setParam('configFile', 'mysqldumper.ini');
|
||||
$_SESSION['msd_lang'] = $language;
|
||||
$redirectUrl = $this->view->url(array('controller' => 'install', 'action' => 'step2'), null, true);
|
||||
$redirectUrl = $this->view->url(array('controller' => 'install', 'action' => 'step2'), null, true);
|
||||
$this->_response->setRedirect($redirectUrl);
|
||||
}
|
||||
// set selected languge
|
||||
$language = $this->_getParam('language', null);
|
||||
$languages = $lang->getAvailableLanguages();
|
||||
$language = $this->_getParam('language', null);
|
||||
$languages = $this->_lang->getAvailableLanguages();
|
||||
|
||||
// check user browser language
|
||||
$locale = new Zend_Locale();
|
||||
$locale = new Zend_Locale();
|
||||
$browserLocale = array_keys($locale->getBrowser());
|
||||
|
||||
// get default or last selected language
|
||||
|
|
@ -99,22 +114,24 @@ class InstallController extends Zend_Controller_Action
|
|||
$this->view->stepInfo = array(
|
||||
'language' => $language,
|
||||
'stepInfo' => array(
|
||||
'number' => 1,
|
||||
'description' => $lang->getTranslator()
|
||||
->_('L_SELECT_LANGUAGE')
|
||||
. ' (' . $language . ')'));
|
||||
$languagesStatus = array();
|
||||
'number' => 1,
|
||||
'description' => $this->_lang->getTranslator()
|
||||
->_('L_SELECT_LANGUAGE')
|
||||
. ' (' . $language . ')'));
|
||||
$languagesStatus = array();
|
||||
foreach ($languages as $langId => $langName) {
|
||||
$languagesStatus[$langId] = array(
|
||||
'langName' => $langName,
|
||||
'langName' => $langName,
|
||||
'installed' => file_exists(
|
||||
APPLICATION_PATH . '/language/' . $langId . '/lang.php'
|
||||
)
|
||||
);
|
||||
}
|
||||
$config->set('config.interface.language', $language);
|
||||
$this->_config->setParam('interface.language', $language);
|
||||
$this->view->languages = $languagesStatus;
|
||||
$this->view->lang = $lang;
|
||||
$this->view->lang = Msd_Language::getInstance();
|
||||
Msd_Registry::setConfig($this->_config);
|
||||
$this->view->config = Msd_Registry::getConfig();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -126,24 +143,22 @@ class InstallController extends Zend_Controller_Action
|
|||
*/
|
||||
public function step2Action()
|
||||
{
|
||||
$lang = Msd_Language::getInstance();
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$language = $config->get('config.interface.language');
|
||||
$language = $this->_config->getParam('interface.language');
|
||||
$this->view->stepInfo = array(
|
||||
'language' => $language,
|
||||
'language' => $language,
|
||||
'firstStepOK' => true,
|
||||
'stepInfo' => array(
|
||||
'number' => 2,
|
||||
'description' => $lang->getTranslator()->_('L_CHECK_DIRS'),
|
||||
'stepInfo' => array(
|
||||
'number' => 2,
|
||||
'description' => $this->_lang->getTranslator()->_('L_CHECK_DIRS'),
|
||||
)
|
||||
);
|
||||
$creationStatus = array();
|
||||
$checkDirs = array(
|
||||
'work' => $config->get('paths.work'),
|
||||
'config' => $config->get('paths.config'),
|
||||
'log' => $config->get('paths.log'),
|
||||
'backup' => $config->get('paths.backup'),
|
||||
'iconpath' => $config->get('paths.iconPath')
|
||||
$creationStatus = array();
|
||||
$checkDirs = array(
|
||||
'work' => $this->_config->getParam('paths.work'),
|
||||
'config' => $this->_config->getParam('paths.config'),
|
||||
'log' => $this->_config->getParam('paths.log'),
|
||||
'backup' => $this->_config->getParam('paths.backup'),
|
||||
'iconpath' => $this->_config->getParam('paths.iconPath')
|
||||
);
|
||||
|
||||
foreach ($checkDirs as $checkDir) {
|
||||
|
|
@ -152,22 +167,21 @@ class InstallController extends Zend_Controller_Action
|
|||
@mkdir($checkDir, 0777);
|
||||
}
|
||||
clearstatcache();
|
||||
$checkExists = file_exists($checkDir);
|
||||
$checkWritable = Msd_File::isWritable($checkDir, 0777);
|
||||
$checkExists = file_exists($checkDir);
|
||||
$checkWritable = Msd_File::isWritable($checkDir, 0777);
|
||||
$creationStatus[$checkDir] = array(
|
||||
'chmod' => Msd_File::getChmod($checkDir),
|
||||
'exists' => $checkExists,
|
||||
'chmod' => Msd_File::getChmod($checkDir),
|
||||
'exists' => $checkExists,
|
||||
'writable' => $checkWritable,
|
||||
);
|
||||
$this->view->status = $creationStatus;
|
||||
$this->view->status = $creationStatus;
|
||||
}
|
||||
if (!in_array(false, $creationStatus)) {
|
||||
$config->set('dynamic.configFile', 'mysqldumper');
|
||||
$config->saveConfigToSession();
|
||||
$this->_config->setParam('configFile', 'mysqldumper');
|
||||
//$this->_config->save();
|
||||
$redirectUrl = $this->view->url(array('controller' => 'install', 'action' => 'step3'), null, true);
|
||||
$this->_response->setRedirect($redirectUrl);
|
||||
}
|
||||
$this->view->lang = $lang;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -177,23 +191,20 @@ class InstallController extends Zend_Controller_Action
|
|||
*/
|
||||
public function step3Action()
|
||||
{
|
||||
$lang = Msd_Language::getInstance();
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$language = $config->get('config.interface.language');
|
||||
$form = new Application_Form_Install_User();
|
||||
$language = $this->_config->getParam('interface.language');
|
||||
$form = new Application_Form_Install_User();
|
||||
$this->view->stepInfo = array(
|
||||
'language' => $language,
|
||||
'firstStepOK' => true,
|
||||
'language' => $language,
|
||||
'firstStepOK' => true,
|
||||
'secondStepOK' => true,
|
||||
'stepInfo' => array(
|
||||
'number' => 3,
|
||||
'description' => $lang->getTranslator()->_('L_AUTHENTICATE'),
|
||||
'stepInfo' => array(
|
||||
'number' => 3,
|
||||
'description' => $this->_lang->getTranslator()->_('L_AUTHENTICATE'),
|
||||
)
|
||||
);
|
||||
if ($this->_request->isPost()) {
|
||||
$postData = $this->_request->getParams();
|
||||
$form->getElement('pass_confirm')->getValidator('Identical')
|
||||
->setToken($postData['pass']);
|
||||
$form->getElement('pass_confirm')->getValidator('Identical')->setToken($postData['pass']);
|
||||
if ($form->isValid($postData)) {
|
||||
$ini = new Msd_Ini();
|
||||
$ini->set('name', $postData['user'], 'user');
|
||||
|
|
@ -204,7 +215,7 @@ class InstallController extends Zend_Controller_Action
|
|||
}
|
||||
}
|
||||
$this->view->form = $form;
|
||||
$this->view->lang = $lang;
|
||||
$this->view->lang = Msd_Language::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -214,63 +225,61 @@ class InstallController extends Zend_Controller_Action
|
|||
*/
|
||||
public function step4Action()
|
||||
{
|
||||
$lang = Msd_Language::getInstance();
|
||||
$config = Msd_Configuration::getInstance();
|
||||
$language = $config->get('config.interface.language');
|
||||
$language = $this->_config->getParam('interface.language');
|
||||
$this->view->stepInfo = array(
|
||||
'language' => $language,
|
||||
'firstStepOK' => true,
|
||||
'language' => $language,
|
||||
'firstStepOK' => true,
|
||||
'secondStepOK' => true,
|
||||
'thirdStepOK' => true,
|
||||
'stepInfo' => array(
|
||||
'number' => 4,
|
||||
'description' => $lang->getTranslator()->_('L_DBPARAMETER'),
|
||||
'thirdStepOK' => true,
|
||||
'stepInfo' => array(
|
||||
'number' => 4,
|
||||
'description' => $this->_lang->getTranslator()->_('L_DBPARAMETER'),
|
||||
)
|
||||
);
|
||||
|
||||
if ($this->_request->isPost()) {
|
||||
$options = array(
|
||||
'host' => $this->_getParam('host'),
|
||||
'user' => $this->_getParam('user'),
|
||||
'pass' => $this->_getParam('pass'),
|
||||
'host' => $this->_getParam('host'),
|
||||
'user' => $this->_getParam('user'),
|
||||
'pass' => $this->_getParam('pass'),
|
||||
'manual' => $this->_getParam('manual'),
|
||||
'port' => $this->_getParam('port'),
|
||||
'port' => $this->_getParam('port'),
|
||||
'socket' => $this->_getParam('socket'),
|
||||
);
|
||||
|
||||
$dbAdapter = Msd_Db::getAdapter($options);
|
||||
try {
|
||||
$this->view->databases = $dbAdapter->getDatabaseNames();
|
||||
$this->view->success = true;
|
||||
$this->_config->setParam('dbuser', $options);
|
||||
if (!$this->version->checkMysqlVersion()) {
|
||||
$this->_forward(
|
||||
'badversion',
|
||||
'install',
|
||||
'default',
|
||||
array(
|
||||
'message' => 'L_MYSQL_VERSION_TOO_OLD'
|
||||
)
|
||||
);
|
||||
}
|
||||
} catch (Msd_Exception $e) {
|
||||
$this->view->errorMessage = $e->getMessage();
|
||||
$this->view->success = false;
|
||||
return;
|
||||
}
|
||||
|
||||
$saveParam = $this->_getParam('save');
|
||||
$config->set('config.dbuser', $options);
|
||||
$this->_config->setParam('dbuser', $options);
|
||||
if ($saveParam !== null && $saveParam == 1) {
|
||||
$config->set('config.general.title', 'MySQLDumper');
|
||||
$config->set('config.dbuser.defaultDb', $this->_getParam('defaultDb'));
|
||||
$config->save('mysqldumper');
|
||||
$this->_config->setParam('general.title', 'MySQLDumper');
|
||||
$this->_config->setParam('dbuser.defaultDb', $this->_getParam('defaultDb'));
|
||||
$this->_config->save('mysqldumper.ini');
|
||||
unset($_SESSION['msd_lang']);
|
||||
unset($_SESSION['msd_install']);
|
||||
$redirectUrl = $this->view->url(array('controller' => 'index', 'action' => 'index', null, true));
|
||||
$this->_response->setRedirect($redirectUrl);
|
||||
} else {
|
||||
$dbAdapter = Msd_Db::getAdapter($options);
|
||||
try {
|
||||
$this->view->databases = $dbAdapter->getDatabaseNames();
|
||||
$this->view->success = true;
|
||||
$config->set('config.dbuser', $options);
|
||||
if (!$this->version->checkMysqlVersion()) {
|
||||
$this->_forward(
|
||||
'badversion',
|
||||
'install',
|
||||
'default',
|
||||
array(
|
||||
'message' => 'L_MYSQL_VERSION_TOO_OLD'
|
||||
)
|
||||
);
|
||||
}
|
||||
$config->saveConfigToSession();
|
||||
} catch (Msd_Exception $e) {
|
||||
$this->view->errorMessage = $e->getMessage();
|
||||
$this->view->success = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->view->lang = $lang;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -284,15 +293,14 @@ class InstallController extends Zend_Controller_Action
|
|||
Zend_Controller_Front::getInstance()->setParam('noViewRenderer', true);
|
||||
$this->_response->setHeader('Content-Type', 'text/javascript');
|
||||
$language = $this->_request->getParam('lang');
|
||||
$lang = Msd_Language::getInstance();
|
||||
$version = new Msd_Version();
|
||||
$files = array(
|
||||
$version = new Msd_Version();
|
||||
$files = array(
|
||||
'lang' => ':language/lang.php',
|
||||
'flag' => ':language/flag.gif'
|
||||
);
|
||||
if ($language === null) {
|
||||
if (!isset($_SESSION['langlist'])) {
|
||||
$languages = $lang->getAvailableLanguages();
|
||||
$languages = $this->_lang->getAvailableLanguages();
|
||||
$_SESSION['langlist'] = array_keys($languages);
|
||||
}
|
||||
rsort($_SESSION['langlist']);
|
||||
|
|
@ -303,9 +311,7 @@ class InstallController extends Zend_Controller_Action
|
|||
echo json_encode('done');
|
||||
return;
|
||||
}
|
||||
$update = new Msd_Update(
|
||||
APPLICATION_PATH . '/configs/update.ini'
|
||||
);
|
||||
$update = new Msd_Update(APPLICATION_PATH . '/configs/update.ini');
|
||||
$update->setUpdateParam('language', $language);
|
||||
$update->setUpdateParam('version', $version->getMsdVersion());
|
||||
$updateResult = $update->doUpdate('language', $files);
|
||||
|
|
@ -313,20 +319,20 @@ class InstallController extends Zend_Controller_Action
|
|||
switch ($updateResult['action']) {
|
||||
case 'connection':
|
||||
$message = array('L_UPDATE_CONNECTION_FAILED',
|
||||
$updateResult['server']);
|
||||
$updateResult['server']);
|
||||
break;
|
||||
case 'saveresponse':
|
||||
$message = array('L_UPDATE_ERROR_RESPONSE',
|
||||
$updateResult['status']);
|
||||
$updateResult['status']);
|
||||
break;
|
||||
case 'createfile':
|
||||
$message = array('L_WRONG_RIGHTS',
|
||||
$updateResult['file'],
|
||||
'0777');
|
||||
$updateResult['file'],
|
||||
'0777');
|
||||
break;
|
||||
case 'getrequest':
|
||||
$message = array('L_UPDATE_ERROR_RESPONSE',
|
||||
$updateResult['status']);
|
||||
$updateResult['status']);
|
||||
break;
|
||||
default:
|
||||
$message = '';
|
||||
|
|
@ -334,25 +340,25 @@ class InstallController extends Zend_Controller_Action
|
|||
|
||||
if ($message !== '') {
|
||||
$this->view
|
||||
->popUpMessage()
|
||||
->addMessage(
|
||||
'update-message',
|
||||
'L_LOGIN',
|
||||
$message,
|
||||
array(
|
||||
'modal' => true,
|
||||
'dialogClass' => 'error'
|
||||
)
|
||||
);
|
||||
->popUpMessage()
|
||||
->addMessage(
|
||||
'update-message',
|
||||
'L_LOGIN',
|
||||
$message,
|
||||
array(
|
||||
'modal' => true,
|
||||
'dialogClass' => 'error'
|
||||
)
|
||||
);
|
||||
$updateResult['message'] = (string)$this->view->popUpMessage();
|
||||
}
|
||||
}
|
||||
|
||||
echo json_encode(
|
||||
array(
|
||||
'language' => $language,
|
||||
'success' => ($updateResult === true) ? true : false,
|
||||
'error' => ($updateResult === true) ? '' : $updateResult
|
||||
'language' => $language,
|
||||
'success' => ($updateResult === true) ? true : false,
|
||||
'error' => ($updateResult === true) ? '' : $updateResult
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
@ -365,8 +371,8 @@ class InstallController extends Zend_Controller_Action
|
|||
public function badversionAction()
|
||||
{
|
||||
$translator = Msd_Language::getInstance()->getTranslator();
|
||||
$messageId = $this->_request->get('message');
|
||||
$message = $translator->_($messageId);
|
||||
$messageId = $this->_request->get('message');
|
||||
$message = $translator->_($messageId);
|
||||
if ($messageId == 'L_PHP_VERSION_TOO_OLD') {
|
||||
$this->view->message = sprintf(
|
||||
$message,
|
||||
|
|
@ -374,7 +380,7 @@ class InstallController extends Zend_Controller_Action
|
|||
PHP_VERSION
|
||||
);
|
||||
} else {
|
||||
$dbObject = Msd_Db::getAdapter();
|
||||
$dbObject = Msd_Db::getAdapter();
|
||||
$this->view->message = sprintf(
|
||||
$message,
|
||||
$dbObject->getServerInfo(),
|
||||
|
|
|
|||
|
|
@ -90,8 +90,7 @@ class SqlServerController extends Msd_Controller_Action
|
|||
public function showProcesslistAction()
|
||||
{
|
||||
$this->getProcesslistAction(false);
|
||||
$interval = $this->view->config
|
||||
->get('config.interface.refreshProcesslist');
|
||||
$interval = $this->view->config->getParam('interface.refreshProcesslist');
|
||||
if ($interval < 2) {
|
||||
$interval = 2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
|||
|
||||
/**
|
||||
* Configuration
|
||||
* @var Msd_Configuration
|
||||
* @var Msd_Config
|
||||
*/
|
||||
protected $_config;
|
||||
|
||||
|
|
@ -596,7 +596,7 @@ class Application_Form_Config_Email extends Zend_Form_SubForm
|
|||
* @param string $name
|
||||
* @param string $value
|
||||
*
|
||||
* @return void
|
||||
* @return Zend_Form
|
||||
*/
|
||||
public function setDefault($name, $value)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -329,8 +329,7 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
|||
'escape' => false,
|
||||
'label' => '',
|
||||
'class' => 'Formbutton ftpToggle' . $index,
|
||||
'onclick' => "testFtpConnection(" .
|
||||
$index . ");",
|
||||
'onclick' => "testFtpConnection(" . $index . ");",
|
||||
)
|
||||
);
|
||||
|
||||
|
|
@ -346,8 +345,7 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
|||
'escape' => false,
|
||||
'label' => '',
|
||||
'class' => 'Formbutton',
|
||||
'onclick' => "deleteFtpConnection(" .
|
||||
$index . ");",
|
||||
'onclick' => "deleteFtpConnection(" . $index . ");",
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
@ -361,19 +359,21 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
|||
*/
|
||||
public function getValidValues($data)
|
||||
{
|
||||
$values = parent::getValidValues($data, true);
|
||||
while (false !== (list($key, $value) = each($values))) {
|
||||
//$values = parent::getValidValues($data, true);
|
||||
$ftpData = array();
|
||||
foreach ($data as $key => $value) {
|
||||
if (substr($key, 0, 4) != 'ftp_') {
|
||||
continue;
|
||||
}
|
||||
list(, $ftpId, $ftpKey) = explode('_', $key);
|
||||
if (!isset($values[$ftpId])) {
|
||||
$values[$ftpId] = array();
|
||||
if (!isset($ftpData[$ftpId])) {
|
||||
$ftpData[$ftpId] = array();
|
||||
}
|
||||
$values[$ftpId][$ftpKey] = $value;
|
||||
unset($values[$key]);
|
||||
$ftpData[$ftpId][$ftpKey] = $value;
|
||||
//unset($values[$key]);
|
||||
}
|
||||
return $values;
|
||||
//var_dump($ftpData); die();
|
||||
return $ftpData;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -409,9 +409,6 @@ class Application_Form_Config_Ftp extends Zend_Form_SubForm
|
|||
*/
|
||||
public function setDefault($name, $value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
list($ftpId, $key) = explode('.', $name);
|
||||
}
|
||||
$name = 'ftp_' . str_replace('.', '_', $name);
|
||||
parent::setDefault($name, $value);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@ class Application_Model_Config_FormValidator
|
|||
* Checks database connection params.
|
||||
* If connection is successfull the values are saved to the config file.
|
||||
*
|
||||
* @param Zend_View $view The view of the form for adding messages
|
||||
* @param Zend_View_Interface $view The view of the form for adding messages
|
||||
*/
|
||||
public function validateAndSaveConfig(Zend_View $view)
|
||||
{
|
||||
|
|
@ -81,17 +81,17 @@ class Application_Model_Config_FormValidator
|
|||
if ($saveConfig) {
|
||||
$this->_config->setConfig($this->_configData);
|
||||
$saved = $this->_config->save();
|
||||
$this->_config->load(Msd_Registry::getConfigFilename());
|
||||
if ($saved === true) {
|
||||
$view->popUpMessage()->addMessage(
|
||||
'save-config',
|
||||
'L_NOTICE',
|
||||
array('L_SAVE_SUCCESS', $this->_config->getParam('general.title')),
|
||||
array(
|
||||
'modal' => true,
|
||||
'dialogClass' => 'notice'
|
||||
)
|
||||
);
|
||||
$this->_config->load(Msd_Registry::getConfigFilename());
|
||||
$view->popUpMessage()->addMessage(
|
||||
'save-config',
|
||||
'L_NOTICE',
|
||||
array('L_SAVE_SUCCESS', $this->_config->getParam('general.title')),
|
||||
array(
|
||||
'modal' => true,
|
||||
'dialogClass' => 'notice'
|
||||
)
|
||||
);
|
||||
} else {
|
||||
die("Fehler beim Speichern der Konfiguration!");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,17 +1,16 @@
|
|||
<?php
|
||||
$okIcon = $this->getIcon('Ok', null, 16);
|
||||
$request = Zend_Controller_Front::getInstance()->getRequest();
|
||||
?>
|
||||
<form action="<?php
|
||||
echo $this->url(array(
|
||||
'controller' => 'install',
|
||||
'action' => 'step4',
|
||||
));
|
||||
));?>" method="post" enctype="multipart/formdata">
|
||||
|
||||
$okIcon = $this->getIcon('Ok', null, 16);
|
||||
$request = Zend_Controller_Front::getInstance()->getRequest();
|
||||
|
||||
?>" method="post" enctype="multipart/formdata">
|
||||
<table cellpadding="0" cellspacing="0" class="bdr" style="width: 700px;" summary="Provide MySQL access data">
|
||||
<?php
|
||||
if (isset($this->success) && $this->success) {
|
||||
?>
|
||||
if (isset($this->success) && $this->success) { ?>
|
||||
<tr class="thead">
|
||||
<td style="text-align:center;" colspan="2">
|
||||
<br />
|
||||
|
|
@ -19,85 +18,77 @@ if (isset($this->success) && $this->success) {
|
|||
<?php echo $this->getIcon('save'); ?> <?php echo $this->lang->L_SAVEANDCONTINUE; ?>
|
||||
</button><br class="clear" /><br />
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<tr class="row-even">
|
||||
<td><?php echo $this->lang->L_DB_HOST; ?>:</td>
|
||||
<td><input type="text" class="text" name="host" maxlength="100" style="width:250px;"
|
||||
value="<?php echo $request->getParam('host', 'localhost'); ?>"
|
||||
autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr class="row-odd">
|
||||
<td><?php echo $this->lang->L_DB_USER; ?>:</td>
|
||||
<td><input type="text" class="text" name="user" maxlength="100" style="width:250px;"
|
||||
value="<?php echo $request->getParam('user', 'root'); ?>"
|
||||
autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr class="row-even">
|
||||
<td><?php echo $this->lang->L_DB_PASS; ?>:</td>
|
||||
<td><input type="password" class="text" name="pass" maxlength="100" style="width:250px;"
|
||||
value="<?php echo $request->getParam('pass', ''); ?>"
|
||||
autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr class="row-odd">
|
||||
<td><?php echo $this->lang->L_DB; ?>:
|
||||
<p class="small"><?php echo $this->lang->L_ENTER_DB_INFO; ?></p></td>
|
||||
<td><input type="text" class="text" name="manual" maxlength="100" style="width:250px;" value="<?php echo $request->getParam('manual', ''); ?>" /></td>
|
||||
</tr>
|
||||
<tr class="row-even">
|
||||
<td><?php echo $this->lang->L_PORT; ?>:
|
||||
<p class="small"><?php echo $this->lang->L_INSTALL_HELP_PORT; ?></p></td>
|
||||
<td><input type="text" class="text" name="port" maxlength="100" style="width:250px;" value="<?php echo $request->getParam('port', ''); ?>" /></td>
|
||||
</tr>
|
||||
<tr class="row-odd">
|
||||
<td><?php echo $this->lang->L_SOCKET; ?>:
|
||||
<p class="small"><?php echo $this->lang->L_INSTALL_HELP_SOCKET; ?></p></td>
|
||||
<td><input type="text" class="text" name="socket" maxlength="100" style="width:250px;" value="<?php echo $request->getParam('socket', ''); ?>" /></td>
|
||||
</tr>
|
||||
<tr class="row-even">
|
||||
<td><?php echo $this->lang->L_TESTCONNECTION; ?>:</td>
|
||||
<td><button type="submit" class="Formbutton">
|
||||
<?php echo $this->getIcon('Connect', null, 16); ?> <?php echo $this->lang->L_CONNECTTOMYSQL; ?>
|
||||
</button></td>
|
||||
</tr>
|
||||
</tr><?php
|
||||
} ?>
|
||||
<tr class="row-even">
|
||||
<td><?php echo $this->lang->L_DB_HOST; ?>:</td>
|
||||
<td><input type="text" class="text" name="host" maxlength="100" style="width:250px;"
|
||||
value="<?php echo $request->getParam('host', 'localhost'); ?>"
|
||||
autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr class="row-odd">
|
||||
<td><?php echo $this->lang->L_DB_USER; ?>:</td>
|
||||
<td><input type="text" class="text" name="user" maxlength="100" style="width:250px;"
|
||||
value="<?php echo $request->getParam('user', 'root'); ?>"
|
||||
autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr class="row-even">
|
||||
<td><?php echo $this->lang->L_DB_PASS; ?>:</td>
|
||||
<td><input type="password" class="text" name="pass" maxlength="100" style="width:250px;"
|
||||
value="<?php echo $request->getParam('pass', ''); ?>"
|
||||
autocomplete="off" /></td>
|
||||
</tr>
|
||||
<tr class="row-odd">
|
||||
<td><?php echo $this->lang->L_DB; ?>:
|
||||
<p class="small"><?php echo $this->lang->L_ENTER_DB_INFO; ?></p></td>
|
||||
<td><input type="text" class="text" name="manual" maxlength="100" style="width:250px;" value="<?php echo $request->getParam('manual', ''); ?>" /></td>
|
||||
</tr>
|
||||
<tr class="row-even">
|
||||
<td><?php echo $this->lang->L_PORT; ?>:
|
||||
<p class="small"><?php echo $this->lang->L_INSTALL_HELP_PORT; ?></p></td>
|
||||
<td><input type="text" class="text" name="port" maxlength="100" style="width:250px;" value="<?php echo $request->getParam('port', ''); ?>" /></td>
|
||||
</tr>
|
||||
<tr class="row-odd">
|
||||
<td><?php echo $this->lang->L_SOCKET; ?>:
|
||||
<p class="small"><?php echo $this->lang->L_INSTALL_HELP_SOCKET; ?></p></td>
|
||||
<td><input type="text" class="text" name="socket" maxlength="100" style="width:250px;" value="<?php echo $request->getParam('socket', ''); ?>" /></td>
|
||||
</tr>
|
||||
<tr class="row-even">
|
||||
<td><?php echo $this->lang->L_TESTCONNECTION; ?>:</td>
|
||||
<td><button type="submit" class="Formbutton">
|
||||
<?php echo $this->getIcon('Connect', null, 16); ?> <?php echo $this->lang->L_CONNECTTOMYSQL; ?>
|
||||
</button></td>
|
||||
</tr>
|
||||
</table>
|
||||
<?php
|
||||
if(isset($this->success)) {
|
||||
?><br/><br/>
|
||||
<table class="bdr" cellpadding="0" cellspacing="0" style="width:700px;" summary="MySQL connection results">
|
||||
<?php
|
||||
if ($this->success) {
|
||||
?>
|
||||
|
||||
<?php if(isset($this->success)) { ?>
|
||||
<p> </p>
|
||||
<table class="bdr" cellpadding="0" cellspacing="0" style="width:700px;" summary="MySQL connection results"><?php
|
||||
if ($this->success) { ?>
|
||||
<tr class="thead">
|
||||
<th><?php echo $this->lang->L_DBCONNECTION; ?> <?php echo $okIcon; ?></th>
|
||||
</tr>
|
||||
<?php
|
||||
</tr><?php
|
||||
if (count($this->databases) > 0) {
|
||||
foreach ($this->databases as $database) {
|
||||
?>
|
||||
<tr class="dbrow">
|
||||
<td class="small success">
|
||||
<div style="float:left; padding-right: 5px;" title="<?php echo $this->lang->L_INSTALL_DB_DEFAULT; ?>">
|
||||
<input type="radio" name="defaultDb" value="<?php echo $database; ?>" />
|
||||
</div>
|
||||
<?php echo $database; ?>
|
||||
<div style="float:right;">
|
||||
<?php echo $okIcon; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
foreach ($this->databases as $index => $database) { ?>
|
||||
<tr class="dbrow">
|
||||
<td class="small success">
|
||||
<div style="float:left; padding-right: 5px;" title="<?php echo $this->lang->L_INSTALL_DB_DEFAULT; ?>">
|
||||
<input id="db-<?php echo $index;?>" type="radio" name="defaultDb" value="<?php echo $database; ?>" />
|
||||
</div>
|
||||
<label for="db-<?php echo $index;?>">
|
||||
<?php echo $database; ?>
|
||||
</label>
|
||||
<div style="float:right;">
|
||||
<?php echo $okIcon; ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr><?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $okIcon; ?> <?php echo $this->lang->L_NO_DB_FOUND_INFO; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
} else { ?>
|
||||
<tr>
|
||||
<td><?php echo $okIcon; ?> <?php echo $this->lang->L_NO_DB_FOUND_INFO; ?></td>
|
||||
</tr><?php
|
||||
} ?>
|
||||
<tr class="thead">
|
||||
<td style="text-align:center;">
|
||||
<br />
|
||||
|
|
@ -106,10 +97,8 @@ if(isset($this->success)) {
|
|||
</button><br class="clear" /><br />
|
||||
<input type="hidden" name="save" value="1"/>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
} else {
|
||||
?>
|
||||
</tr><?php
|
||||
} else { ?>
|
||||
<tr class="thead">
|
||||
<th><?php echo $this->lang->L_DBCONNECTION; ?> <?php echo $this->getIcon('delete'); ?></th>
|
||||
</tr>
|
||||
|
|
@ -117,12 +106,9 @@ if(isset($this->success)) {
|
|||
<td class="error">
|
||||
<br /><?php echo $this->errorMessage; ?><br /><br/>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
</tr><?php
|
||||
}?>
|
||||
</table><?php
|
||||
}
|
||||
?>
|
||||
</form>
|
||||
</form>
|
||||
|
|
|
|||
Laden …
Tabelle hinzufügen
Einen Link hinzufügen
In neuem Issue referenzieren