first part of module functions

This commit is contained in:
Roland Gruber 2004-01-30 17:06:28 +00:00
parent 1bb21836bd
commit 9180e779dd
1 changed files with 98 additions and 46 deletions

View File

@ -3,7 +3,7 @@
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Roland Gruber
Copyright (C) 2003-04 Roland Gruber
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -138,6 +138,11 @@ class Config {
// text to include in user PDF files
var $pdftext = "";
// account modules // TODO add default modules for LAM <0.5
var $usermodules = "um1,um2,um3";
var $groupmodules = "gm1,gm2,gm3";
var $hostmodules = "hm1,hm2,hm3";
// name of configuration file
var $file;
@ -145,7 +150,8 @@ class Config {
var $settings = array("ServerURL", "Passwd", "Admins", "usersuffix", "groupsuffix", "hostsuffix",
"domainsuffix", "MinUID", "MaxUID", "MinGID", "MaxGID", "MinMachine", "MaxMachine",
"userlistAttributes", "grouplistAttributes", "hostlistAttributes", "maxlistentries",
"defaultLanguage", "scriptPath", "scriptServer", "samba3", "cachetimeout", "pwdhash");
"defaultLanguage", "scriptPath", "scriptServer", "samba3", "cachetimeout", "pwdhash",
"usermodules", "groupmodules", "hostmodules");
// constructor, loads preferences from config file
@ -695,8 +701,54 @@ class Config {
return true;
}
// returns an array of all selected user modules
function get_UserModules() {
return explode(",", $this->usermodules);
}
// sets the selected user modules
// $modules: array with module names (not aliases!)
// returns true if $modules has correct format
function set_UserModules($modules) {
if (! is_array($modules)) return false;
// check module names
// TODO check against available module names
$this->usermodules = implode(",", $modules);
}
// returns an array of all selected group modules
function get_GroupModules() {
return explode(",", $this->usermodules);
}
// sets the selected group modules
// $modules: array with module names (not aliases!)
// returns true if $modules has correct format
function set_GroupModules($modules) {
if (! is_array($modules)) return false;
// check module names
// TODO check against available module names
$this->groupmodules = implode(",", $modules);
}
// returns an array of all selected host modules
function get_HostModules() {
return explode(",", $this->usermodules);
}
// sets the selected host modules
// $modules: array with module names (not aliases!)
// returns true if $modules has correct format
function set_HostModules($modules) {
if (! is_array($modules)) return false;
// check module names
// TODO check against available module names
$this->hostmodules = implode(",", $modules);
}
}
/*
// class CfgMain
*/