summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c25cdd2)
raw | patch | inline | side by side (parent: c25cdd2)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Sep 2010 12:15:12 +0000 (12:15 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 7 Sep 2010 12:15:12 +0000 (12:15 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19548 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/groupware/personal/groupware/class_groupware.inc | patch | blob | history |
diff --git a/gosa-plugins/groupware/personal/groupware/class_groupware.inc b/gosa-plugins/groupware/personal/groupware/class_groupware.inc
index e816b0403a3edc30bd0fb42d103ac6518f3d1ec3..bf15267c510d8d7e43f425f99f205d739a6fcac3 100644 (file)
}
}
- // TODO: Detect if we've a valid groupware account here.
- $this->is_account = FALSE;
+ // Get rpc handle to fetch account info and feature availability.
+ $rpc = $this->config->getRpcHandle();
+ $this->initially_was_account = $this->is_account = $rpc->gwAcctExists($this->uid);
// Set vacation start/stop if not set alreasy
$this->vacationStart = time();
function execute()
{
-
// Register plugin execution
$display = plugin::execute();
function remove_from_parent()
{
- /* Cancel if there's nothing to do here */
- if (!$this->initially_was_account){
- return;
+ // Get rpc handle to remove the account
+ if($this->initially_was_account){
+ $rpc = $this->config->getRpcHandle();
+ $rpc->gwAcctDel($this->uid,TRUE);
+ if(!$rpc->success()){
+ echo $rpc->getError();
+ }
}
-
}
function save()
{
+ // Get rpc handle to create or update the account
+ if(!$this->initially_was_account){
+ $rpc = $this->config->getRpcHandle();
+ $rpc->gwAcctAdd($this->uid,$this->mailAddress);
+ if(!$rpc->success()){
+ echo $rpc->getError();
+ }
+ }
}