Results 1 to 3 of 3

Thread: Disable user account after three unsuccessful login attempts

  1. #1
    enrikm is offline Sugar Community Member
    Join Date
    Dec 2006
    Posts
    61

    Default Disable user account after three unsuccessful login attempts

    Good afternoon all, I am looking for a way to disable a user account after he or she has attempted three unsuccessful login attempts. Is there an easier way to do this other than changing the code? If not then what part of the code should I look at? Thanks for your time.

  2. #2
    pblag's Avatar
    pblag is offline Sugar Community Member
    Join Date
    Jul 2006
    Location
    Ukraine (Chernivtsy)
    Posts
    347

    Default Re: Disable user account after three unsuccessful login attempts

    Hi enrikm!

    you have to update the file

    modules/Users/Authenticate.php

    Also you have to add new custom field to the user module and save there value of how many times user was no logged in.

    Hope it will help you!

    // example of code


    $authController->login($_REQUEST['user_name'], $_REQUEST['user_password']);
    if(isset($_SESSION['authenticated_user_id'])) {



    $module = !empty($_REQUEST['login_module']) ? '?module='.$_REQUEST['login_module'] : '?module=Home';
    $action = !empty($_REQUEST['login_action']) ? '&action='.$_REQUEST['login_action'] : '&action=index';
    $record = !empty($_REQUEST['login_record']) ? '&record='.$_REQUEST['login_record'] : '';

    global $current_user;
    //C.L. Added $hasHistory check to respect the login_XXX settings if they are set
    $hasHistory = (!empty($_REQUEST['login_module']) || !empty($_REQUEST['login_action']) || !empty($_REQUEST['login_record']));
    if(isset($current_user) && !$hasHistory){
    $modListHeader = query_module_access_list($current_user);
    //try to get the user's tabs
    $tempList = $modListHeader;
    $idx = array_shift($tempList);
    if(!empty($modListHeader[$idx])){
    $module = '?module='.$modListHeader[$idx];
    $action = '&action=index';
    $record = '';
    }
    }
    } else {

    //New code

    //End of new Code


    $module ="";
    $action="";
    $record="";
    }
    sugar_cleanup();
    header('Location: index.php'.$module.$action.$record);?>
    Petro Blagodir
    petro@blagodir.ua
    http://www.blagodir.com
    Blagodir Ltd.( SugarCRM - Consultations, Development and Support)

  3. #3
    enrikm is offline Sugar Community Member
    Join Date
    Dec 2006
    Posts
    61

    Default Re: Disable user account after three unsuccessful login attempts

    Thanks for the reply! Will try to do some coding and hopefully it works.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Users can't login / logon
    By jvvlogi in forum General Discussion
    Replies: 5
    Last Post: 2006-12-06, 05:58 PM
  2. Login fine, except for one specific user
    By ndaniels in forum Help
    Replies: 1
    Last Post: 2006-11-17, 07:56 AM
  3. Replies: 3
    Last Post: 2006-05-19, 04:59 PM
  4. Login problem for a single user
    By joealiferis in forum Help
    Replies: 2
    Last Post: 2006-01-16, 08:12 PM
  5. Cannot Login
    By Dillon in forum Help
    Replies: 16
    Last Post: 2004-10-13, 02:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •