From c13e26a072d3cf3295c477b8b4c36da0cde394db Mon Sep 17 00:00:00 2001 From: paulr Date: Sat, 19 Jun 2010 10:46:37 +1000 Subject: [PATCH] various stuff... initial coding mostly --- design/beginnings | 23 +++++++++++++++++++++- design/system interaction | 18 ++++++++++++++++- etc/config.php | 9 ++++++++ lib/lib.php | 6 +++++ plugins/samba.php | 5 ++++ sms/sms.php | 6 +++++ test/test.php | 46 +++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 111 insertions(+), 2 deletions(-) create mode 100644 etc/config.php create mode 100644 lib/lib.php create mode 100644 plugins/samba.php create mode 100644 test/test.php diff --git a/design/beginnings b/design/beginnings index 522c2d3..56497c9 100644 --- a/design/beginnings +++ b/design/beginnings @@ -17,4 +17,25 @@ there will also be a user created called root@domain which will be how people "j once a machine has a domain, its then up to the user to connect as a priveledge user (root for eg) then create users and assign them priveledges -on multi-machine domains, things get blah blah \ No newline at end of file +on multi-machine domains, things get blah blah + +ok, so what each user does: +1) system@domain/super is responsible for naming. i.e. you can ask it what machines exist on that domain, what users and what groups, plus +creation of them +2) hostname@domain/system is responsible for managing the system. if you want to restart a daemon or change its config, messages +go to that user. + +what im trying to sya here is that system will be responsible for managing users and assigning them to groups and so forth, but hostname@domain +will be responsible for allowing access to resources based on the group or user of a person + +initial interaction will be via text via a good ol xmpp chat client... + +i.e. to system: list users, list groups, list computers + +i.e. to hostname: list services, restart service, etc. + +i.e. from hostname to user: log messages of importance (crash errors, filesystems filling up, things like that). + +i.e. from system to user: log messages of importance (creation/deleteion of users and stuff). + +lets start with that, and see where it takes us. \ No newline at end of file diff --git a/design/system interaction b/design/system interaction index 4b883c0..1309fb2 100644 --- a/design/system interaction +++ b/design/system interaction @@ -1 +1,17 @@ -tasdf \ No newline at end of file + +How this system will come together +================================== + +This system will work on a basis of connectors. + +Lets talk about a single system which will have the following things running on it: +1) auth/pam +2) group management +3) management stuff for services.. i.e. webmin type thing + +so basically the system will startup and an xmpp daemon will start up with it. the daemon used should be able to be "anything". The following daemons will run: +1) xmpp server +2) auth interaction server (and cache) with a pam plugin. +3) config management server + +ug.. its ugly, its ugly... diff --git a/etc/config.php b/etc/config.php new file mode 100644 index 0000000..8652167 --- /dev/null +++ b/etc/config.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/lib/lib.php b/lib/lib.php new file mode 100644 index 0000000..cdd96b9 --- /dev/null +++ b/lib/lib.php @@ -0,0 +1,6 @@ + \ No newline at end of file diff --git a/plugins/samba.php b/plugins/samba.php new file mode 100644 index 0000000..21bfd01 --- /dev/null +++ b/plugins/samba.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/sms/sms.php b/sms/sms.php index 15c5adc..4ac0d58 100644 --- a/sms/sms.php +++ b/sms/sms.php @@ -1,3 +1,9 @@ \ No newline at end of file diff --git a/test/test.php b/test/test.php new file mode 100644 index 0000000..e412c39 --- /dev/null +++ b/test/test.php @@ -0,0 +1,46 @@ +autoSubscribe(); + +try { + $conn->connect(); + while(!$conn->isDisconnected()) { + //$payloads = $conn->processUntil(); + $payloads = $conn->processUntil(array('message', 'presence', 'end_stream', 'session_start', 'subscription_requested')); + print_r($payloads); + foreach($payloads as $event) { + $pl = $event[1]; + switch($event[0]) { + case 'message': + print "---------------------------------------------------------------------------------\n"; + print "Message from: {$pl['from']}\n"; + if($pl['subject']) print "Subject: {$pl['subject']}\n"; + print $pl['body'] . "\n"; + print "---------------------------------------------------------------------------------\n"; + $conn->message($pl['from'], $body="Thanks for sending me \"{$pl['body']}\".", $type=$pl['type']); + if($pl['body'] == 'quit') $conn->disconnect(); + if($pl['body'] == 'break') $conn->send(""); + break; + case 'presence': + print "Presence: {$pl['from']} [{$pl['show']}] {$pl['status']}\n"; + break; + case 'session_start': + print "Session Start\n"; + $conn->getRoster(); + $conn->presence($status="Cheese!"); + break; + } + } + } +} catch(XMPPHP_Exception $e) { + die($e->getMessage()); +} +?> \ No newline at end of file -- 1.7.0.4