changed help to use the accountContainer object in session

This commit is contained in:
duergner 2004-09-08 18:26:00 +00:00
parent afa7e8b8a3
commit 550c136063
9 changed files with 39 additions and 28 deletions

View File

@ -401,6 +401,9 @@ class baseModule {
if(isset($this->meta['help'][$id])) { if(isset($this->meta['help'][$id])) {
return $this->meta['help'][$id]; return $this->meta['help'][$id];
} }
elseif(isset($this->meta['help'][$this->scope][$id])) {
return $this->meta['help'][$this->scope][$id];
}
else { else {
return false; return false;
} }

View File

@ -1360,5 +1360,9 @@ class accountContainer {
$return['main'] = array( 'dn'); $return['main'] = array( 'dn');
return $return; return $return;
} }
function getHelp($module,$id) {
return $this->module[$module]->get_help($id);
}
} }
?> ?>

View File

@ -105,14 +105,14 @@ class account extends baseModule {
/* /*
*/ */
function get_help($id) { /*function get_help($id) {
switch ($id) { switch ($id) {
case "description": case "description":
return array ("ext" => "FALSE", "Headline" => _("Gecos"), "Text" => _("Host description. If left empty host name will be used.")); return array ("ext" => "FALSE", "Headline" => _("Gecos"), "Text" => _("Host description. If left empty host name will be used."));
break; break;
} }
return false; return false;
} }*/
/* This function returns all ldap attributes /* This function returns all ldap attributes
* which are part of account and returns * which are part of account and returns

View File

@ -196,7 +196,7 @@ class inetOrgPerson extends baseModule {
/* /*
*/ */
function get_help($id) { /*function get_help($id) {
switch ($id) { switch ($id) {
case 'description': case 'description':
return array ("ext" => "FALSE", "Headline" => _("Gecos"), "Text" => _("Host description. If left empty host name will be used.")); return array ("ext" => "FALSE", "Headline" => _("Gecos"), "Text" => _("Host description. If left empty host name will be used."));
@ -236,7 +236,7 @@ class inetOrgPerson extends baseModule {
break; break;
} }
return false; return false;
} }*/
/* This function returns all ldap attributes /* This function returns all ldap attributes
* which are part of inetOrgPerson and returns * which are part of inetOrgPerson and returns

View File

@ -149,10 +149,13 @@ class posixAccount extends baseModule {
'userPassword', 'userPassword',
'loginShell'); 'loginShell');
// help Entries // help Entries
$return['help'] = array ( 'uid' => array ("ext" => "FALSE", "Headline" => _("Username"), "Text" => _("Username of the user who should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If username is already used username will be expanded with a number. The next free number will be used. Warning: Older systems have problems with usernames longer than 8 characters. You can not log in to Windows if username is longer than 16 characters.")), $return['help'] = array ( 'user' => array( 'uid' => array ("ext" => "FALSE", "Headline" => _("Username"), "Text" => _("Username of the user who should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If username is already used username will be expanded with a number. The next free number will be used. Warning: Older systems have problems with usernames longer than 8 characters. You can not log in to Windows if username is longer than 16 characters.")),
'gecos' => array ("ext" => "FALSE", "Headline" => _("Gecos"), "Text" => _("User description. If left empty sur- and give name will be used.")),
'gidNumber' => array ("ext" => "FALSE", "Headline" => _("Primary group"), "Text" => _("The Primary Group the user should be member of."))),
'host' => array( 'uid' => array ("ext" => "FALSE", "Headline" => _("Host name"), "Text" => _("Host name of the host which should be created. Valid characters are: a-z,0-9, .-_$. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. Hostnames are always ending with $. If last character is not $ it will be added. If hostname is already used hostname will be expanded with a number. The next free number will be used.")),
'gecos' => array ("ext" => "FALSE", "Headline" => _("Gecos"), "Text" => _("Host description. If left empty host name will be used.")),
'gidNumber' => array ("ext" => "FALSE", "Headline" => _("Primary group"), "Text" => _("The Primary group the host should be member of."))),
'uidNumber' => array ("ext" => "FALSE", "Headline" => _("UID number"), "Text" => _("If empty UID number will be generated automaticly.")), 'uidNumber' => array ("ext" => "FALSE", "Headline" => _("UID number"), "Text" => _("If empty UID number will be generated automaticly.")),
'gecos' => array ("ext" => "FALSE", "Headline" => _("Gecos"), "Text" => _("User description. If left empty sur- and give name will be used.")),
'gidNumber' => array ("ext" => "FALSE", "Headline" => _("Primary group"), "Text" => _("The Primary Group the user should be member of.")),
'addgroup' => array ("ext" => "FALSE", "Headline" => _("Additional groups"), "Text" => _("Hold the CTRL-key to (de)select multiple groups."). ' '. _("Can be left empty.")), 'addgroup' => array ("ext" => "FALSE", "Headline" => _("Additional groups"), "Text" => _("Hold the CTRL-key to (de)select multiple groups."). ' '. _("Can be left empty.")),
'homeDirectory' => array ("ext" => "FALSE", "Headline" => _("Home directory"), "Text" => _("$user and $group are replaced with username or primary groupname.")), 'homeDirectory' => array ("ext" => "FALSE", "Headline" => _("Home directory"), "Text" => _("$user and $group are replaced with username or primary groupname.")),
/*'userPassword' =>*/ /*'userPassword' =>*/
@ -260,7 +263,7 @@ class posixAccount extends baseModule {
/* /*
*/ */
function get_help($id) { /*function get_help($id) {
switch ($id) { switch ($id) {
case 'uid': case 'uid':
return array ("ext" => "FALSE", "Headline" => _("Username"), "Text" => _("Username of the user who should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If username is already used username will be expanded with a number. The next free number will be used. Warning: Older systems have problems with usernames longer than 8 characters. You can not log in to Windows if username is longer than 16 characters.")); return array ("ext" => "FALSE", "Headline" => _("Username"), "Text" => _("Username of the user who should be created. Valid characters are: a-z,0-9, .-_. Lam does not allow a number as first character because useradd also does not allow it. Lam does not allow capital letters A-Z because it can cause several problems. If username is already used username will be expanded with a number. The next free number will be used. Warning: Older systems have problems with usernames longer than 8 characters. You can not log in to Windows if username is longer than 16 characters."));
@ -279,22 +282,22 @@ class posixAccount extends baseModule {
break; break;
case 'homeDirectory': case 'homeDirectory':
return array ("ext" => "FALSE", "Headline" => _("Home directory"), "Text" => _("$user and $group are replaced with username or primary groupname.")); return array ("ext" => "FALSE", "Headline" => _("Home directory"), "Text" => _("$user and $group are replaced with username or primary groupname."));
break; break;*/
/*case 'userPassword': /*case 'userPassword':
return ;*/ return ;
break; break;*/
case 'userPassword_no': /*case 'userPassword_no':
return array ("ext" => "FALSE", "Headline" => _("Use no password"), "Text" => _("If checked no password will be used.")); return array ("ext" => "FALSE", "Headline" => _("Use no password"), "Text" => _("If checked no password will be used."));
break; break;*/
/*case 'userPassword_lock': /*case 'userPassword_lock':
return ;*/ return ;
break; break;*/
case 'loginShell': /*case 'loginShell':
return array ("ext" => "FALSE", "Headline" => _("Login shell"), "Text" => _("To disable login use /bin/false. List of shells is read from lam/config/shells")); return array ("ext" => "FALSE", "Headline" => _("Login shell"), "Text" => _("To disable login use /bin/false. List of shells is read from lam/config/shells"));
break; break;
} }
return false; return false;
} }*/
/* This function returns all ldap attributes /* This function returns all ldap attributes
* which are part of posixAccount and returns * which are part of posixAccount and returns

View File

@ -259,7 +259,7 @@ class posixGroup extends baseModule {
/* /*
*/ */
function get_help($id) { /*function get_help($id) {
switch ($id) { switch ($id) {
case "description": case "description":
return array ("ext" => "FALSE", "Headline" => _("Description"), return array ("ext" => "FALSE", "Headline" => _("Description"),
@ -276,19 +276,19 @@ class posixGroup extends baseModule {
break; break;
case 'adduser': case 'adduser':
return array ("ext" => "FALSE", "Headline" => _("Group members"), "Text" => _("Users also being member of the current group."). ' '. _("Can be left empty.")); return array ("ext" => "FALSE", "Headline" => _("Group members"), "Text" => _("Users also being member of the current group."). ' '. _("Can be left empty."));
break; break;*/
/*case 'userPassword': /*case 'userPassword':
return ; return ;
break;*/ break;*/
case 'userPassword_no': /*case 'userPassword_no':
return array ("ext" => "FALSE", "Headline" => _("Use no password"), "Text" => _("If checked no password will be used.")); return array ("ext" => "FALSE", "Headline" => _("Use no password"), "Text" => _("If checked no password will be used."));
break; break;*/
/*case 'userPassword_lock': /*case 'userPassword_lock':
return ; return ;
break;*/ break;*/
} /*}
return false; return false;
} }*/
/* This function returns all ldap attributes /* This function returns all ldap attributes
* which are part of posixGroup and returns * which are part of posixGroup and returns

View File

@ -164,7 +164,7 @@ class sambaGroupMapping extends baseModule {
/* /*
*/ */
function get_help($id) { /*function get_help($id) {
switch ($id) { switch ($id) {
case 'displayName': case 'displayName':
return array ("ext" => "FALSE", "Headline" => _("Display name"), "Text" => _("Windows clients will show display name as group description.")); return array ("ext" => "FALSE", "Headline" => _("Display name"), "Text" => _("Windows clients will show display name as group description."));
@ -177,7 +177,7 @@ class sambaGroupMapping extends baseModule {
break; break;
} }
return false; return false;
} }*/
/* This function returns all ldap attributes /* This function returns all ldap attributes
* which are part of sambaGroupMapping and returns * which are part of sambaGroupMapping and returns

View File

@ -209,7 +209,7 @@ class shadowAccount extends baseModule {
/* /*
*/ */
function get_help($id) { /*function get_help($id) {
switch ($id) { switch ($id) {
case 'shadowWarning': case 'shadowWarning':
return array ("ext" => "FALSE", "Headline" => _("Password warn"), "Text" => _("Days before password is to expire that user is warned of pending password expiration. If set value must be 0<."). ' '. _("Can be left empty.")); return array ("ext" => "FALSE", "Headline" => _("Password warn"), "Text" => _("Days before password is to expire that user is warned of pending password expiration. If set value must be 0<."). ' '. _("Can be left empty."));
@ -228,7 +228,7 @@ class shadowAccount extends baseModule {
break; break;
} }
return false; return false;
} }*/
/* This function returns all ldap attributes /* This function returns all ldap attributes
* which are part of shadowAccount and returns * which are part of shadowAccount and returns

View File

@ -97,7 +97,8 @@ $helpEntry = array();
if(isset($_GET['module'])) { if(isset($_GET['module'])) {
include_once("../lib/modules.inc"); include_once("../lib/modules.inc");
$helpEntry = getHelp($_GET['module'],$_GET['item']); //$helpEntry = getHelp($_GET['module'],$_GET['item']);
$helpEntry = $_SESSION['account']->getHelp($_GET['module'],$_GET['item']);
if(!$helpEntry) { if(!$helpEntry) {
$variables = array(); $variables = array();
array_push($variables,$_GET['item']); array_push($variables,$_GET['item']);