From ce34aabc8c605c006cee93ea3e11669f2d207608 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 7 Sep 2010 12:15:12 +0000 Subject: [PATCH] Added some dummy functionality to the groupware account git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19548 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../personal/groupware/class_groupware.inc | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/gosa-plugins/groupware/personal/groupware/class_groupware.inc b/gosa-plugins/groupware/personal/groupware/class_groupware.inc index e816b0403..bf15267c5 100644 --- a/gosa-plugins/groupware/personal/groupware/class_groupware.inc +++ b/gosa-plugins/groupware/personal/groupware/class_groupware.inc @@ -85,8 +85,9 @@ class groupware extends plugin } } - // 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(); @@ -100,7 +101,6 @@ class groupware extends plugin function execute() { - // Register plugin execution $display = plugin::execute(); @@ -505,16 +505,27 @@ class groupware extends plugin 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(); + } + } } -- 2.30.2