summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 392c7a4)
raw | patch | inline | side by side (parent: 392c7a4)
author | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Sep 2010 12:09:02 +0000 (12:09 +0000) | ||
committer | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 14 Sep 2010 12:09:02 +0000 (12:09 +0000) |
// for short comments
/* \brief doxygene style for Function commments
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19662 594d385d-05f5-0310-b6e9-bd551577e9d8
/* \brief doxygene style for Function commments
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19662 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 f81e70cda2e78b9ea9e4b1e265a3b5ae2c72d2d6..65625af3e360bd17dfd73fe50f13cde3e1559c85 100644 (file)
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
+
+
class groupware extends plugin
{
var $plHeadline = "Mail";
var $localDeliveryOnly = FALSE;
var $dropOwnMails = FALSE;
- var $groupwareDao = FALSE;
- function __construct ($config, $dn= NULL)
+ var $groupwareDao = null;
+
+
+ /*
+ * TODO: comment
+ */
+ function __construct ($config, $dn= NULL)
{
plugin::plugin($config,$dn);
$this->init();
}
+
/*! \brief Try to execute a function on the gosa backend using json-rpc.
* This method also takes care about errors and sets the required
* class members, such as rpcError and rpcErrorMessage.
}
return($res);
}
- public function isFeatureEnabled($featureName){
+
+
+ /*
+ * TODO: comment
+ */
+ public function isFeatureEnabled($featureName)
+ {
if(isset($this->enabledFeatures[$featureName]) && $this->enabledFeatures[$featureName]){
return TRUE;
}
return FALSE;
}
+
/*! \brief Try initialize the groupware account.
* This method fetches all required information to manage the
* account using the GOsa gui.
$this->groupwareDao = new groupware_dao($this);
$features = array();
-
- /*
- * feature names with a list of groupware function that must be availabele
- * these groupware functions are not the rpc functions, because they are asked from the groupware server
- */
+ //feature names with a list of groupware function that must be availabele
+ //these groupware functions are not the rpc functions, because they are asked from the groupware server
$featureReq = array(
"primaryMail" => array(
'acctGetPrimaryMailAddress'),
// Get rpc handle to fetch account info and feature availability.
$status = $this->rpcExec('gwAcctExists', $this->uid);
if($status !== NULL){
-
-
$response = $this->groupwareDao->getComprehensiverUser($this->uid);
- /*
- $response = array("mailAddress"=>"hape@exdom.de",
- "mailLocation"=>"mailbox 1",
- "mailLocations"=>array("hape","mailbox 1"),
- "quotaUsage"=>10,
- "quotaSize"=>100,
- "alternateAddresses"=>"alternateAddresses@exdom.de",
- "forwardingAddresses"=>"forwardingAddresses@exdom.de",
- "vacationEnabled"=>1,
- "vacationStart"=>"09.09.2010",
- "vacationStop"=>"08.09.2010",
- "vacationMessage"=>"bin in Urlaub message",
- "mailBoxWarnLimitEnabled"=>1,
- "mailBoxWarnLimitValue"=>99,
- "mailBoxSendSizelimitEnabled"=>1,
- "mailBoxSendSizelimitValue"=>100,
- "mailBoxHardSizelimitEnabled"=>1,
- "mailBoxHardSizelimitValue"=>105,
- "mailBoxAutomaticRemovalEnabled"=>0,
- "mailBoxAutomaticRemovalValue"=>"mailBoxAutomaticRemovalValue",
- "localDeliveryOnly"=>0,
- "dropOwnMails"=>0 );
-
- $response = array_merge( $response, $compResponse);
- */
$this->mapComprehensiveUserData($response);
$this->initially_was_account = $this->is_account = $status;
foreach($this->enabledFeatures as $feature => $state){
$smarty->assign($feature."_isActive", $state);
}
-
$smarty->assign("mailLocations", $this->mailLocations);
if (count($this->vacationTemplates)){
$smarty->assign("initFailed", !$this->accountInitialized);
$smarty->assign("rpcError", $this->rpcError);
$smarty->assign("rpcErrorMessage", $this->rpcErrorMessage);
-
return($display.$smarty->fetch(get_template_path("generic.tpl",TRUE,dirname(__FILE__))));
}
// We ran into a communication error with the backend.
// Try a simple communication operation with the backend
- // again and let us see if it works.
+ // again and let us see if it works.
if(isset($_POST['retry'])){
$this->rpcExec('gwGetCapabilities');
}
/*! \brief Parse vacation templates and build up an array
- containing 'filename' => 'description'.
- Used to fill vacation dropdown box.
- @return Array All useable vacation templates.
+ * containing 'filename' => 'description'.
+ * Used to fill vacation dropdown box.
+ * @return Array All useable vacation templates.
*/
function get_vacation_templates()
{
}
}
- /*
- *save the primary Email Address.
- */
+ //save the primary Email Address.
if(!empty($this->mailAddress)){
$this->groupwareDao->save("primaryMail", $this->uid, $this->mailAddress);
}
- /*
- * save alternateAddresses and forwarding.
- */
+
+ // save alternateAddresses and forwarding.
if(isset($this->alternateAddresses) && is_array($this->alternateAddresses)){
$this->groupwareDao->save("alternateAddresses", $this->uid, $this->alternateAddresses);
}
if(isset($this->forwardingAddresses) && is_array($this->forwardingAddresses)){
$this->groupwareDao->save("forwardingAddresses", $this->uid, $this->forwardingAddresses);
}
- /*
- * save the quota
- */
- if(true){
+
+ //save the quota
+ if(true){
$quota = array( "warn_limit" => $this->mailBoxWarnLimitValue,
"send_limit" => $this->mailBoxSendSizelimitValue,
"hard_limit" => $this->mailBoxHardSizelimitValue,
* TODO: Remove all echo Messages
*/
$messages = plugin::check();
- /*
- * Check the dates
- */
+ //Check the dates
/*
* TODO: check only if features are enabled.
*/
if(!tests::is_email ($this->mailAddress)){
$messages[] = msgPool::invalid(_("Mail address"),$this->mailAddress , "", _("Example: user@excom.intranet.gonicus.de"));
}
- /*
- * forwarding Addresses
- * $alternateAddresses
- * $forwardingAddresses
- */
+
if(isset($this->forwardingAddresses) && is_array($this->forwardingAddresses)){
foreach($this->forwardingAddresses as $fAddress){
if(!tests::is_email ($fAddress)){
}
}
}
- //TODO: Checks for quota and Locations?
+ /*
+ * TODO: Checks for quota and Locations?
+ */
return($messages);
}
}
- /*
- * maps the resultset fetched from the Dao to the class variables
- * of the plugin.
+ /*! \brief maps the resultset fetched from the Dao to the class variables
+ * of the plugin.
*/
function mapComprehensiveUserData($callBackMap)
{
+ //dropdown
$this->mailLocations = $callBackMap["mailLocations"];
-
+ //data from the groupware
$this->mailAddress = $callBackMap["primaryMail"];
$this->mailLocation = $callBackMap["mailLocation"];
$this->quotaUsage = $callBackMap["quotaUsage"];
$this->mailBoxAutomaticRemovalValue = $callBackMap["mailBoxAutomaticRemovalValue"];
$this->localDeliveryOnly = $callBackMap["localDeliveryOnly"];
$this->dropOwnMails = $callBackMap["dropOwnMails"];
-
}
}
-/*
- * Data Access Object for groupwares
+/*! \brief Data Access Object for groupwares
*/
class groupware_dao{
/*
private $groupwarePluginRef = False;
- /*
- * Constructor sets the connection to the rpc service
- * initializes the class
+ /*! \brief Constructor sets the connection to the rpc service
+ * initializes the class
*/
function __construct(&$pluginRef)
{
}
- /*
- * gets the capabilities of the server
+ /*! \brief gets the capabilities of the server
* builds an array with availbale features and knows how to call get, save, delete functions of
* groupware rpc.
*/
}
- /*
- * generic saving method for all features defined in $gwFeatures
+ /*! \brief generic saving method for all features defined in $gwFeatures
* which are the available features.
*/
public function save($feature, $uid, $valueArray)
}
- /*
- * generic get method for all features defined in $gwFeatures
- * which are the available features.
+ /*! \brief generic get method for all features defined in $gwFeatures
+ * which are the available features.
*/
public function get($feature, $valueArray)
{
}
- /*
- * generic delete function for all features defined in $gwFeatures
- * which are the available features.
+ /*! \brief generic delete function for all features defined in $gwFeatures
+ * which are the available features.
*
* NOT YET IMPLEMENTED
*/
}
- /*
- * determine availability of features.
+ /*! \brief determine availability of features.
+ *
* @param methodName
* @return boolean
*/
}
- /*
- * comprehensive user info will dessolve into one groupware call later
- * right now it will get all data of the features that are available in the plugin.
+ /*! \brief comprehensive user info will dessolve into one groupware call later
+ * right now it will get all data of the features that are available in the plugin.
* @param int $uid
* @return assoc array "feature" => "gwValue";
*/
$this->groupwarePluginRef->isFeatureEnabled("mailBoxSendSizelimit") ||
$this->groupwarePluginRef->isFeatureEnabled("mailBoxHardSizelimit")){
- /*
- * Usage is a Mapi function which is not yet
- */
+ //Usage is a Mapi function which is not yet
/*
* TODO:
* remove the following dummy and enable the qota fetch from groupware
}
}
- /*
- * this function seems to be broken on the server.
- * addding dummy
- */
+ //this function seems to be broken on the server.
+ //addding dummy
+
if($this->groupwarePluginRef->isFeatureEnabled("vacationMessage")){
$vacMessage = $this->get("vacationMessage", array($uid));