Commit eb8039ba authored by Mortier Benoit's avatar Mortier Benoit
Browse files

correcting error from sonar



Move this trailing comment on the previous empty line.
Signed-off-by: default avatarMortier Benoit <benoit.mortier@opensides.be>
parent 9d9d1db8
......@@ -187,8 +187,8 @@ class argonautQueue extends simpleManagement
if ($this->o_queue->is_error()) {
msg_dialog::display(_('Info'), sprintf(_('%s'), $this->o_queue->get_error()), INFO_DIALOG);
}
$this->o_queue->remove_entries($taskids); // Removing the task.
// Removing the task.
$this->o_queue->remove_entries($taskids);
}
function processNow($action = '', $target = array(), $all = array())
......
......@@ -225,7 +225,8 @@ class supportDaemon
return $status[0];
} catch (jsonRPCClient_RequestErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
$this->new_state(TRUE); // connection is OK
// connection is OK
$this->new_state(TRUE);
return FALSE;
} catch (jsonRPCClient_NetworkErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
......@@ -394,7 +395,8 @@ class supportDaemon
return $this->new_state(TRUE);
} catch (jsonRPCClient_RequestErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
$this->new_state(TRUE); // connection is OK
// connection is OK
$this->new_state(TRUE);
return FALSE;
} catch (jsonRPCClient_NetworkErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
......@@ -454,7 +456,8 @@ class supportDaemon
return $this->new_state(TRUE);
} catch (jsonRPCClient_RequestErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
$this->new_state(TRUE); // connection is OK
// connection is OK
$this->new_state(TRUE);
return FALSE;
} catch (jsonRPCClient_NetworkErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
......@@ -528,7 +531,8 @@ class supportDaemon
return $entries;
} catch (jsonRPCClient_RequestErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
$this->new_state(TRUE); // connection is OK
// connection is OK
$this->new_state(TRUE);
return FALSE;
} catch (jsonRPCClient_NetworkErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
......@@ -629,7 +633,8 @@ class supportDaemon
return $client->ping($mac);
} catch (jsonRPCClient_RequestErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
$this->new_state(TRUE); // connection is OK
// connection is OK
$this->new_state(TRUE);
return FALSE;
} catch (jsonRPCClient_NetworkErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
......@@ -664,7 +669,9 @@ class supportDaemon
if ($this->saved_state() == FALSE) {
return array();
}
if ($package_list) { // filters is a package name list
// filters is a package name list
if ($package_list) {
foreach ($filters as &$filter) {
$filter = "^".$this->escape_perl_chars($filter)."$";
}
......@@ -688,7 +695,8 @@ class supportDaemon
}
if (in_array("SECTION", $attrs)) {
foreach ($packages as &$package) {
$package['SECTION'] = $section; // FIXME : do we want to do this? It will replace "contrib/misc by contrib, for instance
// FIXME : do we want to do this? It will replace "contrib/misc by contrib, for instance
$package['SECTION'] = $section;
}
unset($package);
}
......@@ -699,7 +707,8 @@ class supportDaemon
return $to_return;
} catch (jsonRPCClient_RequestErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
$this->new_state(TRUE); // connection is OK
// connection is OK
$this->new_state(TRUE);
return array();
} catch (jsonRPCClient_NetworkErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
......@@ -763,7 +772,8 @@ class supportDaemon
return $this->new_state(TRUE);
} catch (jsonRPCClient_RequestErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
$this->new_state(TRUE); // connection is OK
// connection is OK
$this->new_state(TRUE);
return FALSE;
} catch (jsonRPCClient_NetworkErrorException $e) {
$this->set_error(nl2br($e->getMessage()));
......
......@@ -425,7 +425,8 @@ class mailMethodCyrus extends mailMethod
$acls = imap_getacl ($this->imap_handle, $this->account_id);
foreach ($acls as $user => $acl) {
if ($user == "anyone") {
$user = "__anyone__"; // Map to internal placeholder
// Map to internal placeholder
$user = "__anyone__";
}
$folder_acls[$user] = $acl;
}
......
......@@ -64,7 +64,8 @@ class DebconfEntriesAttribute extends CompositeAttribute
$cn = $entry['cn'][0];
if (isset($this->attributes[$cn])) {
$this->attributes[$cn]->setValue($entry['value'][0]);
$this->attributes[$cn]->loadValue(NULL); // set initialValue
// set initialValue
$this->attributes[$cn]->loadValue(NULL);
//~ 'flags'
//~ 'owners'
//~ 'template'
......@@ -115,8 +116,10 @@ class DebconfImportAttribute extends FileAttribute
$matches = array();
$str = fread($handle, 1024);
strpos($str, "dn:");
$tmp = str_replace ("\n", "", $str); // removing breaklines
$tmp = str_replace (" ", "", $tmp); // removing spaces
// removing breaklines
$tmp = str_replace ("\n", "", $str);
// removing spaces
$tmp = str_replace (" ", "", $tmp);
if (preg_match( "/dn:.*,ou=templates,ou=([^,=]+),".get_ou("debconfRDN").
$config->current['BASE']."/",
$tmp, $matches) > 0) { // searching for dn: containing the template name
......
......@@ -39,7 +39,8 @@ class dhcpPlugin extends simplePlugin
_('Options'), _('The DHCP options'),
'dhcpOption', FALSE
),
FALSE, array(), TRUE // Order disabled, Default values, Edit enabled
// Order disabled, Default values, Edit enabled
FALSE, array(), TRUE
),
new OrderedArrayAttribute (
new StringAttribute(
......
......@@ -372,7 +372,8 @@ class DnsRecordAttribute extends CompositeAttribute
$this->attributes[2]->setVisible(FALSE);
}
}
$this->setAttributes($this->attributes); // Update ACLs
// Update ACLs
$this->setAttributes($this->attributes);
}
function applyPostValue()
......
......@@ -89,7 +89,8 @@ class EjbcaUserCertsAttribute extends GenericDialogAttribute
{
$id = $this->getHtmlId();
$div = new divSelectBox($id);
$displays = $this->getDisplayValues(); // Updates and get display values
// Updates and get display values
$displays = $this->getDisplayValues();
foreach ($displays as $key => $display_item) {
$fields = array(
array('string' => $display_item['cn'][0])
......
......@@ -266,19 +266,23 @@ class PackagesAttribute extends DialogOrderedArrayAttribute
}
if (empty($this->value)) {
return; // If there are no packages, no need to do anything
// If there are no packages, no need to do anything
return;
}
$attrs = array('distribution','package','version','section','description','timestamp','hastemplate');
$packages = array_diff_key($this->value, $this->buffer); // packages names that are not already in the buffer
// packages names that are not already in the buffer
$packages = array_diff_key($this->value, $this->buffer);
$release = $this->plugin->FAIdebianRelease;
$q = new supportDaemon();
$customs = serviceRepository::getCustomReleases($release);
for ($i = -1; (count($packages) > 0) && ($i < count($customs)); $i++) {
if ($i >= 0) { // if release has been handled
$release = $customs[$i]; // take the next custom
// if release has been handled
if ($i >= 0) {
// take the next custom
$release = $customs[$i];
}
$ret = $q->FAI_get_packages($release, $attrs, array_keys($packages), -1, -1, TRUE);
if ($q->is_error()) {
......
......@@ -173,9 +173,11 @@ class serviceRepository extends simpleService
_('Repositories this server hosts'),
'FAIrepository'
),
FALSE, // no order
// no order
FALSE,
array(),
TRUE // edit button
// edit button
TRUE
)
)
)
......
......@@ -49,24 +49,24 @@ class freeradiusGroup extends simplePlugin {
'name' => _('Support 802.1x'),
'attrs' => array(
new StringAttribute(
_('Tunnel medium type'), // Label of the attribute
_('Name of the tunnel medium type'), // Description
'radiusTunnelMediumType', // LDAP name
TRUE, // Mandatory
'IEEE-802' // default value
_('Tunnel medium type'),
_('Name of the tunnel medium type'),
'radiusTunnelMediumType',
TRUE,
'IEEE-802'
),
new StringAttribute(
_('Tunnel type'), // Label of the attribute
_('Name of the tunnel type'), // Description
'radiusTunnelType', // LDAP name
TRUE, // Mandatory
'VLAN' // default value
_('Tunnel type'),
_('Name of the tunnel type'),
'radiusTunnelType',
TRUE,
'VLAN'
),
new StringAttribute(
_('VLAN id'), // Label of the attribute
_('VLAN identifier'), // Description
'radiusTunnelPrivateGroupId', // LDAP name
FALSE, // Mandatory
_('VLAN id'),
_('VLAN identifier'),
'radiusTunnelPrivateGroupId',
FALSE,
''
)
)
......
......@@ -23,7 +23,7 @@
class freeradiusAccount extends simplePlugin {
var $displayHeader = TRUE; // If we want the button Add/Delete
var $displayHeader = TRUE;
var $objectclasses = array('radiusprofile');
/*!
......@@ -36,7 +36,7 @@ class freeradiusAccount extends simplePlugin {
'plDescription' => _('This Plugin is for Radius accounting based in FreeRadius'),
'plIcon' => 'geticon.php?context=applications&icon=freeradius&size=48',
'plSmallIcon' => 'geticon.php?context=applications&icon=freeradius&size=16',
'plSelfModify' => TRUE, // Does this plugin have an owner that might be able to edit its entry
'plSelfModify' => TRUE,
'plPriority' => 11,
'plObjectType' => array('user'),
......@@ -79,13 +79,13 @@ class freeradiusAccount extends simplePlugin {
'section2' => array(
'name' => _('Groups'),
'attrs' => array(
new SetAttribute( // This attribute is multi-valuated
new SetAttribute(
new SelectAttribute (
_('Groups'), // Label of the attribute
_('FreeRadius Group'), // Description
'radiusGroupName', // LDAP name
FALSE, // Mandatory
array("") // [SelectAttribute] Choices
_('Groups'),
_('FreeRadius Group'),
'radiusGroupName',
FALSE,
array("")
)
),
),
......@@ -111,9 +111,9 @@ class freeradiusAccount extends simplePlugin {
new IntAttribute(
_('Framed-MTU'), _('Framed-MTU'),
'radiusFramedMTU', FALSE,
0, // [FloatAttribute] Minimum value
FALSE, // [FloatAttribute] No maximum value
1500 // [FloatAttribute] Default value
0,
FALSE,
1500
),
new StringAttribute(
_('Compression'), _('Compression'),
......@@ -127,10 +127,10 @@ class freeradiusAccount extends simplePlugin {
),
new IntAttribute(
_('Session Timeout'), _('Session Timeout'),
'radiusSessionTimeout', FALSE, // Mandatory
FALSE, // no minimum value
FALSE, // no maximum value
"" // no default value
'radiusSessionTimeout', FALSE,
FALSE,
FALSE,
""
),
new IntAttribute(
_('Idle Timeout'), _('Idle Timeout'),
......
......@@ -109,12 +109,14 @@ class pgpKeySelect extends simpleSelectManagement
static function pgpSize($size)
{
return strval(intval($size)); // Remove useless 0 at the beginning
// Remove useless 0 at the beginning
return strval(intval($size));
}
static function pgpRevoked($value)
{
return ($value == 0?'No':'Yes'); // Remove useless 0 at the beginning
// Remove useless 0 at the beginning
return ($value == 0?'No':'Yes');
}
}
......@@ -193,14 +195,16 @@ class PgpKeyAttribute extends GenericDialogAttribute
$headers = array_values($this->displayed_values);
$headers[] = '';
$div->SetHeaders($headers);
$displays = $this->getDisplayValues(); // Updates and get display values
// Updates and get display values
$displays = $this->getDisplayValues();
foreach ($displays as $key => $display_item) {
$fields = array();
foreach (array_keys($this->displayed_values) as $field) {
if (isset($display_item[$field][0]) && !empty($display_item[$field][0])) {
$display = $display_item[$field][0];
if ($field == 'pgpKeySize') {
$display = pgpKeySelect::pgpSize($display); // Remove useless 0 in front of the number
// Remove useless 0 in front of the number
$display = pgpKeySelect::pgpSize($display);
} elseif ($field == 'pgpKeyCreateTime') {
$display = pgpKeySelect::pgpDate($display);
} elseif ($field == 'pgpKeyExpireTime') {
......
......@@ -144,8 +144,8 @@ class serviceKolab extends simpleService
_('Quota occupation limit before warning users (%)'),
_('Warn users when using more than X% of their mail quota'),
'cyrus-quotawarn', FALSE,
FALSE, FALSE, // min and max
80 // default value
FALSE, FALSE,
80
)
)
),
......@@ -161,8 +161,8 @@ class serviceKolab extends simpleService
_('Number of days to include when creating free/busy lists'),
_('Include data from X days in the past when creating free/busy lists'),
'kolabFreeBusyFuture', FALSE,
FALSE, FALSE, // min and max
1 // default value
FALSE, FALSE,
1
)
)
),
......
......@@ -167,7 +167,8 @@ class ldapmanager extends simplePlugin
function save_export($dn, $acl, $scope, $name)
{
global $config;
if (!empty($dn)) { // An LDIF export was asked
// An LDIF export was asked
if (!empty($dn)) {
// Check permissions
if (!$this->acl_is_writeable($acl, $this->acl_skip_write())) {
msg_dialog::display(_('Permission error'),
......
......@@ -32,7 +32,8 @@ class mailMethod
protected $mailEqualsCN = FALSE;
/* the attribute used to create accounts */
protected $uattrib = "mail"; // Naming attribute for accounts, e.g. imap.
/* Naming attribute for accounts, e.g. imap. */
protected $uattrib = "mail";
/* The account prefixes, keep the '.' here! See FAQ cyrusUseSlashes */
protected $user_prefix = "user.";
......
......@@ -138,9 +138,11 @@ class opsiProductProperties extends simplePlugin
),
'|', '', ''
),
FALSE, // no order
// no order
FALSE,
array(),
TRUE // edit button
// edit button
TRUE
)
)
)
......
......@@ -102,7 +102,8 @@ class dashboardPpolicy extends simplePlugin
$locked_users = array();
$expired_accounts = array();
$next_expired_accounts = array();
$maxAges = array(); // ppolicies cache
// ppolicies cache
$maxAges = array();
foreach ($users as $user) {
if (isset($user['pwdAccountLockedTime'])) {
$locked_user = dashboardUsers::get_user_infos($user);
......
......@@ -24,7 +24,6 @@ class puppetNode extends simplePlugin
var $displayHeader = TRUE;
var $objectclasses = array("puppetClient");
// The main function : information about attributes
static function getAttributesInfo ()
{
return array(
......@@ -45,9 +44,12 @@ class puppetNode extends simplePlugin
new StringAttribute ('', _('Name of the variable'), 'puppetVar'),
new StringAttribute ('=', _('Value of the variable'), 'puppetVarValue'),
),
'%[^ =]=%[^ ]', // sscanf format
'%s=%s', // sprintf format
'', // acl, empty string means we don't care (handle it automagically)
// sscanf format
'%[^ =]=%[^ ]',
// sprintf format
'%s=%s',
// acl, empty string means we don't care (handle it automagically)
'',
'Puppet Vars'
)
),
......
......@@ -54,7 +54,11 @@ class serviceQuota extends simpleService
new IntAttribute(
_('Quota block size'), _('Quota block size on this share (usually 1024)'),
'quotaBlockSize', TRUE,
1 /*min*/, FALSE/*no max*/, 1024
// min
1,
// no max
FALSE,
1024
),
new StringAttribute(
_('Comment'), _('Short comment about this quota'),
......@@ -63,9 +67,11 @@ class serviceQuota extends simpleService
),
':'
),
FALSE, // no order
// no order
FALSE,
array(),
TRUE // edit button
// edit button
TRUE
)
)
),
......
......@@ -132,25 +132,37 @@ class quotaAccount extends simplePlugin
new BytesSizeAttribute(
_('Block soft limit'), _('Soft limit for the block the user can use'),
'quotaBlockSoftLimit', TRUE,
0 /*min*/, FALSE /*no max*/,
// min
0,
// no max
FALSE,
0
),
new BytesSizeAttribute(
_('Block hard limit'), _('Hard limit for the block the user can use'),
'quotaBlockHardLimit', TRUE,
0 /*min*/, FALSE /*no max*/,
// min
0,
// no max
FALSE,
0
),
new IntAttribute(
_('Inode soft limit'), _('Soft limit for the inodes the user can use'),
'quotaInodeSoftLimit', TRUE,
0 /*min*/, FALSE /*no max*/,
// min
0,
// no max
FALSE,
0
),
new IntAttribute(
_('Inode hard limit'), _('Hard limit for the inodes the user can use'),
'quotaInodeHardLimit', TRUE,
0 /*min*/, FALSE /*no max*/,
// min
0,
// no max
FALSE,
0
),
new SelectAttribute(
......@@ -160,9 +172,11 @@ class quotaAccount extends simplePlugin
),
':'
),
FALSE, // no order
// no order
FALSE,
array(),
TRUE // edit button
// edit button
TRUE
)
)
),
......
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