Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Fidde Posted February 10, 2016 Posted February 10, 2016 I have a script that checks if the user is the the group guest (not logged in at all) or members and allow access only to members to the page. However you can access the page as soon as you have registered, you don't even have to confirm your email (we even have manual validation on), so I was wondering if there is a way to check if the account is verified and then deny access. <?php // Initialize IPS4 Framework require_once( '../init.php' ); require_once( '../conf_global.php' ); require_once( 'pnum.php' ); // Indicate that we should consider this a front-end session so we can obtain the currently logged in users information. \IPS\Session\Front::i(); // Grab the currently Logged In user. $member = \IPS\Member::loggedIn(); if ($member->mgroup_others) { $cn_membergroups = explode(',', $member->mgroup_others); } $cn_membergroups[] = $member->member_group_id; ?> if (!in_array(3, $cn_membergroups)) { //Don't allow access } else { //display the page
Daniel F Posted February 10, 2016 Posted February 10, 2016 Do you mean if the member verified his email address or if the admin approved the member? IPS\Member::loggedIn()->members_bitoptions['validating']
Fidde Posted February 11, 2016 Author Posted February 11, 2016 12 hours ago, Daniel F said: Do you mean if the member verified his email address or if the admin approved the member? IPS\Member::loggedIn()->members_bitoptions['validating'] Works perfect, thanks
Ahmad E. Posted February 11, 2016 Posted February 11, 2016 By the way require_once( '../conf_global.php' ); is not needed.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.