mirror of https://github.com/movim/movim
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.2 KiB
48 lines
1.2 KiB
<?php
|
|
|
|
class AdminDB extends \Movim\Widget\Base
|
|
{
|
|
function load() {
|
|
|
|
}
|
|
|
|
public function ajaxUpdateDatabase()
|
|
{
|
|
$md = \modl\Modl::getInstance();
|
|
$md->check(true);
|
|
$this->rpc('MovimUtils.reloadThis');
|
|
}
|
|
|
|
public function hidePassword($pass)
|
|
{
|
|
return str_repeat('*', strlen($pass));
|
|
}
|
|
|
|
function display()
|
|
{
|
|
$md = \Modl\Modl::getInstance();
|
|
$infos = $md->check();
|
|
|
|
$errors = '';
|
|
|
|
$this->view->assign('infos', $infos);
|
|
$this->view->assign('db_update', $this->call('ajaxUpdateDatabase')
|
|
."this.className='button color loading';");
|
|
try {
|
|
$md->connect();
|
|
} catch(Exception $e) {
|
|
$errors = $e->getMessage();
|
|
}
|
|
|
|
if(file_exists(DOCUMENT_ROOT.'/config/db.inc.php')) {
|
|
require DOCUMENT_ROOT.'/config/db.inc.php';
|
|
}
|
|
|
|
$supported = $md->getSupportedDatabases();
|
|
|
|
$this->view->assign('connected', $md->_connected);
|
|
$this->view->assign('conf', $conf);
|
|
$this->view->assign('dbtype', $supported[$conf['type']]);
|
|
$this->view->assign('errors', $errors);
|
|
}
|
|
}
|