Closed Demonheart closed 2 years ago
Debug say:
PHP Warning (2): mysqli::real_connect(): (HY000/1045): Access denied for user 'adminocs'@'localhost' (using password: NO) in /var/www/glpi/src/DBmysql.php at line 240
Have you a solution ?
Have you set TRACE_DELETED = ON on the OCS server side?
I confirm the problem on GLPI 10.0.0-rc1, OCS 2.9.2 and plugin ocsinventoryng-2.0.0-rc2.
Hello,
Debian 11.2 php 7.4 glpi 10.0.0-rc2 ocsinventory NG 2.0.0-rc2
Same problem here. The is no value for ocs_db_passwd in the glpi_plugin_ocsinventoryng_ocsservers glpi table.
Probably link to this PHP warning :
Hello,
See inc/ocsserver.class.php file, at prepareInputForUpdate($input) I've changed encrypt instead decrypt, and the connection is done... Anybody can't explain this missmatch? A code error...?
function prepareInputForUpdate($input){
$adm = new PluginOcsinventoryngOcsAdminInfosLink();
$adm->updateAdminInfo($input);
if (isset($input["ocs_db_passwd"]) && !empty($input["ocs_db_passwd"])) {
$input["ocs_db_passwd"] = rawurlencode(stripslashes($input["ocs_db_passwd"]));
//$input["ocs_db_passwd"] = (new GLPIKey())->decrypt(stripslashes($input["ocs_db_passwd"]));
$input["ocs_db_passwd"] = (new GLPIKey())->encrypt(stripslashes($input["ocs_db_passwd"]));
} else {
unset($input["ocs_db_passwd"]);
}
if (isset($input["_blank_passwd"]) && $input["_blank_passwd"]) {
$input['ocs_db_passwd'] = '';
}
return $input;
}
After this change , I am able to run the plugin on glpi 10 version and import the OCS computers into glpi asset manager
regards.
Thanks rgonzalezmas - good game 👍
I got "Database connection failure" when I try to configure the server.