Commit 5cdce38f authored by Benoit Mortier's avatar Benoit Mortier
Browse files

Fixes: 3517 remove gouvernement mode from fusiondirectory

parent 0f595268
......@@ -354,6 +354,7 @@ attributetype ( 1.3.6.1.4.1.38414.8.17.5 NAME 'fdSnapshotAdminPassword'
attributetype ( 1.3.6.1.4.1.38414.8.18.1 NAME 'fdHonourIvbbAttributes'
DESC 'FusionDirectory - Honour ivbb attributes'
OBSOLETE
EQUALITY booleanMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.7
SINGLE-VALUE )
......
......@@ -231,15 +231,6 @@ class user extends plugin
var $objectclasses = array("top", "person", "organizationalPerson", "inetOrgPerson",
"gosaAccount");
/* attributes that are part of the government mode */
var $govattrs = array("gouvernmentOrganizationalUnit", "houseIdentifier", "vocation",
"ivbbLastDeliveryCollective", "gouvernmentOrganizationalPersonLocality",
"gouvernmentOrganizationalUnitDescription","gouvernmentOrganizationalUnitSubjectArea",
"functionalTitle", "publicVisible", "street", "role",
"postalCode");
var $governmentmode = FALSE;
var $mobiles_available;
var $phones_available;
......@@ -252,11 +243,6 @@ class user extends plugin
global $lang;
$this->config = $config;
/* Configuration is fine, allways */
if ($this->config->get_cfg_value("honourIvbbAttributes") == "TRUE") {
$this->governmentmode = TRUE;
$this->attributes = array_merge($this->attributes, $this->govattrs);
}
/* Load base attributes */
parent::__construct ($config, $dn, $object);
......@@ -264,23 +250,6 @@ class user extends plugin
$this->orig_dn = $this->dn;
$this->new_dn = $dn;
if ($this->governmentmode) {
/* Fix public visible attribute if unset */
if (!isset($this->attrs['publicVisible'])) {
$this->publicVisible == "nein";
}
}
/* Load government mode attributes */
if ($this->governmentmode) {
/* Copy all attributs */
foreach ($this->govattrs as $val) {
if (isset($this->attrs["$val"][0])) {
$this->$val= $this->attrs["$val"][0];
}
}
}
/* Create me for new accounts */
if ($dn == "new") {
$this->is_account = TRUE;
......@@ -635,20 +604,6 @@ class user extends plugin
/* Create base acls */
$smarty->assign("base", $this->baseSelector->render());
/* Save government mode attributes */
if($this->governmentmode){
$smarty->assign("governmentmode", "true");
$ivbbmodes= array("nein", "ivbv", "testa", "ivbv,testa", "internet",
"internet,ivbv", "internet,testa", "internet,ivbv,testa");
$smarty->assign("ivbbmodes", $ivbbmodes);
foreach ($this->govattrs as $val){
$smarty->assign("$val", $this->$val);
$smarty->assign("$val"."ACL", $this->getacl($val,(!is_object($this->parent) && !session::is_set('edit'))));
}
} else {
$smarty->assign("governmentmode", "false");
}
/* Special mode for uid */
$uidACL = $this->getacl("uid", (!is_object($this->parent) && !session::is_set('edit')));
if (!(isset($this->dn) && ($this->dn == "new")) && !$this->is_template) {
......@@ -751,19 +706,6 @@ class user extends plugin
$this->gosaLoginRestrictionWidget->setListData($this->gosaLoginRestrictionWidget->getMaintainedData());
}
/* Save government mode attributes */
if ($this->governmentmode){
foreach ($this->govattrs as $val){
if ($this->acl_is_writeable($val,(!is_object($this->parent) && !session::is_set('edit'))) && isset($_POST["$val"])){
$data= stripcslashes($_POST["$val"]);
if ($data != $this->$val){
$this->is_modified= TRUE;
}
$this->$val= $data;
}
}
}
/* Get pw_storage mode */
if (isset($_POST['pw_storage'])) {
$data = validate($_POST['pw_storage']);
......@@ -873,32 +815,6 @@ class user extends plugin
$this->attrs['objectClass'][]= "gosaUserTemplate";
}
/* Hard coded government mode? */
if ($this->governmentmode){
$this->attrs['objectClass'][]= "ivbbentry";
/* Copy standard attributes */
foreach ($this->govattrs as $val){
if ($this->$val != ""){
$this->attrs["$val"]= $this->$val;
} elseif (!$this->is_new) {
$this->attrs["$val"]= array();
}
}
/* Remove attribute if set to "nein" */
if ($this->publicVisible == "nein"){
$this->attrs['publicVisible']= array();
if($this->is_new){
unset($this->attrs['publicVisible']);
}else{
$this->attrs['publicVisible']=array();
}
}
}
/* Special handling for dateOfBirth value */
if ($this->dateOfBirth == ""){
if ($this->is_new) {
......@@ -1358,32 +1274,6 @@ class user extends plugin
$this->base= preg_replace('/^[^,]+,'.preg_quote(get_people_ou(), '/').'/i', '', $dn);
$this->baseSelector->setBase($this->base);
if($this->governmentmode){
/* Walk through govattrs */
foreach ($this->govattrs as $val){
if (in_array($val, $skip)){
continue;
}
if (isset($this->attrs["$val"][0])) {
/* If attribute is set, replace dynamic parts:
%sn, %givenName and %uid. Fill these in our local variables. */
$value = $this->attrs["$val"][0];
foreach (array("sn", "givenName", "uid") as $repl) {
if (preg_match("/%$repl%/i", $value)) {
$value = preg_replace ("/%$repl%/i",
$this->parent->$repl, $value);
}
}
$this->$val = $value;
}
}
}
/* Get back uid/sn/givenName - only write if nothing's skipped */
if ($this->parent !== NULL && count($skip) == 0){
$this->uid= $this->parent->uid;
......@@ -1424,88 +1314,66 @@ class user extends plugin
static function plInfo()
{
$govattrs = array(
"gouvernmentOrganizationalUnit" => _("Unit"),
"houseIdentifier" => _("House identifier"),
"vocation" => _("Vocation"),
"ivbbLastDeliveryCollective" => _("Last delivery"),
"gouvernmentOrganizationalPersonLocality" => _("Person locality"),
"gouvernmentOrganizationalUnitDescription" => _("Unit description"),
"gouvernmentOrganizationalUnitSubjectArea" => _("Subject area"),
"functionalTitle" => _("Functional title"),
"publicVisible" => _("Public visible"),
"street" => _("Street"),
"role" => _("Role"),
"postalCode" => _("Postal code"));
$ret = array(
"plShortName" => _('User'),
"plDescription" => _('User account information'),
"plIcon" => 'geticon.php?context=applications&icon=user-info&size=48',
"plSmallIcon" => 'geticon.php?context=applications&icon=user-info&size=16',
"plSelfModify" => TRUE,
"plCategory" => array("user" => array("description" => _("Users"),
"objectClass" => "gosaAccount")),
"plObjectType" => array("user" => array(
'name' => _('User'),
'description' => _('User account'),
'filter' => 'objectClass=gosaAccount',
'mainAttr' => 'cn',
'icon' => 'geticon.php?context=types&icon=user&size=16',
'ou' => get_ou('userRDN'),
)),
'plForeignKeys' => array(
'manager' => array('user','dn')
),
return array(
'plShortName' => _('User'),
'plDescription' => _('User account information'),
'plIcon' => 'geticon.php?context=applications&icon=user-info&size=48',
'plSmallIcon' => 'geticon.php?context=applications&icon=user-info&size=16',
'plSelfModify' => TRUE,
'plCategory' => array('user' => array('description' => _('Users'),
'objectClass' => 'gosaAccount')),
'plObjectType' => array('user' => array(
'name' => _('User'),
'description' => _('User account'),
'filter' => 'objectClass=gosaAccount',
'mainAttr' => 'cn',
'icon' => 'geticon.php?context=types&icon=user&size=16',
'ou' => get_ou('userRDN'),
)),
'plForeignKeys' => array(
'manager' => array('user','dn')
),
"plProvidedAcls" => array(
"sn" => _("Last name"),
"givenName" => _("First name"),
"uid" => _("Login"),
"personalTitle" => _("Personal title"),
"academicTitle" => _("Academic title"),
"dateOfBirth" => _("Date of birth"),
"gender" => _("Sex"),
"preferredLanguage" => _("Preferred language"),
"base" => _("Base"),
"userPicture" => _("User picture"),
"gosaLoginRestriction" => _("Login restrictions"),
"o" => _("Organization"),
"ou" => _("Department"),
"departmentNumber" => _("Department number"),
"description" => _("Description"),
"manager" => _("Manager"),
"employeeNumber" => _("Employee number"),
"employeeType" => _("Employee type"),
"roomNumber" => _("Room number"),
"telephoneNumber" => _("Telefon number"),
"pager" => _("Pager number"),
"mobile" => _("Mobile number"),
"facsimileTelephoneNumber" => _("Fax number"),
"st" => _("State"),
"l" => _("Location"),
"postalAddress" => _("Postal address"),
"homePostalAddress" => _("Home postal address"),
"homePhone" => _("Home phone number"),
"labeledURI" => _("Homepage"),
"userPassword" => _("User password method"),
));
/* Append government attributes if required */
global $config;
if ($config->get_cfg_value("honourIvbbAttributes") == "TRUE") {
foreach ($govattrs as $attr => $desc) {
$ret["plProvidedAcls"][$attr] = $desc;
}
}
return $ret;
'plProvidedAcls' => array(
'sn' => _('Last name'),
'givenName' => _('First name'),
'uid' => _('Login'),
'personalTitle' => _('Personal title'),
'academicTitle' => _('Academic title'),
'dateOfBirth' => _('Date of birth'),
'gender' => _('Sex'),
'preferredLanguage' => _('Preferred language'),
'base' => _('Base'),
'userPicture' => _('User picture'),
'gosaLoginRestriction' => _('Login restrictions'),
'o' => _('Organization'),
'ou' => _('Department'),
'departmentNumber' => _('Department number'),
'description' => _('Description'),
'manager' => _('Manager'),
'employeeNumber' => _('Employee number'),
'employeeType' => _('Employee type'),
'roomNumber' => _('Room number'),
'telephoneNumber' => _('Phone'),
'pager' => _('Pager'),
'mobile' => _('Mobile'),
'facsimileTelephoneNumber' => _('Fax number'),
'st' => _('State'),
'l' => _('Location'),
'postalAddress' => _('Postal address'),
'homePostalAddress' => _('Home postal address'),
'homePhone' => _('Home phone number'),
'labeledURI' => _('Homepage'),
'userPassword' => _('User password method'),
)
);
}
protected function attributeInitialValue($field)
......
......@@ -267,7 +267,6 @@
<!-- Base 2 container -->
<tr>
{if $governmentmode ne "true"}
<!-- Company, ... -->
<td style="vertical-align:top;">
<table summary="">
......@@ -425,161 +424,6 @@
</tr>
</table>
</td>
{else}
<!-- Beschreibung, ... -->
<td style="vertical-align:top;border-right:1px solid #b0b0b0">
<table summary="">
<tr>
<td><label for="vocation">{t}Vocation{/t}</label></td>
<td>
{render acl=$vocationACL}
<input type="text" id="vocation" name="vocation" size=22 maxlength=60 value="{$vocation}">
{/render}
</td>
</tr>
<tr>
<td><label for="gouvernmentOrganizationalUnitDescription">{t}Unit description{/t}</label></td>
<td>
{render acl=$gouvernmentOrganizationalUnitDescriptionACL}
<input type="text" id="gouvernmentOrganizationalUnitDescription" name="gouvernmentOrganizationalUnitDescription" size=22 maxlength=60
value="{$gouvernmentOrganizationalUnitDescription}">
{/render}
</td>
</tr>
<tr>
<td><label for="gouvernmentOrganizationalUnitSubjectArea">{t}Subject area{/t}</label></td>
<td>
{render acl=$gouvernmentOrganizationalUnitSubjectAreaACL}
<input type="text" id="gouvernmentOrganizationalUnitSubjectArea" name="gouvernmentOrganizationalUnitSubjectArea" size=22 maxlength=60
value="{$gouvernmentOrganizationalUnitSubjectArea}">
{/render}
</td>
</tr>
<tr>
<td><label for="functionalTitle">{t}Functional title{/t}</label></td>
<td>
{render acl=$functionalTitleACL}
<input type="text" name="functionalTitle" id="functionalTitle" size=22 maxlength=60
value="{$functionalTitle}">
{/render}
</td>
</tr>
<tr>
<td><label for="role">{t}Role{/t}</label></td>
<td>
{render acl=$roleACL}
<input type="text" id="role" name="role" size=22 maxlength=60 value="{$role}">
{/render}
</td>
</tr>
</table>
</td>
<!-- Phone, ... -->
<td style="vertical-align:top;border-right:1px solid #b0b0b0">
<table summary="">
<tr>
<td><label for="gouvernmentOrganizationalPersonLocality">{t}Person locality{/t}</label></td>
<td>
{render acl=$gouvernmentOrganizationalPersonLocalityACL}
<input type="text" id="gouvernmentOrganizationalPersonLocality" name="gouvernmentOrganizationalPersonLocality" size=22 maxlength=60
value="{$gouvernmentOrganizationalPersonLocality}">
{/render}
</td>
</tr>
<tr>
<td><label for="gouvernmentOrganizationalUnit">{t}Unit{/t}</label></td>
<td>
{render acl=$gouvernmentOrganizationalUnitACL}
<input type="text" id="gouvernmentOrganizationalUnit" name="gouvernmentOrganizationalUnit" size=22 maxlength=60
value="{$gouvernmentOrganizationalUnit}">
{/render}
</td>
</tr>
<tr>
<td><label for="street">{t}Street{/t}</label></td>
<td>
{render acl=$streetACL}
<input type="text" name="street" id="street" size=22 maxlength=60 value="{$street}">
{/render}
</td>
</tr>
<tr>
<td><label for="postalCode">{t}Postal code{/t}</label></td>
<td>
{render acl=$postalCodeACL}
<input type="text" name="postalCode" id="postalCode" size=22 maxlength=60 value="{$postalCode}">
{/render}
</td>
</tr>
<tr>
<td><label for="houseIdentifier">{t}House identifier{/t}</label></td>
<td>
{render acl=$houseIdentifierACL}
<input type="text" id="houseIdentifier" name="houseIdentifier" size=22 maxlength=60
value="{$houseIdentifier}">
{/render}
</td>
</tr>
</table>
</td>
<!-- Location, ... -->
<td style="vertical-align:top;">
<table summary="">
<tr>
<td><label for="roomNumber">{t}Room No.{/t}</label></td>
<td>
{render acl=$roomNumberACL}
<input type="text" id="roomNumber" name="roomNumber" size=22 maxlength=60 value="{$roomNumber}">
{/render}
</td>
</tr>
<tr>
<td><label for="telephoneNumber">{t}Phone{/t}</label></td>
<td>
{render acl=$telephoneNumberACL}
{if $has_phoneaccount ne "true"}
<input type="text" id="telephoneNumber" name="telephoneNumber" size=22 maxlength=60 value="{$telephoneNumber}">
{else}
<i>{t}Please use the phone tab{/t}</i>
{/if}
{/render}
</td>
</tr>
<tr>
<td><label for="facsimileTelephoneNumber">{t}Fax{/t}</label></td>
<td>
{render acl=$facsimileTelephoneNumberACL}
<input type="text" id="facsimileTelephoneNumber" name="facsimileTelephoneNumber" size=22 maxlength=60
value="{$facsimileTelephoneNumber}">
{/render}
</td>
</tr>
<tr>
<td><label for="ivbbLastDeliveryCollective">{t}Last delivery{/t}</label></td>
<td>
{render acl=$ivbbLastDeliveryCollectiveACL}
<input type="text" name="ivbbLastDeliveryCollective" size=22 maxlength=60 id="ivbbLastDeliveryCollective"
value="{$ivbbLastDeliveryCollective}">
{/render}
</td>
</tr>
<tr>
<td><label for="publicVisible">{t}Public visible{/t}</label></td>
<td>
{render acl=$publicVisibleACL}
<select size="1" id="publicVisible" name="publicVisible">
{html_options values=$ivbbmodes output=$ivbbmodes selected=$publicVisible}
</select>
{/render}
</td>
</tr>
</table>
</td>
{/if}
</tr>
</table>
......
......@@ -71,19 +71,6 @@
{/if}
</td>
</tr>
{if $governmentmode eq "true"}
<tr>
<td>
<LABEL for="certificateSerialNumber">{t}Certificate serial number{/t}</LABEL>
</td>
<td>
{render acl=$CertificateACL}
<input type='text' id="certificateSerialNumber" name="certificateSerialNumber" size=10 maxlength=20 value="{$certificateSerialNumber}">
{/render}
</td>
</tr>
{/if}
</table>
<p class="plugbottom">
......
......@@ -23,7 +23,6 @@
class Step_Config2 extends setup_step
{
var $governmentmode = FALSE;
var $sambaidmapping = FALSE;
var $header_image = 'geticon.php?context=categories&icon=settings&size=48';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment