Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8499693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:44:12+00:00 2026-06-11T00:44:12+00:00

So I have just setup tank auth, I have not changed anything yet so

  • 0

So I have just setup tank auth, I have not changed anything yet so everything should be default. It works perfectly fine. However I want to require for a certain domain for emails to be able to login. For now I will say gmail. So how can i make it so it checks that the email address has @gmail.com in it before the user can register. I have found where the valid email error message is and can change that but i cannot find where the actual check for the valid email.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T00:44:13+00:00Added an answer on June 11, 2026 at 12:44 am

    Tank auth is using CI’s default valid_email validation rule, found in the Form Validation class.

    It’s definitely a strange thing to want to do, but you can create a callback validation function and add it to your form validation rules on the registration page.

    This is basically the equivalent of an ends_with rule, but adds the “@”:

    // Check if the inputs last characters matches the parameter
    function is_email_domain($input, $domain) {
       $domain_str = '@'.$domain;
       $result = strpos($input, $domain_str) === (strlen($input) - strlen($domain_str));
       if ( ! $result) $this->form_validation->set_message('is_email_domain', 'The %s field must be a %s email address');
       return $result;
    }
    

    So create the callback function in your controller and add it to the validation:

    $this->form_validation->set_rules(
        'email',
        'Email',
        'trim|required|xss_clean|valid_email|callback_is_email_domain[gmail.com]'
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just setup a new local site (localhost/pfb.net/) which has been cloned from
I have just setup a wordpress forum and I find that all images are
We have just setup our hudson server to build .NET projects which seems to
I have an MVC 1.0 app just setup but it only shows the Index.aspx
I have an app that I just got setup with a split view controller
I have a very simple ColorBox gallery setup just like the examples. Simple tags
Just a basic html link question. I have an intranet setup, and I need
I have a CRON job php script that I just set up not too
I have just setup my website locally so I can test my pages more
i have just setup a proxy page to handle ajax requests but i cannot

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.