-

-
-ACL()->has_right_on_sbas($sbas_id, 'bas_manage')) {
- ?>
-
-
-
-
+
+
+
+
+

+ ACL()->has_right_on_sbas($sbas_id, "bas_manage")) {
?>
+
+
+
+
-
-
-
-get('GV_RootPath') . 'config/minilogos/logopdf_' . $databox->get_sbas_id())) {
- echo(_('admin::base:collection: aucun fichier (minilogo, watermark ...)'));
-} else {
- echo '

';
-}
-?>
+
+
-
+
-
-
diff --git a/www/admin/databases.php b/www/admin/databases.php
index 9c736b62c4..fc505b8840 100644
--- a/www/admin/databases.php
+++ b/www/admin/databases.php
@@ -27,226 +27,210 @@ $error = array();
$Core = bootstrap::getCore();
-phrasea::headers();
?>
-
-
-
-
-
-
-
-
- has_post_datas() && $user_obj->is_admin() === true) {
- $parm = $request->get_parms('upgrade');
- if ( ! is_null($parm['upgrade'])) {
- $checks = phrasea::is_scheduler_started();
- if ($checks !== true) {
- $appbox = appbox::get_instance(\bootstrap::getCore());
- try {
- $upgrader = new Setup_Upgrade($appbox);
- $advices = $appbox->forceUpgrade($upgrader);
+has_post_datas() && $user_obj->is_admin() === true) {
+ $parm = $request->get_parms('upgrade');
+ if ( ! is_null($parm['upgrade'])) {
+ $checks = phrasea::is_scheduler_started();
+ if ($checks !== true) {
+ $appbox = appbox::get_instance(\bootstrap::getCore());
+ try {
+ $upgrader = new Setup_Upgrade($appbox);
+ $advices = $appbox->forceUpgrade($upgrader);
- $code = '';
- foreach ($advices as $advice) {
- $code .= $advice['sql'] . '
';
- }
+ $code = '';
+ foreach ($advices as $advice) {
+ $code .= $advice['sql'] . '
';
+ }
- $recommendations = $upgrader->getRecommendations();
+ $recommendations = $upgrader->getRecommendations();
- if($code) {
- $code = _('Propositions de modifications des tables')
- . '
' . $code . '
';
+ if($code) {
+ $code = _('Propositions de modifications des tables')
+ . '
' . $code . '
';
+ ?>
+
+
+
+
+
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ get_parms('mount_base', 'new_settings', 'new_dbname', 'new_data_template', 'new_hostname', 'new_port', 'new_user', 'new_user', 'new_password', 'new_dbname', 'new_data_template');
+ if ( ! $parm['mount_base']) {
+ if ( ! $parm['new_settings'] && $parm['new_dbname'] && $parm['new_data_template']) {
+ if (p4string::hasAccent($parm['new_dbname'])) {
+ $error[] = _('Database name can not contains special characters');
+ }
+
+ if (count($error) === 0) {
+ try {
+ $configuration = \Alchemy\Phrasea\Core\Configuration::build();
+
+ $choosenConnexion = $configuration->getPhraseanet()->get('database');
+
+ $connexion = $configuration->getConnexion($choosenConnexion);
+
+ $hostname = $connexion->get('host');
+ $port = $connexion->get('port');
+ $user = $connexion->get('user');
+ $password = $connexion->get('password');
+
+ $data_template = new \SplFileInfo($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
+
+ $connbas = new connection_pdo('databox_creation', $hostname, $port, $user, $password, $parm['new_dbname'], array(), $appbox->get_registry());
+
+ try {
+ $base = databox::create($appbox, $connbas, $data_template, $registry);
+ $base->registerAdmin($user_obj);
+ $createBase = $sbas_id = $base->get_sbas_id();
+ } catch (Exception $e) {
+ $error[] = $e->getMessage();
+ }
+ } catch (Exception $e) {
+ $error[] = _('Database does not exists or can not be accessed');
}
}
- $parm = $request->get_parms('mount_base', 'new_settings', 'new_dbname', 'new_data_template', 'new_hostname', 'new_port', 'new_user', 'new_user', 'new_password', 'new_dbname', 'new_data_template');
- if ( ! $parm['mount_base']) {
- if ( ! $parm['new_settings'] && $parm['new_dbname'] && $parm['new_data_template']) {
- if (p4string::hasAccent($parm['new_dbname'])) {
- $error[] = _('Database name can not contains special characters');
- }
+ } elseif ($parm['new_settings'] && $parm['new_hostname'] && $parm['new_port']
+ && $parm['new_user'] && $parm['new_password']
+ && $parm['new_dbname'] && $parm['new_data_template']) {
- if (count($error) === 0) {
- try {
- $configuration = \Alchemy\Phrasea\Core\Configuration::build();
+ if (p4string::hasAccent($parm['new_dbname'])) {
+ $error[] = _('Database name can not contains special characters');
+ }
- $choosenConnexion = $configuration->getPhraseanet()->get('database');
+ if (count($error) === 0) {
- $connexion = $configuration->getConnexion($choosenConnexion);
-
- $hostname = $connexion->get('host');
- $port = $connexion->get('port');
- $user = $connexion->get('user');
- $password = $connexion->get('password');
-
- $data_template = new \SplFileInfo($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
-
- $connbas = new connection_pdo('databox_creation', $hostname, $port, $user, $password, $parm['new_dbname'], array(), $appbox->get_registry());
-
- try {
- $base = databox::create($appbox, $connbas, $data_template, $registry);
- $base->registerAdmin($user_obj);
- $createBase = $sbas_id = $base->get_sbas_id();
- } catch (Exception $e) {
- $error[] = $e->getMessage();
- }
- } catch (Exception $e) {
- $error[] = _('Database does not exists or can not be accessed');
- }
- }
- } elseif ($parm['new_settings'] && $parm['new_hostname'] && $parm['new_port']
- && $parm['new_user'] && $parm['new_password']
- && $parm['new_dbname'] && $parm['new_data_template']) {
-
- if (p4string::hasAccent($parm['new_dbname'])) {
- $error[] = _('Database name can not contains special characters');
- }
-
- if (count($error) === 0) {
-
- try {
- $data_template = new \SplFileInfo($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
- $connbas = new connection_pdo('databox_creation', $parm['new_hostname'], $parm['new_port'], $parm['new_user'], $parm['new_password'], $parm['new_dbname'], array(), $appbox->get_registry());
- $base = databox::create($appbox, $connbas, $data_template, $registry);
- $base->registerAdmin($user_obj);
- $createBase = $sbas_id = $base->get_sbas_id();
- } catch (Exception $e) {
- $error[] = $e->getMessage();
- }
- }
- }
- } elseif ($parm['mount_base']) {
- if ( ! $parm['new_settings'] && $parm['new_dbname']) {
-
- if (p4string::hasAccent($parm['new_dbname']))
- $error[] = _('Database name can not contains special characters');
-
- if (count($error) === 0) {
- try {
- $configuration = \Alchemy\Phrasea\Core\Configuration::build();
-
- $connexion = $configuration->getConnexion();
-
- $hostname = $connexion->get('host');
- $port = $connexion->get('port');
- $user = $connexion->get('user');
- $password = $connexion->get('password');
-
- $appbox->get_connection()->beginTransaction();
- $base = databox::mount($appbox, $hostname, $port, $user, $password, $parm['new_dbname'], $registry);
- $base->registerAdmin($user_obj);
- $mountBase = true;
- $appbox->get_connection()->commit();
- } catch (Exception $e) {
- $appbox->get_connection()->rollBack();
- $error[] = $e->getMessage();
- }
- }
- } elseif ($parm['new_settings'] && $parm['new_hostname'] && $parm['new_port'] && $parm['new_user']
- && $parm['new_password'] && $parm['new_dbname']) {
-
- if (p4string::hasAccent($parm['new_dbname']))
- $error[] = 'No special chars in dbname';
-
- if (count($error) === 0) {
- try {
- $appbox->get_connection()->beginTransaction();
- $base = databox::mount($appbox, $parm['new_hostname'], $parm['new_port'], $parm['new_user'], $parm['new_password'], $parm['new_dbname'], $registry);
- $base->registerAdmin($user_obj);
- $appbox->get_connection()->commit();
- } catch (Exception $e) {
- $appbox->get_connection()->rollBack();
- $error[] = $e->getMessage() . '@' . $e->getFile() . $e->getLine();
- }
- }
+ try {
+ $data_template = new \SplFileInfo($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $parm['new_data_template'] . '.xml');
+ $connbas = new connection_pdo('databox_creation', $parm['new_hostname'], $parm['new_port'], $parm['new_user'], $parm['new_password'], $parm['new_dbname'], array(), $appbox->get_registry());
+ $base = databox::create($appbox, $connbas, $data_template, $registry);
+ $base->registerAdmin($user_obj);
+ $createBase = $sbas_id = $base->get_sbas_id();
+ } catch (Exception $e) {
+ $error[] = $e->getMessage();
}
}
}
+ } elseif ($parm['mount_base']) {
+ if ( ! $parm['new_settings'] && $parm['new_dbname']) {
+
+ if (p4string::hasAccent($parm['new_dbname']))
+ $error[] = _('Database name can not contains special characters');
+
+ if (count($error) === 0) {
+ try {
+ $configuration = \Alchemy\Phrasea\Core\Configuration::build();
+
+ $connexion = $configuration->getConnexion();
+
+ $hostname = $connexion->get('host');
+ $port = $connexion->get('port');
+ $user = $connexion->get('user');
+ $password = $connexion->get('password');
+
+ $appbox->get_connection()->beginTransaction();
+ $base = databox::mount($appbox, $hostname, $port, $user, $password, $parm['new_dbname'], $registry);
+ $base->registerAdmin($user_obj);
+ $mountBase = true;
+ $appbox->get_connection()->commit();
+ } catch (Exception $e) {
+ $appbox->get_connection()->rollBack();
+ $error[] = $e->getMessage();
+ }
+ }
+ } elseif ($parm['new_settings'] && $parm['new_hostname'] && $parm['new_port'] && $parm['new_user']
+ && $parm['new_password'] && $parm['new_dbname']) {
+
+ if (p4string::hasAccent($parm['new_dbname']))
+ $error[] = 'No special chars in dbname';
+
+ if (count($error) === 0) {
+ try {
+ $appbox->get_connection()->beginTransaction();
+ $base = databox::mount($appbox, $parm['new_hostname'], $parm['new_port'], $parm['new_user'], $parm['new_password'], $parm['new_dbname'], $registry);
+ $base->registerAdmin($user_obj);
+ $appbox->get_connection()->commit();
+ } catch (Exception $e) {
+ $appbox->get_connection()->rollBack();
+ $error[] = $e->getMessage() . '@' . $e->getFile() . $e->getLine();
+ }
+ }
+ }
+ }
+}
- $upgrade_available = false;
+$upgrade_available = false;
- if ($appbox->upgradeavailable())
+if ($appbox->upgradeavailable())
+ $upgrade_available = true;
+
+$sbas_ids = array_merge(
+ array_keys($user_obj->ACL()->get_granted_sbas(array('bas_manage')))
+ , array_keys($user_obj->ACL()->get_granted_sbas(array('bas_modify_struct')))
+);
+
+$hasRightsMountDB = count($sbas_ids) > 0;
+
+$sbas = array();
+foreach ($sbas_ids as $sbas_id) {
+ $version = 'unknown';
+ $sbas[$sbas_id] = '

' . ' (Unreachable server)';
+ try {
+ $databox = databox::get_instance($sbas_id);
+ $version = $databox->get_version();
+ if ($databox->upgradeavailable())
$upgrade_available = true;
+ $sbas[$sbas_id] = '

' . phrasea::sbas_names($sbas_id)
+ . ' (version ' . $version . ') MySQL ' . $databox->get_connection()->server_info();
+ } catch (Exception $e) {
- $sbas_ids = array_merge(
- array_keys($user_obj->ACL()->get_granted_sbas(array('bas_manage')))
- , array_keys($user_obj->ACL()->get_granted_sbas(array('bas_modify_struct')))
- );
-
- $hasRightsMountDB = count($sbas_ids) > 0;
-
- $sbas = array();
- foreach ($sbas_ids as $sbas_id) {
- $version = 'unknown';
- $sbas[$sbas_id] = '

' . ' (Unreachable server)';
- try {
- $databox = databox::get_instance($sbas_id);
- $version = $databox->get_version();
- if ($databox->upgradeavailable())
- $upgrade_available = true;
- $sbas[$sbas_id] = '

' . phrasea::sbas_names($sbas_id)
- . ' (version ' . $version . ') MySQL ' . $databox->get_connection()->server_info();
- } catch (Exception $e) {
-
- }
- }
- ?>
-
-
+
+
+
+
@@ -336,7 +337,7 @@ $rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
-$out .= "
";
+$out .= "
";
$out .= "
" . _('admin:: demandes en cours') . "
";
$out .= "
";
@@ -496,7 +497,7 @@ $out .= "
";
$out .= "
";
$out .= " ";
diff --git a/www/admin/global_values.php b/www/admin/global_values.php
index 06362a9f5b..0feb04b547 100644
--- a/www/admin/global_values.php
+++ b/www/admin/global_values.php
@@ -62,93 +62,41 @@ function getFormTimezone($props = array(), $selected = false)
}
phrasea::start($Core);
?>
-
-
-
-
-
-
-
-
-
-
-
-
- Adresse :
-
-
- Installation :
-
-
- Maintenance : get('GV_maintenance') == true ? "checked='checked'" : ''; ?>/>
-
-
- Debug : get('GV_debug') == true ? "checked='checked'" : ''; ?>/>
-
+
';
+echo '