index 45a9b06be81afac68050a0380c3907885e109594..7b79378f378894218e6a5fdc23e9752f1204781d 100644 (file)
if (isset($this->attrs['member'])){
foreach ($this->attrs['member'] as $key => $value){
if ("$key" != "count"){
if (isset($this->attrs['member'])){
foreach ($this->attrs['member'] as $key => $value){
if ("$key" != "count"){
+ $value= @LDAP::convert($value);
$this->member["$value"]= "$value";
}
}
$this->member["$value"]= "$value";
}
}
"W" => "workstations",
"T" => "terminals",
"F" => "phones",
"W" => "workstations",
"T" => "terminals",
"F" => "phones",
+ "_" => "subtrees",
"P" => "printers") as $key => $val){
if (preg_match("/$key/", $this->gosaGroupObjects)){
"P" => "printers") as $key => $val){
if (preg_match("/$key/", $this->gosaGroupObjects)){
if ($this->dn == "new"){
$this->base= $_SESSION['CurrentMainBase'];
} else {
if ($this->dn == "new"){
$this->base= $_SESSION['CurrentMainBase'];
} else {
- $this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn);
+ $this->base= preg_replace("/^[^,]+,".get_groups_ou()."/","",$this->dn);
}
/* set permissions */
}
/* set permissions */
$this->reload();
}else{
/* Delete objects from group */
$this->reload();
}else{
/* Delete objects from group */
- if (isset($_POST['delete_membership']) && isset($_POST['members'])){
+ if (isset($_POST['delete_membership']) && isset($_POST['members']) && chkacl($this->acl,"gosaGroupObjects") == ""){
foreach ($_POST['members'] as $value){
$this->objects["$value"]= $this->memberList[$value];
unset ($this->memberList["$value"]);
foreach ($_POST['members'] as $value){
$this->objects["$value"]= $this->memberList[$value];
unset ($this->memberList["$value"]);
}
/* Add objects to group */
}
/* Add objects to group */
- if (isset($_POST['add_object_finish']) && isset($_POST['objects'])){
+ if (isset($_POST['add_object_finish']) && isset($_POST['objects']) && chkacl($this->acl,"gosaGroupObjects") == ""){
foreach ($_POST['objects'] as $value){
$this->memberList["$value"]= $this->objects[$value];
$this->member["$value"]= $value;
foreach ($_POST['objects'] as $value){
$this->memberList["$value"]= $this->objects[$value];
$this->member["$value"]= $value;
}
/* Delete objects from group */
}
/* Delete objects from group */
- if (isset($_POST['delete_membership']) && isset($_POST['members'])){
+ if (isset($_POST['delete_membership']) && isset($_POST['members']) && chkacl($this->acl,"gosaGroupObjects") == ""){
foreach ($_POST['members'] as $value){
if(isset($this->memberList[$value])){
$this->objects["$value"]= $this->memberList[$value];
foreach ($_POST['members'] as $value){
if(isset($this->memberList[$value])){
$this->objects["$value"]= $this->memberList[$value];
/* Base select dialog */
$once = true;
foreach($_POST as $name => $value){
/* Base select dialog */
$once = true;
foreach($_POST as $name => $value){
- if(preg_match("/^chooseBase/",$name) && $once){
+ if(preg_match("/^chooseBase/",$name) && $once && chkacl($this->acl,"base") == ""){
$once = false;
$this->dialog = new baseSelectDialog($this->config);
$this->dialog->setCurrentBase($this->base);
$once = false;
$this->dialog = new baseSelectDialog($this->config);
$this->dialog->setCurrentBase($this->base);
}
/* Add objects? */
}
/* Add objects? */
- if (isset($_POST["edit_membership"])){
+ if (isset($_POST["edit_membership"]) && chkacl($this->acl,"gosaGroupObjects") == ""){
$this->group_dialog= TRUE;
$this->dialog= TRUE;
}
$this->group_dialog= TRUE;
$this->dialog= TRUE;
}
}
if (isset($_POST['dselect'])){
foreach( array("accounts", "groups", "applications", "departments",
}
if (isset($_POST['dselect'])){
foreach( array("accounts", "groups", "applications", "departments",
- "servers", "workstations", "terminals", "printers",
+ "servers", "workstations", "terminals", "printers","subtrees",
"phones") as $type){
if (isset($_POST[$type])) {
"phones") as $type){
if (isset($_POST[$type])) {
$smarty->assign("deplist", $this->config->idepartments);
$smarty->assign("alphabet", generate_alphabet());
foreach( array("dselect", "regex", "accounts", "groups", "applications",
$smarty->assign("deplist", $this->config->idepartments);
$smarty->assign("alphabet", generate_alphabet());
foreach( array("dselect", "regex", "accounts", "groups", "applications",
- "departments", "servers", "workstations", "terminals",
+ "departments", "servers", "workstations", "terminals","subtrees",
"printers", "phones") as $type){
$smarty->assign("$type", $ogfilter[$type]);
}
"printers", "phones") as $type){
$smarty->assign("$type", $ogfilter[$type]);
}
}
/* Bases / Departments */
}
/* Bases / Departments */
-
- if (isset($_POST['base'])){
- $this->base= $_POST['base'];
- }
+ if (isset($_POST['base']) && chkacl($this->acl,"base") == ""){
+ $this->base= $_POST['base'];
+ }
/* Assemble combine string */
if ($this->gosaGroupObjects == "[]"){
/* Assemble combine string */
if ($this->gosaGroupObjects == "[]"){
if (chkacl ($this->acl, "base") == "" && isset($_POST["base"])){
$this->base= $_POST["base"];
}
if (chkacl ($this->acl, "base") == "" && isset($_POST["base"])){
$this->base= $_POST["base"];
}
-
}
}
}
}
/* Perform search for selected objectClasses */
foreach($objectClasses as $class=> $basedn){
/* Perform search for selected objectClasses */
foreach($objectClasses as $class=> $basedn){
- $ldap->ls("(&(objectClass=".$class.")(|(uid=$regex)(cn=$regex)(ou=$regex)))",$basedn.$ogfilter['dselect'] ,
- array("dn", "cn", "description", "objectClass", "sn", "givenName", "uid","ou"));
+
+ if($ogfilter['subtrees'] == "checked"){
+ $ldap->cd($ogfilter['dselect']);
+ $ldap->search("(&(objectClass=".$class.")(|(uid=$regex)(cn=$regex)(ou=$regex)))",
+ array("dn", "cn", "description", "objectClass", "sn", "givenName", "uid","ou"));
+ }else{
+ $ldap->ls("(&(objectClass=".$class.")(|(uid=$regex)(cn=$regex)(ou=$regex)))",$basedn.$ogfilter['dselect'] ,
+ array("dn", "cn", "description", "objectClass", "sn", "givenName", "uid","ou"));
+ }
/* fetch results and append them to the list */
while($attrs = $ldap->fetch()){
/* fetch results and append them to the list */
while($attrs = $ldap->fetch()){
$ldap= $this->config->get_ldap_link();
/* Try to resolv the entry again, if it still fails, display error msg */
$ldap= $this->config->get_ldap_link();
/* Try to resolv the entry again, if it still fails, display error msg */
- $ldap->cat($dn, array("cn", "sn", "givenName", "ou", "description", "objectClass"));
+ $ldap->cat($dn, array("cn", "sn", "givenName", "ou", "uid", "description", "objectClass"));
/* It has failed, add entry with type flag I (Invalid)*/
if ($ldap->error != "Success"){
/* It has failed, add entry with type flag I (Invalid)*/
if ($ldap->error != "Success"){
foreach ($input as $key => $value){
/* Generate output */
foreach ($input as $key => $value){
/* Generate output */
- $temp.= "<option value=\"$key\" class=\"select\" style=\"background-image:url('".get_template_path("images/".$conv[$value['type']])."');\">".$value['text']."</option>\n";
+ $temp.= "<option title='".addslashes($key)."' value=\"$key\" class=\"select\" style=\"background-image:url('".get_template_path("images/".$conv[$value['type']])."');\">".$value['text']."</option>\n";
}
return ($temp);
}
return ($temp);
$ui= get_userinfo();
$acl= get_permissions ($new_dn, $ui->subtreeACL);
$acl= get_module_permission($acl, "group", $new_dn);
$ui= get_userinfo();
$acl= get_permissions ($new_dn, $ui->subtreeACL);
$acl= get_module_permission($acl, "group", $new_dn);
- if (chkacl($acl, "create") != ""){
+ if (chkacl($acl, "create") != "" && $this->dn=="new"){
$message[]= _("You have no permissions to create a group on this 'Base'.");
}
$message[]= _("You have no permissions to create a group on this 'Base'.");
}
function getCopyDialog()
{
function getCopyDialog()
{
- $str = "";
- $str .= _("Group name");
- $str .= " <input type='text' name='cn' value='".$this->cn."'>";
- return($str);
+ $str = "";
+
+ $smarty = get_smarty();
+ $smarty->assign("cn", $this->cn);
+ $str = $smarty->fetch(get_template_path("paste_generic.tpl",TRUE,dirname(__FILE__)));
+ $ret = array();
+ $ret['string'] = $str;
+ $ret['status'] = "";
+ return($ret);
}
function saveCopyDialog()
}
function saveCopyDialog()