Project

General

Profile

« Previous | Next » 

Revision 1dd07051

Added by Jim Pingle about 9 years ago

Respect all Class attributes returned by the RADIUS server, not only the last one received. Fixes #6086

View differences:

src/etc/inc/auth.inc
1441 1441
*/
1442 1442
function radius_get_groups($attributes) {
1443 1443
	$groups = array();
1444
	if (!empty($attributes) && is_array($attributes) && !empty($attributes['class'])) {
1445
		$groups = explode(";", $attributes['class']);
1444
	if (!empty($attributes) && is_array($attributes) && (!empty($attributes['class']) || !empty($attributes['class_int']))) {
1445
		/* Some RADIUS servers return multiple class attributes, so check them all. */
1446
		$groups = array();
1447
		if (!empty($attributes['class']) && is_array($attributes['class'])) {
1448
			foreach ($attributes['class'] as $class) {
1449
				$groups = array_unique(array_merge($groups, explode(";", $class)));
1450
			}
1451
		}
1452

  
1446 1453
		foreach ($groups as & $grp) {
1447 1454
			$grp = trim($grp);
1448 1455
			if (strtolower(substr($grp, 0, 3)) == "ou=") {
src/etc/inc/radius.inc
480 480
                break;
481 481

  
482 482
            case RADIUS_CLASS:
483
                $this->attributes['class'] = radius_cvt_string($data);
483
                if (!array($this->attributes['class'])) {
484
                        $this->attributes['class'] = array();
485
                }
486
                $this->attributes['class'][] = radius_cvt_string($data);
484 487
                break;
485 488

  
486 489
            case RADIUS_FRAMED_PROTOCOL:

Also available in: Unified diff