new type API
This commit is contained in:
parent
1a16b3cd5b
commit
c51918907e
|
@ -46,8 +46,8 @@ class group extends baseType {
|
|||
parent::__construct($type);
|
||||
$this->LABEL_CREATE_ANOTHER_ACCOUNT = _('Create another group');
|
||||
$this->LABEL_BACK_TO_ACCOUNT_LIST = _('Back to group list');
|
||||
if (isset($_SESSION['config'])) {
|
||||
$modules = $_SESSION['config']->get_AccountModules('group');
|
||||
if ($this->getType() != null) {
|
||||
$modules = $this->getType()->getModules();
|
||||
if (in_array('organizationalRole', $modules)) {
|
||||
$this->LABEL_CREATE_ANOTHER_ACCOUNT = _('Create another role');
|
||||
$this->LABEL_BACK_TO_ACCOUNT_LIST = _('Back to role list');
|
||||
|
@ -61,8 +61,8 @@ class group extends baseType {
|
|||
* @return string alias name
|
||||
*/
|
||||
function getAlias() {
|
||||
if (isLoggedIn() && isset($_SESSION['config'])) {
|
||||
$modules = $_SESSION['config']->get_AccountModules('group');
|
||||
if ($this->getType() != null) {
|
||||
$modules = $this->getType()->getModules();
|
||||
if (in_array('organizationalRole', $modules)) {
|
||||
return _('Roles');
|
||||
}
|
||||
|
@ -114,8 +114,8 @@ class group extends baseType {
|
|||
"roleOccupant" => _("Role member DNs"),
|
||||
"uniqueMember" => _("Group member DNs"),
|
||||
);
|
||||
if (!empty($_SESSION['config'])) {
|
||||
$modules = $_SESSION['config']->get_AccountModules('group');
|
||||
if ($this->getType() != null) {
|
||||
$modules = $this->getType()->getModules();
|
||||
if (in_array('organizationalRole', $modules)) {
|
||||
$return['cn'] = _('Role name');
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ class lamGroupList extends lamList {
|
|||
'error_noneFound' => _("No groups found!"),
|
||||
'newEntry' => _("New group"),
|
||||
'deleteEntry' => _("Delete selected groups"));
|
||||
$modules = $_SESSION['config']->get_AccountModules('group');
|
||||
$modules = $this->type->getModules();
|
||||
if (in_array('organizationalRole', $modules)) {
|
||||
$this->labels = array(
|
||||
'nav' => _("Role count: %s"),
|
||||
|
|
|
@ -884,7 +884,7 @@ class lamUserList extends lamList {
|
|||
for ($i = 0; $i < $entryCount; $i++) {
|
||||
$unixAvailable = self::isUnixAvailable($this->entries[$i]);
|
||||
$sambaAvailable = self::isSambaAvailable($this->entries[$i]);
|
||||
$ppolicyAvailable = self::isPPolicyAvailable($this->entries[$i]);
|
||||
$ppolicyAvailable = $this->isPPolicyAvailable($this->entries[$i]);
|
||||
$windowsAvailable = self::isWindowsAvailable($this->entries[$i]);
|
||||
$unixLocked = self::isUnixLocked($this->entries[$i]);
|
||||
$sambaLocked = self::isSambaLocked($this->entries[$i]);
|
||||
|
@ -931,7 +931,7 @@ class lamUserList extends lamList {
|
|||
// check status
|
||||
$unixAvailable = self::isUnixAvailable($attrs);
|
||||
$sambaAvailable = self::isSambaAvailable($attrs);
|
||||
$ppolicyAvailable = self::isPPolicyAvailable($attrs);
|
||||
$ppolicyAvailable = $this->isPPolicyAvailable($attrs);
|
||||
$windowsAvailable = self::isWindowsAvailable($attrs);
|
||||
$unixLocked = self::isUnixLocked($attrs);
|
||||
$sambaLocked = self::isSambaLocked($attrs);
|
||||
|
@ -1049,8 +1049,8 @@ class lamUserList extends lamList {
|
|||
* @param array $attrs LDAP attributes
|
||||
* @return boolean PPolicy part exists
|
||||
*/
|
||||
public static function isPPolicyAvailable(&$attrs) {
|
||||
return in_array('ppolicyUser', $_SESSION['config']->get_AccountModules('user'));
|
||||
public function isPPolicyAvailable(&$attrs) {
|
||||
return in_array('ppolicyUser', $this->type->getModules());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1089,8 +1089,8 @@ class lamUserList extends lamList {
|
|||
* @param array $attrs LDAP attributes
|
||||
* @return boolean 389ds available
|
||||
*/
|
||||
public static function is389dsAvailable(&$attrs) {
|
||||
return in_array('locking389ds', $_SESSION['config']->get_AccountModules('user'));
|
||||
public function is389dsAvailable(&$attrs) {
|
||||
return in_array('locking389ds', $this->type->getModules());
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue