Преглед изворни кода

File Sync Perms multidomain support

Piotr Labudda пре 11 година
родитељ
комит
69dcc19cb7
2 измењених фајлова са 5 додато и 4 уклоњено
  1. 1 1
      SE/VERSION
  2. 4 3
      SE/bash_sync_perms.php

+ 1 - 1
SE/VERSION

@@ -1 +1 @@
-3.9.9-6
+3.9.9-7

+ 4 - 3
SE/bash_sync_perms.php

@@ -269,6 +269,7 @@ class SyncPerms {
 
 
 	public static function run($script_name, $domain, $arg2 = null, $arg3 = null) {
 	public static function run($script_name, $domain, $arg2 = null, $arg3 = null) {
 		if ($arg2 == 'addToLaunchctl') {
 		if ($arg2 == 'addToLaunchctl') {
+			$plistFile = "/Library/LaunchDaemons/pl.biallnet.sync_perms.{$domain}.php.plist";
 			system("echo \"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
 			system("echo \"<?xml version=\"1.0\" encoding=\"UTF-8\"?>
 <!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
 <!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">
 <plist version=\"1.0\">
 <plist version=\"1.0\">
@@ -276,7 +277,7 @@ class SyncPerms {
 	<key>Disabled</key>
 	<key>Disabled</key>
 		<false/>  
 		<false/>  
 		<key>Label</key>
 		<key>Label</key>
-		<string>pl.biallnet.sync_perms.php</string>
+		<string>pl.biallnet.sync_perms.{$domain}.php</string>
 		<key>UserName</key>
 		<key>UserName</key>
 		<string>root</string>
 		<string>root</string>
 		<key>ProgramArguments</key>
 		<key>ProgramArguments</key>
@@ -290,8 +291,8 @@ class SyncPerms {
 </dict>
 </dict>
 </plist>
 </plist>
 
 
-\" > /Library/LaunchDaemons/pl.biallnet.sync_perms.php.plist");
-			echo "Run By Root: launchctl load /Library/LaunchDaemons/pl.biallnet.sync_perms.php.plist\n";
+\" > {$plistFile}");
+			echo "Run as root: launchctl load {$plistFile} \n";
 		}
 		}
 		else if ($arg2 == 'newFiles') {
 		else if ($arg2 == 'newFiles') {
 			$time = new stdClass();
 			$time = new stdClass();