diff --git a/plugins/personal/posix/class_posixAccount.inc b/plugins/personal/posix/class_posixAccount.inc
index 3f06a241e0e9b3aca71f963aed6b4afae35e5b1c..2a59d5b86323e1051632f534a586f1367022dd07 100644 (file)
var $plHeadline= "UNIX";
var $plDescription= "This does something";
- /* CLI vars */
- var $cli_summary= "Manage users posix account";
- var $cli_description= "Some longer text\nfor help";
- var $cli_parameters= array("eins" => "Eins ist toll", "zwei" => "Zwei ist noch besser");
-
/* Plugin specific values */
var $homeDirectory= "";
var $loginShell= "/bin/bash";
var $shadowInactive= "0";
var $shadowExpire= "0";
var $gosaDefaultPrinter= "";
- var $gosaDefaultLanguage= "";
var $accessTo= array();
var $trustModel= "";
var $GroupRegex = "*";
var $GroupUserRegex = "*";
var $SubSearch = false;
+ var $memberGroup = array();
/* attribute list for save action */
var $CopyPasteVars = array("grouplist","groupMembership","use_shadowMin","use_shadowMax","use_shadowWarning","use_shadowInactive","use_shadowExpire","must_change_password","grouplist","savedGidNumber","savedUidNumber");
var $attributes = array("homeDirectory", "loginShell", "uidNumber", "gidNumber", "gecos",
"shadowMin", "shadowMax", "shadowWarning", "shadowInactive", "shadowLastChange",
- "shadowExpire", "gosaDefaultPrinter", "gosaDefaultLanguage", "uid","accessTo","trustModel");
+ "shadowExpire", "gosaDefaultPrinter", "uid","accessTo","trustModel");
var $objectclasses= array("posixAccount", "shadowAccount");
var $uid ="";
} else {
$smarty->assign("groups", "");
}
- $smarty->assign("languages", $this->config->data['MAIN']['LANGUAGES']);
/* Avoid "Undefined index: forceMode" */
$smarty->assign("forceMode", "");
$this->is_modified= TRUE;
}
$this->primaryGroup= $_POST['primaryGroup'];
+ if ($this->primaryGroup != 0){
+ $this->gidNumber= $this->primaryGroup;
+ }
}
/* Save pwmode dependent attributes, curently hardcoded because there're
}
add_lock ("uidnumber", "gosa");
- $this->uidNumber= $this->get_next_id("uidNumber");
+ $this->uidNumber= $this->get_next_id("uidNumber", $this->dn);
if ($this->savedGidNumber != ""){
$this->gidNumber= $this->savedGidNumber;
} else {
- $this->gidNumber= $this->get_next_id("gidNumber");
+ $this->gidNumber= $this->get_next_id("gidNumber", $this->dn);
}
}
/* Include global link_info */
$ldap= $this->config->get_ldap_link();
+ /* Append groups as memberGroup: to check hook
+ */
+ $tmp_attributes = $this->attributes;
+ $this->attributes[] = "memberGroup";
+ $this->memberGroup = array();
+ foreach($this->groupMembership as $dn => $name){
+ $this->memberGroup[] = $name;
+ }
+
/* Call common method to give check the hook */
$message= plugin::check();
+ $this->attributes = $tmp_attributes;
/* must: homeDirectory */
if ($this->homeDirectory == ""){
}
}
- function get_next_id($attrib)
+ function get_next_id($attrib, $dn)
{
$ids= array();
$ldap= $this->config->get_ldap_link();
}
/* Add the nobody id */
- $ids[]= 65534;
+ $ids[]= 65534;
/* Find out next free id near to UID_BASE */
- for ($id= $this->config->current['UIDBASE']; $id++; $id < pow(2,32)){
+ if (!isset($this->config->current['BASE_HOOK'])){
+ $base= $this->config->current['UIDBASE'];
+ } else {
+ /* Call base hook */
+ $base= get_base_from_hook($dn, $attrib);
+ }
+ for ($id= $base; $id++; $id < pow(2,32)){
if (!in_array($id, $ids)){
return ($id);
}
function reload()
{
-
/* Set base for all searches */
$base = $_SESSION['CurrentMainBase'];
- $base = $base;
$ldap = $this->config->get_ldap_link();
$attrs = array("cn", "description", "gidNumber");
$Flags = GL_SIZELIMIT;
plugin::PrepareForCopyPaste($source);
/* Avoid using the same gid/uid number as source user */
- $this->savedUidNumber = $this->get_next_id("gidNumber");
- $this->savedGidNumber = $this->get_next_id("uidNumber");
+ $this->savedUidNumber = $this->get_next_id("uidNumber", $this->dn);
+ $this->savedGidNumber = $this->get_next_id("gidNumber", $this->dn);
}
function convertToSeconds($val)