summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 89d550b)
raw | patch | inline | side by side (parent: 89d550b)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 13 May 2005 11:48:02 +0000 (11:48 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Fri, 13 May 2005 11:48:02 +0000 (11:48 +0000) |
TODO | patch | blob | history | |
plugins/personal/connectivity/class_kolabAccount.inc | patch | blob | history | |
plugins/personal/posix/class_posixAccount.inc | patch | blob | history |
index 2f10b65fcdedd25d3d9642e4114df11230f6a8f7..32db0aa39a8f067efab6b9a8463b2b62d362f5e6 100644 (file)
--- a/TODO
+++ b/TODO
* Make it "barrierefrei"
+* Unify filters (User -> Add local)
+
+* Check for iconv support in setup
+
Target for 2.4:
===============
diff --git a/plugins/personal/connectivity/class_kolabAccount.inc b/plugins/personal/connectivity/class_kolabAccount.inc
index 0bff3f32651195801d26ac64e8db004ce7195bb9..a7a609a5ad747c74f4374b7c4bb0b29fa291f169 100644 (file)
var $attributes= array( "kolabFreeBusyFuture", "unrestrictedMailSize", "calFBURL");
var $objectclasses= array();
+ /* Helper */
+ var $imapping= array();
+
function kolabAccount ($config, $dn= NULL)
{
plugin::plugin ($config, $dn);
$smarty->assign($val."ACL", chkacl($this->acl, "$val"));
}
+ /* Check for invitation action */
+ $nr= 0;
+ while (isset($_POST["policy$nr"])){
+ if (isset($_POST["add$nr"])){
+ $this->kolabInvitationPolicy[]= ": ACT_MANUAL";
+ }
+ if (isset($_POST["remove$nr"])){
+ $new= array();
+ foreach ($this->kolabInvitationPolicy as $entry){
+ if (!preg_match("/^".$this->imapping[$nr].":/", $entry)){
+ $new[]= $entry;
+ }
+ }
+ $this->kolabInvitationPolicy= $new;
+ }
+ $nr++;
+ }
+
+ /* Unify addresses */
+ $new= array();
+ foreach($this->kolabInvitationPolicy as $value){
+ if (preg_match('/^:/', $value)){
+ continue;
+ }
+ $address= preg_replace('/^([^:]+:).*$/', '\1', $value);
+ $new[$address]= $value;
+ }
+ $this->kolabInvitationPolicy= array();
+ foreach($new as $value){
+ $this->kolabInvitationPolicy[]= $value;
+ }
+
/* Add delegation */
if (isset($_POST['add_delegation'])){
if ($_POST['delegate_address'] != ""){
/* Create InvitationPolicy table */
$invitation= "";
+ $this->imapping= array();
$nr= 0;
$acl= chkacl($this->acl, "kolabInvitationPolicy");
foreach ($this->kolabInvitationPolicy as $entry){
/* The default entry does not have colons... */
if (!preg_match('/:/', $entry)){
$invitation.= _("Anonymous");
+ $name= "";
$mode= $entry;
} else {
$name= preg_replace('/:.*$/', '', $entry);
- $mode= preg_replace('/^[^:]+: */', '', $entry);
- $invitation.= "<input name=\"address$nr\" size=25 maxlength=60 $acl value=\"$name\">";
+ $mode= preg_replace('/^[^:]*: */', '', $entry);
+ $invitation.= "<input name=\"address$nr\" size=16 maxlength=60 $acl value=\"$name\">";
}
$invitation.= "</td>";
/* Assign buttons */
$button= "";
if ($nr == count($this->kolabInvitationPolicy)-1){
- $button= "[Add button]";
- } elseif ($nr != 0) {
- $button= "[Remove button]";
+ $button= "<input type=submit name=\"add$nr\" value=\""._("Add")."\">";
+ }
+ if ($nr != 0) {
+ $button.= "<input type=submit name=\"remove$nr\" value=\""._("Remove")."\">";
}
$invitation.= "</select> $button</td></tr>\n";
+ $this->imapping[$nr]= $name;
$nr++;
}
$smarty->assign("invitation", $invitation);
$message[]= _("The value specified as Free Busy Information URL is invalid.");
}
+ /* Check invitation policy for existing mail addresses */
+ foreach($this->kolabInvitationPolicy as $policy){
+
+ /* Ignore anonymous string */
+ if (!preg_match('/:/', $policy)){
+ continue;
+ }
+
+ $address= preg_replace('/^([^:]+).*$/', '\1', $policy);
+ if (!is_email($address)){
+ if (!is_email($address, TRUE)){
+ $message[]= sprintf(_("The invitation policy entry for address '%s' is not valid."), $address);
+ }
+ } else {
+
+ $ldap= $this->config->get_ldap_link();
+ $ldap->cd ($this->config->current['BASE']);
+ $ldap->search('(mail='.$address.')');
+ if ($ldap->count() == 0){
+ $message[]= sprintf(_("There's no mail user with address '%s' for your invitation policy!"), $address);
+ } else {
+ $valid= TRUE;
+ }
+ }
+ }
+
return ($message);
}
{
plugin::save();
- /* Transfer delegation array */
+ /* Transfer arrays */
$this->attrs['kolabDelegate']= $this->kolabDelegate;
+ $this->attrs['kolabInvitationPolicy']= $this->kolabInvitationPolicy;
/* Write back to ldap */
$ldap= $this->config->get_ldap_link();
diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc
index f6616018b166e8a0a47c114025dcd24cc7c69019..47b7b36ada1c2b0c9ab95955e8279d7b165c0083 100644 (file)
$ldap->search("(&(objectClass=posixGroup)(gidNumber=".$this->gidNumber."))", array("cn"));
/* Create group if it doesn't exist */
- if (!$ldap->count()){
+ if ($ldap->count() == 0){
$groupdn= preg_replace ('/^'.$this->config->current['DNMODE'].'=[^,]+,'.get_people_ou().'/i', 'cn='.$this->uid.','.get_groups_ou(), $this->dn);
$g= new group($this->config, $groupdn);