|
|
@ -324,34 +324,40 @@ abstract class pippo{ |
|
|
|
} |
|
|
|
|
|
|
|
class LilikGroup extends pippo{ |
|
|
|
function __construct($id, $is_posix=False){ |
|
|
|
global $HOST, $PORT, $LOGIN_DN; |
|
|
|
parent::__construct($id); |
|
|
|
$this->adapters=[new GroupAdapter("cn=%s,o=Group,dc=lilik,dc=it")]; |
|
|
|
$this->is_posix=$is_posix; |
|
|
|
} |
|
|
|
|
|
|
|
function get_id($user){ |
|
|
|
if ($is_posix) |
|
|
|
return $user->$id; |
|
|
|
else |
|
|
|
return sprintf($user->adapters[1]->dn,$user->id); |
|
|
|
} |
|
|
|
|
|
|
|
function add_user($user){ |
|
|
|
return $this->add_in_list('member', $this->get_id($user)); |
|
|
|
} |
|
|
|
|
|
|
|
function del_user($user){ |
|
|
|
return $this->del_in_list('member', $this->get_id($user)); |
|
|
|
} |
|
|
|
|
|
|
|
function is_user($user){ |
|
|
|
if (in_array($this->get_id($user), $this->get_attr('member'))){ |
|
|
|
return True; |
|
|
|
} |
|
|
|
return False; |
|
|
|
} |
|
|
|
function __construct($id, $is_posix=False){ |
|
|
|
global $HOST, $PORT, $LOGIN_DN; |
|
|
|
parent::__construct($id); |
|
|
|
$this->adapters=[new GroupAdapter("cn=%s,o=Group,dc=lilik,dc=it")]; |
|
|
|
$this->is_posix=$is_posix; |
|
|
|
if ($is_posix){ |
|
|
|
$this->member_attr="memberUid"; |
|
|
|
}else{ |
|
|
|
$this->member_attr="member"; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function get_id($user){ |
|
|
|
if ($this->is_posix){ |
|
|
|
return $user->id; |
|
|
|
}else{ |
|
|
|
return sprintf($user->adapters[1]->dn,$user->id); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
function add_user($user){ |
|
|
|
return $this->add_in_list($this->member_attr, $this->get_id($user)); |
|
|
|
} |
|
|
|
|
|
|
|
function del_user($user){ |
|
|
|
return $this->del_in_list($this->member_attr, $this->get_id($user)); |
|
|
|
} |
|
|
|
|
|
|
|
function is_user($user){ |
|
|
|
if (in_array($this->get_id($user), $this->get_attr($this->member_attr))){ |
|
|
|
return True; |
|
|
|
} |
|
|
|
return False; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
class LilikUser extends pippo{ |
|
|
|