The following warnings occurred: | ||||||||||||||||||||||||
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
|
Need ability to approve new user - 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: Need ability to approve new user (/showthread.php?tid=652) Pages:
1
2
|
Need ability to approve new user - joelmalach - 07-31-2017 Hi. I'm new to Userspice so please be gentle. I am creating an online course and using Userspice to enable clients access the course Clients need to make a payment before access is allowed I would like them to be able to register, using the form here - users/join.php, then be redirected to my payment page Once they have made the payment, I then want to be able to "approve" their registration in the admin panel and give them access to the course. Could someone please explain how I can go about this? Currently, once they complete the registration form, they can access the course immediately without making the payment Thanks in advance Need ability to approve new user - dan - 07-31-2017 No worries at all. People are not mean on our forums. What I do in that situation is create a new access level called staff or approved user or something like that and only a sign of two people after I approved them. I can give you a more technical explanation if you need it but I am on my phone so difficult now. Need ability to approve new user - dan - 07-31-2017 Sorry. That was really bad voice to text. What you need to do is make a new user permission called student. Then assign all of your class PHP files to permission level of student. The only way someone can get that permission level is if you assign it to them. If you look in the documentation menu there is something called functions. In there there is one called has perm. You can basically a flash a banner or something if someone does not have the permission of student to let them know that their account has not yet been verified. Need ability to approve new user - joelmalach - 07-31-2017 Thanks Dan. I'll try that and let you know how I get on Need ability to approve new user - joelmalach - 07-31-2017 Hi Dan Thanks - I've managed to set up the new user permission - STUDENT - and prevent access to a page until I change the client's permission to STUDENT. So far so good. However, I'm a bit lost with the function. From what I understand, if the client hasn't paid and their permission is still set to USER, I can show a banner or alert that displays when the client tries to access a STUDENT protected page. I can't work out how to do it. I have looked at a file called us_helpers.php that has, on line 769, a reference to the hasperm function you mentioned, but I'm not sure how to implement the banner/alert Could you point me in the right direction please Thanks Need ability to approve new user - karsen - 07-31-2017 You could use Code: checkPermission() Code: checkMenu() Code: Redirect::to('payments.php') Code: //When placed before securePage() this will redirect to your custom page Code: if (!checkPermission($studentPermissionId)){Redirect::to('payments.php');} Code: // If placed before checkPermission() this will redirect to account.php Code: // when logged in or login.php if not, but doesn't send them to Code: // your custom payment page Code: if (!securePage($_SERVER['PHP_SELF'])){die();} Code: echo 'Hello Student, you have permission to view this course.'; I use a customer permissions system so there may be a more optimum way for you to do this but give it a shot and see if it works for you. Need ability to approve new user - joelmalach - 08-01-2017 Hi Karsen Thanks for your help. I will try that Need ability to approve new user - joelmalach - 08-02-2017 Hi I looked at that but it's too complicated for me. I think what I'd like to do is this Currently, when someone logs in, they are sent to this page - users/account.php Ideally, I would like to change this DIV on line 53 as follows <div class="col-xs-12 col-md-9"> <h1><?=ucfirst($user->data()->username)?></h1> <p><?=ucfirst($user->data()->fname)." ".ucfirst($user->data()->lname)?></p> <p>Member Since:<?=$signupdate?></p> <p>Number of Logins: <?=$user->data()->logins?></p> (If client is USER, show this text) Your payment has not yet been processed. Please click here to Log Out (If client is STUDENT, show this) <p>Click here to enter the Online Programme</p> </div> Could you let me know how to do this? Thank in advance Need ability to approve new user - firestorm - 08-02-2017 simple if statement should do it: <pre> Code: if(checkMenu(2,$user->data->id) { replace the 2 with the student perm id. instead of asking to logout you could do a redirect to logout.php so they will be automatically logged out Need ability to approve new user - joelmalach - 08-03-2017 Hi Firestorm Thanks for the idea, although I still can't quite make it work I have put the following in <? if(checkMenu(3,$user->data->id) { echo "<p>Not yet registered. Click here to return to Home page</p>"; } else { echo "<p>Click here to enter the Online Programme</p>"; } ?> But I get this error message Parse error: syntax error, unexpected '{' in /var/sites/public_html/onlinecourse/users/account.php on line 61 Line 61 is this if(checkMenu(3,$user->data->id) { Am I making a simple error? |