Anonymous | Login | Signup for a new account | 2021-01-21 05:39 GMT | ![]() |
Main | My View | View Issues | Change Log | Roadmap |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0001424 | SiT! | LDAP | public | 2010-12-05 03:34 | 2013-07-06 17:15 | ||||
Reporter | johng | ||||||||
Assigned To | paulh | ||||||||
Priority | normal | Severity | minor | Reproducibility | sometimes | ||||
Status | resolved | Resolution | fixed | ||||||
Platform | OS | OS Version | |||||||
Product Version | 3.62 LTS | ||||||||
Target Version | 3.68 | Fixed in Version | Current SVN | ||||||
Summary | 0001424: LDAP service tries to disable a customer who is already disabled and fails | ||||||||
Description | If a customer account in LDAP is disabled, SIT will try to repeatedly disable the account. | ||||||||
Tags | patch | ||||||||
Attached Files | |||||||||
![]() |
|||||||||||
|
![]() |
|
(0003498) johng (reporter) 2010-12-05 03:35 |
Solution: # svn diff * Index: auto.php =================================================================== --- auto.php (revision 7) +++ auto.php (working copy) @@ -944,7 +944,9 @@ if (strtolower($contact_attributes[$CONFIG['ldap_logindisabledattribute']][0]) == strtolower($CONFIG['ldap_logindisabledvalue'])) { // We want to disable - $sit_db_contacts[$contact_attributes[$CONFIG['ldap_userattribute']][0]]->disable(); + if ($sit_db_contacts[$contact_attributes[$CONFIG['ldap_userattribute']][0]]) { + $sit_db_contacts[$contact_attributes[$CONFIG['ldap_userattribute']][0]]->disable(); + } } } } @@ -968,7 +970,7 @@ // TODO reassign incidents? foreach ($sit_db_contacts AS $c) { - debug_log ("Disabling {$c->username}", TRUE); + debug_log ("Disabling {$c->username} because they don't exist in LDAP", TRUE); $c->disable(); } } Index: lib/classes.inc.php =================================================================== --- lib/classes.inc.php (revision 7) +++ lib/classes.inc.php (working copy) @@ -491,19 +495,24 @@ $toReturn = true; if (!empty($this->id)) { - $sql = "UPDATE `{$GLOBALS['dbContacts']}` SET active = 'false' WHERE id = {$this->id}"; - - $result = mysql_query($sql); - if (mysql_error()) trigger_error(mysql_error(),E_USER_WARNING); - if (mysql_affected_rows() != 1) - { - trigger_error("Failed to disable contact {$this->username}", E_USER_WARNING); - $toReturn = false; - } - else - { - $toReturn = true; - } + $sql = "SELECT 1 FROM `{$GLOBALS['dbContacts']}` WHERE id = {$this->id} AND active = 'false'"; + $result = mysql_query($sql); + if (mysql_error()) trigger_error(mysql_error(),E_USER_WARNING); + if (mysql_fetch_array($result,MYSQL_NUM)) { + debug_log("Failed to disable contact {$this->username}, was already disabled"); + } + else + { + $sql = "UPDATE `{$GLOBALS['dbContacts']}` SET active = 'false' WHERE id = {$this->id}"; + + $result = mysql_query($sql); + if (mysql_error()) trigger_error(mysql_error(),E_USER_WARNING); + if (mysql_affected_rows() != 1) + { + trigger_error("Failed to disable contact {$this->username}", E_USER_WARNING); + $toReturn = false; + } + } } return $toReturn; |
ivan (administrator) 2011-02-10 09:46 |
Thanks johng |
paulh (administrator) 2011-02-10 09:59 |
Looks like I merged some of this patch in http://gitorious.org/sit/paulheaneys-sit/commit/b0c685f [^] (see linked bug) |
paulh (administrator) 2011-02-14 21:33 |
Confirm second issue about sync task becoming disabled |
paulh (administrator) 2013-03-02 13:19 |
current svn resolves this, see associated bugs |
![]() |
|||
Date Modified | Username | Field | Change |
2010-12-05 03:34 | johng | New Issue | |
2010-12-05 03:35 | johng | Note Added: 0003498 | |
2011-02-10 09:46 | ivan | Tag Attached: patch | |
2011-02-10 09:46 | ivan | Note Added: 0003563 | |
2011-02-10 09:46 | ivan | Status | new => acknowledged |
2011-02-10 09:59 | paulh | Relationship added | duplicate of 0001399 |
2011-02-10 09:59 | paulh | Note Added: 0003564 | |
2011-02-14 21:33 | paulh | Assigned To | => paulh |
2011-02-14 21:33 | paulh | Status | acknowledged => assigned |
2011-02-14 21:33 | paulh | Note Added: 0003603 | |
2013-03-01 19:48 | paulh | Relationship added | related to 0001843 |
2013-03-02 13:19 | paulh | Note Added: 0004726 | |
2013-03-02 13:19 | paulh | Status | assigned => resolved |
2013-03-02 13:19 | paulh | Resolution | open => fixed |
2013-03-02 13:19 | paulh | Fixed in Version | => Current SVN |
2013-07-06 17:15 | ivan | Target Version | => 3.68 |
Copyright © 2000 - 2021 MantisBT Team |