Code Duplication    Length = 14-14 lines in 2 locations

Auth/class.LDAPUser.php 1 location

@@ 254-267 (lines=14) @@
251
        return false;
252
    }
253
254
    public static function from_name($name, $data = false)
255
    {
256
        if($data === false)
257
        {
258
            throw new \Exception('data must be set for LDAPUser');
259
        }
260
        $filter = new \Data\Filter("uid eq $name");
261
        $user = $data->read($data->user_base, $filter);
262
        if($user === false || !isset($user[0]))
263
        {
264
            return false;
265
        }
266
        return new static($user[0]);
267
    }
268
269
    public function flushUser()
270
    {

Auth/class.LDAPGroup.php 1 location

@@ 253-266 (lines=14) @@
250
        }
251
    }
252
253
    public static function from_name($name, $data = false)
254
    {
255
        if($data === false)
256
        {
257
            throw new \Exception('data must be set for LDAPGroup');
258
        }
259
        $filter = new \Data\Filter("cn eq $name");
260
        $group = $data->read($data->group_base, $filter);
261
        if($group === false || !isset($group[0]))
262
        {
263
            return false;
264
        }
265
        return new static($group[0]);
266
    }
267
}
268
/* vim: set tabstop=4 shiftwidth=4 expandtab: */
269