Commit 18e6af96 authored by Côme Bernigaud's avatar Côme Bernigaud Committed by Benoit Mortier
Browse files

Fixes: #2595 The code should follow code guidelines

parent b23f0566
......@@ -52,7 +52,7 @@ class userinfo
/* get acl's an put them into the userinfo object
attr subtreeACL (userdn:components, userdn:component1#sub1#sub2,component2,...) */
function userinfo(&$config, $userdn)
function __construct(&$config, $userdn)
{
$this->config = &$config;
$ldap = $this->config->get_ldap_link();
......@@ -174,7 +174,7 @@ class userinfo
$interresting = FALSE;
} else {
/* Inspect members... */
foreach ($type['members'] as $grp => $grpdsc) {
foreach (array_keys($type['members']) as $grp) {
/* Some group inside the members that is relevant for us? */
if (in_array_ics(@LDAP::convert(preg_replace('/^G:/', '', $grp)), $this->groups)) {
$interresting = TRUE;
......@@ -621,7 +621,6 @@ class userinfo
$module = array($module);
}
global $plist;
$res = array();
foreach ($module as $mod) {
if (isset($ACL_CACHE['MODULE_DEPARTMENTS'][$mod])) {
......@@ -904,9 +903,8 @@ class userinfo
$$attr = (isset($attrs[$attr][0])? $attrs[$attr][0] : NULL);
}
// Check if the account has reached its kick off limitations.
// ---------------------------------------------------------
// ----------------------------------------------------------
// Once the accout reaches the kick off limit it has expired.
if ($sambaKickoffTime !== NULL) {
if (time() >= $sambaKickoffTime) {
......@@ -914,7 +912,6 @@ class userinfo
}
}
// Check if the account has expired.
// ---------------------------------
// An account is locked/expired once its expiration date has reached (shadowExpire).
......
......@@ -93,6 +93,10 @@ class aclrole extends acl
$this->baseSelector->update(TRUE);
}
function compute_dn()
{
return 'cn='.$this->cn.",".get_ou('aclRoleRDN').$this->base;
}
function execute()
{
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003 Cajus Pollmeier
......@@ -22,8 +21,7 @@
class acltab extends tabs
{
function acltab($config, $data, $dn, $cat = "", $copied_object = NULL)
function __construct($config, $data, $dn, $cat = "", $copied_object = NULL)
{
$data = array(array("CLASS" => "acl" , "NAME" => _("ACL")));
parent::__construct($config, $data, $dn, "", $copied_object);
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003 Cajus Pollmeier
......@@ -20,58 +19,32 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
class aclroletab extends tabs
class aclroletab extends simpleTabs_noSpecial
{
function __construct($config, $data, $dn, $cat = "", $copied_object = NULL)
{
$data = array(array("CLASS" => "aclrole" , "NAME" => _("ACL Templates")));
parent::__construct($config, $data, $dn, "acl", $copied_object);
}
function save($ignore_account = FALSE)
{
$baseobject = $this->by_object['aclrole'];
/* Check for new 'dn', in order to propagate the
'dn' to all plugins */
$new_dn = 'cn='.$baseobject->cn.",".get_ou('aclRoleRDN').$baseobject->base;
if ($this->dn != $new_dn) {
/* Write entry on new 'dn' */
if ($this->dn != "new"){
$baseobject->move($this->dn, $new_dn);
$this->by_object['aclrole']= $baseobject;
}
/* Happen to use the new one */
$this->dn= $new_dn;
}
$ret= tabs::save();
return $ret;
}
function save_object($ignore_account= FALSE)
function save_object($ignore_account = FALSE)
{
tabs::save_object();
parent::save_object();
}
function execute()
{
$display = tabs::execute();
$display = parent::execute();
if ($this->read_only) {
$display.= '<p class="plugbottom">'."\n";
$display.= ' <input type="submit" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'."\n";
$display.= '</p>';
} elseif(!$this->by_object['aclrole']->dialog) {
$display.= '<p class="plugbottom">'."\n";
$display.= ' <input type="submit" name="edit_finish" style="width:80px" value="'.msgPool::okButton().'"/>'."\n";
$display.= " &nbsp;\n";
$display.= ' <input type="submit" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'."\n";
$display.= '</p>';
$display .= '<p class="plugbottom">'."\n";
$display .= ' <input type="submit" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'."\n";
$display .= '</p>';
} elseif (!$this->by_object['aclrole']->dialog) {
$display .= '<p class="plugbottom">'."\n";
$display .= ' <input type="submit" name="edit_finish" style="width:80px" value="'.msgPool::okButton().'"/>'."\n";
$display .= " &nbsp;\n";
$display .= ' <input type="submit" name="edit_cancel" value="'.msgPool::cancelButton().'"/>'."\n";
$display .= '</p>';
}
return $display;
}
......
......@@ -72,7 +72,6 @@ class ObjectsAttribute extends GenericDialogAttribute
function renderOnlyFormInput()
{
$id = $this->getHtmlId();
$smarty = get_smarty();
$display = '<select multiple="multiple" name="row'.$id.'[]" id="row'.$id.'"'.
($this->disabled? ' disabled="disabled"':'').
' >'."\n";
......
This diff is collapsed.
Markdown is supported
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