#!/usr/bin/perl
# ldapcache_ldif.cgi
# Ldif LDAP Cache Services 
# STTA Rev. 1.3 Copyright (c) 2001-2002 Jesús Pérez Lorenzo  --- license GNU GPL 

 require './stta-lib.pl';
&foreign_require("proc", "proc-lib.pl");
&headerstta($text{'index_ldapcacheldif'}, "", "ldapcacheldif",undef,1,1,$text{headpage_rigth} );
if ( $config{'is_ldapcache'} ne "true" ) { &footCacheHere; exit }

 print "<hr><p>\n"; 
 print "<table width=100% border>\n";
 print "<tr $tb> <td><b>$text{'titidx_ldapcacheldif'}</b></td> </tr>\n";
 print "<tr $cb> <td><table width=100%>\n";
	print "<hr>\n";
	print "<tr><td>\n";
        if ($config{'ldapcache_ldif_dir'}) {
              $ahora=`date +%Y_%m_%d_%H%M%S`;
              $namefile=$config{'ldapcache_ldif_dir'}."/".$ahora;
              $str=$config{'ldapcache_ldif'}." ".$namefile;
        } else {
              $str=$config{'ldapcache_ldif'};
        }
        $exec_str="ldapcache";
        $cmd_str="ldif";
        if (&run_cmd($str)) { 
            print "<tr><td><center><b>-- oOo --</b></center></td></tr>\n";
        } else {
            print "<tr><td><b>$text{'index_cmderr'}</b></td></tr>\n";
        }
 print "<tr>\n";
 print "<tr>\n";
 print "<tr>\n";
 print "</table></table><p>\n";
 &footer($text{'back_return'},$text{'index'});
 do "footer.pl";
 exit;


