本文整理汇总了PHP中LOCATE_PHP5_BIN2函数的典型用法代码示例。如果您正苦于以下问题:PHP LOCATE_PHP5_BIN2函数的具体用法?PHP LOCATE_PHP5_BIN2怎么用?PHP LOCATE_PHP5_BIN2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOCATE_PHP5_BIN2函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: schedules
function schedules()
{
@unlink("/etc/cron.d/apt-mirror");
$php = LOCATE_PHP5_BIN2();
$file = __FILE__;
$sock = new sockets();
shell_exec("/bin/rm -f /etc/cron.d/apt-mirror-* >/dev/null 2>&1");
$config = unserialize(base64_decode($sock->GET_INFO("AptMirrorConfigSchedule")));
if (!is_array($config)) {
return;
}
$count = 0;
while (list($uid, $schedule) = each($config)) {
if (trim($schedule) == null) {
continue;
}
$f[] = "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/X11R6/bin:/usr/share/artica-postfix/bin";
$f[] = "MAILTO=\"\"";
$f[] = "{$schedule} root {$php} {$file} --perform >/dev/null 2>&1";
$f[] = "";
@file_put_contents("/etc/cron.d/apt-mirror-{$count}", @implode("\n", $f));
$count++;
unset($f);
}
shell_exec("/etc/init.d/cron reload");
}
示例2: status
function status()
{
$cmd = LOCATE_PHP5_BIN2() . " /usr/share/artica-postfix/exec.status.php --transmission-daemon --nowachdog";
exec($cmd, $results);
writelogs_framework($cmd . " ->" . count($results) . " lines", __FUNCTION__, __FILE__, __LINE__);
echo "<articadatascgi>" . base64_encode(implode("\n", $results)) . "</articadatascgi>";
}
示例3: schedules_mldonkey
function schedules_mldonkey(){
@unlink("/etc/artica-postfix/mldonkey.tasks");
$sql="SELECT * FROM mldonkey ORDER BY schedule_time DESC";
$q=new mysql();
$results=$q->QUERY_SQL($sql,"artica_backup");
while($ligne=mysql_fetch_array($results,MYSQL_ASSOC)){
$params=unserialize(base64_decode($ligne["parameters"]));
$params["hours"];
$params["minutes"];
if($params["minutes"]==null){$params["minutes"]="59";}
if($params["hours"]==null){$params["hours"]="0";}
$f[]="{$params["minutes"]} {$params["hours"]} * * * ".LOCATE_PHP5_BIN2()." ".dirname(__FILE__)."/exec.mldonkey.php --settings {$ligne["ID"]}";
}
if(is_array($f)){
@file_put_contents("/etc/artica-postfix/mldonkey.tasks",@implode("\n",$f));
}
}
示例4: Parseline
function Parseline($buffer){
$buffer=trim($buffer);
if($buffer==null){return null;}
if(strpos($buffer,"init urllist")>0){return ;}
if(strpos($buffer,"init expressionlist")>0){return ;}
if(strpos($buffer,"init domainlist")>0){return ;}
if(preg_match('#INFO: loading dbfile (.+)#',$buffer,$re)){
events("LOADING $re[1]");
$GLOBALS[__FILE__]["DBFILE"]=trim($re[1]);
return null;
}
if(preg_match("#FATAL: Error db_open: Unknown error#",$buffer,$re)){
events("ERROR ON {$GLOBALS[__FILE__]["DBFILE"]}");
$file="/etc/artica-postfix/croned.1/squidguard.". md5($GLOBALS[__FILE__]["DBFILE"]).".error";
if(IfFileTime($file)){
shell_exec(LOCATE_PHP5_BIN2()." /usr/share/artica-postfix/exec.squidguard.php --compile-single \"{$GLOBALS[__FILE__]["DBFILE"]}\" &");
WriteFileCache($file);
}
return null;
}
if(strpos($buffer,"ERROR: Going into emergency mode")>0){
events("ERROR: Going into emergency mode");
send_email_events("squidguard: squidguard turn to emergency mode","SquidGuard claim\n$buffer\nPlease contact your support to fix this problem\ncurrently, no filtering urls will be enabled","proxy");
return ;
}
events("Not filtered: $buffer");
}
示例5: array
$GLOBALS["bcc_maps"] = array();
$GLOBALS["transport_maps"] = array();
$GLOBALS["smtp_generic_maps"] = array();
if (!is_file($GLOBALS["postfix"])) {
die;
}
if (!Build_pid_func(__FILE__, $argv[1])) {
echo "Starting......: Already executed\n";
}
$ldap = new clladp();
if ($ldap->ldapFailed) {
echo "Starting......: failed connecting to ldap server {$ldap->ldap_host}\n";
die;
}
if ($GLOBALS["EnablePostfixMultiInstance"] == 1) {
system(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.postfix-multi.php");
die;
}
if ($argv[1] == "--postmaster") {
postmaster();
die;
}
if ($argv[1] == "--bcc") {
recipient_bcc_maps();
recipient_bcc_maps_build();
sender_bcc_maps();
sender_bcc_maps_build();
shell_exec("{$GLOBALS["postfix"]} reload >/dev/null 2>&1");
die;
}
if ($argv[1] == "--recipient-canonical") {
示例6: ParseResolvMX
function ParseResolvMX()
{
$sock = new sockets();
$WhiteListResolvMX = $sock->GET_INFO("WhiteListResolvMX");
if (!is_numeric($WhiteListResolvMX)) {
return null;
}
if ($WhiteListResolvMX == 0) {
return null;
}
if (!function_exists("getmxrr")) {
echo "getmxrr() no such function\n";
return;
}
$sql = "SELECT sender FROM postfix_global_whitelist WHERE enabled=1 ORDER BY sender";
if ($GLOBALS["VERBOSE"]) {
echo $sql . "\n";
}
$q = new mysql();
if (!$q->TestingConnection()) {
echo "ParseResolvMX()/" . basename(__FILE__) . " Connection to MySQL server failed...\n";
return;
}
$results = $q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
echo $q->mysql_error;
return;
}
$q = new mysql();
$sql = "SELECT * FROM postfix_whitelist_con";
$results = $q->QUERY_SQL($sql, "artica_backup");
if (!$q->ok) {
echo "{$q->mysql_error}\n";
}
while ($ligne = mysql_fetch_array($results, MYSQL_ASSOC)) {
$WHITELISTED[$ligne["ipaddr"]] = true;
$WHITELISTED[$ligne["hostname"]] = true;
}
$count_whitelisted_before = count($WHITELISTED);
while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
$domain = trim($ligne["sender"]);
if ($domain == null) {
continue;
}
if (preg_match("#@(.+)#", $domain, $re)) {
$domain = $re[1];
}
if (strpos($domain, "*") > 0) {
continue;
}
$array_mx = resolvMX($domain);
if (count($array_mx) == 0) {
continue;
}
echo "{$domain} = " . count($array_mx) . " mx\n";
while (list($ipaddr, $hostname) = each($array_mx)) {
$notif[] = "{$domain}: {$hostname} [{$ipaddr}]";
$WHITELISTED[$ipaddr] = $hostname;
}
}
$count_whitelisted_after = count($WHITELISTED);
$somme = $count_whitelisted_after - $count_whitelisted_before;
if ($somme == 0) {
echo "Nothing to do...\n";
return;
}
if ($somme > 0) {
if ($GLOBALS["VERBOSE"]) {
echo "{$somme} items added in array\n" . @implode("\n", $notif);
}
$unix = new unix();
$unix->send_email_events("{$somme} items MX has been whitelisted", @implode("\n", $notif), "postfix");
}
reset($WHITELISTED);
while (list($value, $hostname) = each($WHITELISTED)) {
if (trim($value) == null) {
continue;
}
$sql = "DELETE FROM iptables WHERE serverip='{$value}' AND local_port=25";
$q->QUERY_SQL($sql, "artica_backup");
$sql = "INSERT IGNORE INTO postfix_whitelist_con (ipaddr,hostname) VALUES('{$value}','{$hostname}')";
$q->QUERY_SQL($sql, "artica_backup");
}
$cmd = LOCATE_PHP5_BIN2() . " /usr/share/artica-postfix/exec.postfix.maincf.php --postscreen";
shell_exec($cmd);
}
示例7: reconfigure
function reconfigure(){
if($GLOBALS["VERBOSE"]){writelogs("starting reconfigure()",__FUNCTION__,__FILE__,__LINE__);}
$unix=new unix();
$sock=new sockets();
if($GLOBALS["VERBOSE"]){writelogs("->clladp()",__FUNCTION__,__FILE__,__LINE__);}
$ldap=new clladp();
$smbpasswd=$unix->find_program("smbpasswd");
if($GLOBALS["VERBOSE"]){writelogs("smbpasswd=$smbpasswd -->samba()",__FUNCTION__,__FILE__,__LINE__);}
$samba=new samba();
$net=$unix->LOCATE_NET_BIN_PATH();
$ldap_passwd=$ldap->ldap_password;
$EnableSambaActiveDirectory=$sock->GET_INFO("EnableSambaActiveDirectory");
$EnableSambaRemoteLDAP=$sock->GET_INFO("EnableSambaRemoteLDAP");
if($EnableSambaRemoteLDAP==1){
$SambaRemoteLDAPInfos=unserialize(base64_decode($sock->GET_INFO("SambaRemoteLDAPInfos")));
$ldap_passwd=$SambaRemoteLDAPInfos["user_dn_password"];
}
if($EnableSambaActiveDirectory==1){activedirectory();}
CheckFilesAndDirectories();
FixsambaDomainName();
echo "Starting......: Samba building main configuration...\n";
@file_put_contents("/etc/samba/smb.conf",$samba->BuildConfig());
shell_exec("$smbpasswd -w $ldap_passwd");
SambaAudit();
fixEtcHosts();
$master_password=$samba->GetAdminPassword("administrator");
$SambaEnableEditPosixExtension=$sock->GET_INFO("SambaEnableEditPosixExtension");
if($SambaEnableEditPosixExtension==1){
$cmd="$net idmap secret {$samba->main_array["global"]["workgroup"]} \"$ldap_passwd\" >/dev/null 2>&1 &";
shell_exec($cmd);
$cmd="$net idmap secret alloc \"$ldap_passwd\" >/dev/null 2>&1 &";
shell_exec($cmd);
}
if($EnableSambaActiveDirectory==1){kinit();}
$unix->THREAD_COMMAND_SET(LOCATE_PHP5_BIN2()." ".__FILE__." --check-dirs");
$unix->THREAD_COMMAND_SET("/usr/share/artica-postfix/bin/artica-install --samba-reconfigure");
reload();
}
示例8: _CheckSambaConfig
function _CheckSambaConfig()
{
if (!is_file("/etc/artica-postfix/settings/Daemons/SambaSMBConf")) {
@copy("/etc/samba/smb.conf", "/etc/artica-postfix/settings/Daemons/SambaSMBConf");
$EXEC_NICE = EXEC_NICE();
shell_exec("{$EXEC_NICE}" . LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.artica.meta.users.php --export-all-settings");
}
}
示例9: unix
$unix = new unix();
if ($GLOBALS["VERBOSE"]) {
echo " --> /etc/hosts {$ComputerRealName} -> {$ip}\n";
}
$unix->del_EtcHosts($ip);
$dns = new pdns($GLOBALS["domain"]);
writelogs("EditIPName -> ComputerRealName=`{$ComputerRealName}` {$ip} {$MAC}", __FUNCTION__, __FILE__, __LINE__);
if (trim($ComputerRealName) != null) {
$dns->EditIPName(strtolower($ComputerRealName), $ip, 'A', $MAC);
}
$GLOBALS["FIXIPHOST"] = true;
}
}
if ($GLOBALS["FIXIPHOST"]) {
writelogs("-> exec.samba.php --fix-etc-hosts", __FUNCTION__, __FILE__, __LINE__);
shell_exec(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.samba.php --fix-etc-hosts");
}
events("Set content cache has {$md5}", "main", __LINE__);
$sock->SET_INFO('DHCPLeaseMD5', $md5);
function events($text, $function, $line)
{
writelogs($text, $function, __FILE__, $line);
}
function Changed()
{
if (!is_file("/var/lib/dhcp3/dhcpd.leases")) {
if ($GLOBALS["VERBOSE"]) {
echo " --> unable to stat /var/lib/dhcp3/dhcpd.leases\n";
}
return false;
}
示例10: execute
function execute()
{
$nice = EXEC_NICE();
if (is_file(dirname(__FILE__) . "/exec.sarg.gilou.php")) {
events("Executing exec.sarg.gilou.php instead...");
shell_exec($nice . LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.sarg.gilou.php --exec");
return;
}
$sock = new sockets();
$SargOutputDir = $sock->GET_INFO("SargOutputDir");
if ($SargOutputDir == null) {
$SargOutputDir = "/var/www/html/squid-reports";
}
$nice = EXEC_NICE();
$unix = new unix();
$today = date("d/m/Y");
$sarg_bin = $unix->find_program("sarg");
if (!is_file($sarg_bin)) {
sarg_admin_events("Fatal, unable to locate sarg binary, aborting...", __FUNCTION__, __FILE__, __LINE__, "sarg");
return;
}
events("Building settings..");
buildconf();
$usersauth = false;
$squid = new squidbee();
if ($squid->LDAP_AUTH == 1) {
$usersauth = true;
}
if ($squid->LDAP_EXTERNAL_AUTH == 1) {
$usersauth = true;
}
if (!is_file("/etc/squid/exclude_codes")) {
@file_put_contents("/etc/squid/exclude_codes", "\nNONE/400\n");
}
@mkdir("{$SargOutputDir}", 0755, true);
$u = " -i ";
$cmd = "{$nice}{$sarg_bin} -d {$today}-{$today} {$u}-f /etc/squid3/sarg.conf -l /var/log/squid/access.log -o \"{$SargOutputDir}\" -x -z 2>&1";
$t1 = time();
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, {$cmd}\n";
sargevents("execute(): {$cmd}");
exec($cmd, $results);
while (list($index, $line) = each($results)) {
if (preg_match("#SARG: No records found#", $line)) {
events("No records found");
$subject_add = "(No records found)";
}
if (preg_match("#SARG:\\s+.+?mixed records format#", $line)) {
send_email_events("SARG: Error, squid was reloaded", "It seems that there is a mixed log file format detected in squid\n\t\t\tThis reason is Artica change squid log format from orginial to http access mode.\n\t\t\tIn this case, the log will be moved and squid will be reloaded \n\t\t\tin order to build a full log file with only one log format.\n\t\t\t\n" . @implode("\n", $results), "proxy");
shell_exec(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.squid.php --reconfigure");
shell_exec($unix->LOCATE_SQUID_BIN() . " -k rotate");
shell_exec("/etc/init.d/auth-tail restart >/dev/null 2>&1");
shell_exec("/etc/init.d/cache-tail restart >/dev/null 2>&1");
return;
}
if (preg_match("#SARG:\\s+.+?enregistrements de plusieurs formats#", $line)) {
send_email_events("SARG: Error, squid was reloaded", "It seems that there is a mixed log file format detected in squid\n\t\t\tThis reason is Artica change squid log format from orginial to http access mode.\n\t\t\tIn this case, the log will be moved and squid will be reloaded \n\t\t\tin order to build a full log file with only one log format.\n\t\t\t\n" . @implode("\n", $results), "proxy");
shell_exec(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.squid.php --reconfigure");
shell_exec($unix->LOCATE_SQUID_BIN() . " -k rotate");
shell_exec("/etc/init.d/auth-tail restart >/dev/null 2>&1");
shell_exec("/etc/init.d/cache-tail restart >/dev/null 2>&1");
return;
}
if (preg_match("#SARG.+?Unknown input log file format#", $line)) {
send_email_events("SARG: \"Unknown input log file format\", squid was reloaded", "It seems that there is a input log file format log file format detected in squid\n\t\t\tThis reason is Artica change squid log format from orginial to log_fqn on, this will be disabled\n\t\t\tIn this case, the log will be moved and squid will be reloaded \n\t\t\tin order to build a full log file with only one log format.\n\t\t\t\n" . @implode("\n", $results), "proxy");
shell_exec(LOCATE_PHP5_BIN2() . " " . dirname(__FILE__) . "/exec.squid.php --reconfigure");
shell_exec($unix->LOCATE_SQUID_BIN() . " -k rotate");
shell_exec("/etc/init.d/auth-tail restart >/dev/null 2>&1");
shell_exec("/etc/init.d/cache-tail restart >/dev/null 2>&1");
return;
}
}
$NICE = EXEC_NICE();
$unix = new unix();
$lighttpd_user = $unix->APACHE_SRC_ACCOUNT();
$php = $unix->LOCATE_PHP5_BIN();
$nohup = $unix->find_program("nohup");
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, lighttpd user: {$lighttpd_user}\n";
$chown = $unix->find_program("chown");
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]},{$chown} -R {$lighttpd_user}:{$lighttpd_user} {$SargOutputDir}/*\n";
exec("{$chown} -R {$lighttpd_user}:{$lighttpd_user} {$SargOutputDir}/* >/dev/null 2>&1", $results2);
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]},\n" . @implode("\n" . $results2) . "\n";
shell_exec("{$nohup} {$php} " . __FILE__ . " --backup >/dev/null 2>&1 &");
$t2 = time();
$distanceOfTimeInWords = distanceOfTimeInWords($t1, $t2);
echo "Starting......: " . date("H:i:s") . " [INIT]: {$GLOBALS["TITLENAME"]}, {$distanceOfTimeInWords}\n";
events("Statistics generated ({$distanceOfTimeInWords})");
if ($GLOBALS["VERBOSE"]) {
echo "SARG: Statistics generated ({$distanceOfTimeInWords})\n\n";
echo @implode("\n", $results) . "\n";
}
status(true);
sarg_admin_events("SARG: Statistics generated ({$distanceOfTimeInWords}) {$subject_add}", "Command line:\n-----------\n{$cmd}\n" . @implode("\n", $results), __FUNCTION__, __FILE__, __LINE__, "sarg");
}
示例11: NMAP_SCAN
function NMAP_SCAN($value)
{
$value = base64_decode($value);
$EXEC_NICE = EXEC_NICE();
$unix = new unix();
$tmpstr = $unix->FILE_TEMP();
@unlink("/usr/share/artica-postfix/ressources/logs/nmap.log");
$cmd = $EXEC_NICE . LOCATE_PHP5_BIN2() . " /usr/share/artica-postfix/exec.scan-networks.php >{$tmpstr} 2>&1";
events("running {$cmd}", __FUNCTION__, __FILE__, __LINE__);
$t1 = time();
shell_exec($cmd);
$t2 = time();
$time_duration = distanceOfTimeInWords($t1, $t2);
events("success executing exec.scan-networks.php ", __FUNCTION__, __FILE__, __LINE__);
send_email_events("success executing network scanning ({$time_duration})", @file_get_contents("/usr/share/artica-postfix/ressources/logs/nmap.log"), "CLOUD");
@unlink($tmpstr);
return true;
}
示例12: zarafa_hash
function zarafa_hash()
{
if (isset($_GET["rebuild"])) {
@unlink("/etc/artica-postfix/zarafa-export.db");
}
if (!is_file("/etc/artica-postfix/zarafa-export.db")) {
$cmd = LOCATE_PHP5_BIN2() . " /usr/share/artica-postfix/exec.zarafa.build.stores.php --export-hash";
shell_exec($cmd);
}
echo "<articadatascgi>" . @file_get_contents("/etc/artica-postfix/zarafa-export.db") . "</articadatascgi>";
}
示例13: zarafa_server
function zarafa_server(){
if(!$GLOBALS["CLASS_USERS"]->ZARAFA_INSTALLED){
if($GLOBALS["VERBOSE"]){echo __FUNCTION__." not installed\n";}
return null;
}
$enabled=1;
$pid_path="/var/run/zarafa-server.pid";
$master_pid=trim(@file_get_contents($pid_path));
$l[]="[APP_ZARAFA_SERVER]";
$l[]="service_name=APP_ZARAFA_SERVER";
$l[]="master_version=".$GLOBALS["CLASS_UNIX"]->ZARAFA_VERSION();
$l[]="service_cmd=zarafa";
$l[]="service_disabled=$enabled";
$l[]="pid_path=$pid_path";
$l[]="remove_cmd=--zarafa-remove";
$l[]="watchdog_features=1";
$l[]="family=mailbox";
if(!$GLOBALS["CLASS_UNIX"]->process_exists($master_pid)){
WATCHDOG("APP_ZARAFA","zarafa");
$l[]="running=0\ninstalled=1";$l[]="";
}else{
$l[]="running=1";
}
$meme=GetMemoriesOf($master_pid);
$l[]=$meme;
$l[]="";
$l[]="[APP_ZARAFA]";
$l[]="service_name=APP_ZARAFA";
$l[]="master_version=".$GLOBALS["CLASS_UNIX"]->ZARAFA_VERSION();
$l[]="family=mailbox";
$l[]="service_cmd=zarafa";
$l[]="service_disabled=$enabled";
$l[]="pid_path=$pid_path";
$l[]="remove_cmd=--zarafa-remove";
$l[]="watchdog_features=1";
if(!$GLOBALS["CLASS_UNIX"]->process_exists($master_pid)){
WATCHDOG("APP_ZARAFA","zarafa");
$l[]="running=0\ninstalled=1";$l[]="";
return implode("\n",$l);
return;
}
if(!$GLOBALS["DISABLE_WATCHDOG"]){
$nohup=$GLOBALS["CLASS_UNIX"]->find_program("nohup")." ";
if($GLOBALS["PHP5"]==null){$GLOBALS["PHP5"]=LOCATE_PHP5_BIN2();}
$cmd=trim($nohup.$GLOBALS["PHP5"]." ".dirname(__FILE__)."/exec.zarafa.build.stores.php --export-hash >/dev/null 2>&1 &");
events("running $cmd",__FUNCTION__,__LINE__);
shell_exec($cmd);
}
$l[]="running=1";
$l[]=$meme;
$l[]="";
return implode("\n",$l);return;
}
示例14: OPENGOO_INSTALL
function OPENGOO_INSTALL($servername, $root, $hash = array())
{
$srcfolder = "/usr/local/share/artica/opengoo";
$GLOBALS["ADDLOG"] = "{$GLOBALS["ARTICALOGDIR"]}/{$servername}.log";
$sql_file = "/usr/share/artica-postfix/bin/install/opengoo/opengoo.sql";
if ($root == null) {
events("Starting install opengoo Unable to stat root dir");
return false;
}
if (!is_dir($srcfolder)) {
events("Starting install opengoo Unable to stat SRC");
return false;
}
$user = $hash["wwwmysqluser"][0];
$mysql_password = $hash[strtolower("WWWMysqlPassword")][0];
$appli_user = $hash["wwwappliuser"][0];
$appli_password = $hash["wwwapplipassword"][0];
$wwwsslmode = $hash["wwwsslmode"][0];
$server_database = str_replace(".", "_", $servername);
$server_database = str_replace(" ", "_", $server_database);
$server_database = str_replace("-", "_", $server_database);
events("Starting install opengoo sub-system mysql database {$server_database}...");
if ($user == null) {
events("Starting install opengoo Unable to stat Mysql username");
return false;
}
if ($mysql_password == null) {
events("Starting install opengoo Unable to stat Mysql password");
return false;
}
@mkdir($root, 0755, true);
events("Starting install opengoo sub-system mysql database {$server_database}...");
$q = new mysql();
if (!$q->DATABASE_EXISTS($server_database)) {
$q->CREATE_DATABASE($server_database);
}
if (!$q->DATABASE_EXISTS($server_database)) {
events("Starting install opengoo unable to create MYSQL Database");
return false;
}
events("Starting setting permissions on Database with user {$user}");
$q->PRIVILEGES($user, $mysql_password, $server_database);
if (!OPENGOO_TEST_FILES($root)) {
events("Starting install opengoo installing source code");
shell_exec("/bin/cp -rf {$srcfolder}/* {$root}/");
}
$opengoo = new opengoo(null, $server_database);
if (!OPENGOO_CHECK_TABLES($server_database)) {
if ($q->mysql_password != null) {
$password = " --password={$q->mysql_password} ";
} else {
events("Starting install opengoo installing tables datas with null password");
}
$cmd = "mysql --port={$q->mysql_port} --skip-column-names --database={$server_database} --silent --xml ";
$cmd = $cmd . " --user={$q->mysql_admin}{$password} <{$sql_file}";
shell_exec($cmd);
} else {
events("Starting install opengo Mysql tables are already installed");
}
$sock = new sockets();
$ApacheGroupWarePort = $sock->GET_INFO("ApacheGroupWarePort");
events("Starting install opengo SSL={$wwwsslmode}");
if ($wwwsslmode == "TRUE") {
$ROOT_URL = "https://{$servername}";
} else {
$ROOT_URL = "http://{$servername}:{$ApacheGroupWarePort}";
}
$conf = "<?php\n";
$conf = $conf . "define('DB_ADAPTER', 'mysql');\n";
$conf = $conf . "define('DB_HOST', '127.0.0.1');\n";
$conf = $conf . "define('DB_USER', '{$q->mysql_admin}');\n";
$conf = $conf . "define('DB_PASS', '{$q->mysql_password}');\n";
$conf = $conf . "define('DB_NAME', '{$server_database}');\n";
$conf = $conf . "define('DB_PERSIST', true);\n";
$conf = $conf . "define('TABLE_PREFIX', 'og_');\n";
$conf = $conf . "define('DB_ENGINE', 'InnoDB');\n";
$conf = $conf . "define('ROOT_URL', '{$ROOT_URL}');\n";
$conf = $conf . "define('DEFAULT_LOCALIZATION', 'en_us');\n";
$conf = $conf . "define('COOKIE_PATH', '/');\n";
$conf = $conf . "define('DEBUG', false);\n";
$conf = $conf . "define('SEED', '6eb2551152da5a57576754716397703c');\n";
$conf = $conf . "define('DB_CHARSET', 'utf8');\n";
$conf = $conf . "return true;\n";
$conf = $conf . "?>";
@file_put_contents("{$root}/config/config.php", $conf);
$opengoo->DefaultsValues();
events("updating administrator credentials");
$opengoo->www_servername = $servername;
$opengoo->UpdateAdmin($appli_user, $appli_password);
events("updating company name");
$ou = $opengoo->get_Organization($servername);
$opengoo->UpdateCompany($ou);
$unix = new unix();
$sock = new sockets();
sys_THREAD_COMMAND_SET(LOCATE_PHP5_BIN2() . " /usr/share/artica-postfix/exec.opengoo.php");
}
示例15: status
function status()
{
exec(LOCATE_PHP5_BIN2() . " /usr/share/artica-postfix/exec.status.php --squidguard-http --nowachdog", $results);
writelogs_framework("/usr/share/artica-postfix/exec.status.php --squidguard-http " . count($results) . " rows", __FUNCTION__, __FILE__, __LINE__);
echo "<articadatascgi>" . base64_encode(@implode("\n", $results)) . "</articadatascgi>";
}