moved atrribute descriptions to lists.inc

This commit is contained in:
Roland Gruber 2004-06-01 13:00:09 +00:00
parent c74404ec29
commit e59b6f6418
6 changed files with 119 additions and 79 deletions

View File

@ -220,13 +220,6 @@ class Ldap{
/** LDAP password used for bind */
var $password;
/** Contains LDAP attributes for user list and their descriptions */
var $ldapUserAttributes;
/** Contains LDAP attributes for group list and their descriptions */
var $ldapGroupAttributes;
/** Contains LDAP attributes for host list and their descriptions */
var $ldapHostAttributes;
/** Array with all objectClass strings from the LDAP server */
var $objectClasses;
@ -248,35 +241,6 @@ class Ldap{
setlanguage();
if (is_object($config)) $this->conf = $config;
else return false;
// construct arrays with known LDAP attributes
$this->ldapUserAttributes = array (
"uid" => _("User ID"),
"uidnumber" => _("UID number"),
"gidnumber" => _("GID number"),
"cn" => _("Username"),
"host" => _("Allowed hosts"),
"givenname" => _("First name"),
"sn" => _("Last name"),
"homedirectory" => _("Home directory"),
"loginshell" => _("Login shell"),
"mail" => _("E-Mail"),
"gecos" => _("Description")
);
$this->ldapGroupAttributes = array (
"cn" => _("Group name"),
"gidnumber" => _("GID number"),
"memberuid" => _("Group members"),
"member" => _("Group member DNs"),
"description" => _("Group description")
);
$this->ldapHostAttributes = array (
"uid" => _("Host username"),
"cn" => _("Host name"),
"rid" => _("RID (Windows UID)"),
"description" => _("Host description"),
"uidnumber" => _("UID number"),
"gidnumber" => _("GID number")
);
mt_srand((double)microtime()*1000000);
$this->rand = mt_rand();
return true;
@ -582,33 +546,6 @@ class Ldap{
$this->password="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
}
/**
* Returns the LDAP attribute names and their description for the user list
*
* @return array list of LDAP attributes and descriptions
*/
function attributeUserArray() {
return $this->ldapUserAttributes;
}
/**
* Returns the LDAP attribute names and their description for the group list
*
* @return array list of LDAP attributes and descriptions
*/
function attributeGroupArray() {
return $this->ldapGroupAttributes;
}
/**
* Returns the LDAP attribute names and their description for the host list
*
* @return array list of LDAP attributes and descriptions
*/
function attributeHostArray() {
return $this->ldapHostAttributes;
}
/**
* Helper function to sort the unit DNs

View File

@ -76,7 +76,7 @@ function listSort($sort, $attr_array, $info) {
/**
* @brief draws a navigation bar to switch between pages
* Draws a navigation bar to switch between pages
*
* @param integer $count number of account entries
* @param integer $max_page_entries maximum number of account per page
@ -125,5 +125,57 @@ function listDrawNavigationBar($count, $max_page_entries, $page, $sort, $searchF
}
/**
* Returns the LDAP attribute names and their description for the user list
*
* @return array list of LDAP attributes and descriptions
*/
function listGetAttributeUserArray() {
return array (
"uid" => _("User ID"),
"uidnumber" => _("UID number"),
"gidnumber" => _("GID number"),
"cn" => _("Username"),
"host" => _("Allowed hosts"),
"givenname" => _("First name"),
"sn" => _("Last name"),
"homedirectory" => _("Home directory"),
"loginshell" => _("Login shell"),
"mail" => _("E-Mail"),
"gecos" => _("Description")
);
}
/**
* Returns the LDAP attribute names and their description for the group list
*
* @return array list of LDAP attributes and descriptions
*/
function listGetAttributeGroupArray() {
return array (
"cn" => _("Group name"),
"gidnumber" => _("GID number"),
"memberuid" => _("Group members"),
"member" => _("Group member DNs"),
"description" => _("Group description")
);
}
/**
* Returns the LDAP attribute names and their description for the host list
*
* @return array list of LDAP attributes and descriptions
*/
function listGetAttributeHostArray() {
return array (
"uid" => _("Host username"),
"cn" => _("Host name"),
"rid" => _("RID (Windows UID)"),
"description" => _("Host description"),
"uidnumber" => _("UID number"),
"gidnumber" => _("GID number")
);
}
?>

View File

@ -19,12 +19,24 @@ $Id$
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
This code displays a list of all Samba domains.
*/
/**
* This page displays a list of all Samba domains.
*
* @package lists
* @author Roland Gruber
*/
/** Access to configuration options */
include_once("../../lib/config.inc");
/** Access to LDAP connection */
include_once("../../lib/ldap.inc");
/** Used to print status messages */
include_once("../../lib/status.inc");
/** Basic list functions */
include_once("../../lib/lists.inc");
// start session

View File

@ -19,15 +19,28 @@ $Id$
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
This code displays a list of all groups.
*/
/**
* This page displays a list of all groups.
*
* @package lists
* @author Roland Gruber
*/
/** Access to configuration options */
include_once ("../../lib/config.inc");
/** Access to LDAP connection */
include_once ("../../lib/ldap.inc");
/** Used to print status messages */
include_once ("../../lib/status.inc");
include_once("../../lib/account.inc");
/** Used to create PDF files */
include_once("../../lib/pdf.inc");
/** Access to account modules */
include_once("../../lib/modules.inc");
/** Basic list functions */
include_once("../../lib/lists.inc");
// start session
@ -104,7 +117,7 @@ $attr_array = array(); // list of LDAP attributes to show
$desc_array = array(); // list of descriptions for the attributes
$attr_string = $_SESSION["config"]->get_grouplistAttributes();
$temp_array = explode(";", $attr_string);
$hash_table = $_SESSION["ldap"]->attributeGroupArray();
$hash_table = listGetAttributeGroupArray();
// get current page
$page = $_GET["page"];

View File

@ -19,15 +19,28 @@ $Id$
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
This code displays a list of all Samba hosts.
*/
/**
* This page displays a list of all hosts.
*
* @package lists
* @author Roland Gruber
*/
/** Access to configuration options */
include_once ("../../lib/config.inc");
/** Access to LDAP connection */
include_once ("../../lib/ldap.inc");
/** Used to print status messages */
include_once ("../../lib/status.inc");
include_once("../../lib/account.inc");
/** Used to create PDF files */
include_once("../../lib/pdf.inc");
/** Access to account modules */
include_once("../../lib/modules.inc");
/** Basic list functions */
include_once("../../lib/lists.inc");
// start session
@ -100,7 +113,7 @@ $attr_array = array(); // list of LDAP attributes to show
$desc_array = array(); // list of descriptions for the attributes
$attr_string = $_SESSION["config"]->get_hostlistAttributes();
$temp_array = explode(";", $attr_string);
$hash_table = $_SESSION["ldap"]->attributeHostArray();
$hash_table = listGetAttributeHostArray();
// get current page
$page = $_GET["page"];

View File

@ -22,15 +22,28 @@ $Id$
*/
/**
* This page displays a list of all users.
*
* @package lists
* @author Roland Gruber
*/
/** Access to configuration options */
include_once ("../../lib/config.inc");
include_once("../../lib/ldap.inc");
/** Access to LDAP connection */
include_once ("../../lib/ldap.inc");
/** Used to print status messages */
include_once ("../../lib/status.inc");
/** Used to create PDF files */
include_once("../../lib/pdf.inc");
include_once("../../lib/account.inc");
/** Access to account modules */
include_once("../../lib/modules.inc");
/** Basic list functions */
include_once("../../lib/lists.inc");
// used to display status messages
include_once ("../../lib/status.inc");
// start session
session_save_path("../../sess");
@ -138,7 +151,7 @@ $attr_array = array(); // list of LDAP attributes to show
$desc_array = array(); // list of descriptions for the attributes
$attr_string = $_SESSION["config"]->get_userlistAttributes();
$temp_array = explode(";", $attr_string);
$hash_table = $_SESSION["ldap"]->attributeUserArray();
$hash_table = listGetAttributeUserArray();
// generate column attributes and descriptions
for ($i = 0; $i < sizeof($temp_array); $i++) {