diff --git a/html/getxls.php b/html/getxls.php
index 8b42c15baf35383fd7a9bbdc15b02e7ce149d199..de3607c82cc6fe4b4c7f874586080f4a314b5af3 100644 (file)
--- a/html/getxls.php
+++ b/html/getxls.php
{
global $config;
$ldap= $config->get_ldap_link();
{
global $config;
$ldap= $config->get_ldap_link();
- error_reporting (E_ALL & ~E_NOTICE);
-
$display = "";
$display = "";
+
+
if($mode == 2){ // Single Entry Export !
if($mode == 2){ // Single Entry Export !
+
+ /* Get required attributes */
$d = base64_decode($_GET['d']);
$n = base64_decode($_GET['n']);
$d = base64_decode($_GET['d']);
$n = base64_decode($_GET['n']);
+
+ /* Create dn to search entries in */
$dn=$d.$n;
$dn=$d.$n;
+
+ /* Create some strings */
$date=date('dS \of F Y ');
$fname = tempnam("/tmp", "demo.xls");
$date=date('dS \of F Y ');
$fname = tempnam("/tmp", "demo.xls");
- $workbook=& new writeexcel_workbook($fname);
- $title_title=& $workbook->addformat(array(
+ /* Create xls workbench */
+ $workbook= new writeexcel_workbook($fname);
+
+ /* Create some styles to generate xls */
+ $title_title= $workbook->addformat(array(
bold => 1,
color => 'green',
size => 11,
bold => 1,
color => 'green',
size => 11,
font => 'Helvetica'
));
font => 'Helvetica'
));
- $title_bold=& $workbook->addformat(array(
+ $title_bold= $workbook->addformat(array(
bold => 1,
color => 'black',
size => 10,
font => 'Helvetica'
));
bold => 1,
color => 'black',
size => 10,
font => 'Helvetica'
));
- # Create a format for the phone numbers
- $f_phone =& $workbook->addformat();
- $f_phone->set_align('left');
- $f_phone->set_num_format('\0#');
+ # Create a format for the phone numbers
+ $f_phone = $workbook->addformat();
+ $f_phone->set_align('left');
+ $f_phone->set_num_format('\0#');
+
+
+ /* If the switch reaches default (it should not),
+ this will be set to false, so nothig will be created ... */
+ $save = true;
+ /* Check which type of data was requested */
switch ($d){
switch ($d){
- case "ou=people," :
- $user= $ldap->gen_xls($dn,"(objectClass=*)",array("uid","dateOfBirth","gender","givenName","preferredLanguage"));
- $intitul=array(_("Birthday").":", _("Sex").":", _("Surname")."/"._("Given Name").":",_("Language").":");
-
- //name of the xls file
- $name_section=_("Users");
-
- $worksheet=& $workbook->addworksheet(_("Users"));
- $worksheet->set_column('A:B', 51);
-
- $user_nbr=count($user);
- $worksheet->write('A1',_("User List of ").$n._(" on ").$date,$title_title);
- $r=3;
- for($i=1;$i<$user_nbr;$i++)
- {
- if($i>1)
- $worksheet->write('A'.$r++,"");
- $worksheet->write('A'.$r++,_("User ID").": ".$user[$i][0],$title_bold);
- for($j=1;$j<5;$j++)
- {
- $r++;
- $worksheet->write('A'.$r,$intitul[$j-1]);
- $user[$i][$j]=utf8_decode ($user[$i][$j]);
- $worksheet->write('B'.$r,$user[$i][$j]);
- }
- $worksheet->write('A'.$r++,"");
- }
- break;
- case "ou=groups,": $groups= $ldap->gen_xls($dn,"(objectClass=*)",array("cn","memberUid"),TRUE,1);
- $intitul=array(_("Members").":");
+ /* PEOPLE
+ Get all peoples from this $dn
+ and put them into the xls work sheet */
+ case "ou=people," :
- //name of the xls file
- $name_section=_("Groups");
+ $user = $ldap->gen_xls($dn,"(objectClass=*)",array("uid","dateOfBirth","gender","givenName","preferredLanguage"));
+ $intitul = array(_("Birthday").":", _("Sex").":", _("Surname")."/"._("Given name").":",_("Language").":");
- $worksheet =& $workbook->addworksheet(_("Groups"));
- $worksheet->set_column('A:B', 51);
+ // name of the xls file
+ $name_section = _("Users");
+ $worksheet = $workbook->addworksheet(_("Users"));
+ $worksheet->set_column('A:B', 51);
- //count number of groups
- $groups_nbr=count($groups);
- $worksheet->write('A1',_("Groups of ").$n._(" on ").$date,$title_title);
- $r=3;
- for($i=1;$i<$groups_nbr;$i++)
- {
- $worksheet->write('A'.$r++,_("User ID").": ".$groups[$i][0][0],$title_bold);
- for($j=1;$j<=2;$j++)
+ $user_nbr = count($user);
+ $worksheet->write('A1',sprintf(_("User list of %s on %s"),$n,$date),$title_title);
+ $r=3;
+ for($i=1;$i<$user_nbr;$i++)
{
{
- $r++;
- $worksheet->write('A'.$r,$intitul[$j-1]);
- for($k=0;$k<= $groups[$i][$j]['count'];$k++)
+ if($i>1)
+ $worksheet->write('A'.$r++,"");
+ $worksheet->write('A'.$r++,_("User ID").": ".$user[$i][0],$title_bold);
+
+ for($j=1;$j<5;$j++)
{
{
- $worksheet->write('B'.$r,$groups[$i][$j][$k]);
$r++;
$r++;
+ $worksheet->write('A'.$r,$intitul[$j-1]);
+ $user[$i][$j]=utf8_decode ($user[$i][$j]);
+ $worksheet->write('B'.$r,$user[$i][$j]);
}
}
- }
- }
- break;
-
- case "ou=computers,": $computers= $ldap->gen_xls($dn,"(objectClass=*)",array("cn","description","uid"));
- $intitul=array(_("Description").":",_("User ID").":");
- $worksheet =& $workbook->addworksheet(_("Computers"));
- $worksheet->set_column('A:B', 32);
- //count number of computers
- $computers_nbr=count($computers);
- $r=1;
- for($i=1;$i<$computers_nbr;$i++)
- {
- if($i>1)
$worksheet->write('A'.$r++,"");
$worksheet->write('A'.$r++,"");
- $worksheet->write('A'.$r++,_("Common Name").": ".$computers[$i][0],$title_bold);
- for($j=1;$j<3;$j++)
- {
- $r++;
- $worksheet->write('A'.$r,$intitul[$j-1]);
- $computers[$i][$j]=utf8_decode ($computers[$i][$j]);
- $worksheet->write('B'.$r,$computers[$i][$j]);
}
}
- $worksheet->write('A'.$r++,"");
- }
break;
break;
- case "ou=servers,ou=systems,": $servers= $ldap->gen_xls($dn,"(objectClass=*)",array("cn"));
- $intitul=array(_("Server Name").":");
-
- //name of the xls file
- $name_section=_("Servers");
- $worksheet =& $workbook->addworksheet(_("Servers"));
- $worksheet->set_column('A:B', 51);
-
- //count number of servers
- $servers_nbr=count($servers);
- $worksheet->write('A1',_("Servers of ").$n._(" on ").$date,$title_title);
- $r=3;
- $worksheet->write('A'.$r++,_("Servers").": ",$title_bold);
- for($i=1;$i<$servers_nbr;$i++)
- {
- for($j=0;$j<1;$j++)
- {
- $r++;
- $worksheet->write('A'.$r,$intitul[$j]);
- $servers[$i][$j]=utf8_decode ($servers[$i][$j]);
- $worksheet->write('B'.$r,$servers[$i][$j]);
- }
- }
- break;
+ /* GROUPS
+ Get all groups from th $dn
+ and put them into the xls work sheet */
+ case "ou=groups,":
- case "dc=addressbook,": //data about addressbook
- $address= $ldap->gen_xls($dn,"(objectClass=*)",array("cn","displayName","facsimileTelephoneNumber","givenName","homePhone","homePostalAddress","initials","l","mail","mobile","o","ou","pager","telephoneNumber","postalAddress","postalCode","sn","st","title"));
+ /* Get group data */
+ $groups = $ldap->gen_xls($dn,"(objectClass=*)",array("cn","memberUid"),TRUE,1);
+ $intitul = array(_("Members").":");
- $intitul=array(_("Common name").":",_("Display Name").":",_("Fax").":",_("Name")."/"._("Given Name").":",_("Home phone").":",_("Home postal address").":",_("Initials").":",_("Location").":",_("Mail address").":",_("Mobile phone").":",_("City").":",_("Postal address").":",_("Pager").":",_("Phone number").":",_("Adress").":",_("Postal code").":",_("Surname").":",_("State").":",_("Function").":");
-
- //name of the xls file
- $name_section=_("Adressbook");
+ //name of the xls file
+ $name_section=_("Groups");
- $worksheet =& $workbook->addworksheet(_("Servers"));
- $worksheet->set_column('A:B', 51);
+ $worksheet = $workbook->addworksheet(_("Groups"));
+ $worksheet->set_column('A:B', 51);
- //count number of entries
- $address_nbr=count($address);
- $worksheet->write('A1',_("Adressbook of ").$n._(" on ").$date,$title_title);
- $r=3;
- for($i=1;$i<$address_nbr;$i++)
- {
- if($i>1)
- $worksheet->write('A'.$r++,"");
- $worksheet->write('A'.$r++,_("Common Name").": ".$address[$i][0],$title_bold);
- for($j=1;$j<19;$j++)
+ //count number of groups
+ $groups_nbr=count($groups);
+ $worksheet->write('A1', sprintf(_("Groups of %s on %s"), $n, $date),$title_title);
+ $r=3;
+ for($i=1;$i<$groups_nbr;$i++)
{
{
- $r++;
- $worksheet->write('A'.$r,$intitul[$j]);
- $address[$i][$j]=utf8_decode ($address[$i][$j]);
- $worksheet->write('B'.$r,$address[$i][$j],$f_phone);
+ $worksheet->write('A'.$r++,_("User ID").": ".$groups[$i][0][0],$title_bold);
+ for($j=1;$j<=2;$j++)
+ {
+ $r++;
+ $worksheet->write('A'.$r,$intitul[$j-1]);
+ for($k=0;$k<= $groups[$i][$j]['count'];$k++)
+ {
+ $worksheet->write('B'.$r,$groups[$i][$j][$k]);
+ $r++;
+ }
+ }
}
}
- $worksheet->write('A'.$r++,"");
- }
-
- break;
-
- default: echo "error!!";
- }
-
- $workbook->close();
-
-
- // We'll be outputting a xls
- header('Content-type: application/x-msexcel');
-
- // It will be called demo.xls
- header('Content-Disposition: attachment; filename='.$name_section.".xls");
-
- // The source is in original.xls
- readfile($fname);
- unlink ($fname);
+ break;
+
+
+ /* SYSTEMS
+ Get all systems from th $dn
+ and put them into the xls work sheet */
+ case "ou=systems,":
+
+ $name_section=_("Servers");
+ $computers= $ldap->gen_xls($dn,"(&(objectClass=*)(cn=*))",array("cn","description","uid"));
+
+ $intitul=array(_("Description").":",_("User ID").":");
+ $worksheet = $workbook->addworksheet(_("Computers"));
+ $worksheet->set_column('A:B', 32);
+
+ //count number of computers
+ $computers_nbr=count($computers);
+ $r=1;
+ for($i=1;$i<$computers_nbr;$i++)
+ {
+ if($i>1)
+ $worksheet->write('A'.$r++,"");
+ $worksheet->write('A'.$r++,_("Common name").": ".$computers[$i][0],$title_bold);
+ for($j=1;$j<3;$j++)
+ {
+ $r++;
+ $worksheet->write('A'.$r,$intitul[$j-1]);
+ $computers[$i][$j]=utf8_decode ($computers[$i][$j]);
+ $worksheet->write('B'.$r,$computers[$i][$j]);
+ }
+ $worksheet->write('A'.$r++,"");
+ }
+ break;
+
+ /* SYSTEMS
+ Get all systems from th $dn
+ and put them into the xls work sheet */
+ case "ou=servers,ou=systems,": $servers= $ldap->gen_xls($dn,"(objectClass=*)",array("cn"));
+ $intitul=array(_("Server name").":");
+
+ //name of the xls file
+ $name_section=_("Servers");
+
+ $worksheet = $workbook->addworksheet(_("Servers"));
+ $worksheet->set_column('A:B', 51);
+
+ //count number of servers
+ $servers_nbr=count($servers);
+ $worksheet->write('A1',sprintf(_("Servers of %s on %s"), $n, $date),$title_title);
+ $r=3;
+ $worksheet->write('A'.$r++,_("Servers").": ",$title_bold);
+ for($i=1;$i<$servers_nbr;$i++)
+ {
+ for($j=0;$j<1;$j++)
+ {
+ $r++;
+ $worksheet->write('A'.$r,$intitul[$j]);
+ $servers[$i][$j]=utf8_decode ($servers[$i][$j]);
+ $worksheet->write('B'.$r,$servers[$i][$j]);
+ }
+ }
+ break;
+
+ case "dc=addressbook,": //data about addressbook
+
+ /* ADDRESSBOOK
+ Get all addressbook entries from $dn
+ and put them into the xls work sheet */
+
+ $address= $ldap->gen_xls($dn,"(objectClass=*)",
+ array("cn","displayName","facsimileTelephoneNumber","givenName",
+ "homePhone","homePostalAddress","initials","l","mail","mobile",
+ "o","ou","pager","telephoneNumber","postalAddress",
+ "postalCode","sn","st","title"));
+
+ $intitul= array(_("Common name").":",_("Display name").":",_("Fax").":",
+ _("Name")."/"._("Given name").":",_("Home phone").":",
+ _("Home postal address").":",_("Initials").":",_("Location").":",
+ _("Mail address").":",_("Mobile phone").":",_("City").":",
+ _("Postal address").":",_("Pager").":",_("Phone number").":",
+ _("Address").":",_("Postal code").":",_("Surname").":",
+ _("State").":",_("Function").":");
+
+ //name of the xls file
+ $name_section=_("Adressbook");
+
+ $worksheet = $workbook->addworksheet(_("Servers"));
+ $worksheet->set_column('A:B', 51);
+
+ //count number of entries
+ $address_nbr=count($address);
+ $worksheet->write('A1',sprintf(_("Adressbook of %s on %s"),$n, $date),$title_title);
+ $r=3;
+ for($i=1;$i<$address_nbr;$i++)
+ {
+ if($i>1)
+ $worksheet->write('A'.$r++,"");
+ $worksheet->write('A'.$r++,_("Common Name").": ".$address[$i][0],$title_bold);
+ for($j=1;$j<19;$j++)
+ {
+ $r++;
+ $worksheet->write('A'.$r,$intitul[$j]);
+ $address[$i][$j]=utf8_decode ($address[$i][$j]);
+ $worksheet->write('B'.$r,$address[$i][$j],$f_phone);
+ }
+ $worksheet->write('A'.$r++,"");
+ }
+
+ break;
+ default:
+
+ $save = false;
+ echo "Specified parameter '".$d."' was not found in switch-case.";
+ }
+
+ if($save){
+ $workbook->close();
+ }
+
+ // We'll be outputting a xls
+ header('Content-type: application/x-msexcel');
+
+ // It will be called demo.xls
+ header('Content-Disposition: attachment; filename=xls_export_'.$name_section.".xls");
+
+ // The source is in original.xls
+ readfile($fname);
+ unlink ($fname);
}
elseif($mode == 3){ // Full Export !
$dn = base64_decode($_GET['dn']);
//data about users
$user= $ldap->gen_xls("ou=people,".$dn,"(objectClass=*)",array("uid","dateOfBirth","gender","givenName","preferredLanguage"));
}
elseif($mode == 3){ // Full Export !
$dn = base64_decode($_GET['dn']);
//data about users
$user= $ldap->gen_xls("ou=people,".$dn,"(objectClass=*)",array("uid","dateOfBirth","gender","givenName","preferredLanguage"));
- $user_intitul=array(_("BirthDate").":",_("Sex").":",_("Surname")."/"._("Given Name").":",_("Language").":");
+ $user_intitul=array(_("Day of birth").":",_("Sex").":",_("Surname")."/"._("Given name").":",_("Language").":");
//data about groups
$groups= $ldap->gen_xls("ou=groups,".$dn,"(objectClass=*)",array("cn","memberUid"),TRUE,1);
$groups_intitul=array(_("Members").":");
//data about computers
$computers= $ldap->gen_xls("ou=computers,".$dn,"(objectClass=*)",array("cn","description","uid"));
//data about groups
$groups= $ldap->gen_xls("ou=groups,".$dn,"(objectClass=*)",array("cn","memberUid"),TRUE,1);
$groups_intitul=array(_("Members").":");
//data about computers
$computers= $ldap->gen_xls("ou=computers,".$dn,"(objectClass=*)",array("cn","description","uid"));
- $computers_intitul=array(_("Description").":",_("Uid").":");
+ $computers_intitul=array(_("Description").":",_("UID").":");
//data about servers
$servers= $ldap->gen_xls("ou=servers,ou=systems,".$dn,"(objectClass=*)",array("cn"));
$servers_intitul=array(_("Name").":");
//data about addressbook
//data about servers
$servers= $ldap->gen_xls("ou=servers,ou=systems,".$dn,"(objectClass=*)",array("cn"));
$servers_intitul=array(_("Name").":");
//data about addressbook
- $address= $ldap->gen_xls("dc=addressbook,".$dn,"(objectClass=*)",array("cn","displayName","facsimileTelephoneNumber","givenName","homePhone","homePostalAddress","initials","l","mail","mobile","o","ou","pager","telephoneNumber","postalAddress","postalCode","sn","st","title"));
- $address_intitul=array("cn",_("DisplayName").":",_("Fax").":",_("Surname")."/"._("Given Name").":",_("Phone Number").":",_("Postal Adress").":",_("Initials").":",_("City").":",_("Email address").":",_("mobile").":",_("Organization").":",_("Organizational Unit").":",_("Pager").":",_("Phone Number").":",_("Postal Address").":",_("Postal Code").":",_("Sn").":",_("st").":",_("Title").":");
+ $address= $ldap->gen_xls("dc=addressbook,".$dn,"(objectClass=*)",
+ array("cn","displayName","facsimileTelephoneNumber","givenName","homePhone","homePostalAddress",
+ "initials","l","mail","mobile","o","ou","pager","telephoneNumber","postalAddress",
+ "postalCode","sn","st","title"));
+ $address_intitul=
+ array("cn",_("Display name").":",_("Fax").":",_("Surname")."/"._("Given name").":",
+ _("Phone number").":",_("Postal address").":",_("Initials").":",_("City").":",
+ _("Email address").":",_("Mobile").":",_("Organization").":",_("Organizational unit").":",
+ _("Pager").":",_("Phone number").":",_("Postal address").":",_("Postal Code").":",
+ _("Surename").":",_("State").":",_("Title").":");
//name of the xls file
$name_section=_("Full");
$date=date('dS \of F Y ');
$fname = tempnam("/tmp", "demo.xls");
//name of the xls file
$name_section=_("Full");
$date=date('dS \of F Y ');
$fname = tempnam("/tmp", "demo.xls");
- $workbook =& new writeexcel_workbook($fname);
- $worksheet =& $workbook->addworksheet(_("Users"));
- $worksheet2 =& $workbook->addworksheet(_("Groups"));
- $worksheet3 =& $workbook->addworksheet(_("Servers"));
- $worksheet4 =& $workbook->addworksheet(_("Computers"));
- $worksheet5 =& $workbook->addworksheet(_("Adressbook"));
+ $workbook = new writeexcel_workbook($fname);
+ $worksheet = $workbook->addworksheet(_("Users"));
+ $worksheet2 = $workbook->addworksheet(_("Groups"));
+ $worksheet3 = $workbook->addworksheet(_("Servers"));
+ $worksheet4 =$workbook->addworksheet(_("Computers"));
+ $worksheet5 = $workbook->addworksheet(_("Adressbook"));
$worksheet->set_column('A:B', 51);
$worksheet2->set_column('A:B', 51);
$worksheet->set_column('A:B', 51);
$worksheet2->set_column('A:B', 51);
$worksheet4->set_column('A:B', 51);
$worksheet5->set_column('A:B', 51);
$worksheet4->set_column('A:B', 51);
$worksheet5->set_column('A:B', 51);
- $title_title=& $workbook->addformat(array(
+ $title_title= $workbook->addformat(array(
bold => 1,
color => 'green',
size => 11,
font => 'Helvetica'
));
bold => 1,
color => 'green',
size => 11,
font => 'Helvetica'
));
- $title_bold =& $workbook->addformat(array(
+ $title_bold = $workbook->addformat(array(
bold => 1,
color => 'black',
size => 10,
font => 'Helvetica'
));
bold => 1,
color => 'black',
size => 10,
font => 'Helvetica'
));
- # Create a format for the phone numbers
- $f_phone =& $workbook->addformat();
- $f_phone->set_align('left');
- $f_phone->set_num_format('\0#');
+# Create a format for the phone numbers
+ $f_phone = $workbook->addformat();
+ $f_phone->set_align('left');
+ $f_phone->set_num_format('\0#');
//count number of users
$user_nbr=count($user);
//count number of users
$user_nbr=count($user);
- $worksheet->write('A1',_("User List of ").$dn._(" on ").$date,$title_title);
+ $worksheet->write('A1',sprintf(_("User List of %s on %s"), $dn, $date),$title_title);
$r=3;
for($i=1;$i<$user_nbr;$i++)
{
$r=3;
for($i=1;$i<$user_nbr;$i++)
{
//count number of groups
$groups_nbr=count($groups);
//count number of groups
$groups_nbr=count($groups);
- $worksheet2->write('A1',_("Groups of ").$dn._(" on ").$date,$title_title);
+ $worksheet2->write('A1',sprintf(_("Groups of %s on %s"), $dn, $date),$title_title);
$r=3;
for($i=1;$i<$groups_nbr;$i++)
{
$r=3;
for($i=1;$i<$groups_nbr;$i++)
{
//count number of servers
$servers_nbr=count($servers);
//count number of servers
$servers_nbr=count($servers);
- $worksheet3->write('A1',_("Servers of ").$dn._(" on ").$date,$title_title);
+ $worksheet3->write('A1',sprintf(_("Servers of %s on %s"),$dn,$date),$title_title);
$r=3;
$worksheet3->write('A'.$r++,_("Servers").": ",$title_bold);
for($i=1;$i<$servers_nbr;$i++)
$r=3;
$worksheet3->write('A'.$r++,_("Servers").": ",$title_bold);
for($i=1;$i<$servers_nbr;$i++)
//count number of computers
$computers_nbr=count($computers);
//count number of computers
$computers_nbr=count($computers);
- $worksheet4->write('A1',_("Computers of ").$dn._(" on ").$date,$title_title);
+ $worksheet4->write('A1',sprintf(_("Computers of %s on %s"),$dn,$date),$title_title);
$r=3;
for($i=1;$i<$computers_nbr;$i++)
{
if($i>1)
$worksheet->write('A'.$r++,"");
$r=3;
for($i=1;$i<$computers_nbr;$i++)
{
if($i>1)
$worksheet->write('A'.$r++,"");
- $worksheet4->write('A'.$r++,_("Common Name").": ".$computers[$i][0],$title_bold);
+ $worksheet4->write('A'.$r++,_("Common name").": ".$computers[$i][0],$title_bold);
for($j=1;$j<3;$j++)
{
$r++;
for($j=1;$j<3;$j++)
{
$r++;
//count number of entries
$address_nbr=count($address);
//count number of entries
$address_nbr=count($address);
- $worksheet5->write('A1',_("Adressbook of ").$dn._(" on ").$date,$title_title);
+ $worksheet5->write('A1',sprintf(_("Adressbook of %s on %s"),$dn, $date),$title_title);
$r=3;
for($i=1;$i<$address_nbr;$i++)
{
if($i>1)
$worksheet5->write('A'.$r++,"");
$r=3;
for($i=1;$i<$address_nbr;$i++)
{
if($i>1)
$worksheet5->write('A'.$r++,"");
- $worksheet5->write('A'.$r++,_("Common Name").": ".$address[$i][0],$title_bold);
+ $worksheet5->write('A'.$r++,_("Common name").": ".$address[$i][0],$title_bold);
for($j=1;$j<19;$j++)
{
$r++;
for($j=1;$j<19;$j++)
{
$r++;
}
elseif($mode == 4){ // IVBB LDIF Export
$dn = base64_decode($_GET['dn']);
}
elseif($mode == 4){ // IVBB LDIF Export
$dn = base64_decode($_GET['dn']);
- /*$display= $ldap->gen_ldif($dn,"(objectClass=ivbbEntry)",array(
+ /*$display= $ldap->gen_ldif($dn,"(objectClass=ivbbentry)",array(
"GouvernmentOrganizationalUnit","houseIdentifier","vocation",
"ivbbLastDeliveryCollective","gouvernmentOrganizationalPersonLocality",
"gouvernmentOrganizationalUnitDescription","gouvernmentOrganizationalUnitSubjectArea",
"GouvernmentOrganizationalUnit","houseIdentifier","vocation",
"ivbbLastDeliveryCollective","gouvernmentOrganizationalPersonLocality",
"gouvernmentOrganizationalUnitDescription","gouvernmentOrganizationalUnitSubjectArea",
/* Basic setup, remove eventually registered sessions */
@require_once ("../include/php_setup.inc");
@require_once ("functions.inc");
/* Basic setup, remove eventually registered sessions */
@require_once ("../include/php_setup.inc");
@require_once ("functions.inc");
-error_reporting (E_ALL);
session_start ();
/* Logged in? Simple security check */
if (!isset($_SESSION['ui'])){
session_start ();
/* Logged in? Simple security check */
if (!isset($_SESSION['ui'])){
- gosa_log ("Error: getldif.php called without session");
- header ("Location: ../index.php");
+ new log("security","all/all","",array(),"Error: getxls.php called without session") ;
+ header ("Location: index.php");
exit;
}
exit;
}
-$ui= $_SESSION["ui"];
-$config= $_SESSION['config'];
+$ui = $_SESSION["ui"];
+$config = $_SESSION['config'];
+
+
+/* Check ACL's */
+$dn ="";
+if(isset($_GET['n'])){
+ $dn = base64_decode($_GET['n']);
+}elseif(isset($_GET['dn'])){
+ $dn = base64_decode($_GET['dn']);
+}
+$acl = $ui->get_permissions($dn,"ldapmanager/xlsexport");
+if(!preg_match("/r/",$acl)){
+ echo "insufficient permissions";
+ exit();
+}
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
header("Content-type: text/plain");
header("Content-type: text/plain");
-/* Check ACL's */
-$acl= get_permissions ($config->current['BASE'], $ui->subtreeACL);
-$acl= get_module_permission($acl, "all", $config->current['BASE']);
-if (chkacl($acl, "all") != ""){
- header ("Location: ../index.php");
- exit;
-}
-
switch ($_GET['ivbb']){
case 2: dump_ldap (2);
break;
switch ($_GET['ivbb']){
case 2: dump_ldap (2);
break;