SiT! Bugs

View Revisions: Issue #1843 All Revisions ] Back to Issue ]
Summary 0001843: LDAP-Sync: Disabling of contacts fails
Revision 2013-03-01 13:18 by dipohl
Additional Information Wrong program logic in classes.inc.php.
Can be fixed by

sit-devel/lib # diff -u classes.inc.php.old classes.inc.php
--- classes.inc.php.old 2013-02-28 19:51:15.000000000 +0100
+++ classes.inc.php 2013-02-28 19:51:49.000000000 +0100
@@ -504,7 +504,7 @@
             $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_num_rows($result) == 0)
+ if (mysql_num_rows($result) == 1)
             {
                 debug_log("Failed to disable contact {$this->username}, was already disabled");
                 $toReturn = true;
@@ -554,4 +554,4 @@
         else return false;
     }
 }
-?>
\ No newline at end of file
+?>
Revision 2013-03-01 13:17 by dipohl
Additional Information Wrong program logic in classes.inc.php.
Can be fixed by

sit-devel/lib # diff classes.inc.php.old classes.inc.php
507c507
< if (mysql_num_rows($result) == 0)
---
> if (mysql_num_rows($result) == 1)
557c557
< ?>
\ No newline at end of file
---
> ?>
srv-kon-ap3:/opt/www/htdocs/sit-devel/lib # diff -u classes.inc.php.old classes.inc.php
--- classes.inc.php.old 2013-02-28 19:51:15.000000000 +0100
+++ classes.inc.php 2013-02-28 19:51:49.000000000 +0100
@@ -504,7 +504,7 @@
             $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_num_rows($result) == 0)
+ if (mysql_num_rows($result) == 1)
             {
                 debug_log("Failed to disable contact {$this->username}, was already disabled");
                 $toReturn = true;
@@ -554,4 +554,4 @@
         else return false;
     }
 }
-?>
\ No newline at end of file
+?>


Copyright © 2000 - 2020 MantisBT Team
Powered by Mantis Bugtracker