added session_save_path()
print warning message if no objects were found
This commit is contained in:
parent
cc482441e7
commit
746df60e45
|
@ -24,6 +24,9 @@ $Id$
|
||||||
*/
|
*/
|
||||||
include_once ('../config/config.php');
|
include_once ('../config/config.php');
|
||||||
include_once("ldap.php");
|
include_once("ldap.php");
|
||||||
|
|
||||||
|
// start session
|
||||||
|
session_save_path("../sess");
|
||||||
@session_start();
|
@session_start();
|
||||||
|
|
||||||
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\" />";
|
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\" />";
|
||||||
|
@ -31,11 +34,14 @@ echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\" />
|
||||||
// Samba hosts have the attribute "sambaAccount" and end with "$"
|
// Samba hosts have the attribute "sambaAccount" and end with "$"
|
||||||
$filter = "(objectClass=posixGroup)";
|
$filter = "(objectClass=posixGroup)";
|
||||||
$attrs = array("cn", "gidNumber", "memberUID", "description");
|
$attrs = array("cn", "gidNumber", "memberUID", "description");
|
||||||
$sr = ldap_search($_SESSION["ldap"]->server(),
|
$sr = @ldap_search($_SESSION["ldap"]->server(),
|
||||||
$_SESSION["config"]->get_GroupSuffix(),
|
$_SESSION["config"]->get_GroupSuffix(),
|
||||||
$filter, $attrs);
|
$filter, $attrs);
|
||||||
|
if ($sr) {
|
||||||
$info = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
$info = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
||||||
ldap_free_result($sr);
|
ldap_free_result($sr);
|
||||||
|
}
|
||||||
|
else echo ("<br><br><font color=\"red\"><b>" . _("No Groups found!") . "</b></font><br><br>");
|
||||||
|
|
||||||
// print host table header
|
// print host table header
|
||||||
echo "<table width=\"100%\">\n";
|
echo "<table width=\"100%\">\n";
|
||||||
|
|
|
@ -24,6 +24,9 @@ $Id$
|
||||||
*/
|
*/
|
||||||
include_once ('../config/config.php');
|
include_once ('../config/config.php');
|
||||||
include_once("ldap.php");
|
include_once("ldap.php");
|
||||||
|
|
||||||
|
// start session
|
||||||
|
session_save_path("../sess");
|
||||||
@session_start();
|
@session_start();
|
||||||
|
|
||||||
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\" />";
|
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\" />";
|
||||||
|
@ -31,11 +34,14 @@ echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../style/layout.css\" />
|
||||||
// Samba hosts have the attribute "sambaAccount" and end with "$"
|
// Samba hosts have the attribute "sambaAccount" and end with "$"
|
||||||
$filter = "(&(objectClass=sambaAccount) (uid=*$))";
|
$filter = "(&(objectClass=sambaAccount) (uid=*$))";
|
||||||
$attrs = array("cn", "rid");
|
$attrs = array("cn", "rid");
|
||||||
$sr = ldap_search($_SESSION["ldap"]->server(),
|
$sr = @ldap_search($_SESSION["ldap"]->server(),
|
||||||
$_SESSION["config"]->get_HostSuffix(),
|
$_SESSION["config"]->get_HostSuffix(),
|
||||||
$filter, $attrs);
|
$filter, $attrs);
|
||||||
|
if ($sr) {
|
||||||
$info = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
$info = ldap_get_entries($_SESSION["ldap"]->server, $sr);
|
||||||
ldap_free_result($sr);
|
ldap_free_result($sr);
|
||||||
|
}
|
||||||
|
else echo ("<br><br><font color=\"red\"><b>" . _("No Samba Hosts found!") . "</b></font><br><br>");
|
||||||
|
|
||||||
// print host table
|
// print host table
|
||||||
echo "<table width=\"100%\">\n";
|
echo "<table width=\"100%\">\n";
|
||||||
|
|
Loading…
Reference in New Issue