~ubuntu-branches/ubuntu/maverick/gosa/maverick

« back to all changes in this revision

Viewing changes to plugins/personal/posix/class_posixAccount.inc

  • Committer: Bazaar Package Importer
  • Author(s): Cajus Pollmeier
  • Date: 2007-04-11 10:02:20 UTC
  • Revision ID: james.westby@ubuntu.com-20070411100220-p30rdbqio3m61dvj
Tags: 2.5.10-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
  var $plHeadline= "UNIX";
17
17
  var $plDescription= "This does something";
18
18
 
19
 
  /* CLI vars */
20
 
  var $cli_summary= "Manage users posix account";
21
 
  var $cli_description= "Some longer text\nfor help";
22
 
  var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
23
 
 
24
19
  /* Plugin specific values */
25
20
  var $homeDirectory= "";
26
21
  var $loginShell= "/bin/bash";
763
758
        }
764
759
 
765
760
        add_lock ("uidnumber", "gosa");
766
 
        $this->uidNumber= $this->get_next_id("uidNumber");
 
761
        $this->uidNumber= $this->get_next_id("uidNumber", $this->dn);
767
762
        if ($this->savedGidNumber != ""){
768
763
          $this->gidNumber= $this->savedGidNumber;
769
764
        } else {
770
 
          $this->gidNumber= $this->get_next_id("gidNumber");
 
765
          $this->gidNumber= $this->get_next_id("gidNumber", $this->dn);
771
766
        }
772
767
      }
773
768
 
1082
1077
    }
1083
1078
  }
1084
1079
 
1085
 
  function get_next_id($attrib)
 
1080
  function get_next_id($attrib, $dn)
1086
1081
  {
1087
1082
    $ids= array();
1088
1083
    $ldap= $this->config->get_ldap_link();
1101
1096
    }
1102
1097
 
1103
1098
    /* Add the nobody id */
1104
 
    $ids[]=  65534;
 
1099
    $ids[]= 65534;
1105
1100
 
1106
1101
    /* Find out next free id near to UID_BASE */
1107
 
    for ($id= $this->config->current['UIDBASE']; $id++; $id < pow(2,32)){
 
1102
    if (!isset($this->config->current['BASE_HOOK'])){
 
1103
      $base= $this->config->current['UIDBASE'];
 
1104
    } else {
 
1105
      /* Call base hook */
 
1106
      $base= get_base_from_hook($dn, $attrib);
 
1107
    }
 
1108
    for ($id= $base; $id++; $id < pow(2,32)){
1108
1109
      if (!in_array($id, $ids)){
1109
1110
        return ($id);
1110
1111
      }
1272
1273
    plugin::PrepareForCopyPaste($source);
1273
1274
    
1274
1275
    /* Avoid using the same gid/uid number as source user */
1275
 
    $this->savedUidNumber = $this->get_next_id("gidNumber");
1276
 
    $this->savedGidNumber = $this->get_next_id("uidNumber");
 
1276
    $this->savedUidNumber = $this->get_next_id("gidNumber", $this->dn);
 
1277
    $this->savedGidNumber = $this->get_next_id("uidNumber", $this->dn);
1277
1278
  }
1278
1279
 
1279
1280
  function convertToSeconds($val)