示例#1
0
}
if (!$access) {
    $tpl = new templates();
    echo "alert('" . $tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}') . "');";
    die;
}
if (isset($_GET["sugar-index"])) {
    sugar_index();
    exit;
}
if (isset($_GET["sugar-install"])) {
    sugar_install();
    exit;
}
if (isset($_GET["sugaradminpassword"])) {
    sugar_save();
    exit;
}
js();
function js()
{
    $tpl = new templates();
    $title = $tpl->_ENGINE_parse_body('{APP_SUGARCRM}');
    $page = CurrentPageName();
    $html = "\n\n\n\nfunction sugarStartPage(){\n\tYahooWinS(700,'{$page}?sugar-index=yes&ou={$_GET["ou"]}','{$title}');\n\t}\n\t\nvar x_sugarInstall= function (obj) {\n\tvar tempvalue=obj.responseText;\n\tif(tempvalue.length>0){alert(tempvalue)};\n\tsugarStartPage();\n\t}\n\nfunction sugarInstall(){\n\tvar XHR = new XHRConnection();\n\tdocument.getElementById('logojoom').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>'\n\tXHR.appendData('sugar-install','{$_GET["ou"]}');\n\tXHR.appendData('ou','{$_GET["ou"]}');\t\n\tXHR.sendAndLoad('{$page}', 'GET',x_sugarInstall);\n}\n\nfunction SavesugarForm(){\n\tvar XHR = new XHRConnection();\n\tXHR.appendData('sugaradminname',document.getElementById('sugaradminname').value);\n\tXHR.appendData('sugarservername',document.getElementById('sugarservername').value);\n\tXHR.appendData('sugaradminpassword',document.getElementById('sugaradminpassword').value);\n\t\n\t\n\tXHR.appendData('ou','{$_GET["ou"]}');\t\n\tdocument.getElementById('joomforms').innerHTML='<center><img src=\"img/wait_verybig.gif\"></center>';\n\tXHR.sendAndLoad('{$page}', 'GET',x_sugarInstall);\n\n}\n\n\nsugarStartPage();";
    echo $html;
}
function sugar_index()
{
    $sock = new sockets();
    $sugarinstalled = trim($sock->getfile("IsSugarCRMInstalled:{$_GET["ou"]}"));
示例#2
0
	include_once('ressources/class.users.menus.inc');
	include_once('ressources/class.user.inc');
	
	


	
	if(!checkrights()){
		$tpl=new templates();
		echo "alert('".$tpl->_ENGINE_parse_body('{ERROR_NO_PRIVS}')."');";
		die();
		}
		
	if(isset($_GET["index"])){catchall_index();exit;}
	if(isset($_GET["catch-all-addr"])){catchall_save();exit;}		
	if(isset($_GET["sugaradminpassword"])){sugar_save();exit;}
	js();
	
	
function checkrights(){
	$users=new usersMenus();
	if(!isset($_GET["ou"])){return false;}
	if(!isset($_GET["domain"])){return false;}
	if($_SESSION["uid"]<>-100){if($_SESSION["ou"]<>$_GET["ou"]){return false;}}
	if($users->AsMessagingOrg){return true;}
	if($users->AllowEditOuSecurity){return true;}
	if($users->AsAnAdministratorGeneric){return true;}
	return false;
	
	
}