The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Confirm Admin Password
#11
Hey, right now I'm working on the verification page only, just to make sure it works, but it's pushing a fatal error:
Code:
Fatal error: Using $this when not in object context in /home/aircentralized/public_html/boss/usersc/adminverify.php on line 37

https://hastebin.com/wulusunona.xml
  Reply
#12
While I was waiting for an answer I decided to work with the function part of it...I got the function in custom functions, however it produces an error in any of these circumstances:

Line 1 is:
-public static function - produces unexpected public
-static function - produces unexpected verifyadmin
-function - produces undefined constant of verifyadmin (from the PHP file - not from customfunctions)

Thoughts?

Another thing I need to verify is how to obtain the referring URL to redirect BACK to that page if verification succeeds.

Thanks guys!
  Reply
#13
a rough guess would be to change
Code:
if (password_verify($password,$this->data()->password)) {
to
Code:
if (password_verify($password,$user->data()->password)) {

Can you paste your function code please.

as for url redirect I would reuse some of the code in login.php to handle a redirect if admin was accessing an admin page.
I believe this would be included in your function.
  Reply
#14
We're getting somewhere. Works for bad passwords. But for good passwords it produces:
Code:
Notice: Undefined variable: users in /home/aircentralized/public_html/boss/usersc/adminverify.php on line 41

Code:
Fatal error: Call to a member function data() on null in /home/aircentralized/public_html/boss/usersc/adminverify.php on line 41

function:
https://hastebin.com/alayofutax.php

I'm also struggling to get the timestamps to subtract. I did almost an hours worth of research last night and no luck. I'm wondering if maybe an easier method would be to run a cron every half hour that clears the value in last_verified = 1, it redirects you? I think the timestamp is my best option but I really can't figure it out gah!

Thanks for your help guys, I'm excited for this!
  Reply
#15
I think I noticed in one of your hastebins that you had $users->data() instead of $user->data somewhere. You might want to do a search for that.
  Reply
#16
Seems like the $users variable is not being passed through the chain. There is some US functions/methods which can be used. Will need to look into it though.

Quickly I can see the is an error in the time format when defining $current, I believe it is an error anyway, should it not be
Code:
h:i:s
instead of
Code:
hi:i:s
? typo Smile ?
I had a look at timestamp stuff last night and remember seeing what you are looking for. I will send you something this evening for the timestamp check, you cannot treat it like a standard equation.

  Reply
#17
I did notice the typo before and corrected that, sorry about that. Correcting
Code:
users
to
Code:
user
fixed the issue of updating the DB. My only concern now is getting the function to work, and do the math correctly. This is the function I have:

https://hastebin.com/anifukalaw.php

I've been playing around with the query just in a regular page and echoing the results so I can see if they work, and I have had no success.

Thanks for your guys' help!
  Reply
#18
Quick update, I spent a few hours last night looking at this and got very frustrated but I seem to be getting towards a solution. I hope to do some more investigation and testing before I can confidently send you something to use.
  Reply
#19
I hear ya on that! I spent like 5 hours trying to test it out and I just can't get it! I'm stumped! It shouldn't be this hard!
  Reply
#20
Where are you guys at with this? What's stumping you?
  Reply


Forum Jump:


Users browsing this thread: 7 Guest(s)