Jump to the post that solved this thread.
Solved: 1 Year, 10 Months, 3 Weeks ago Delete all the users who doesn't use gmail
#1
Solved: 1 Year, 10 Months, 3 Weeks ago
Hello, I am trying to delete all the users who doesn't use gmail. How can I do this?

And also how can I only accept gmail users for future?
Reply
#2
Solved: 1 Year, 10 Months, 3 Weeks ago
Query:

DELETE FROM `mybb_users` WHERE `email` NOT LIKE '%@gmail%';
Reply
#3
Solved: 1 Year, 10 Months, 3 Weeks ago
This user has been denied support. This user has been denied support.
As far as keeping new users from registering from domains other than Gmail go ahead and add the following code to a file in your inc/plugins and call it DomainRestriction.php

<?php
define('THE_DOMAIN', 'gmail.com');

// Registration 
$plugins->add_hook('datahandler_user_validate', 'DomainRestrict_registration');

function DomainRestrict_info(){
    return array(
        "name"            => "Restrict registration",
        "description"    => "",
        "website"        => "https://websupportforum.net",
        "author"        => "R34P3R",
        "authorsite"    => "https://websupportforum.net",
        "guid" => "",
        "version" => "2.0",
        "compatibility" => "16*"
    );
}

function DomainRestrict_registration($data) {
	$email = explode("@", $data->data['email']);
	
	if (strtolower($email[1])!=THE_DOMAIN) {
		$data->set_error('Only users of '.THE_DOMAIN.' may register here.');
	}
}
?>
[Image: BhenchodForumsBannerSmall.gif]
Reply
#4
Solved: 1 Year, 10 Months, 3 Weeks ago
(2020-10-23, 11:22 PM)R34P3R Wrote:
"compatibility" => "16*"
Really sure your plugin is only for 1.6.x versions ?
Do not ask me help through PM or Discord
Reply
#5
Solved: 1 Year, 10 Months, 3 Weeks ago
Thanks, it solved.
What I did:

DELETE FROM mybb_users WHERE email NOT LIKE '%@gmail%' AND email NOT LIKE '%@hotmail%' AND email NOT LIKE '%@outlook%' AND email NOT LIKE '%@yahoo%' AND email NOT LIKE '%@naver.com' AND email NOT LIKE '%@nate.com' AND email NOT LIKE '%@aol.com%' AND email NOT LIKE '%@icloud%' AND email NOT LIKE '%@comcast%' AND email NOT LIKE '%@protonmail%' AND email NOT LIKE '%@mail.com' AND email NOT LIKE '%@live.com';
Reply
#6
Solved: 1 Year, 10 Months, 3 Weeks ago
(2020-10-28, 07:50 PM)online0227 Wrote: What I did:...

What should i think about it? You said: Only gmail is required.
With your query you almost didn't delete anyone. Big Grin
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)