예제 #1
0
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();
	
	
	}
예제 #2
0
    exit;
}
if (isset($_GET["ufdb"])) {
    ufdb_js();
    exit;
}
if (isset($_GET["popup-ufdb"])) {
    ufdb_popup();
    exit;
}
if (isset($_GET["popup-justbutton"])) {
    justbutton();
    exit;
}
if (isset($_GET["popup-activedirectory"])) {
    activedirectory();
    exit;
}
js();
function js()
{
    $tpl = new templates();
    $title = $tpl->_ENGINE_parse_body("{urgency_mode}");
    $page = CurrentPageName();
    header("content-type: application/x-javascript");
    $html = "\n\t\tjQuery(function(){\n\t\t\tjQuery('head').append('<link href=\"/css/styles_main.css\" rel=\"stylesheet\" type=\"text/css\" title=\"styles_main_css\"  />');\n\t\t\tjQuery('head').append('<link href=\"/ressources/templates/default/blurps.css\" rel=\"stylesheet\" type=\"text/css\" title=\"blurps_css\"/>');\n\t\t\t\n\t\t\t\n\t\t});\n\n\t\n\t\n\tYahooWin3('700','{$page}?popup=yes&justbutton={$_GET["justbutton"]}','{$title}');";
    echo $html;
}
function justbutton_js()
{
    $tpl = new templates();
예제 #3
0
function reconfigure()
{
    $unix = new unix();
    $sock = new sockets();
    $EnableSambaActiveDirectory = $sock->GET_INFO("EnableSambaActiveDirectory");
    if ($EnableSambaActiveDirectory == 1) {
        activedirectory();
    }
    CheckExistentDirectories();
    $samba = new samba();
    @file_put_contents("/etc/samba/smb.conf", $samba->BuildConfig());
    if (!is_file("/var/lib/samba/usershares/data")) {
        @mkdir("/var/lib/samba/usershares", null, true);
        @file_put_contents("/var/lib/samba/usershares/data", "#");
    }
    SambaAudit();
    ParseHomeDirectories();
    $samba = new samba();
    $net = $unix->find_program("net");
    $master_password = $samba->GetAdminPassword("administrator");
    $SambaEnableEditPosixExtension = $sock->GET_INFO("SambaEnableEditPosixExtension");
    if ($SambaEnableEditPosixExtension == 1) {
        $cmd = "{$net} idmap secret {$samba->main_array["global"]["workgroup"]} {$master_password} >/dev/null 2>&1 &";
        shell_exec($cmd);
        $cmd = "{$net} idmap secret alloc {$master_password} >/dev/null 2>&1 &";
    }
    if ($EnableSambaActiveDirectory == 1) {
        kinit();
    }
    shell_exec("/usr/share/artica-postfix/bin/artica-install --samba-reconfigure >/dev/null 2>&1");
}