summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 53ed44d)
raw | patch | inline | side by side (parent: 53ed44d)
author | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 9 Sep 2010 12:53:05 +0000 (12:53 +0000) | ||
committer | hzerres <hzerres@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Thu, 9 Sep 2010 12:53:05 +0000 (12:53 +0000) |
fetching primaryMail in comprehensive user function.
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19585 594d385d-05f5-0310-b6e9-bd551577e9d8
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19585 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 1ddc0dfaca16ef017ba5ee04ffe36b0ac293b79c..a6611657dee7cafc76bad70d09c71d989dc1db4d 100644 (file)
var $enabledFeatures = array();
+ var $flagAttributes = array("vacationEnabled","mailBoxWarnLimitEnabled","mailBoxSendSizelimitEnabled",
+ "mailBoxHardSizelimitEnabled","mailBoxAutomaticRemovalEnabled","localDeliveryOnly","dropOwnMails");
+
var $mailAddressSelectDialog = NULL;
var $filterManager = NULL;
var $filterRules = array();
echo "Calling function:".$function."<br>";
$params = func_get_args();
unset($params[0]);
+
$rpc = $this->config->getRpcHandle();
$res = call_user_func_array(array($rpc,$function),array_values($params));
$this->rpcError = !$rpc->success();
}
return($res);
}
-
+ public function isFeatureEnabled($featureName){
+ if(!empty($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
$features = array();
$featureReq = array(
+ "primaryMail" => array(
+ 'acctGetPrimaryMail'),
"quotaUsage" => array(
'acctGetQuota'),
"quotaSize" => array(
var_dump($this->rpcExec('gwAcctGetLocation',$this->uid));
$User =$this->groupwareDao->getComprehensiverUser($this->uid);
+
$response = array("mailAddress"=>"hape@exdom.de",
"mailLocation"=>"hape@exdom.de",
"quotaUsage"=>10,
"dropOwnMails"=>0 );
$this->mapComprehensiveUserData($response);
$this->initially_was_account = $this->is_account = $status;
- $this->accountInitialized = TRUE;
+
+ $this->accountInitialized = TRUE;
+
}
// Set vacation start/stop if not set alreasy
}
// Get ui modifications and store them in the class.
- $testAttrs = array("mailAddress","mailLocation","quotaUsage","quotaSize",
- "alternateAddresses","forwardingAddresses","vacationEnabled","vacationStart",
- "vacationStop","vacationMessage");
- foreach($testAttrs as $attr){
+ foreach($this->attributes as $attr){
if(isset($_POST[$attr]) && $this->acl_is_writeable($attr)){
$this->$attr = get_post($attr);
}
/*
* TODO: ACL check is missing
*/
- // Detect checkbox states
- $checkAttrs = array("mailBoxWarnLimit","mailBoxSendSizelimit",
- "mailBoxHardSizelimit","mailBoxAutomaticRemoval");
- foreach($checkAttrs as $boxname){
- if($this->acl_is_writeable($boxname)){
- $v = $boxname."Value";
- $e = $boxname."Enabled";
- $this->$e = isset($_POST[$e]);
- if($this->$e){
- $this->$v = get_post($v);
- }
- }
- }
+ echo 'ACL checks missing!';
- // Get posted flag changes
- $flagAttrs = array("localDeliveryOnly","dropOwnMails");
- foreach($flagAttrs as $attr){
- if($this->acl_is_writeable($attr)){
- $this->$attr = isset($_POST[$attr]);
- }
+ foreach($this->flagAttributes as $attr){
+ $this->$attr = isset($_POST[$attr]);
}
}
}
*/
class groupware_dao{
private $availableMethods;
+ /*
+ * TODO: fill the following vars on init.
+ */
+ private $accountLocations;
+
+
private static $gwFeatures = array(
- "user" => array("get"=>"acctGetUser",
- "save"=>"acctSetUser",
- "delete"=>"acctDelUser")
+ "primaryAddress" => array( "get"=>"acctGetUser",
+ "save"=>"acctSetUser",
+ "delete"=>"acctDelUser")
+
);
private $groupwarePluginRef = False;
$this->groupwarePluginRef = &$pluginRef;
- $this->availableMethods = $this->groupwarePluginRef->rpcExec('gwGetCapabilities');
+
/*
* TODO:
* Remove all echos
* groupware rpc.
*/
public function init(){
-
+ $this->availableMethods = $this->groupwarePluginRef->rpcExec('gwGetCapabilities');
+ echo "Got the capabilities.";
}
public function save($feature, $valueArray){
if($this->gwFeatureAvailable($feature)){
$result = $this->availableMethods = $this->groupwarePluginRef->rpcExec('gwGetCapabilities');
+
return $result;
}
return false;
* del and return the result.
*/
return false;
-
}
public function gwFeatureAvailable($methodName){
return $this->availableMethods[$methodName];
return $this->groupwarePluginRef->rpcExec("acctGetMailboxLocations");
}
public function getComprehensiverUser($uid){
- $location = $this->groupwarePluginRef->rpcExec("gwGetLocation");
-
- return $location;
+ //$hi = $this->groupwarePluginRef->rpcExec('gwGetCapabilities');
+ if($this->groupwarePluginRef->isFeatureEnabled("primaryMail")){
+ $pMail = $this->groupwarePluginRef->rpcExec("gwAcctGetPrimaryMailAddress",$uid);
+ echo "pMail for $uid<pre>";
+ print_r($pMail);
+ echo "</pre>";
+ }
+ return $pMail;
}
}
?>