Julian45123
Forum Replies Created
-
Forum: Plugins
In reply to: [External Login] Can’t LoginMy code right now is like that:
function myExlogHashAuthenticator($password, $hashFromDatabase, $username, $externalUserData) { error_log('EXLOG Empieza el hook'); $hashedPassword = strtoupper(md5($password)); $staticKey = 'houdini'; error_log('EXLOG Hashed pwd'); error_log(var_export($hashedPassword, true)); $flashClientHash = getLoginHash($hashedPassword, $staticKey); error_log('EXLOG FLASH'); error_log(var_export($flashClientHash, true)); $datbasePassword = password_hash($flashClientHash, PASSWORD_DEFAULT, [ 'cost' => 12 ]); error_log('EXLOG $datbasePassword'); error_log(var_export($datbasePassword, true)); echo "\n\r\n\r -> " . $datbasePassword . " <- \n\r\n\r"; function encryptPassword($password, $md5 = true) { if($md5 !== false) { $password = md5($password); } $hash = substr($password, 16, 16) . substr($password, 0, 16); return $hash; } error_log('EXLOG password md5'); error_log(var_export($password, true)); function getLoginHash($password, $staticKey) { $hash = encryptPassword($password, false); $hash .= $staticKey; $hash .= 'Y(02.>\'H}t":E1'; $hash = encryptPassword($hash); return $hash; } error_log('EXLOG Comparison Values?'); error_log(var_export($hash, true)); error_log(var_export($hashFromDatabase, true)); error_log('EXLOG VALID PASSWORD?'); error_log(var_export($hash == $hashFromDatabase, true)); error_log('EXLOG END >>>>>>>>>>>>>>>>>>>'); return $hash == $hashFromDatabase; } add_filter('exlog_hook_filter_authenticate_hash', 'myExlogHashAuthenticator', 10, 4);
This error logs are supposed to appear wp-content/debug.log or in any other file? This is the debug options I have in wp_config.php:
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_LOG', true ); define( 'WP_DEBUG_DISPLAY', false ); @ini_set( 'display_errors', 0 );
Thanks for your help.
Forum: Plugins
In reply to: [External Login] Can’t LoginI also updated the code to this:
function myExlogHashAuthenticator($password, $hashFromDatabase, $username, $externalUserData) { $hashedPassword = strtoupper(md5($password)); $staticKey = 'houdini'; $flashClientHash = getLoginHash($hashedPassword, $staticKey); $datbasePassword = password_hash($flashClientHash, PASSWORD_DEFAULT, [ 'cost' => 12 ]); echo "\n\r\n\r -> " . $datbasePassword . " <- \n\r\n\r"; function encryptPassword($password, $md5 = true) { if($md5 !== false) { $password = md5($password); } $hash = substr($password, 16, 16) . substr($password, 0, 16); return $hash; } function getLoginHash($password, $staticKey) { $hash = encryptPassword($password, false); $hash .= $staticKey; $hash .= 'Y(02.>\'H}t":E1'; $hash = encryptPassword($hash); return $hash == $hashFromDatabase; } } add_filter('exlog_hook_filter_authenticate_hash', 'myExlogHashAuthenticator', 10, 4);
But still doesn’t work.
Forum: Plugins
In reply to: [External Login] Can’t LoginHi again,
Thanks your keep helping me! I checked error.log and I have this code:`2020/04/18 16:19:33 [error] 27699#27699: *5903 FastCGI sent in stderr: "PHP message: PHP Notice: Undefined index: role in /var/www/community/wp-content/plugins/external-login/login/authenticate.php on line 13 PHP message: PHP Notice: Undefined index: exlog_authenticated in /var/www/community/wp-content/plugins/external-login/login/authenticate.php on line 30 PHP message: PHP Warning: pg_query(): No PostgreSQL link opened yet in /var/www/community/wp-content/pg4wp/driver_pgsql.php on line 139 PHP message: PHP Warning: pg_last_error(): No PostgreSQL link opened yet in /var/www/community/wp-content/pg4wp/driver_pgsql.php on line 140 PHP message: PHP Warning: pg_last_error(): No PostgreSQL link opened yet in /var/www/community/wp-content/pg4wp/driver_pgsql.php on line 55" while reading response header from upstream, client: IP, server: MYWORDPRESSLINK, request: "POST /wp-login.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.2-fpm.sock:", host: "MYWPLINK", referrer: "WPLINK/wp-login.php" 2020/04/18 16:19:33 [error] 27699#27699: *5903 FastCGI sent in stderr: "PHP message: PHP Warning: pg_query(): No PostgreSQL link opened yet in /var/www/community/wp-content/pg4wp/driver_pgsql.php on line 139
Do you know what could be? Also, how do I check that the hook is on and working?
Thanks.Forum: Plugins
In reply to: [External Login] Can’t LoginHey @tbenyon,
Thanks for your answers. I’ve developed this code:function myExlogHashAuthenticator($password, $hashFromDatabase, $username, $externalUserData) { $hashedPassword = strtoupper(md5($password)); $staticKey = 'houdini'; $flashClientHash = getLoginHash($hashedPassword, $staticKey); $datbasePassword = password_hash($flashClientHash, PASSWORD_DEFAULT, [ 'cost' => 12 ]); echo "\n\r\n\r -> " . $datbasePassword . " <- \n\r\n\r"; $password = md5($password); $hash = substr($password, 16, 16) . substr($password, 0, 16); $hash = encryptPassword($password, false); $hash .= $staticKey; $hash .= 'Y(02.>\'H}t":E1'; $hash = encryptPassword($hash); return $hash == $hashFromDatabase; } add_filter('exlog_hook_filter_authenticate_hash', 'myExlogHashAuthenticator', 10, 4);
I’ve placed the code in my theme’s functions.php and it says invalid username and password. Can you help me? Do you see any error on the code?
Thanks again,
Julian.- This reply was modified 4 years, 11 months ago by Julian45123.
Forum: Plugins
In reply to: [External Login] Can’t LoginAlso, the passwords from the external database are generated as explained here: https://solero.github.io/password. Thanks again!
- This reply was modified 4 years, 11 months ago by Julian45123.
Forum: Themes and Templates
In reply to: [Nisarg] Create a child theme like the parent themeOkay, and what I have to set so its exactly like Nisarg?
Thanks.Forum: Themes and Templates
In reply to: [Atahualpa] Put Comments on the pagesHi!
Yes! Now I can comment on the pages.
Thanks!!!Forum: Themes and Templates
In reply to: [Atahualpa] Put Comments on the pagesHi,
This is my blog: https://noticias.pinguieventos.hol.es/
This is a page: https://noticias.pinguieventos.hol.es/equipoThanks.
Forum: Themes and Templates
In reply to: [Atahualpa] Put Comments on the pagesHello,
Now I’m in a laptop. I do it Screenshot. But in the page there isn’t the comment form Screenschot.
Thanks.Forum: Themes and Templates
In reply to: [Atahualpa] Put Comments on the pagesHello,
I can’t see it. Screenshot
Thanks.Forum: Themes and Templates
In reply to: [Atahualpa] Put Comments on the pages