Ejemplo n.º 1
0
    exit;
}
if (isset($_GET["CreateMBX"])) {
    CreateMBX();
    exit;
}
if (isset($_GET["MBXSetACL"])) {
    MBXSetACL();
    exit;
}
if (isset($_GET["MBXSubscribe"])) {
    MBXSubscribe();
    exit;
}
if (isset($_GET["StatusFailed"])) {
    StatusFailed();
    exit;
}
js();
//error_creating_mailbox
function js()
{
    $page = CurrentPageName();
    $tpl = new templates();
    $uid = $_GET["uid"];
    $title = $tpl->_ENGINE_parse_body('{mailbox_main_settings}');
    $html = "\n\t\n\tfunction LoadMBXInterface(){\n\t\tRTMMail('550','{$page}?popup=yes','{$title}');\n\t\tsetTimeout('MBXCheckrights()',1000);\n\t}\n\t\n\tfunction mbxFilogs(logs){\n\t\tlogs=escapeVal(logs,'<br>');\n\t\tvar MBX_textlogs=document.getElementById('MBX_textlogs').innerHTML;\n\t\tMBX_textlogs='<div style=\"margin:3px;padding:3px;border-bottom:1px solid #CCCCCC\"><code>'+logs+'</code></div>'+MBX_textlogs;\n\t\tdocument.getElementById('MBX_textlogs').innerHTML=MBX_textlogs;\n\t}\n\t\n\tvar x_MBXChangeStatus= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tdocument.getElementById('progression_mbx_compile').innerHTML=tempvalue;\n\t\t\n\t}\t\n\n\tfunction MBXChangeStatusFailed(){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('StatusFailed','yes');\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_MBXChangeStatus);\t\n\t}\t\n\t\n\tfunction MBXChangeStatus(number){\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('Status',number);\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_MBXChangeStatus);\t\n\t}\n\t\n\tvar x_MBXCheckrights= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tif(tempvalue.length>3){\n\t\t\tmbxFilogs(tempvalue);\n\t\t\tfinish_failed();\n\t\t\treturn;\n\t\t}\n\t\tCreateMBX();\n\t}\t\t\n\n\tfunction MBXCheckrights(){\n\t\tMBXChangeStatus(10);\n\t\tvar mp_l=1;\n\t\tvar mp_r=1;\n\t\tvar mp_s=1;\n\t\tvar mp_w=1;\n\t\tvar mp_i=1;\n\t\tvar mp_p=1;\n\t\tvar mp_c=1;\n\t\tvar mp_d=1;\n\t\tvar mp_a=1;\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('checkrights','{$uid}');\n\t\tXHR.appendData('MailboxActive',document.getElementById('MailboxActive').value);\n\t\tXHR.appendData('MailBoxMaxSize',document.getElementById('MailBoxMaxSize').value);\n\t\tif(document.getElementById('mp_l').checked){mp_l=1;}else{mp_l=0;}\n\t\tif(document.getElementById('mp_r').checked){mp_r=1;}else{mp_r=0;}\n\t\tif(document.getElementById('mp_s').checked){mp_s=1;}else{mp_s=0;}\n\t\tif(document.getElementById('mp_w').checked){mp_w=1;}else{mp_w=0;}\n\t\tif(document.getElementById('mp_i').checked){mp_i=1;}else{mp_i=0;}\n\t\tif(document.getElementById('mp_p').checked){mp_p=1;}else{mp_p=0;}\n\t\tif(document.getElementById('mp_c').checked){mp_c=1;}else{mp_c=0;}\n\t\tif(document.getElementById('mp_d').checked){mp_d=1;}else{mp_d=0;}\n\t\tif(document.getElementById('mp_a').checked){mp_a=1;}else{mp_a=0;}\t\n\t\t\n\t\tXHR.appendData('mp_l',mp_l);\n\t\tXHR.appendData('mp_r',mp_r);\n\t\tXHR.appendData('mp_s',mp_s);\n\t\tXHR.appendData('mp_w',mp_w);\n\t\tXHR.appendData('mp_i',mp_i);\n\t\tXHR.appendData('mp_p',mp_p);\n\t\tXHR.appendData('mp_c',mp_c);\n\t\tXHR.appendData('mp_d',mp_d);\n\t\tXHR.appendData('mp_a',mp_a);\n\t\t\n\t\t\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_MBXCheckrights);\t\n\t}\n\t\n\t\n\tvar x_CreateMBX= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tmbxFilogs(tempvalue);\n\t\tMBXSetACL();\n\t}\n\n\tvar x_MBXSetACL= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tmbxFilogs(tempvalue);\n\t\tMBXSubscribe();\n\t\t\n\t}\t\n\t\n\n\tvar x_MBXSubscribe= function (obj) {\n\t\tvar tempvalue=obj.responseText;\n\t\tmbxFilogs(tempvalue);\n\t\tfinish();\n\t\tRefreshTab('container-users-tabs');\n\t\tYahooWinHide();\n\t}\t\t\n\t\n\tfunction CreateMBX(){\n\t\tMBXChangeStatus(20);\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('CreateMBX','{$uid}');\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_CreateMBX);\t\n\t}\t\n\t\n\tfunction MBXSetACL(){\n\t\tMBXChangeStatus(50);\n\t\tvar XHR = new XHRConnection();\n\t\tXHR.appendData('MBXSetACL','{$uid}');\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_MBXSetACL);\t\n\t}\n\n\tfunction MBXSubscribe(){\n\t\tMBXChangeStatus(80);\n\t\tvar XHR = new XHRConnection();\n\t\tmbxFilogs('subscription');\n\t\tXHR.appendData('MBXSubscribe','{$uid}');\n\t\tXHR.sendAndLoad('{$page}', 'GET',x_MBXSubscribe);\t\n\t}\t\n\n\tfunction finish(){\n\t\tMBXChangeStatus(100);\n\t\tdocument.getElementById('wait_image_mbx').innerHTML='&nbsp;';\n\t\tRefreshTab('container-users-tabs');\n\t\tYahooWinHide();\n\t\t\n\t}\n\n\tfunction finish_failed(){\n\t\tdocument.getElementById('wait_image_mbx').innerHTML='&nbsp;';\n\t\tMBXChangeStatusFailed();\n\t\tRefreshTab('container-users-tabs');\n\t\tYahooWinHide();\n\t}\n\t\n\tfunction escapeVal(content,replaceWith){\n\t\tcontent = escape(content) \n\t\n\t\t\tfor(i=0; i<content.length; i++){\n\t\t\t\tif(content.indexOf(\"%0D%0A\") > -1){\n\t\t\t\t\tcontent=content.replace(\"%0D%0A\",replaceWith)\n\t\t\t\t}\n\t\t\t\telse if(content.indexOf(\"%0A\") > -1){\n\t\t\t\t\tcontent=content.replace(\"%0A\",replaceWith)\n\t\t\t\t}\n\t\t\t\telse if(content.indexOf(\"%0D\") > -1){\n\t\t\t\t\tcontent=content.replace(\"%0D\",replaceWith)\n\t\t\t\t}\n\t\n\t\t\t}\t\n\t\treturn unescape(content);\n\t}\t\t\n\t\n\t\n\t\n\tLoadMBXInterface();";
    echo $html;
}
function popup()
{
	$usr=new usersMenus();
	
	
	if($usr->AsMailBoxAdministrator==false){
		$tpl=new Templates();
		echo "alert('".$tpl->javascript_parse_text('{ERROR_NO_PRIVS}')."');";
		die();
	}	
	
	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_GET["Status"])){echo Status($_GET["Status"]);exit;}
	if(isset($_GET["checkrights"])){checkrights();exit;}
	if(isset($_GET["CreateMBX"])){CreateMBX();exit;}
	if(isset($_GET["MBXSetACL"])){MBXSetACL();exit;}
	if(isset($_GET["MBXSubscribe"])){MBXSubscribe();exit;}
	if(isset($_GET["StatusFailed"])){StatusFailed();exit;}
	
	
js();

//error_creating_mailbox
function js(){
	$page=CurrentPageName();
	$tpl=new templates();
	$uid=$_GET["uid"];
	$title=$tpl->_ENGINE_parse_body('{mailbox_main_settings}');
	$html="
	
	function LoadMBXInterface(){
		RTMMail('550','$page?popup=yes','$title');
		setTimeout('MBXCheckrights()',1000);