Subversion Repositories oidplus

Rev

Rev 1116 | Rev 1124 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1116 Rev 1121
Line 225... Line 225...
225
                                $res = OIDplus::db()->query("select oChild.id as id, oChild.ra_email as child_mail, oParent.ra_email as parent_mail from ###objects as oChild ".
225
                                $res = OIDplus::db()->query("select oChild.id as id, oChild.ra_email as child_mail, oParent.ra_email as parent_mail from ###objects as oChild ".
226
                                                            "left join ###objects as oParent on oChild.parent = oParent.id ".
226
                                                            "left join ###objects as oParent on oChild.parent = oParent.id ".
227
                                                            "order by ".OIDplus::db()->natOrder('oChild.id'));
227
                                                            "order by ".OIDplus::db()->natOrder('oChild.id'));
228
                                while ($row = $res->fetch_array()) {
228
                                while ($row = $res->fetch_array()) {
229
                                        if (!OIDplus::authUtils()->isRaLoggedIn($row['parent_mail']) && OIDplus::authUtils()->isRaLoggedIn($row['child_mail'])) {
229
                                        if (!OIDplus::authUtils()->isRaLoggedIn($row['parent_mail']) && OIDplus::authUtils()->isRaLoggedIn($row['child_mail'])) {
230
                                                $x = self::parse($row['id']); // can be FALSE if namespace was disabled
230
                                                $x = self::parse($row['id']); // can be NULL if namespace was disabled
231
                                                if ($x) $out[] = $x;
231
                                                if ($x) $out[] = $x;
232
                                        }
232
                                        }
233
                                }
233
                                }
234
                        } else {
234
                        } else {
235
                                $res = OIDplus::db()->query("select oChild.id as id from ###objects as oChild ".
235
                                $res = OIDplus::db()->query("select oChild.id as id from ###objects as oChild ".
Line 237... Line 237...
237
                                                            "where (".OIDplus::db()->getSlang()->isNullFunction('oParent.ra_email',"''")." <> ? and ".
237
                                                            "where (".OIDplus::db()->getSlang()->isNullFunction('oParent.ra_email',"''")." <> ? and ".
238
                                                            OIDplus::db()->getSlang()->isNullFunction('oChild.ra_email',"''")." = ?) or ".
238
                                                            OIDplus::db()->getSlang()->isNullFunction('oChild.ra_email',"''")." = ?) or ".
239
                                                            "      (oParent.ra_email is null and ".OIDplus::db()->getSlang()->isNullFunction('oChild.ra_email',"''")." = ?) ".
239
                                                            "      (oParent.ra_email is null and ".OIDplus::db()->getSlang()->isNullFunction('oChild.ra_email',"''")." = ?) ".
240
                                                            "order by ".OIDplus::db()->natOrder('oChild.id'), array($ra, $ra, $ra));
240
                                                            "order by ".OIDplus::db()->natOrder('oChild.id'), array($ra, $ra, $ra));
241
                                while ($row = $res->fetch_array()) {
241
                                while ($row = $res->fetch_array()) {
242
                                        $x = self::parse($row['id']); // can be FALSE if namespace was disabled
242
                                        $x = self::parse($row['id']); // can be NULL if namespace was disabled
243
                                        if ($x) $out[] = $x;
243
                                        if ($x) $out[] = $x;
244
                                }
244
                                }
245
                        }
245
                        }
246
                } else {
246
                } else {
247
                        if (!$ra) {
247
                        if (!$ra) {
Line 693... Line 693...
693
        /**
693
        /**
694
         * @param OIDplusObject $obj
694
         * @param OIDplusObject $obj
695
         * @return bool
695
         * @return bool
696
         */
696
         */
697
        public function equals(OIDplusObject $obj): bool {
697
        public function equals(OIDplusObject $obj): bool {
-
 
698
                if (!$obj) return false;
698
                if (!is_object($obj)) $obj = OIDplusObject::parse($obj);
699
                if (!is_object($obj)) $obj = OIDplusObject::parse($obj);
-
 
700
                if (!$obj) return false;
699
                if (!($obj instanceof $this)) return false;
701
                if (!($obj instanceof $this)) return false;
700
 
702
 
701
                $distance = $this->distance($obj);
703
                $distance = $this->distance($obj);
702
                if (is_numeric($distance)) return $distance === 0; // if the distance function is implemented, use it
704
                if (is_numeric($distance)) return $distance === 0; // if the distance function is implemented, use it
703
 
705