Subversion Repositories oidplus

Rev

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

Rev 1148 Rev 1156
Line 226... Line 226...
226
 
226
 
227
                if (!OIDplus::baseConfig()->getValue('OBJECT_CACHING', true)) {
227
                if (!OIDplus::baseConfig()->getValue('OBJECT_CACHING', true)) {
228
                        if (!$ra) {
228
                        if (!$ra) {
229
                                $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 ".
229
                                $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 ".
230
                                                            "left join ###objects as oParent on oChild.parent = oParent.id");
230
                                                            "left join ###objects as oParent on oChild.parent = oParent.id");
231
                                $res = new OIDplusNaturalSortedQueryResult($res, 'oChild.id');
231
                                $res->naturalSortByField('oChild.id');
232
                                while ($row = $res->fetch_array()) {
232
                                while ($row = $res->fetch_array()) {
233
                                        if (!OIDplus::authUtils()->isRaLoggedIn($row['parent_mail']) && OIDplus::authUtils()->isRaLoggedIn($row['child_mail'])) {
233
                                        if (!OIDplus::authUtils()->isRaLoggedIn($row['parent_mail']) && OIDplus::authUtils()->isRaLoggedIn($row['child_mail'])) {
234
                                                $x = self::parse($row['id']); // can be NULL if namespace was disabled
234
                                                $x = self::parse($row['id']); // can be NULL if namespace was disabled
235
                                                if ($x) $out[] = $x;
235
                                                if ($x) $out[] = $x;
236
                                        }
236
                                        }
Line 240... Line 240...
240
                                                            "left join ###objects as oParent on oChild.parent = oParent.id ".
240
                                                            "left join ###objects as oParent on oChild.parent = oParent.id ".
241
                                                            "where (".OIDplus::db()->getSlang()->isNullFunction('oParent.ra_email',"''")." <> ? and ".
241
                                                            "where (".OIDplus::db()->getSlang()->isNullFunction('oParent.ra_email',"''")." <> ? and ".
242
                                                            OIDplus::db()->getSlang()->isNullFunction('oChild.ra_email',"''")." = ?) or ".
242
                                                            OIDplus::db()->getSlang()->isNullFunction('oChild.ra_email',"''")." = ?) or ".
243
                                                            "      (oParent.ra_email is null and ".OIDplus::db()->getSlang()->isNullFunction('oChild.ra_email',"''")." = ?) ",
243
                                                            "      (oParent.ra_email is null and ".OIDplus::db()->getSlang()->isNullFunction('oChild.ra_email',"''")." = ?) ",
244
                                                            array($ra, $ra, $ra));
244
                                                            array($ra, $ra, $ra));
245
                                $res = new OIDplusNaturalSortedQueryResult($res, 'oChild.id');
245
                                $res->naturalSortByField('oChild.id');
246
                                while ($row = $res->fetch_array()) {
246
                                while ($row = $res->fetch_array()) {
247
                                        $x = self::parse($row['id']); // can be NULL if namespace was disabled
247
                                        $x = self::parse($row['id']); // can be NULL if namespace was disabled
248
                                        if ($x) $out[] = $x;
248
                                        if ($x) $out[] = $x;
249
                                }
249
                                }
250
                        }
250
                        }
Line 289... Line 289...
289
        public static function getAllNonConfidential(): array {
289
        public static function getAllNonConfidential(): array {
290
                $out = array();
290
                $out = array();
291
 
291
 
292
                if (!OIDplus::baseConfig()->getValue('OBJECT_CACHING', true)) {
292
                if (!OIDplus::baseConfig()->getValue('OBJECT_CACHING', true)) {
293
                        $res = OIDplus::db()->query("select id from ###objects where confidential = ?", array(false));
293
                        $res = OIDplus::db()->query("select id from ###objects where confidential = ?", array(false));
294
                        $res = new OIDplusNaturalSortedQueryResult($res, 'id');
294
                        $res->naturalSortByField('id');
295
                        while ($row = $res->fetch_array()) {
295
                        while ($row = $res->fetch_array()) {
296
                                $obj = self::parse($row['id']); // will be NULL if the object type is not registered
296
                                $obj = self::parse($row['id']); // will be NULL if the object type is not registered
297
                                if ($obj && (!$obj->isConfidential())) {
297
                                if ($obj && (!$obj->isConfidential())) {
298
                                        $out[] = $row['id'];
298
                                        $out[] = $row['id'];
299
                                }
299
                                }