Project

General

Profile

« Previous | Next » 

Revision 1ab20834

Added by Scott Ullrich over 20 years ago

Do not define redeclare execute_command_return_output() in this file.
It has been moved to pfsense-utils.inc.

View differences:

usr/local/www/vpn_openvpn_create_certs.php
43 43
    return "File not found " . $filename;
44 44
}
45 45

  
46
function execute_command_return_output($command) {
47
    $fd = popen($command . " 2>&1 ", "r");
48
    echo "\n<script language=\"JavaScript\">this.document.forms[0].output.value = \"\";</script>";
49
    $counter = 0;
50
    $counter2 = 0;
51
    while(!feof($fd)) {
52
	$tmp = fread($fd,49);
53
	$tmp1 = ereg_replace("\n","\\n", $tmp);
54
	$text = ereg_replace("\"","'", $tmp1);
55
	if($lasttext == "..") {
56
	    $text = "";
57
	    $lasttext = "";
58
	    $counter=$counter-2;
59
	} else {
60
	    $lasttext .= $text;
61
	}
62
	if($counter > 51) {
63
	    $counter = 0;
64
	    $extrabreak = "\\n";
65
	} else {
66
	    $extrabreak = "";
67
	    $counter++;
68
	}
69
	if($counter2 > 600) {
70
	    echo "\n<script language=\"JavaScript\">this.document.forms[0].output.value = \"\";</script>";
71
	    $counter2 = 0;
72
	} else
73
	    $counter2++;
74
	echo "\n<script language=\"JavaScript\">this.document.forms[0].output.value = this.document.forms[0].output.value + \"" . $text . $extrabreak .  "\"; f('output'); </script>";
75
    }
76
    fclose($fd);
77
}
78

  
79 46
$fd = fopen("/etc/ssl/openssl.cnf", "r");
80 47
$openssl = fread($fd,8096);
81 48
fclose($fd);

Also available in: Unified diff