コード例 #1
0
<?php

if (posix_getuid() != 0) {
    die("Cannot be used in web server mode\n\n");
}
include_once dirname(__FILE__) . '/ressources/class.templates.inc';
include_once dirname(__FILE__) . '/ressources/class.ini.inc';
include_once dirname(__FILE__) . '/ressources/class.samba.inc';
include_once dirname(__FILE__) . '/samba.sid.php';
system('/usr/share/artica-postfix/bin/artica-install --samba-reconfigure');
$ldap = new clladp();
$samba = new samba();
$sid = $ldap->LOCAL_SID();
$samba->ChangeSID($sid);
SMBCHANGECOMPUTERS();
SMBGROUPS();
SMBCHANGEUSERS();
SMBRESTART();
die;
コード例 #2
0
ファイル: samba.sid.php プロジェクト: brucewu16899/1.6.x
	include_once(dirname(__FILE__).'/ressources/class.samba.inc');
	include_once(dirname(__FILE__).'/ressources/class.computers.inc');
	include_once(dirname(__FILE__).'/ressources/class.groups.inc');
	include_once(dirname(__FILE__).'/ressources/class.user.inc');
	
	
	

if(isset($_GET["popup-index"])){popup();exit;}
if(isset($_GET["SID_SUFFIX"])){save();exit;}
if(isset($_GET["popup-logs"])){popup_logs();exit;}
if(isset($_GET["Status"])){echo Status($_GET["Status"]);exit;}
if(isset($_GET["SMBRESTART"])){SMBRESTART();exit;}
if(isset($_GET["SMBCHANGECOMPUTERS"])){SMBCHANGECOMPUTERS();exit;}
if(isset($_GET["SMBGROUPS"])){SMBGROUPS();exit;}
if(isset($_GET["SMBCHANGEUSERS"])){SMBCHANGEUSERS();exit;}
if(posix_getuid()<>0){js();}
function js(){

$page=CurrentPageName();
$prefix=str_replace($page,'.','',$prefix);
$tpl=new templates();
$title=$tpl->_ENGINE_parse_body('{CHANGE_SID_TEXT}','samba.index.php');
	
	$users=new usersMenus();
	if(!$users->AsSambaAdministrator){
		$error=$tpl->_ENGINE_parse_body("{ERROR_NO_PRIVS}");
		echo "alert('$error')";
		die();
	}