Exemple #1
0
if ($argv[1] == '--mysqllist') {
    mysql_table_list();
    die;
}
if ($argv[1] == '--certificate-self') {
    CreateSelfSignedCertificate();
}
if ($argv[1] == '--certificate') {
    CreateCertificate();
}
if ($argv[1] == '--final-cert') {
    CreateFinalCertificate();
    exit;
}
if ($argv[1] == '--injection') {
    AutomaticInjection();
    exit;
}
if ($argv[1] == '--builddbinc') {
    builddbinc();
    exit;
}
function build_certificate($hostname)
{
    $unix = new unix();
    if ($GLOBALS["REBUILD"]) {
        if (is_file("{$GLOBALS["SSLKEY_PATH"]}/{$hostname}.crt")) {
            @unlink("{$GLOBALS["SSLKEY_PATH"]}/{$hostname}.crt");
        }
    }
    $sock = new sockets();
Exemple #2
0
include_once(dirname(__FILE__) . '/ressources/class.ldap.inc');
include_once(dirname(__FILE__) . '/ressources/class.computers.inc');
include_once(dirname(__FILE__) . '/ressources/class.ocs.inc');

if(is_array($argv)){if(preg_match("#--verbose#",implode(" ",$argv))){$GLOBALS["VERBOSE"]=true;}}
if(is_array($argv)){if(preg_match("#--rebuild#",implode(" ",$argv))){$GLOBALS["REBUILD"]=true;}}
if(is_array($argv)){if(preg_match("#--force#",implode(" ",$argv))){$GLOBALS["FORCE"]=true;}}
if($GLOBALS["VERBOSE"]){echo "Debug mode TRUE for {$argv[1]}\n";}


if($argv[1]=='--mysql'){mysqlCheck();die();}
if($argv[1]=='--mysqllist'){mysql_table_list();die();}
if($argv[1]=='--certificate-self'){CreateSelfSignedCertificate();}
if($argv[1]=='--certificate'){CreateCertificate();}
if($argv[1]=='--final-cert'){CreateFinalCertificate();exit;}
if($argv[1]=='--injection'){AutomaticInjection();exit;}


function build_certificate($hostname){
	$unix=new unix();
	if($GLOBALS["REBUILD"]){
		if(is_file("{$GLOBALS["SSLKEY_PATH"]}/$hostname.crt")){
			@unlink("{$GLOBALS["SSLKEY_PATH"]}/$hostname.crt");
		}
	}
	
	$sock=new sockets();
	$sock->SET_INFO("ApacheCertificatesLocations",$GLOBALS["SSLKEY_PATH"]);
	
	$unix->vhosts_BuildCertificate($hostname);