Results 1 to 8 of 8

Thread: user password change

  1. #1
    lobomaujp is offline Senior Member
    Join Date
    Jun 2008
    Posts
    33

    Default user password change

    is there a way to prevent some users to change they passwords???

  2. #2
    MatR is offline Sugar Community Member
    Join Date
    Jul 2007
    Location
    Paris, France
    Posts
    311

    Default Re: user password change

    Hello lobomaujp,

    The only way I see, is to hide the "change password" button with the code but even the administrator couldn't change it. I don't know if this solution is good for you.
    Mathieu Rodrigues
    Consultant CRM
    CARRENET - SugarCRM Gold Partner
    >>> Suivez notre actualité sur Twitter ! http://twitter.com/carrenet

  3. #3
    jsagar's Avatar
    jsagar is offline Sugar Community Member
    Join Date
    Mar 2008
    Location
    Ahmedabad,India
    Posts
    242

    Default Re: user password change

    Hi
    If you want that only Admin can change the password other user can not change.
    you can hide the Button with the condition that
    if (is_admin($current_user))
    {
    show button
    }


    The file you can change is Modules/Users/Detailview.php

    It will help you....
    Thanks & Regards.
    Best Regards
    ---------------------------------------
    Jaydeepsinh Sagar

  4. #4
    lobomaujp is offline Senior Member
    Join Date
    Jun 2008
    Posts
    33

    Default Re: user password change

    Quote Originally Posted by jsagar
    Hi
    If you want that only Admin can change the password other user can not change.
    you can hide the Button with the condition that
    if (is_admin($current_user))
    {
    show button
    }


    The file you can change is Modules/Users/Detailview.php

    It will help you....
    Thanks & Regards.
    Sorry can you be more especific im a new user and im a little lost here
    Thanks

  5. #5
    MatR is offline Sugar Community Member
    Join Date
    Jul 2007
    Location
    Paris, France
    Posts
    311

    Default Re: user password change

    In Modules/Users/Detailview.php line 140 :

    PHP Code:
    if (is_admin($current_user)) // add this condition 
    {
    if (!
    $focus->is_group && (empty($GLOBALS['sugar_config']['disc_client']) || !$GLOBALS['sugar_config']['disc_client'])) {
            
    $buttons .= "<input title='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_TITLE']."' accessKey='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_KEY']."' class='button' LANGUAGE=javascript onclick='return window.open(\"index.php?sugar_body_only=true&module=Users&action=ChangePassword&form=DetailView\",\"test\",\"width=320,height=230,resizable=1,scrollbars=1\");' type='button' name='password' value='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_LABEL']."'>  ";
    }

    Mathieu Rodrigues
    Consultant CRM
    CARRENET - SugarCRM Gold Partner
    >>> Suivez notre actualité sur Twitter ! http://twitter.com/carrenet

  6. #6
    lobomaujp is offline Senior Member
    Join Date
    Jun 2008
    Posts
    33

    Question Re: user password change

    Quote Originally Posted by MatR
    In Modules/Users/Detailview.php line 140 :

    PHP Code:
    if (is_admin($current_user)) // add this condition 
    {
    if (!
    $focus->is_group && (empty($GLOBALS['sugar_config']['disc_client']) || !$GLOBALS['sugar_config']['disc_client'])) {
            
    $buttons .= "<input title='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_TITLE']."' accessKey='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_KEY']."' class='button' LANGUAGE=javascript onclick='return window.open(\"index.php?sugar_body_only=true&module=Users&action=ChangePassword&form=DetailView\",\"test\",\"width=320,height=230,resizable=1,scrollbars=1\");' type='button' name='password' value='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_LABEL']."'>  ";
    }

    Sorry for being so annoying but still not working... i found the code replace with yours, and didnt work and imput just the fisrt 2 lines and didt work too...

    php code:
    PHP Code:
     if (is_admin($current_user)) // add this condition 
    {
    if (!
    $focus->is_group && (empty($GLOBALS['sugar_config']['disc_client']) || !$GLOBALS['sugar_config']['disc_client'])) {
            
    $buttons .= "<input title='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_TITLE']."' accessKey='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_KEY']."' class='button' LANGUAGE=javascript onclick='return window.open(\"index.php?sugar_body_only=true&module=Users&action=ChangePassword&form=DetailView\",\"test\",\"width=320,height=230,resizable=1,scrollbars=1\");' type='button' name='password' value='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_LABEL']."'>  ";
    }

    the normal users still able to see the button... the duplicate button works fine.. when normal user access they dont see this button... the code is too make the change password button to behave like the duplicate button right?
    Last edited by lobomaujp; 2008-06-25 at 06:22 PM.

  7. #7
    lobomaujp is offline Senior Member
    Join Date
    Jun 2008
    Posts
    33

    Question Re: user password change

    Please... its really important....

  8. #8
    nirmit is offline Senior Member
    Join Date
    Aug 2008
    Posts
    42

    Smile Re: user password change

    Quote Originally Posted by lobomaujp
    Sorry for being so annoying but still not working... i found the code replace with yours, and didnt work and imput just the fisrt 2 lines and didt work too...

    php code:
    PHP Code:
     if (is_admin($current_user)) // add this condition 
    {
    if (!
    $focus->is_group && (empty($GLOBALS['sugar_config']['disc_client']) || !$GLOBALS['sugar_config']['disc_client'])) {
            
    $buttons .= "<input title='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_TITLE']."' accessKey='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_KEY']."' class='button' LANGUAGE=javascript onclick='return window.open(\"index.php?sugar_body_only=true&module=Users&action=ChangePassword&form=DetailView\",\"test\",\"width=320,height=230,resizable=1,scrollbars=1\");' type='button' name='password' value='".$mod_strings['LBL_CHANGE_PASSWORD_BUTTON_LABEL']."'>  ";
    }

    the normal users still able to see the button... the duplicate button works fine.. when normal user access they dont see this button... the code is too make the change password button to behave like the duplicate button right?
    Change the line

    Code:
    if (!$focus->is_group && (empty($GLOBALS['sugar_config']['disc_client']) || !$GLOBALS['sugar_config']['disc_client']))
    Hope it helps.

    Nirmit
    SourceFuse Technologies

    to

    Code:
    if (!$focus->is_group && (empty($GLOBALS['sugar_config']['disc_client']) || !$GLOBALS['sugar_config']['disc_client']) && is_admin($current_user))

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. SugarCRM database user name and/or password is invalid
    By rkneeshaw in forum Installation and Upgrade Help
    Replies: 2
    Last Post: 2007-03-01, 03:43 PM
  2. Replies: 7
    Last Post: 2007-02-14, 03:48 PM
  3. Odd Error - Can't change password?
    By jcfiala in forum Help
    Replies: 1
    Last Post: 2005-04-20, 11:59 PM
  4. 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
  •