Commit e7a2d4d9 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

🚑 fix(code) Code style fixes by php-cs-fixer

Basic fixes like identation

issue #5955
parent deff6548
......@@ -106,7 +106,6 @@ class pdfExporter
}
foreach ($columns as $order => $index) {
if (isset($row["_sort$index"])) {
$this->result->Cell($width[$order], 6, utf8_decode($row["_sort$index"]), 'LR', 0, 'L', $fill);
} else {
......@@ -222,7 +221,7 @@ class pdfExporter
*/
function query ()
{
return $this->result->Output("", "S");
return $this->result->Output("", "S");
}
static function export (managementListing $listing)
......@@ -310,7 +309,4 @@ class pdfExporter
return NULL;
}
}
}
?>
......@@ -90,7 +90,7 @@ function __fusiondirectory_autoload ($class_name)
if ($class_mapping === NULL) {
if (isset($config) && is_object($config) &&
$config->get_cfg_value('displayerrors') == 'TRUE') {
list($trace,) = html_trace();
list($trace, ) = html_trace();
echo $trace;
echo "<br/>\n";
}
......@@ -109,7 +109,7 @@ function __fusiondirectory_autoload ($class_name)
@DEBUG(DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $class_name, 'Could not load');
if (isset($config) && is_object($config) &&
$config->get_cfg_value('displayerrors') == 'TRUE') {
list($trace,) = html_trace();
list($trace, ) = html_trace();
echo $trace;
echo "<br/>\n";
}
......@@ -1026,15 +1026,13 @@ function gen_locked_message (array $locks, $dn, $allow_readonly = FALSE)
$remove = FALSE;
/* Save variables from LOCK_VARS_TO_USE in session - for further editing */
if ( session::is_set('LOCK_VARS_TO_USE') && count(session::get('LOCK_VARS_TO_USE'))) {
if (session::is_set('LOCK_VARS_TO_USE') && count(session::get('LOCK_VARS_TO_USE'))) {
$LOCK_VARS_USED_GET = array();
$LOCK_VARS_USED_POST = array();
$LOCK_VARS_USED_REQUEST = array();
$LOCK_VARS_TO_USE = session::get('LOCK_VARS_TO_USE');
foreach ($LOCK_VARS_TO_USE as $name) {
if (empty($name)) {
continue;
}
......@@ -1309,7 +1307,6 @@ function to_byte ($value)
$value = strtolower(trim($value));
if (!is_numeric(substr($value, -1))) {
switch (substr($value, -1)) {
case 'g':
$mult = 1073741824;
......@@ -2057,13 +2054,13 @@ function set_object_info ($str = "")
*/
function isIpInNet ($ip, $net, $mask)
{
// Move to long ints
$ip = ip2long($ip);
$net = ip2long($net);
$mask = ip2long($mask);
// Move to long ints
$ip = ip2long($ip);
$net = ip2long($net);
$mask = ip2long($mask);
// Mask given IP with mask. If it returns "net", we're in...
return (($ip & $mask) == $net);
// Mask given IP with mask. If it returns "net", we're in...
return (($ip & $mask) == $net);
}
/*!
......
......@@ -59,7 +59,8 @@
* based on the print_a() function from
* Stephan Pirson (Saibot)
*/
class printAClass {
class printAClass
{
// this can be changed to FALSE if you don't like the fancy string formatting
var $look_for_leading_tabs = TRUE;
......@@ -117,14 +118,14 @@ class printAClass {
}
if (!$iteration && isset($this->export_flag)) {
$this->output .= '<form id="pa_form_'.$this->export_hash.'" action="'.$this->export_dumper_path.'?mode='.$this->export_flag.'" method="post" target="_blank"><input name="array" type="hidden" value="'.htmlspecialchars( serialize( $array ) ).'"></form>';
$this->output .= '<form id="pa_form_'.$this->export_hash.'" action="'.$this->export_dumper_path.'?mode='.$this->export_flag.'" method="post" target="_blank"><input name="array" type="hidden" value="'.htmlspecialchars(serialize($array)).'"></form>';
}
// lighten up the background color for the key td's =)
if ($iteration) {
for ($i = 0; $i < 6; $i += 2) {
$c = substr( $key_bg_color, $i, 2 );
$c = hexdec( $c );
$c = substr($key_bg_color, $i, 2);
$c = hexdec($c);
$c += 15;
if ($c > 255) {
$c = 255;
......@@ -132,15 +133,14 @@ class printAClass {
if (!isset($tmp_key_bg_color)) {
$tmp_key_bg_color = '';
}
$tmp_key_bg_color .= sprintf( "%02X", $c );
$tmp_key_bg_color .= sprintf("%02X", $c);
}
$key_bg_color = $tmp_key_bg_color;
}
// build a single table ... may be nested
$this->output .= '<table style="border:none;" '.( !$iteration && $this->export_flag ? 'onClick="document.getElementById(\'pa_form_'.$this->export_hash.'\').submit();" )' : '' ).'>';
$this->output .= '<table style="border:none;" '.(!$iteration && $this->export_flag ? 'onClick="document.getElementById(\'pa_form_'.$this->export_hash.'\').submit();" )' : '').'>';
foreach ($array as $key => $value) {
$value_style = 'color:black;';
$key_style = 'color:white;';
......@@ -171,7 +171,7 @@ class printAClass {
if ($this->look_for_leading_tabs && preg_match('/^\t/m', $value)) {
$search = array('/\t/', "/\n/");
$replace = array('&nbsp;&nbsp;&nbsp;','<br />');
$value = preg_replace( $search, $replace, htmlspecialchars($value));
$value = preg_replace($search, $replace, htmlspecialchars($value));
$value_style = 'color:black;border:1px gray dotted;';
} else {
$value_style = 'color:black;';
......@@ -186,7 +186,7 @@ class printAClass {
}
$this->output .= '<tr>';
$this->output .= '<td nowrap align="'.$this->keyalign.'" style="background-color:#'.$key_bg_color.';'.$key_style.';font:bold '.$this->fontsize.' '.$this->fontfamily.';" title="'.gettype( $key ).'['.$type.']">';
$this->output .= '<td nowrap align="'.$this->keyalign.'" style="background-color:#'.$key_bg_color.';'.$key_style.';font:bold '.$this->fontsize.' '.$this->fontfamily.';" title="'.gettype($key).'['.$type.']">';
$this->output .= $key;
$this->output .= '</td>';
$this->output .= '<td nowrap="nowrap" style="background-color:#'.$this->value_bg_color.';font: '.$this->fontsize.' '.$this->fontfamily.'; color:black;">';
......@@ -194,13 +194,13 @@ class printAClass {
// value output
if ($type == 'array') {
if (count($value)) {
$this->print_a( $value, TRUE, $key_bg_color );
$this->print_a($value, TRUE, $key_bg_color);
} else {
$this->output .= '<div style="color:blue;">Array (empty)</div>';
}
} elseif ($type == 'object') {
if ($this->show_object_vars) {
$this->print_a( get_object_vars( $value ), TRUE, $key_bg_color );
$this->print_a(get_object_vars($value), TRUE, $key_bg_color);
} else {
$this->output .= '<div style="'.$value_style.'">OBJECT - '.get_class($value).'</div>';
}
......@@ -226,7 +226,7 @@ class printAClass {
*
* \param boolean $export_flag false
*/
function print_a ($array, $return_mode = FALSE, $show_object_vars = FALSE, $export_flag = FALSE )
function print_a ($array, $return_mode = FALSE, $show_object_vars = FALSE, $export_flag = FALSE)
{
$e = error_reporting(0);
if (is_array($array) || is_object($array)) {
......@@ -242,7 +242,7 @@ function print_a ($array, $return_mode = FALSE, $show_object_vars = FALSE, $expo
$output = &$pa->output;
} else {
$output = '<span style="color:red;font-size:small;">print_a( '.gettype( $array ).' )</span>';
$output = '<span style="color:red;font-size:small;">print_a( '.gettype($array).' )</span>';
}
error_reporting($e);
......@@ -338,10 +338,9 @@ function show_vars ($show_all_vars = FALSE, $show_object_vars = FALSE)
}
if ($$vars_name) {
print '<div class="vars-container" style="background-color:'.$vars_data[1].';"><span class="varsname">'.$vars_data[0].'</span><br />';
print_a($$vars_name, FALSE, $show_object_vars, FALSE );
print_a($$vars_name, FALSE, $show_object_vars, FALSE);
print '</div>';
}
}
print '</div>';
}
?>
......@@ -39,7 +39,6 @@ class LoginPost extends LoginMethod
$smarty->assign('focusfield', 'username');
if (($_SERVER['REQUEST_METHOD'] == 'POST') && isset($_POST['login']) && isset($_POST['username']) && isset($_POST['password'])) {
static::$username = $_POST['username'];
static::$password = $_POST['password'];
......
......@@ -20,7 +20,6 @@
class ManagementColumnAttribute extends CompositeAttribute
{
function __construct ($label, $description, $ldapName, $attributes, $acl = "")
{
parent::__construct($description, $ldapName, $attributes, FALSE, FALSE, $acl, $label);
......
......@@ -227,7 +227,7 @@ class managementListing
// Check if a wrong base was supplied
if (!$this->baseSelector->checkLastBaseUpdate()) {
msg_dialog::display(_('Error'), msgPool::check_base(), ERROR_DIALOG);
msg_dialog::display(_('Error'), msgPool::check_base(), ERROR_DIALOG);
}
// Save base
......
......@@ -69,6 +69,4 @@ class passwordMethodClear extends passwordMethod
{
return "clear";
}
}
?>
......@@ -59,21 +59,21 @@ class passwordMethodCrypt extends passwordMethod
if ($this->hash == "crypt/standard-des") {
$salt = "";
for ($i = 0; $i < 2; $i++) {
$salt .= get_random_char();
$salt .= get_random_char();
}
}
if ($this->hash == "crypt/enhanced-des") {
$salt = "_";
for ($i = 0; $i < 8; $i++) {
$salt .= get_random_char();
$salt .= get_random_char();
}
}
if ($this->hash == "crypt/md5") {
$salt = "\$1\$";
for ($i = 0; $i < 8; $i++) {
$salt .= get_random_char();
$salt .= get_random_char();
}
$salt .= "\$";
}
......@@ -81,7 +81,7 @@ class passwordMethodCrypt extends passwordMethod
if ($this->hash == "crypt/blowfish") {
$salt = "\$2a\$07\$";
for ($i = 0; $i < CRYPT_SALT_LENGTH; $i++) {
$salt .= get_random_char();
$salt .= get_random_char();
}
$salt .= "\$";
}
......@@ -89,7 +89,7 @@ class passwordMethodCrypt extends passwordMethod
if ($this->hash == "crypt/sha-256") {
$salt = "\$5\$";
for ($i = 0; $i < 16; $i++) {
$salt .= get_random_char();
$salt .= get_random_char();
}
$salt .= "\$";
}
......@@ -97,7 +97,7 @@ class passwordMethodCrypt extends passwordMethod
if ($this->hash == "crypt/sha-512") {
$salt = "\$6\$";
for ($i = 0; $i < 16; $i++) {
$salt .= get_random_char();
$salt .= get_random_char();
}
$salt .= "\$";
}
......@@ -186,4 +186,3 @@ class passwordMethodCrypt extends passwordMethod
return "";
}
}
?>
......@@ -90,4 +90,3 @@ class passwordMethodEmpty extends passwordMethod
return '';
}
}
?>
......@@ -56,7 +56,7 @@ class passwordMethodMd5 extends passwordMethod
*/
function generate_hash ($pwd, $locked = FALSE)
{
return '{MD5}'.($locked ? '!' : '').base64_encode( pack('H*', md5($pwd)));
return '{MD5}'.($locked ? '!' : '').base64_encode(pack('H*', md5($pwd)));
}
/*!
......@@ -67,4 +67,3 @@ class passwordMethodMd5 extends passwordMethod
return 'md5';
}
}
?>
......@@ -123,4 +123,3 @@ class passwordMethodsasl extends passwordMethod
return ($config->get_cfg_value('forceSaslPasswordAsk', 'FALSE') == 'TRUE');
}
}
?>
......@@ -75,4 +75,3 @@ class passwordMethodsha extends passwordMethod
return 'sha';
}
}
?>
......@@ -77,4 +77,3 @@ class passwordMethodsmd5 extends passwordMethod
return 'smd5';
}
}
?>
......@@ -93,4 +93,3 @@ class passwordMethodssha extends passwordMethod
return 'ssha';
}
}
?>
......@@ -390,4 +390,3 @@ class passwordMethod
return TRUE;
}
}
?>
......@@ -94,7 +94,8 @@ function html_trace ($errstr = "")
} else {
$hideArgsIndexes = array();
}
$f = function ($index, $arg) use(&$f, $hideArgsIndexes) {
$f = function ($index, $arg) use (&$f, $hideArgsIndexes)
{
static $i = 0;
if (($i == 0) && in_array($index, $hideArgsIndexes)) {
return '***';
......@@ -354,4 +355,3 @@ $ssl = '';
if (!sslOn()) {
$ssl = sslUrl();
}
?>
......@@ -23,8 +23,8 @@
/*!
* \brief filterLDAP backend with blacklist/whitelist handling
*/
class filterLDAPBlacklist {
class filterLDAPBlacklist
{
static function query ($parent, $base, $scope, $filter, $attributes, $category, $objectStorage = "")
{
$result = filterLDAP::query($parent, $base, $scope, $filter, $attributes, $category, $objectStorage);
......@@ -70,4 +70,3 @@ class filterLDAPBlacklist {
return array_values($entries);
}
}
?>
......@@ -33,4 +33,3 @@ class groupSelect extends simpleSelectManagement
parent::__construct();
}
}
?>
......@@ -28,4 +28,3 @@ class systemSelect extends simpleSelectManagement
'terminal', 'workstation', 'server'
);
}
?>
......@@ -121,7 +121,7 @@ class BaseSelectorAttribute extends Attribute
function checkValue ($value)
{
if (!is_string($value) && (!is_object($value) || !method_exists($value, '__toString' ))) {
if (!is_string($value) && (!is_object($value) || !method_exists($value, '__toString'))) {
throw new InvalidValueException(_('Base field value should always be a string'));
}
}
......
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