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
/printthread.php 16 require_once
Warning [2] Undefined property: MyLanguage::$archive_pages - Line: 2 - File: printthread.php(287) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/printthread.php(287) : eval()'d code 2 errorHandler->error
/printthread.php 287 eval
/printthread.php 117 printthread_multipage



UserSpice
Confirm Admin Password - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Miscellaneous (https://userspice.com/forums/forumdisplay.php?fid=28)
+--- Forum: Modifications and Hackery (https://userspice.com/forums/forumdisplay.php?fid=29)
+--- Thread: Confirm Admin Password (/showthread.php?tid=427)

Pages: 1 2 3 4 5 6


Confirm Admin Password - Brandin - 01-19-2017

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


Confirm Admin Password - Brandin - 01-19-2017

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!


Confirm Admin Password - sabr - 01-19-2017

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.


Confirm Admin Password - Brandin - 01-19-2017

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!


Confirm Admin Password - mudmin - 01-19-2017

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.


Confirm Admin Password - sabr - 01-19-2017

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.




Confirm Admin Password - Brandin - 01-19-2017

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!


Confirm Admin Password - sabr - 01-20-2017

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.


Confirm Admin Password - Brandin - 01-20-2017

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!


Confirm Admin Password - mudmin - 01-20-2017

Where are you guys at with this? What's stumping you?