-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcluster.listener.php
53 lines (31 loc) · 932 Bytes
/
cluster.listener.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
include_once(dirname(__FILE__) . '/ressources/class.main_cf.inc');
include_once(dirname(__FILE__) . '/ressources/class.ldap.inc');
include_once(dirname(__FILE__) . "/ressources/class.sockets.inc");
include_once(dirname(__FILE__) . "/ressources/class.nfs.inc");
if(isset($_GET["TESTCONNECTION"])){TESTCONNECTION();exit;}
if(isset($_GET["LINKING"])){LINKING();exit;}
function TESTCONNECTION(){
echo "[MASTER]\n";
$users=new usersMenus();
if(!$users->NFS_SERVER_INSTALLED){
echo "ERROR=No filesystem installed\n";
return false;
}
$nfs=new nfs();
if(trim($nfs->SanClusterBasePath)==null){
echo "ERROR=No STORAGE configured\n";
return false;
}
echo "ERROR=SUCCESS\n";
echo "\n\n";
}
function LINKING(){
echo "[MASTER]\n";
$ip=$_SERVER['REMOTE_ADDR'];
$nfs=new nfs();
$nfs->NFS_CLUSTER_ADD_CLIENT($ip);
$nfs->SaveToServer();
echo "directory=$nfs->SanClusterBasePath\n";
}
?>