Merge pull request #840 from ferOnti/master
CODE STYLE removing old install scripts (maborak)
This commit is contained in:
@@ -1,675 +0,0 @@
|
|||||||
var installer=function()
|
|
||||||
{
|
|
||||||
this.make=function(options)
|
|
||||||
{
|
|
||||||
this.options={
|
|
||||||
target:inst.elements.content,
|
|
||||||
vdef:{
|
|
||||||
wf:'wf_workflow',
|
|
||||||
rb:'rb_workflow',
|
|
||||||
rp:'rp_workflow'
|
|
||||||
}
|
|
||||||
}.concat(options || {});
|
|
||||||
this.html();
|
|
||||||
this.check();
|
|
||||||
};
|
|
||||||
this.html=function()
|
|
||||||
{
|
|
||||||
this.titleBar = document.createElement("div");
|
|
||||||
this.titleBar.className="app_grid_headerBar___gray";
|
|
||||||
leimnud.dom.setStyle(this.titleBar,{
|
|
||||||
height:"auto",
|
|
||||||
textAlign:"right"
|
|
||||||
});
|
|
||||||
this.options.target.appendChild(this.titleBar);
|
|
||||||
|
|
||||||
this.options.button0 = document.createElement("input");
|
|
||||||
this.options.button0.type="button";
|
|
||||||
this.options.button0.value="Test";
|
|
||||||
this.titleBar.appendChild(this.options.button0);
|
|
||||||
|
|
||||||
this.options.button1 = document.createElement("input");
|
|
||||||
this.options.button1.type="button";
|
|
||||||
this.options.button1.value="Install";
|
|
||||||
this.titleBar.appendChild(this.options.button1);
|
|
||||||
|
|
||||||
this.options.button2 = document.createElement("input");
|
|
||||||
this.options.button2.type="button";
|
|
||||||
this.options.button2.value="Reset";
|
|
||||||
this.titleBar.appendChild(this.options.button2);
|
|
||||||
|
|
||||||
this.options.phpinfo = document.createElement("input");
|
|
||||||
this.options.phpinfo.type="button";
|
|
||||||
this.options.phpinfo.style.fontWeight="bold";
|
|
||||||
this.options.phpinfo.value="phpinfo()";
|
|
||||||
this.titleBar.appendChild(this.options.phpinfo);
|
|
||||||
this.options.phpinfo.onmouseup=this.showPhpinfo;
|
|
||||||
|
|
||||||
|
|
||||||
this.options.button1.disabled=true;
|
|
||||||
this.options.button0.onmouseup=this.check;
|
|
||||||
this.options.button1.onmouseup=function(){inst.selectTab(1);}.extend(this);
|
|
||||||
this.options.button2.onmouseup=this.reset;
|
|
||||||
|
|
||||||
this.buttonFun(this.options.button0);
|
|
||||||
this.buttonFun(this.options.button1);
|
|
||||||
this.buttonFun(this.options.button2);
|
|
||||||
this.buttonFun(this.options.phpinfo);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//this.phpVersion =
|
|
||||||
this.table = $(document.createElement("table"));
|
|
||||||
/* this.table.setStyle({
|
|
||||||
cellpadding:23
|
|
||||||
});*/
|
|
||||||
this.table.className="inst_table";
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"<b>Requirements</b>",className:"app_grid_title___gray title",colSpan:4})
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"PHP Version > 5.1.0",className:"inst_td0",colSpan:2}),
|
|
||||||
this.phpVersion = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2})
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"MySQL",className:"inst_td0",colSpan:2}),
|
|
||||||
this.mysqlVersion = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2})
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"Maximum amount of memory a script may consume (memory_limit) >= 40M",className:"inst_td0",colSpan:2}),
|
|
||||||
this.checkMemory = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2})
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"Directory "+this.options.path_trunk+"config/<br> permissions: <b>writable</b>",className:"inst_td0",colSpan:2}),
|
|
||||||
this.checkPI = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2})
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"Directory "+this.options.path_trunk+"content/languages/<br> permissions: <b>writable</b>",className:"inst_td0",colSpan:2}),
|
|
||||||
this.checkDL = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2})
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"File "+this.options.path_trunk+"js/labels/<br> permissions: <b>writable</b>",className:"inst_td0",colSpan:2}),
|
|
||||||
this.checkDLJ = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2})
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"File "+this.options.path_trunk+"plugins/<br> permissions: <b>writable</b>",className:"inst_td0",colSpan:2}),
|
|
||||||
this.checkPL = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2})
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"File "+this.options.path_trunk+"xmlform/<br> permissions: <b>writable</b>",className:"inst_td0",colSpan:2}),
|
|
||||||
this.checkXF = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2})
|
|
||||||
);
|
|
||||||
|
|
||||||
/* Database */
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"<b>Database</b>",className:"app_grid_title___gray title",colSpan:2}),
|
|
||||||
new DOM('td',{className:"app_grid_title___gray title",colSpan:2}).append(
|
|
||||||
this.select_ao_db = new select({data:[
|
|
||||||
{value:1,text:"Advanced options by default"},
|
|
||||||
{value:2,text:"Change Advanced options"}
|
|
||||||
],
|
|
||||||
style:{width:"100%",border:"1px solid #919B9C"},
|
|
||||||
properties:{onchange:function(){
|
|
||||||
if(this.select_ao_db.selected().value==1)
|
|
||||||
{
|
|
||||||
this.ed_advanced_options({
|
|
||||||
sta:"disabled",
|
|
||||||
act:'usr',
|
|
||||||
def:true
|
|
||||||
});
|
|
||||||
this.ao_db_wf.passed().value=this.options.vdef.wf;
|
|
||||||
this.ao_db_rb.passed().value=this.options.vdef.rb;
|
|
||||||
this.ao_db_rp.passed().value=this.options.vdef.rp;
|
|
||||||
this.ao_db_drop.checked=false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.ed_advanced_options({
|
|
||||||
act:'usr',
|
|
||||||
sta:"enabled"
|
|
||||||
});
|
|
||||||
this.ao_db_wf.focus();
|
|
||||||
}
|
|
||||||
}.extend(this)}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"Database server Hostname",className:"inst_td0"},{width:"30%"}),
|
|
||||||
new DOM('td',{className:"inst_td1"},{width:"30%"}).append(
|
|
||||||
// this.databaseHostname =new DOM("input",{value:'localhost',type:"text",onkeyup:this.submit,className:"inputNormal"})
|
|
||||||
this.databaseHostname = new input({label:'localhost',properties:{onkeyup:this.submit},style:{width:"100%"}})
|
|
||||||
),
|
|
||||||
new DOM('td',{innerHTML:"Workflow Database:",className:"inst_td0"},{width:"20%"}),
|
|
||||||
new DOM('td',{className:"inst_td1"},{width:"20%"}).append(
|
|
||||||
this.ao_db_wf = new input({label:this.options.vdef.wf,properties:{onkeyup:this.submit},style:{width:"100%"},maxlength:16}).passed().disable()
|
|
||||||
)
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"Username",className:"inst_td0"},{width:"30%"}),
|
|
||||||
new DOM('td',{className:"inst_td1"},{width:"30%"}).append(
|
|
||||||
// this.databaseUsername =new DOM("input",{value:'root',type:"text",onkeyup:this.submit,className:"inputNormal"})
|
|
||||||
this.databaseUsername = new input({label:'root',properties:{onkeyup:this.submit},style:{width:"100%"}})
|
|
||||||
),
|
|
||||||
new DOM('td',{innerHTML:"Rbac Database:",className:"inst_td0"},{width:"20%"}),
|
|
||||||
new DOM('td',{className:"inst_td1"},{width:"20%"}).append(
|
|
||||||
this.ao_db_rb = new input({label:this.options.vdef.rb,properties:{onkeyup:this.submit},style:{width:"100%"},maxlength:16}).passed().disable()
|
|
||||||
)
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"Password",className:"inst_td0"},{width:"30%"}),
|
|
||||||
new DOM('td',{className:"inst_td1"},{width:"30%"}).append(
|
|
||||||
// this.databasePassword =new DOM("input",{type:"text",onkeyup:this.submit,className:"inputNormal"})
|
|
||||||
this.databasePassword = new input({properties:{type:'password',onkeyup:this.submit},style:{width:"100%"}})
|
|
||||||
),
|
|
||||||
new DOM('td',{innerHTML:"Report Database:",className:"inst_td0"},{width:"20%"}),
|
|
||||||
new DOM('td',{className:"inst_td1"},{width:"20%"}).append(
|
|
||||||
this.ao_db_rp = new input({label:this.options.vdef.rp,properties:{onkeyup:this.submit},style:{width:"100%"},maxlength:16}).passed().disable()
|
|
||||||
)
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"Database Access",className:"inst_td0"},{width:"30%"}),
|
|
||||||
this.databaseGrant = new DOM('td',{className:"inst_td1"},{width:"30%"}),
|
|
||||||
|
|
||||||
new DOM('td',{innerHTML:"DROP DATABASE IF EXISTS",className:"inst_td0"},{width:"20%"}),
|
|
||||||
new DOM('td',{className:"inst_td0"},{width:"20%",textAlign:'left'}).append(
|
|
||||||
this.ao_db_drop = new input({
|
|
||||||
properties:{type:'checkbox',disabled:true,className:''},style:{border:"1px solid #666"}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
this.databaseStatus = new DOM('td',{innerHTML:"<br>",className:"tdNormal",colSpan:4},{height:50})
|
|
||||||
);
|
|
||||||
|
|
||||||
/* Database End */
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Directories Begin */
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"<b>Processmaker Configuration</b>",className:"app_grid_title___gray title",colSpan:2}),
|
|
||||||
new DOM('td',{className:"app_grid_title___gray title",colSpan:2}).append(
|
|
||||||
|
|
||||||
this.select_ao_pm = new select({data:[
|
|
||||||
{value:1,text:"Advanced options by default"},
|
|
||||||
{value:2,text:"Change Advanced options"}
|
|
||||||
],
|
|
||||||
style:{width:"100%",border:"1px solid #919B9C"},
|
|
||||||
properties:{onchange:function(){
|
|
||||||
if(this.select_ao_pm.selected().value==1)
|
|
||||||
{
|
|
||||||
this.ed_advanced_options({
|
|
||||||
act:'pm',
|
|
||||||
sta:"disabled",
|
|
||||||
def:true
|
|
||||||
});
|
|
||||||
this.ao_admin.passed().value="admin";
|
|
||||||
this.ao_admin_pass1.passed().value="admin";
|
|
||||||
this.ao_admin_pass2.passed().value="admin";
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.ed_advanced_options({
|
|
||||||
act:'pm',
|
|
||||||
sta:"enabled"
|
|
||||||
});
|
|
||||||
this.ao_admin.focus();
|
|
||||||
}
|
|
||||||
}.extend(this)}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"Workflow Data Directory (permissions: <b>writable</b>): ",className:"inst_td0"},{width:"30%"}),
|
|
||||||
new DOM('td',{className:"inst_td1"},{width:"30%"}).append(
|
|
||||||
this.workflowData = new input({label:this.options.path_data,properties:{onkeyup:this.submit},style:{width:"100%"},maxlength:200})
|
|
||||||
),
|
|
||||||
new DOM('td',{innerHTML:"Username (Default: admin):",className:"inst_td0"},{width:"20%"}),
|
|
||||||
new DOM('td',{className:"inst_td1"},{width:"20%"}).append(
|
|
||||||
this.ao_admin = new input({label:'admin',properties:{onkeyup:this.submit},style:{width:"100%"}}).passed().disable()
|
|
||||||
)
|
|
||||||
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"",className:"inst_td0"},{width:"30%"}),
|
|
||||||
new DOM('td',{className:"inst_td1"},{width:"30%"}).append(
|
|
||||||
this.compiled = new input({label:this.options.path_compiled,properties:{onkeyup:this.submit},style:{width:"100%", display:'none'},maxlength:200})
|
|
||||||
),
|
|
||||||
new DOM('td',{innerHTML:"Username (Default: admin):",className:"inst_td0"},{width:"20%"}),
|
|
||||||
new DOM('td',{className:"inst_td1"},{width:"20%"}).append(
|
|
||||||
this.ao_admin_pass1 = new input({label:'admin',properties:{onkeyup:this.submit,type:'password'},style:{width:"100%"}}).passed().disable()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{className:"inst_td0",colSpan:2}),
|
|
||||||
new DOM('td',{innerHTML:"Re-type Password:",className:"inst_td0"},{width:"20%"}),
|
|
||||||
new DOM('td',{className:"inst_td1"},{width:"20%"}).append(
|
|
||||||
this.ao_admin_pass2 = new input({label:'admin',properties:{onkeyup:this.submit,type:'password'},style:{width:"100%"}}).passed().disable()
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"<b>HeartBeat Configuration</b><br><i>Heartbeat is an anonymous statistics collector for ProcessMaker. It runs in the background and if you have internet enabled, it will periodically send anonymous information to ProcessMaker servers.<br />No sensitive or private information is collected.<br /><br /> The information collected will allow us to keep improving our software to offer everyone a better user experience</i>",className:"app_grid_title___gray title",colSpan:4})
|
|
||||||
);
|
|
||||||
this.heartBeatTitle=tr;
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
|
|
||||||
this.heartBeat =
|
|
||||||
|
|
||||||
new DOM('td',{innerHTML:"Enable HeartBeat",className:"inst_td0"},{width:"20%"}),
|
|
||||||
new DOM('td',{className:"inst_td0",colSpan:2},{textAlign:'left'}).append(
|
|
||||||
this.ao_hb_status = new input({
|
|
||||||
properties:{type:'checkbox',disabled:false,checked:true,className:''},style:{border:"1px solid #666"}
|
|
||||||
})
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
|
|
||||||
this.heartBeatRow=tr;
|
|
||||||
|
|
||||||
|
|
||||||
//alert(this.options.availableProcess);
|
|
||||||
//alert(this.options.availableProcess.length);
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"<b>Available Processes (auto install)</b>",className:"app_grid_title___gray title",colSpan:4})
|
|
||||||
);
|
|
||||||
this.availableProcessTitle=tr;
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
this.availableProcess = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2})
|
|
||||||
);
|
|
||||||
this.availableProcessRow=tr;
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
new DOM('td',{innerHTML:"<b>Available Plugins (auto install)</b>",className:"app_grid_title___gray title",colSpan:4})
|
|
||||||
);
|
|
||||||
this.availablePluginsTitle=tr;
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
$(tr).append(
|
|
||||||
this.availablePlugins = new DOM('td',{innerHTML:'Loading...',className:"inst_td1",colSpan:2})
|
|
||||||
);
|
|
||||||
this.availablePluginsRow=tr;
|
|
||||||
|
|
||||||
|
|
||||||
leimnud.dom.setStyle([this.workflowData,this.compiled],{
|
|
||||||
textAlign:"left"
|
|
||||||
});
|
|
||||||
this.options.target.appendChild(this.table);
|
|
||||||
};
|
|
||||||
this.formData=function()
|
|
||||||
{
|
|
||||||
//alert(this.databaseExe.value.eplace("\\","/"))
|
|
||||||
return {
|
|
||||||
mysqlH :escape(this.databaseHostname.value),
|
|
||||||
mysqlU :escape(this.databaseUsername.value),
|
|
||||||
mysqlP :escape(this.databasePassword.value),
|
|
||||||
// port :this.port.value,
|
|
||||||
path_data:this.workflowData.value,
|
|
||||||
path_compiled:this.compiled.value,
|
|
||||||
ao_admin :escape(this.ao_admin.value),
|
|
||||||
ao_admin_pass1 :escape(this.ao_admin_pass1.value),
|
|
||||||
ao_admin_pass2 :escape(this.ao_admin_pass2.value),
|
|
||||||
ao_db_wf :this.ao_db_wf.value,
|
|
||||||
ao_db_rb :this.ao_db_rb.value,
|
|
||||||
ao_db_rp :this.ao_db_rp.value,
|
|
||||||
ao_db :parseInt(this.select_ao_db.selected().value),
|
|
||||||
ao_pm :parseInt(this.select_ao_pm.selected().value),
|
|
||||||
ao_db_drop :this.ao_db_drop.checked,
|
|
||||||
heartbeatEnabled :this.ao_hb_status.checked
|
|
||||||
};
|
|
||||||
};
|
|
||||||
this.check=function()
|
|
||||||
{
|
|
||||||
inst.loader.show();
|
|
||||||
this.disabled(true);
|
|
||||||
this.ed_advanced_options({sta:'disabled',act:'all'});
|
|
||||||
var r = new leimnud.module.rpc.xmlhttp({
|
|
||||||
url :this.options.server,
|
|
||||||
method :"POST",
|
|
||||||
args :"action=check&data="+this.formData().toJSONString()
|
|
||||||
});
|
|
||||||
r.callback=function(rpc)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
this.cstatus = rpc.xmlhttp.responseText.parseJSON();
|
|
||||||
}
|
|
||||||
catch(e)
|
|
||||||
{
|
|
||||||
this.cstatus={
|
|
||||||
ao_db_wf:false,
|
|
||||||
ao_db_rb:false,
|
|
||||||
ao_db_rp:false
|
|
||||||
};
|
|
||||||
}
|
|
||||||
this.phpVersion.className = (!this.cstatus.phpVersion)?"inst_td1 tdFailed":"inst_td1 tdOk";
|
|
||||||
this.phpVersion.innerHTML = (!this.cstatus.phpVersion)?"FAILED":"PASSED";
|
|
||||||
|
|
||||||
this.mysqlVersion.className = (!this.cstatus.mysqlVersion)?"inst_td1 tdFailed":"inst_td1 tdOk";
|
|
||||||
this.mysqlVersion.innerHTML = (!this.cstatus.mysqlVersion)?"FAILED":"PASSED";
|
|
||||||
|
|
||||||
this.checkMemory.className = (!this.cstatus.checkMemory)?"inst_td1 tdFailed":"inst_td1 tdOk";
|
|
||||||
this.checkMemory.innerHTML = (!this.cstatus.checkMemory)?"FAILED":"PASSED";
|
|
||||||
|
|
||||||
// this.checkmqgpc.className = (!this.cstatus.checkmqgpc)?"inst_td1 tdFailed":"inst_td1 tdOk";
|
|
||||||
// this.checkmqgpc.innerHTML = (!this.cstatus.checkmqgpc)?"FAILED":"PASSED";
|
|
||||||
|
|
||||||
this.checkPI.className = (!this.cstatus.checkPI)?"inst_td1 tdFailed":"inst_td1 tdOk";
|
|
||||||
this.checkPI.innerHTML = (!this.cstatus.checkPI)?"FAILED":"PASSED";
|
|
||||||
|
|
||||||
this.checkDL.className = (!this.cstatus.checkDL)?"inst_td1 tdFailed":"inst_td1 tdOk";
|
|
||||||
this.checkDL.innerHTML = (!this.cstatus.checkDL)?"FAILED":"PASSED";
|
|
||||||
|
|
||||||
this.checkDLJ.className = (!this.cstatus.checkDLJ)?"inst_td1 tdFailed":"inst_td1 tdOk";
|
|
||||||
this.checkDLJ.innerHTML = (!this.cstatus.checkDLJ)?"FAILED":"PASSED";
|
|
||||||
|
|
||||||
this.checkPL.className = (!this.cstatus.checkPL)?"inst_td1 tdFailed":"inst_td1 tdOk";
|
|
||||||
this.checkPL.innerHTML = (!this.cstatus.checkPL)?"FAILED":"PASSED";
|
|
||||||
|
|
||||||
this.checkXF.className = (!this.cstatus.checkXF)?"inst_td1 tdFailed":"inst_td1 tdOk";
|
|
||||||
this.checkXF.innerHTML = (!this.cstatus.checkXF)?"FAILED":"PASSED";
|
|
||||||
|
|
||||||
this.databaseHostname[(!this.cstatus.mysqlConnection)?"failed":"passed"]();
|
|
||||||
this.databaseUsername[(!this.cstatus.mysqlConnection)?"failed":"passed"]();
|
|
||||||
this.databasePassword[(!this.cstatus.mysqlConnection)?"failed":"passed"]();
|
|
||||||
|
|
||||||
this.databaseGrant.className = (!this.cstatus.grantPriv && this.select_ao_db.selected().value==1)?"inst_td1 tdFailed":"inst_td1 tdOk";
|
|
||||||
this.databaseGrant.innerHTML = (!this.cstatus.grantPriv)?"FAILED":((this.cstatus.grantPriv==1)?'ALL PRIVILEGES':'USAGE');
|
|
||||||
|
|
||||||
this.databaseStatus.className = (!this.cstatus.grantPriv || !this.cstatus.mysqlConnection)?"tdFailed":"tdOk";
|
|
||||||
this.databaseStatus.innerHTML = this.cstatus.databaseMessage;
|
|
||||||
|
|
||||||
this.workflowData[(!this.cstatus.path_data)?"failed":"passed"]();
|
|
||||||
this.compiled[(!this.cstatus.path_compiled)?"failed":"passed"]();
|
|
||||||
|
|
||||||
|
|
||||||
this.ao_db_wf[((!this.cstatus.ao_db_wf['status'])?"failed":"passed")]();
|
|
||||||
this.ao_db_rb[((!this.cstatus.ao_db_rb['status'])?"failed":"passed")]();
|
|
||||||
this.ao_db_rp[((!this.cstatus.ao_db_rp['status'])?"failed":"passed")]();
|
|
||||||
|
|
||||||
this.ao_admin[(!this.cstatus.ao_admin && this.select_ao_pm.selected().value==2)?"failed":"passed"]();
|
|
||||||
this.ao_admin_pass1[(!this.cstatus.ao_admin_pass && this.select_ao_pm.selected().value==2)?"failed":"passed"]();
|
|
||||||
this.ao_admin_pass2[(!this.cstatus.ao_admin_pass && this.select_ao_pm.selected().value==2)?"failed":"passed"]();
|
|
||||||
|
|
||||||
if(this.cstatus.ao_db_wf['status'] && this.cstatus.ao_db_rb['status'] && this.cstatus.ao_db_rp['status'] && this.cstatus.ao_admin && this.cstatus.ao_admin_pass && this.cstatus.checkMemory && this.cstatus.checkPI && this.cstatus.checkDL && this.cstatus.checkDLJ && this.cstatus.checkPL && this.cstatus.checkXF && this.cstatus.phpVersion && this.cstatus.mysqlVersion && this.cstatus.mysqlConnection && this.cstatus.grantPriv && this.cstatus.path_data && this.cstatus.path_compiled)
|
|
||||||
{
|
|
||||||
this.options.button0.disabled=true;
|
|
||||||
this.options.button1.disabled=false;
|
|
||||||
this.disabled(true);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
this.options.button0.disabled=false;
|
|
||||||
this.options.button1.disabled=true;
|
|
||||||
this.disabled(false);
|
|
||||||
try {
|
|
||||||
this.compiled.focus();
|
|
||||||
} catch(err) {}
|
|
||||||
this.ed_advanced_options({sta:((this.select_ao_db.selected().value==2)?'enabled':'disabled'),act:'usr'});
|
|
||||||
this.ed_advanced_options({sta:((this.select_ao_pm.selected().value==2)?'enabled':'disabled'),act:'pm'});
|
|
||||||
}
|
|
||||||
this.buttonFun(this.options.button0);
|
|
||||||
this.buttonFun(this.options.button1);
|
|
||||||
|
|
||||||
this.ao_db_wf.title=this.cstatus.ao_db_wf.message;
|
|
||||||
this.ao_db_rb.title=this.cstatus.ao_db_rb.message;
|
|
||||||
this.ao_db_rp.title=this.cstatus.ao_db_rp.message;
|
|
||||||
|
|
||||||
this.ao_admin.title=(this.cstatus.ao_admin)?'Username invalid':'PASSED';
|
|
||||||
|
|
||||||
|
|
||||||
//*Autoinstall Process and Plugins. By JHL
|
|
||||||
// March 11th. 2009
|
|
||||||
// To enable the way of aoutoinstall process and/or plugins
|
|
||||||
// at same time of initial PM setup
|
|
||||||
if(this.cstatus.availableProcess.length>0){
|
|
||||||
this.availableProcess.className = "inst_td1 tdOk";
|
|
||||||
this.availableProcess.innerHTML="";
|
|
||||||
for(i_process=0;i_process<this.cstatus.availableProcess.length;i_process++){
|
|
||||||
this.availableProcess.innerHTML+=this.cstatus.availableProcess[i_process]+"<br />";
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
//Hide entire Group
|
|
||||||
this.availableProcessTitle.style.display="none";
|
|
||||||
this.availableProcessRow.style.display="none";
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.cstatus.availablePlugins.length>0){
|
|
||||||
this.availablePlugins.className = "inst_td1 tdOk";
|
|
||||||
this.availablePlugins.innerHTML="";
|
|
||||||
for(i_plugin=0;i_plugin<this.cstatus.availablePlugins.length;i_plugin++){
|
|
||||||
this.availablePlugins.innerHTML+=this.cstatus.availablePlugins[i_plugin]+"<br />";
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
//Hide entire Group
|
|
||||||
this.availablePluginsTitle.style.display="none";
|
|
||||||
this.availablePluginsRow.style.display="none";
|
|
||||||
}
|
|
||||||
//End Autoinstall
|
|
||||||
|
|
||||||
inst.loader.hide();
|
|
||||||
}.extend(this);
|
|
||||||
r.make();
|
|
||||||
};
|
|
||||||
this.reset=function()
|
|
||||||
{
|
|
||||||
this.options.button1.disabled=true;
|
|
||||||
this.buttonFun(this.options.button1);
|
|
||||||
this.disabled(false);
|
|
||||||
};
|
|
||||||
this.disabled=function(dis)
|
|
||||||
{
|
|
||||||
this.databaseHostname[(dis===true)?'disable':'enable']();
|
|
||||||
this.databaseUsername[(dis===true)?'disable':'enable']();
|
|
||||||
this.databasePassword[(dis===true)?'disable':'enable']();
|
|
||||||
this.workflowData[(dis===true)?'disable':'enable']();
|
|
||||||
this.compiled[(dis===true)?'disable':'enable']();
|
|
||||||
if(this.compiled.disabled===false)
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
this.compiled.focus();
|
|
||||||
} catch(err) {}
|
|
||||||
}
|
|
||||||
this.options.button0.disabled=dis;
|
|
||||||
this.buttonFun(this.options.button0);
|
|
||||||
};
|
|
||||||
this.ed_advanced_options=function(options)
|
|
||||||
{
|
|
||||||
options = {
|
|
||||||
sta:"disabled",
|
|
||||||
act:"all",
|
|
||||||
def:false
|
|
||||||
}.concat(options || {});
|
|
||||||
|
|
||||||
if(options.act=='pm' || options.act=="all")
|
|
||||||
{
|
|
||||||
this.ao_admin[(options.sta=="disabled")?'disable':'enable']();
|
|
||||||
this.ao_admin_pass1[(options.sta=="disabled")?'disable':'enable']();
|
|
||||||
this.ao_admin_pass2[(options.sta=="disabled")?'disable':'enable']();
|
|
||||||
}
|
|
||||||
if(options.act=='usr' || options.act=="all")
|
|
||||||
{
|
|
||||||
this.ao_db_wf[(options.sta=="disabled")?'disable':'enable']();
|
|
||||||
this.ao_db_rb[(options.sta=="disabled")?'disable':'enable']();
|
|
||||||
this.ao_db_rp[(options.sta=="disabled")?'disable':'enable']();
|
|
||||||
this.ao_db_drop.disabled=(options.sta=="disabled")?true:false;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
this.submit=function(evt)
|
|
||||||
{
|
|
||||||
var evt = (window.event)?window.event:evt;
|
|
||||||
var key = (evt.which)?evt.which:evt.keyCode;
|
|
||||||
if(key==13)
|
|
||||||
{
|
|
||||||
this.check();
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
};
|
|
||||||
this.install=function()
|
|
||||||
{
|
|
||||||
this.values = this.formData();
|
|
||||||
inst.clearContent();
|
|
||||||
inst.loader.show();
|
|
||||||
this.options.button2.disabled=true;
|
|
||||||
this.options.button1.disabled=true;
|
|
||||||
var r = new leimnud.module.rpc.xmlhttp({
|
|
||||||
url :this.options.server,
|
|
||||||
method :"POST",
|
|
||||||
args :"action=install&data="+this.values.toJSONString()
|
|
||||||
});
|
|
||||||
r.callback=this.installation;
|
|
||||||
r.make();
|
|
||||||
};
|
|
||||||
this.installation=function(rpc)
|
|
||||||
{
|
|
||||||
/* var r = new leimnud.module.rpc.xmlhttp({
|
|
||||||
url :"/sysworkflow/en/classic/tools/updateTranslation",
|
|
||||||
method :"GET"
|
|
||||||
});
|
|
||||||
r.callback=function(rpc)
|
|
||||||
{*/
|
|
||||||
inst.loader.hide();
|
|
||||||
this.table = document.createElement("table");
|
|
||||||
this.table.className="inst_table";
|
|
||||||
|
|
||||||
var success = (rpc.xmlhttp.status == 200);
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
var tdtitle = tr.insertCell(0);
|
|
||||||
tdtitle.innerHTML="Status";
|
|
||||||
tdtitle.className="app_grid_title___gray title";
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
var td0 = tr.insertCell(0);
|
|
||||||
td0.innerHTML=(success) ? "Success" : "Failed (Check log below)";
|
|
||||||
td0.className=(success) ? "tdOk" : "tdFailed";
|
|
||||||
this.options.target.appendChild(this.table);
|
|
||||||
|
|
||||||
if (success) {
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
var tdS = tr.insertCell(0);
|
|
||||||
tdS.colSpan = 2;
|
|
||||||
tdS.innerHTML="<br><br>";
|
|
||||||
tdS.className="tdNormal";
|
|
||||||
|
|
||||||
|
|
||||||
this.options.buttong = document.createElement("input");
|
|
||||||
this.options.buttong.type="button";
|
|
||||||
this.options.buttong.value="Finish Installation";
|
|
||||||
this.options.buttong.onmouseup=function()
|
|
||||||
{
|
|
||||||
window.location = "/sysworkflow/en/classic/login/login";
|
|
||||||
}.extend(this);
|
|
||||||
tdS.appendChild(this.options.buttong);
|
|
||||||
this.buttonFun(this.options.buttong);
|
|
||||||
tdS.appendChild(document.createElement("br"));
|
|
||||||
tdS.appendChild(document.createElement("br"));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
var tdtitle = tr.insertCell(0);
|
|
||||||
tdtitle.innerHTML="Installation Log";
|
|
||||||
tdtitle.className="app_grid_title___gray title";
|
|
||||||
|
|
||||||
var tr = this.table.insertRow(-1);
|
|
||||||
var td0 = tr.insertCell(0);
|
|
||||||
var pre = document.createElement('pre');
|
|
||||||
pre.style.overflow='scroll';
|
|
||||||
pre.style.width=(this.options.target.clientWidth-10)+"px";
|
|
||||||
pre.style.height=((this.options.target.clientHeight-this.table.clientHeight)-15)+'px';
|
|
||||||
pre.innerHTML=rpc.xmlhttp.responseText;
|
|
||||||
td0.appendChild(pre);
|
|
||||||
// }.extend(this);
|
|
||||||
// r.make();
|
|
||||||
};
|
|
||||||
this.buttonFun=function(but)
|
|
||||||
{
|
|
||||||
if(but.disabled==true)
|
|
||||||
{
|
|
||||||
but.className="app_grid_title___gray button buttonDisabled";
|
|
||||||
but.onmouseover=function(){ this.className="app_grid_title___gray button buttonDisabled"};
|
|
||||||
but.onmouseout=function(){ this.className="app_grid_title___gray button buttonDisabled"};
|
|
||||||
but.onblur=function(){ this.className="app_grid_title___gray button buttonDisabled"};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
but.className="app_grid_title___gray button";
|
|
||||||
but.onmouseover=function(){ this.className="app_grid_title___gray button buttonHover"};
|
|
||||||
but.onmouseout=function(){ this.className="app_grid_title___gray button"};
|
|
||||||
but.onblur=function(){ this.className="app_grid_title___gray button"};
|
|
||||||
}
|
|
||||||
};
|
|
||||||
this.showPhpinfo=function()
|
|
||||||
{
|
|
||||||
var panel = new leimnud.module.panel();
|
|
||||||
panel.options={
|
|
||||||
title:"PHP info",
|
|
||||||
position:{center:true},
|
|
||||||
size:{w:700,h:document.body.clientHeight-50},
|
|
||||||
fx:{modal:true}
|
|
||||||
};
|
|
||||||
panel.make();
|
|
||||||
var r = new leimnud.module.rpc.xmlhttp({
|
|
||||||
url :"install.php",
|
|
||||||
method :"POST",
|
|
||||||
args :"phpinfo=true"
|
|
||||||
});
|
|
||||||
r.callback=function(rpc)
|
|
||||||
{
|
|
||||||
panel.addContent(rpc.xmlhttp.responseText);
|
|
||||||
};
|
|
||||||
r.make();
|
|
||||||
};
|
|
||||||
this.expand(this);
|
|
||||||
}
|
|
||||||
@@ -1,209 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* install.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*/
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Default home page view
|
|
||||||
*
|
|
||||||
* @author MaBoRaK
|
|
||||||
* @version 0.1
|
|
||||||
*/
|
|
||||||
if ($_POST && isset( $_POST['phpinfo'] )) {
|
|
||||||
phpinfo();
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
echo '<?xml version="1.0" encoding="UTF-8" ?>';
|
|
||||||
?>
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
||||||
<title>Processmaker Installer</title>
|
|
||||||
<script type='text/javascript' src='/js/maborak/core/maborak.js'></script>
|
|
||||||
<link rel="stylesheet" type="text/css"
|
|
||||||
href="/js/maborak/samples/style.css" />
|
|
||||||
|
|
||||||
<script type='text/javascript' src='/sys/en/classic/install/install.js'></script>
|
|
||||||
<script type='text/javascript'>
|
|
||||||
var ifr;
|
|
||||||
var forceCssLoad = true;
|
|
||||||
var grid,winGrill, leimnud = new maborak(forceCssLoad);
|
|
||||||
var inWIN = false;
|
|
||||||
leimnud.make();
|
|
||||||
leimnud.Package.Load("dom,validator,app,rpc,fx,drag,drop,panel,grid,abbr",{Instance:leimnud,Type:"module"});
|
|
||||||
leimnud.Package.Load("json",{Type:"file"});
|
|
||||||
leimnud.exec(leimnud.fix.memoryLeak);
|
|
||||||
var inst;
|
|
||||||
leimnud.event.add(window,'load',function(){myload();});
|
|
||||||
var myload = function() {
|
|
||||||
if (typeof(DOM) === 'undefined') {
|
|
||||||
setTimeout("myload();", 1000);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
inst = new leimnud.module.panel();
|
|
||||||
inst.options={
|
|
||||||
size:{w:document.body.offsetWidth-50,h:825},
|
|
||||||
title :"",
|
|
||||||
position:{x:2,y:2,center:true},
|
|
||||||
statusBar:false,
|
|
||||||
control:{
|
|
||||||
roll :false,
|
|
||||||
close :false
|
|
||||||
},
|
|
||||||
fx:{
|
|
||||||
shadow:false,
|
|
||||||
fadeIn:false
|
|
||||||
}
|
|
||||||
};
|
|
||||||
inst.setStyle={
|
|
||||||
content:{padding:2}
|
|
||||||
};
|
|
||||||
var classInstaller = new installer();
|
|
||||||
inst.tab={
|
|
||||||
optWidth:190,
|
|
||||||
manualDisabled:true,
|
|
||||||
step :(leimnud.browser.isIE?-1:5),
|
|
||||||
options:[{
|
|
||||||
title :"Configuration",
|
|
||||||
content :function()
|
|
||||||
{
|
|
||||||
classInstaller.make({
|
|
||||||
server :"installServer.php",
|
|
||||||
path_data:"<?php echo defined('PATH_DATA')?PATH_DATA:PATH_TRUNK.'shared';?>",
|
|
||||||
path_compiled:"<?php echo defined('PATH_C')?PATH_C:PATH_TRUNK.'compiled';?>",
|
|
||||||
path_trunk:"<?php echo PATH_CORE;?>"
|
|
||||||
});
|
|
||||||
},
|
|
||||||
selected:true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title :"Installation",
|
|
||||||
noClear : true,
|
|
||||||
content :classInstaller.install
|
|
||||||
}
|
|
||||||
|
|
||||||
]
|
|
||||||
};
|
|
||||||
inst.make();
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
<style>
|
|
||||||
input {
|
|
||||||
font: normal 8pt sans-serif, Tahoma, MiscFixed;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background-color: white;
|
|
||||||
font: normal 8pt sans-serif, Tahoma;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inst_table {
|
|
||||||
width: 100%;
|
|
||||||
border-collapse: collapse;
|
|
||||||
font: normal 8pt Tahoma, sans-serif;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inst_td0 {
|
|
||||||
width: 60%;
|
|
||||||
text-align: right;
|
|
||||||
border: 1px solid #CCC;
|
|
||||||
padding: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inst_td1 {
|
|
||||||
font-weight: bold;
|
|
||||||
width: 40%;
|
|
||||||
padding: 5px;
|
|
||||||
border: 1px solid #CCC;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tdNormal,.tdOk,.tdFailed {
|
|
||||||
font-weight: bold;
|
|
||||||
border: 1px solid #CCC;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tdOk {
|
|
||||||
font-weight: bold;
|
|
||||||
color: green;
|
|
||||||
padding: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tdFailed {
|
|
||||||
font-weight: bold;
|
|
||||||
color: red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.title {
|
|
||||||
text-align: left;
|
|
||||||
padding-left: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inputNormal,.inputOk,.inputFailed {
|
|
||||||
width: 100%;
|
|
||||||
border: 1px solid #666;
|
|
||||||
border-left: 3px solid #666;
|
|
||||||
font: normal 8pt Tahoma, sans-serif;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inputOk {
|
|
||||||
border: 1px solid green;
|
|
||||||
border-left: 3px solid green;
|
|
||||||
}
|
|
||||||
|
|
||||||
.inputFailed {
|
|
||||||
border: 1px solid red;
|
|
||||||
border-left: 3px solid red;
|
|
||||||
}
|
|
||||||
|
|
||||||
.button {
|
|
||||||
font: normal 8pt Tahoma, MiscFixed, sans-serif;
|
|
||||||
border: 1px solid #afafaf;
|
|
||||||
margin-left: 2px;
|
|
||||||
color: black;
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonHover {
|
|
||||||
border: 1px solid #666;
|
|
||||||
background-position: 0 -8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.buttonDisabled {
|
|
||||||
border: 1px solid #9f9f9f;
|
|
||||||
background-position: 0 -10;
|
|
||||||
color: #9f9f9f;
|
|
||||||
cursor: default;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<?php
|
|
||||||
//exec("mkdir /var/www/html/asas",$console);
|
|
||||||
?>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
||||||
@@ -1,380 +0,0 @@
|
|||||||
<?php
|
|
||||||
/**
|
|
||||||
* installServer.php
|
|
||||||
*
|
|
||||||
* ProcessMaker Open Source Edition
|
|
||||||
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
|
||||||
*
|
|
||||||
* This program is free software: you can redistribute it and/or modify
|
|
||||||
* it under the terms of the GNU Affero General Public License as
|
|
||||||
* published by the Free Software Foundation, either version 3 of the
|
|
||||||
* License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU Affero General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU Affero General Public License
|
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*
|
|
||||||
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
|
||||||
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
||||||
*/
|
|
||||||
|
|
||||||
$isWindows = PHP_OS == 'WINNT' ? true : false;
|
|
||||||
|
|
||||||
$oJSON = new Services_JSON();
|
|
||||||
$action = $_POST['action'];
|
|
||||||
$dataClient = $oJSON->decode( stripslashes( $_POST['data'] ) );
|
|
||||||
function find_SQL_Version ($my = 'mysql', $infExe = null)
|
|
||||||
{
|
|
||||||
if (PHP_OS == "WINNT" && ! $infExe) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
$output = shell_exec( $my . ' -V' );
|
|
||||||
preg_match( '@[0-9]+\.[0-9]+\.[0-9]+@', $output, $version );
|
|
||||||
return $version[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($action === "check") {
|
|
||||||
/* TODO: Check if this space is required */
|
|
||||||
print " ";
|
|
||||||
G::LoadClass( 'Installer' );
|
|
||||||
$inst = new Installer();
|
|
||||||
$siteName = "workflow";
|
|
||||||
$p1 = (isset( $dataClient->ao_admin_pass1 )) ? $dataClient->ao_admin_pass1 : 'admin';
|
|
||||||
$p2 = (isset( $dataClient->ao_admin_pass2 )) ? $dataClient->ao_admin_pass2 : 'admin';
|
|
||||||
$s = $inst->create_site( Array ('name' => 'workflow','path_data' => $dataClient->path_data,'path_compiled' => $dataClient->path_compiled,'admin' => Array ('username' => (isset( $dataClient->ao_admin )) ? $dataClient->ao_admin : 'admin','password' => $p1
|
|
||||||
),'advanced' => Array ('ao_db' => (isset( $dataClient->ao_db ) && $dataClient->ao_db === 2) ? false : true,'ao_db_drop' => (isset( $dataClient->ao_db_drop ) && $dataClient->ao_db_drop === true) ? true : false,'ao_db_wf' => (isset( $dataClient->ao_db_wf )) ? $dataClient->ao_db_wf : 'wf_' . $siteName,'ao_db_rb' => (isset( $dataClient->ao_db_rb )) ? $dataClient->ao_db_rb : 'rb_' . $siteName,'ao_db_rp' => (isset( $dataClient->ao_db_rp )) ? $dataClient->ao_db_rp : 'rp_' . $siteName
|
|
||||||
),'database' => Array ('hostname' => $dataClient->mysqlH,'username' => $dataClient->mysqlU,'password' => $dataClient->mysqlP
|
|
||||||
)
|
|
||||||
) );
|
|
||||||
$data = null;
|
|
||||||
$data->phpVersion = (version_compare( PHP_VERSION, "5.1.0", ">" )) ? true : false;
|
|
||||||
if (trim( $dataClient->mysqlH ) == '' || trim( $dataClient->mysqlU ) == '') {
|
|
||||||
$con = array ('connection' => false,'grant' => false,'message' => 'Please complete the input fields (Hostname/Username)'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
$data->mysqlConnection = $s['result']['database']['connection'];
|
|
||||||
$data->grantPriv = $s['result']['database']['grant'];
|
|
||||||
$data->databaseMessage = $s['result']['database']['message'];
|
|
||||||
$data->mysqlVersion = $s['result']['database']['version'];
|
|
||||||
$data->path_data = $s['result']['path_data'];
|
|
||||||
$data->path_compiled = true;
|
|
||||||
$data->checkMemory = (((int) ini_get( "memory_limit" )) >= 40) ? true : false;
|
|
||||||
#$data->checkmqgpc =(get_magic_quotes_gpc())?false:true;
|
|
||||||
$data->checkPI = $inst->is_dir_writable( PATH_CORE . "config/" );
|
|
||||||
$data->checkDL = $inst->is_dir_writable( PATH_CORE . "content/languages/" );
|
|
||||||
$data->checkDLJ = $inst->is_dir_writable( PATH_CORE . "js/labels/" );
|
|
||||||
$data->checkPL = $inst->is_dir_writable( PATH_CORE . "plugins/" );
|
|
||||||
$data->checkXF = $inst->is_dir_writable( PATH_CORE . "xmlform/" );
|
|
||||||
$data->ao_db_wf = $s['result']['database']['ao']['ao_db_wf'];
|
|
||||||
$data->ao_db_rb = $s['result']['database']['ao']['ao_db_rb'];
|
|
||||||
$data->ao_db_rp = $s['result']['database']['ao']['ao_db_rp'];
|
|
||||||
|
|
||||||
$data->ao_admin = $s['result']['admin']['username'];
|
|
||||||
$data->ao_admin_pass = ($p1 !== $p2) ? false : true;
|
|
||||||
|
|
||||||
//*Autoinstall Process and Plugins. By JHL
|
|
||||||
// March 11th. 2009
|
|
||||||
// To enable the way of aoutoinstall process and/or plugins
|
|
||||||
// at same time of initial PM setup
|
|
||||||
|
|
||||||
|
|
||||||
//Get Available autoinstall process
|
|
||||||
$data->availableProcess = $inst->getDirectoryFiles( PATH_OUTTRUNK . "autoinstall", "pm" );
|
|
||||||
|
|
||||||
//Get Available autoinstall plugins
|
|
||||||
$data->availablePlugins = $inst->getDirectoryFiles( PATH_OUTTRUNK . "autoinstall", "tar" );
|
|
||||||
|
|
||||||
//End autoinstall
|
|
||||||
|
|
||||||
|
|
||||||
$data->microtime = microtime( true );
|
|
||||||
echo $oJSON->encode( $data );
|
|
||||||
} elseif ($action === "install") {
|
|
||||||
/*
|
|
||||||
* Installation with SIMPLE POST
|
|
||||||
*
|
|
||||||
* Data necessary for the POST:
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* action=install
|
|
||||||
* data= {"mysqlE":"Path/to/mysql.exe",
|
|
||||||
* "mysqlH":"Mysqlhostname",
|
|
||||||
* "mysqlU":"mysqlUsername",
|
|
||||||
* "mysqlP":"mysqlPassword",
|
|
||||||
* "path_data":"/path/to/workflow_data/",
|
|
||||||
* "path_compiled":"/path/to/compiled/",
|
|
||||||
* "heartbeatEnabled":"1"}
|
|
||||||
*
|
|
||||||
*--------------------------------------------------------------------------------------------------------------
|
|
||||||
*
|
|
||||||
* Steps to install.
|
|
||||||
* 1) This data is required:
|
|
||||||
* $HOSTNAME
|
|
||||||
* $USERNAME
|
|
||||||
* $PASSWORD
|
|
||||||
* $PATH_TO_WORKFLOW_DATA
|
|
||||||
* $PATH_TO_COMPILED DATA
|
|
||||||
* 2) create $PATH_TO_WORKFLOW_DATA
|
|
||||||
* 3) create $PATH_TO_COMPILED_DATA
|
|
||||||
* 4) Create the site workflow
|
|
||||||
*
|
|
||||||
* 4.1 Create user (mysql) wf_workflow , password: sample
|
|
||||||
* 4.1.1 Create database wf_workflow with user wf_workflow
|
|
||||||
* 4.1.2 Give all priviledges to database wf_workflow for user wf_workflow
|
|
||||||
* 4.1.3 Dump file processmaker/workflow/engine/data/mysql/schema.sql
|
|
||||||
* 4.1.4 Dump file processmaker/workflow/engine/data/mysql/insert.sql
|
|
||||||
*
|
|
||||||
* 4.2 Create user (mysql) wf_rbac, password: sample
|
|
||||||
* 4.2.1 Create database wf_rbac with user wf_rbac
|
|
||||||
* 4.2.2 Give all priviledges to databse wf_rbac for user wf_rbac
|
|
||||||
* 4.2.3 Dump file processmaker/rbac/engine/data/mysql/schema.sql
|
|
||||||
* 4.2.4 Dump file processmaker/rbac/engine/data/mysql/insert.sql
|
|
||||||
*
|
|
||||||
* 4.3 Create configuratoin file and directories to site workflow
|
|
||||||
*
|
|
||||||
* 4.3.1 Create directories:
|
|
||||||
*
|
|
||||||
* $PATH_TO_WORKFLOW_DATA./sites/workflow/
|
|
||||||
* $PATH_TO_WORKFLOW_DATA./sites/workflow/cutomFunctions/
|
|
||||||
* $PATH_TO_WORKFLOW_DATA./sites/workflow/rtfs/
|
|
||||||
* $PATH_TO_WORKFLOW_DATA./sites/workflow/xmlforms/
|
|
||||||
* $PATH_TO_WORKFLOW_DATA./sites/workflow/processesImages/
|
|
||||||
* $PATH_TO_WORKFLOW_DATA./sites/workflow/files/
|
|
||||||
* 4.3.2 Create file.
|
|
||||||
*
|
|
||||||
* $PATH_TO_WORKFLOW_DATA./sites/workflow/db.php
|
|
||||||
*
|
|
||||||
* with these contents replacing $HOSTNAME.
|
|
||||||
*
|
|
||||||
<?php
|
|
||||||
// Processmaker configuration
|
|
||||||
define ('DB_ADAPTER', 'mysql' );
|
|
||||||
define ('DB_HOST', $HOSTNAME );
|
|
||||||
define ('DB_NAME', 'wf_workflow' );
|
|
||||||
define ('DB_USER', 'wf_workflow' );
|
|
||||||
define ('DB_PASS', 'sample' );
|
|
||||||
define ('DB_RBAC_HOST', $HOSTNAME );
|
|
||||||
define ('DB_RBAC_NAME', 'rbac_workflow' );
|
|
||||||
define ('DB_RBAC_USER', 'rbac_workflow' );
|
|
||||||
define ('DB_RBAC_PASS', 'sample' );
|
|
||||||
?>
|
|
||||||
|
|
||||||
* 4.4 Create file workflow/engine/config/paths_installed.php with these contents.
|
|
||||||
*
|
|
||||||
* <?php
|
|
||||||
define( 'PATH_DATA', '$PATH_TO_WORKFLOW_DATA' );
|
|
||||||
define( 'PATH_C', '$PATH_TO_COMPILED_DATA' );
|
|
||||||
?>
|
|
||||||
|
|
||||||
* Restarting:
|
|
||||||
* $PATH_TO_WORKFLOW_DATA
|
|
||||||
* $PATH_TO_COMPILED DATA
|
|
||||||
*
|
|
||||||
* 4.2 Update translation from this url (background)
|
|
||||||
*
|
|
||||||
* http://ProcessmakerHostname/sysworkflow/en/classic/tools/updateTranslation
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*5) Auto install processes and plugins
|
|
||||||
*5.1 Install processes
|
|
||||||
*5.2 Install plugins
|
|
||||||
* */
|
|
||||||
|
|
||||||
$report = null;
|
|
||||||
|
|
||||||
try {
|
|
||||||
|
|
||||||
require_once 'Log.php';
|
|
||||||
|
|
||||||
$sp = "/";
|
|
||||||
$dir_data = $dataClient->path_data;
|
|
||||||
|
|
||||||
$dir_data = (substr( $dir_data, - 1 ) == $sp) ? $dir_data : $dir_data . "/";
|
|
||||||
$dir_compiled = $dir_data . "compiled/";
|
|
||||||
$dir_log = "{$dir_data}log/";
|
|
||||||
global $isWindows;
|
|
||||||
|
|
||||||
@mkdir( $dir_data . "sites", 0777, true );
|
|
||||||
@mkdir( $dir_compiled, 0777, true );
|
|
||||||
@mkdir( $dir_log, 0777, true );
|
|
||||||
|
|
||||||
$logFilename = "{$dir_log}install.log";
|
|
||||||
$displayLog = Log::singleton( 'display', '', 'INSTALLER', array ('lineFormat' => "%{message}"
|
|
||||||
) );
|
|
||||||
$fileLog = Log::singleton( 'file', $logFilename, 'INSTALLER' );
|
|
||||||
|
|
||||||
global $logger;
|
|
||||||
$logger = Log::singleton( 'composite' );
|
|
||||||
$logger->addChild( $displayLog );
|
|
||||||
|
|
||||||
$create_db = "create-db.sql";
|
|
||||||
$schema = "schema.sql";
|
|
||||||
|
|
||||||
G::LoadClass( 'Installer' );
|
|
||||||
|
|
||||||
/* Create default workspace called workflow */
|
|
||||||
$inst = new Installer();
|
|
||||||
$siteName = "workflow";
|
|
||||||
$p1 = (isset( $dataClient->ao_admin_pass1 )) ? $dataClient->ao_admin_pass1 : 'admin';
|
|
||||||
$p2 = (isset( $dataClient->ao_admin_pass2 )) ? $dataClient->ao_admin_pass2 : 'admin';
|
|
||||||
|
|
||||||
$s = $inst->create_site( Array ('name' => 'workflow','path_data' => $dataClient->path_data,'path_compiled' => $dataClient->path_compiled,'admin' => Array ('username' => (isset( $dataClient->ao_admin )) ? $dataClient->ao_admin : 'admin','password' => $p1
|
|
||||||
),'advanced' => Array ('ao_db' => (isset( $dataClient->ao_db ) && $dataClient->ao_db === 2) ? false : true,'ao_db_drop' => (isset( $dataClient->ao_db_drop ) && $dataClient->ao_db_drop === true) ? true : false,'ao_db_wf' => (isset( $dataClient->ao_db_wf )) ? $dataClient->ao_db_wf : 'wf_' . $siteName,'ao_db_rb' => (isset( $dataClient->ao_db_rb )) ? $dataClient->ao_db_rb : 'rb_' . $siteName,'ao_db_rp' => (isset( $dataClient->ao_db_rp )) ? $dataClient->ao_db_rp : 'rp_' . $siteName
|
|
||||||
),'database' => Array ('hostname' => $dataClient->mysqlH,'username' => $dataClient->mysqlU,'password' => $dataClient->mysqlP
|
|
||||||
)
|
|
||||||
), true );
|
|
||||||
if ($s['created']) {
|
|
||||||
$report = $inst->report;
|
|
||||||
} else {
|
|
||||||
/* On a failed install, $inst->report is blank because the
|
|
||||||
* installation didnt occured at all. So we use the test report
|
|
||||||
* instead.
|
|
||||||
*/
|
|
||||||
$report = $s['result'];
|
|
||||||
}
|
|
||||||
$installError = (! $s['created']);
|
|
||||||
} catch (Exception $e) {
|
|
||||||
$installError = ($e->getMessage() ? $e->getMessage() : true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($installError) {
|
|
||||||
header( 'HTTP', true, 500 );
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Status is used in the Windows installer, do not change this */
|
|
||||||
print_r( "Status: " . (($installError) ? 'FAILED' : 'SUCCESS') . "\n\n" );
|
|
||||||
|
|
||||||
/* Try to open the file log, if it fails, set it to NULL, so we don't try to
|
|
||||||
* write to it again afterwards. If it succeeds, add to the logger.
|
|
||||||
* Only open the log after writing status, otherwise a warning can be issued
|
|
||||||
* which will affect the Windows installer.
|
|
||||||
*/
|
|
||||||
if (! $fileLog->open()) {
|
|
||||||
$fileLog = null;
|
|
||||||
$displayLog->log( "Failed to create file log in $logFilename" );
|
|
||||||
} else {
|
|
||||||
$logger->addChild( $fileLog );
|
|
||||||
$fileLog->log( " ** Starting installation ** " );
|
|
||||||
$fileLog->log( "Status: " . (($installError) ? 'FAILED' : 'SUCCESS') );
|
|
||||||
$displayLog->log( "This log is also available in $logFilename" );
|
|
||||||
}
|
|
||||||
|
|
||||||
$installArgs = (array) $dataClient;
|
|
||||||
$hiddenFields = array ('mysqlP','ao_admin_pass1','ao_admin_pass2');
|
|
||||||
foreach ($installArgs as $arg => $param) {
|
|
||||||
if (in_array( $arg, $hiddenFields )) {
|
|
||||||
$installArgs[$arg] = "********";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$logger->log( "Installation arguments\n" . neat_r( array ($installArgs) ) );
|
|
||||||
|
|
||||||
if (isset( $report )) {
|
|
||||||
$logger->log( "Installation report\n" . neat_r( array ($report ) ) );
|
|
||||||
} else {
|
|
||||||
$logger->log( "** Installation crashed **" );
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_string( $installError )) {
|
|
||||||
$logger->log( "Error message: $installError" );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($installError) {
|
|
||||||
$logger->log( "Installation ending with errors" );
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
|
|
||||||
$sh = md5( filemtime( PATH_GULLIVER . "/class.g.php" ) );
|
|
||||||
$h = G::encrypt( $dataClient->mysqlH . $sh . $dataClient->mysqlU . $sh . $dataClient->mysqlP . $sh . $inst->cc_status, $sh );
|
|
||||||
$db_text = "<?php\n" . "define( 'PATH_DATA', '" . $dir_data . "' );\n" . "define( 'PATH_C', '" . $dir_compiled . "' );\n" . "define( 'HASH_INSTALLATION','" . $h . "' );\n" . "define( 'SYSTEM_HASH','" . $sh . "' );\n" . "?>";
|
|
||||||
$fp = fopen( FILE_PATHS_INSTALLED, "w" );
|
|
||||||
fputs( $fp, $db_text, strlen( $db_text ) );
|
|
||||||
fclose( $fp );
|
|
||||||
|
|
||||||
/* Update languages */
|
|
||||||
$update = file_get_contents( "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . "/sysworkflow/en/classic/tools/updateTranslation" );
|
|
||||||
$logger->log( "Update language => " . ((! $update) ? $update : "OK") );
|
|
||||||
|
|
||||||
/* Heartbeat Enable/Disable */
|
|
||||||
if (! isset( $dataClient->heartbeatEnabled )) {
|
|
||||||
$dataClient->heartbeatEnabled = true;
|
|
||||||
}
|
|
||||||
$update = file_get_contents( "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . "/sysworkflow/en/classic/install/heartbeatStatus?status=" . $dataClient->heartbeatEnabled );
|
|
||||||
$logger->log( "Heartbeat Status => " . str_replace( "<br>", "\n", $update ) );
|
|
||||||
|
|
||||||
/* Autoinstall Process */
|
|
||||||
$update = file_get_contents( "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . "/sysworkflow/en/classic/install/autoinstallProcesses" );
|
|
||||||
if (trim( str_replace( "<br>", "", $update ) ) == "") {
|
|
||||||
$update = "Nothing to do.";
|
|
||||||
}
|
|
||||||
$logger->log( "Process AutoInstall => " . str_replace( "<br>", "\n", $update ) );
|
|
||||||
|
|
||||||
/* Autoinstall Plugins */
|
|
||||||
$update = file_get_contents( "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . "/sysworkflow/en/classic/install/autoinstallPlugins" );
|
|
||||||
if (trim( str_replace( "<br>", "", $update ) ) == "") {
|
|
||||||
$update = "Nothing to do.";
|
|
||||||
}
|
|
||||||
$logger->log( "Plugin AutoInstall => " . str_replace( "<br>", "\n", $update ) );
|
|
||||||
$logger->log( "Installation finished successfuly" );
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
neat_r works like print_r but with much less visual clutter.
|
|
||||||
By Jake Lodwick. Copy freely.
|
|
||||||
*/
|
|
||||||
function neat_r ($arr, $return = false)
|
|
||||||
{
|
|
||||||
$out = array ();
|
|
||||||
$oldtab = " ";
|
|
||||||
$newtab = " ";
|
|
||||||
|
|
||||||
$lines = explode( "\n", print_r( $arr, true ) );
|
|
||||||
|
|
||||||
foreach ($lines as $line) {
|
|
||||||
|
|
||||||
//remove numeric indexes like "[0] =>" unless the value is an array
|
|
||||||
//if (substr($line, -5) != "Array") {
|
|
||||||
$line = preg_replace( "/^(\s*)\[[0-9]+\] => /", "$1", $line, 1 );
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
//garbage symbols
|
|
||||||
foreach (array ("Array" => "","[" => "","]" => ""
|
|
||||||
) as
|
|
||||||
//" =>" => ":",
|
|
||||||
$old => $new) {
|
|
||||||
$out = str_replace( $old, $new, $out );
|
|
||||||
}
|
|
||||||
|
|
||||||
//garbage lines
|
|
||||||
if (in_array( trim( $line ), array ("Array","(",")",""
|
|
||||||
) )) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
//indents
|
|
||||||
$indent = "";
|
|
||||||
$indents = floor( (substr_count( $line, $oldtab ) - 1) / 2 );
|
|
||||||
if ($indents > 0) {
|
|
||||||
for ($i = 0; $i < $indents; $i ++) {
|
|
||||||
$indent .= $newtab;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$out[] = $indent . trim( $line );
|
|
||||||
}
|
|
||||||
|
|
||||||
$out = implode( "\n", $out );
|
|
||||||
if ($return == true) {
|
|
||||||
return $out;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $out;
|
|
||||||
}
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user