Core  3.2
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
freedom_import_dir.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @package FDL
5 */
6 /**
7  * Import directory with document descriptions
8  *
9  * @author Anakeen
10  * @version $Id: freedom_import_dir.php,v 1.5 2007/01/19 16:23:32 eric Exp $
11  * @package FDL
12  * @subpackage GED
13  */
14 /**
15  */
16 
17 include_once ("FDL/import_tar.php");
18 
20 {
21 
22  $to = GetHttpVars("to");
23  $filename = GetHttpVars("filename");
24 
25  $wsh = getWshCmd(true);
26 
27  global $_GET, $_POST;
28  $targs = array_merge($_GET, $_POST);
29  $args = "";
30  foreach ($targs as $k => $v) {
31  if ($k == "action" || $k == "app") {
32  continue;
33  }
34  $args.= " " . escapeshellarg("--$k=$v");
35  }
36 
37  $subject = sprintf(_("result of archive import %s") , $filename);
38 
39  $cmd[] = sprintf("%s --userid=%s --app=FREEDOM --action=FREEDOM_ANA_TAR --htmlmode=Y %s | ( %s --userid=%s --api=fdl_sendmail --subject=%s --htmlmode=Y --file=stdin --to=%s )", $wsh, escapeshellarg($action->user->id) , $args, $wsh, escapeshellarg($action->user->id) , escapeshellarg($subject) , escapeshellarg($to));
40 
41  bgexec($cmd, $result, $err);
42 
43  if ($err == 0) $action->lay->set("text", sprintf(_("Import %s is in progress. When update will be finished an email to &lt;%s&gt; will be sended with result rapport") , $filename, $to));
44  else $action->lay->set("text", sprintf(_("update of %s catalogue has failed,") , $filename));
45 }
if(substr($wsh, 0, 1)!= '/') $args
global $action
global $_POST
Definition: chgpasswd.php:17
$filename
$to
$subject
foreach($argv as $arg) $cmd
getWshCmd($nice=false, $userid=0, $sudo=false)
Definition: Lib.Common.php:594
global $_GET
Definition: wsh.php:37
bgexec($tcmd, &$result, &$err)
Definition: Lib.Common.php:621
if($file) if($subject==""&&$file) if($subject=="") $err
freedom_import_dir(Action &$action)
← centre documentaire © anakeen