Oh no! Where's the JavaScript?
Your Web browser does not have JavaScript enabled or does not support JavaScript. Please enable JavaScript on your Web browser to properly view this Web site, or upgrade to a Web browser that does support JavaScript.
Not a member yet? Click here to register.
Forgot Password?

Error in log

Asked Modified Viewed 3,837 times
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
  • Started this discussions
asked
Veteran Member

Hi folks.

Im re-builting a site that went wrong regarding upgrade.

Only one error left in the log:

Quote

classes/Authenticate.class.php
hash_hmac() [<a href='function.hash-hmac'>function.hash-hmac</a>]: Unknown hashing algorithm: Linje: 158


Line 158 looks like this:

Quote

$key = hash_hmac($user['user_algo'], $userID.$cookieExpiration, $user['user_salt']);


It's not a site that I have tried to upgrade - Im only trying to get it back up again from the upgrade that went wrong.

Any ideas of how I get rid of that one error ?

It's a V7.02.03 right now - but the owner of the site tried to upgrade to both V7.02.03 and V7.02.04 - and they both went wrong for her. I think that this error maybe come from this ?
0 replies

9 posts

M
miskith
M
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)
  • Member, joined since
  • Contributed 117 posts on the community forums.
  • Started 2 threads in the forums
answered
Member

Ok..

Quote

User #3 Staroftheweek has algo ''
User #11 Krigerskjalden has algo ''
User #28 PinkEye has algo ''
User #33 Timian has algo ''
User #37 Hovsa has algo ''
User #41 topghost has algo ''

It's a list of users with bad "user_algo" value.. If I know, they have to have "md5" or "sha256" in user_algo.
0 replies
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
  • Started this discussions
answered
Veteran Member

Hi again.

Your code is printing out the following:

Quote

User #3 Staroftheweek has algo ''
User #11 Krigerskjalden has algo ''
User #28 PinkEye has algo ''
User #33 Timian has algo ''
User #37 Hovsa has algo ''
User #41 topghost has algo ''


Merged on Feb 24 2012 at 20:29:51:
Previewing this in a Custom Page:
<?php

global $user;

print_r($user);

?>

- prints nothing out.
Edited by smokeman on 24-02-2012 22:29,
0 replies
M
miskith
M
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)
  • Member, joined since
  • Contributed 117 posts on the community forums.
  • Started 2 threads in the forums
answered
Member

Hmm. I'm sorry, but I didn't realize that problem is in Authenticate.class.php.
So, try this PHP script:
<?php
$result = dbquery("SELECT user_id, user_name, user_algo FROM users WHERE user_algo<>'sha256' AND user_algo<>'md5'");
if (!dbrows($result))
    echo "Everything fine!";
while ($data = dbarray($result))
    echo "<div>User #".$data['user_id']." ".$data['user_name']." has algo '".$data['user_algo']."'</div>";
?>
0 replies
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
  • Started this discussions
answered
Veteran Member

Hmm, should I just test this from a Custom Page ?

If I do the only thing I get is:

Quote

''
0 replies
M
miskith
M
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)
  • Member, joined since
  • Contributed 117 posts on the community forums.
  • Started 2 threads in the forums
answered
Member

Ok, try this:
echo "'".$user['user_algo']."'";

With this, you can easily check, if isn't in $user['user_algo'] any space or another white char.
0 replies
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
  • Started this discussions
answered
Veteran Member

The out print is:

Quote

Array ( [0] => md2 [1] => md4 [2] => md5 [3] => sha1 [4] => sha256 [5] => sha384 [6] => sha512 [7] => ripemd128 [8] => ripemd160 [9] => ripemd256 [10] => ripemd320 [11] => whirlpool [12] => tiger128,3 [13] => tiger160,3 [14] => tiger192,3 [15] => tiger128,4 [16] => tiger160,4 [17] => tiger192,4 [18] => snefru [19] => gost [20] => adler32 [21] => crc32 [22] => crc32b [23] => haval128,3 [24] => haval160,3 [25] => haval192,3 [26] => haval224,3 [27] => haval256,3 [28] => haval128,4 [29] => haval160,4 [30] => haval192,4 [31] => haval224,4 [32] => haval256,4 [33] => haval128,5 [34] => haval160,5 [35] => haval192,5 [36] => haval224,5 [37] => haval256,5 )
0 replies
M
miskith
M
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)
  • Member, joined since
  • Contributed 117 posts on the community forums.
  • Started 2 threads in the forums
answered
Member

Try this
print_r(hash_algos());

It will print you all available algos on your hosting.
0 replies
S
smokeman
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
  • Started this discussions
answered
Veteran Member

In DB_users there are two: user_algo and user_admin_algo
- they both are set to: sha256

Regarding $userdata and $user: This is from the original not-modified file. It's the same in the V7.02.04 btw. So I don't think we have to change something there.
0 replies
M
mawe4585
M
  • Member, joined since
  • Contributed 84 posts on the community forums.
  • Started 34 threads in the forums
answered
Member

look into the table users, there is one field for the algorithm, which algorithms are used and does the server support these?

edit: wasnt the name of the array "$userdata" and not "$user" ?
0 replies

Category Forum

Upgrading issues - 8

Labels

None yet

Statistics

  • Views 0 views
  • Posts 9 posts
  • Votes 0 votes
  • Topic users 3 members

3 participants

S
S
  • Veteran Member, joined since
  • Contributed 920 posts on the community forums.
  • Started 79 threads in the forums
  • Started this discussions
M
M
  • Member, joined since
  • Contributed 84 posts on the community forums.
  • Started 34 threads in the forums
M
M
My projects:
PHP-Fusion Czech | miskith portfolio | theConnex (In preparation) | Online game (Future project)
  • Member, joined since
  • Contributed 117 posts on the community forums.
  • Started 2 threads in the forums

Notifications

Track thread

You are not receiving notifications from this thread.

Related Questions

Not yet