diff --git a/html/autocomplete.php b/html/autocomplete.php index 11d657069e91528faa6db767d8c85d9640c1bde1..00c2ebac90c7efdf4274dcf7be4b94af3c80d450 100644 --- a/html/autocomplete.php +++ b/html/autocomplete.php @@ -50,15 +50,15 @@ if (isset($_GET['type']) && $_GET['type'] == "base") { continue; } if (mb_stristr($info['name'], $search) !== FALSE) { - $res .= "<li>".mark($search, $pathMapping[$dn]).($info['description'] == ''?"":"<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>"; + $res .= "<li>".mark($search, $pathMapping[$dn]).($info['description'] == '' ? "" : "<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>"; continue; } if (mb_stristr($info['description'], $search) !== FALSE) { - $res .= "<li>".mark($search, $pathMapping[$dn]).($info['description'] == ''?"":"<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>"; + $res .= "<li>".mark($search, $pathMapping[$dn]).($info['description'] == '' ? "" : "<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>"; continue; } if (mb_stristr($pathMapping[$dn], $search) !== FALSE) { - $res .= "<li>".mark($search, $pathMapping[$dn]).($info['description'] == ''?"":"<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>"; + $res .= "<li>".mark($search, $pathMapping[$dn]).($info['description'] == '' ? "" : "<span class='informal'> [".mark($search, $info['description'])."]</span>")."</li>"; continue; } } diff --git a/html/class_passwordRecovery.inc b/html/class_passwordRecovery.inc index e6df4fd4cea6776a186cec3f2ba3a326cf7b314f..b1df2ec180043b26bc1b42a50abec52971dcc50b 100644 --- a/html/class_passwordRecovery.inc +++ b/html/class_passwordRecovery.inc @@ -519,8 +519,8 @@ class passwordRecovery extends standAlonePage { $this->message[] = sprintf(_('The user using email "%s" is locked. Please contact your administrator.'), $this->email_address); return; } - $this->login = $attrs[$this->loginAttribute][0]; - $this->step = 2; + $this->login = $attrs[$this->loginAttribute][0]; + $this->step = 2; if ($this->interactive) { $smarty = get_smarty(); diff --git a/html/include/datepicker.js b/html/include/datepicker.js index b8fbafcc7324cbaf0d1e255a0423b60351b747d2..909099b96cbcd06ff6097e0d1074efc8842923b0 100644 --- a/html/include/datepicker.js +++ b/html/include/datepicker.js @@ -31,8 +31,8 @@ DatePickerFormatter.prototype = { * df.current_date(); * df.match("7/7/2007"); */ - initialize: function(format, separator) { - + initialize: function(format, separator) + { if (Object.isUndefined(format)) format = ["yyyy", "mm", "dd"]; if (Object.isUndefined(separator)) @@ -41,9 +41,9 @@ DatePickerFormatter.prototype = { this._format = format; this.separator = separator; - this._format_year_index = format.indexOf("yyyy"); - this._format_month_index= format.indexOf("mm"); - this._format_day_index = format.indexOf("dd"); + this._format_year_index = format.indexOf("yyyy"); + this._format_month_index = format.indexOf("mm"); + this._format_day_index = format.indexOf("dd"); this._year_regexp = /^\d{4}$/; this._month_regexp = /^0\d|1[012]|\d$/; @@ -54,8 +54,8 @@ DatePickerFormatter.prototype = { * Match a string against date format. * Returns: [year, month, day] */ - match: function(str) { - + match: function(str) + { var d = str.split(this.separator); if (d.length < 3) { @@ -99,14 +99,14 @@ DatePickerFormatter.prototype = { /** * Return a stringified date accordint to format. */ - date_to_string: function(year, month, day, separator) { - + date_to_string: function(year, month, day, separator) + { if (Object.isUndefined(separator)) separator = this.separator; var a = [0, 0, 0]; a[this._format_year_index] = year; - a[this._format_month_index]= month.toPaddedString(2); + a[this._format_month_index] = month.toPaddedString(2); a[this._format_day_index] = day.toPaddedString(2); return a.join(separator); @@ -170,6 +170,7 @@ DatePicker.prototype = { 'zh' : [ '周一', '周二', '周三', '周四', '周五', '周六', '周日' ], 'sv' : [ 'Mån', 'Tis', 'Ons', 'Tor', 'Fre', 'Lör', 'Sön' ] }), + _language_close : $H({ 'fr' : 'fermer', 'en' : 'close', @@ -229,8 +230,8 @@ DatePicker.prototype = { getLocaleClose : function () { return this._language_close.get(this._language); }, - _initCurrentDate : function () { - + _initCurrentDate : function () + { /* Create the DateFormatter */ this._df = new DatePickerFormatter(this._dateFormat[0], this._dateFormat[1]); @@ -252,8 +253,8 @@ DatePicker.prototype = { }, /* init */ - initialize : function ( h_p ) { - + initialize : function ( h_p ) + { /* arguments */ this._relative = h_p["relative"]; if (h_p["language"]) { @@ -302,27 +303,27 @@ DatePicker.prototype = { this._setPositionTop = ( h_p["setPositionTop"] ) ? parseInt(Number(h_p["setPositionTop"])) : 0; this._setPositionLeft = ( h_p["setPositionLeft"] ) ? parseInt(Number(h_p["setPositionLeft"])) : 0; - this._id_datepicker = 'datepicker-'+ this._relative; - this._id_datepicker_prev = this._id_datepicker +'-prev'; - this._id_datepicker_prev_year = this._id_datepicker +'-prev-year'; - this._id_datepicker_next = this._id_datepicker +'-next'; - this._id_datepicker_next_year = this._id_datepicker +'-next-year'; - this._id_datepicker_hdr = this._id_datepicker +'-header'; - this._id_datepicker_ftr = this._id_datepicker +'-footer'; + this._id_datepicker = 'datepicker-' + this._relative; + this._id_datepicker_prev = this._id_datepicker + '-prev'; + this._id_datepicker_prev_year = this._id_datepicker + '-prev-year'; + this._id_datepicker_next = this._id_datepicker + '-next'; + this._id_datepicker_next_year = this._id_datepicker + '-next-year'; + this._id_datepicker_hdr = this._id_datepicker + '-header'; + this._id_datepicker_ftr = this._id_datepicker + '-footer'; /* build up calendar skel */ this._div = new Element('div', { id : this._id_datepicker, className : 'datepicker', - style : 'display: none; z-index:'+ this._zindex + style : 'display: none; z-index:' + this._zindex }); - this._div.innerHTML = '<div class="datepicker-header"><table class="header"><tr><td id="'+ this._id_datepicker_prev_year +'" class="prev-year"> << </td><td id="'+ this._id_datepicker_prev +'" class="prev"> < </td><td id="'+ this._id_datepicker_hdr +'" class="header"></td><td id="'+ this._id_datepicker_next +'" class="next"> > </td><td id="'+ this._id_datepicker_next_year +'" class="next-year"> >> </td></tr></table></div><div class="datepicker-calendar"><table class="body"><tbody id="'+ this._id_datepicker +'-tbody"></tbody></table></div><div id="'+ this._id_datepicker_ftr +'" class="datepicker-footer"></div>'; + this._div.innerHTML = '<div class="datepicker-header"><table class="header"><tr><td id="' + this._id_datepicker_prev_year + '" class="prev-year"> << </td><td id="' + this._id_datepicker_prev + '" class="prev"> < </td><td id="' + this._id_datepicker_hdr + '" class="header"></td><td id="' + this._id_datepicker_next + '" class="next"> > </td><td id="' + this._id_datepicker_next_year + '" class="next-year"> >> </td></tr></table></div><div class="datepicker-calendar"><table class="body"><tbody id="' + this._id_datepicker + '-tbody"></tbody></table></div><div id="' + this._id_datepicker_ftr + '" class="datepicker-footer"></div>'; /* Build the datepicker icon */ var datepickeropener = Builder.node('table',{className : "datepicker-opener-table", id: this._id_datepicker + '_image'}); var con = Builder.node('tr',{},[ - Builder.node('td',{className : "datepicker-opener", id : "datepicker-opener-"+ this._relative}) + Builder.node('td',{className : "datepicker-opener", id : "datepicker-opener-" + this._relative}) ]); // insert into TBODY if (datepickeropener.childNodes[0] !== undefined) { @@ -357,8 +358,8 @@ DatePicker.prototype = { * load : called when document is fully-loaded to append datepicker * to main object. */ - load : function () { - + load : function () + { /* if externalControl defined set the observer on it */ if (this._externalControl) Event.observe(this._externalControl, 'click', this.click.bindAsEventListener(this), false); @@ -421,8 +422,8 @@ DatePicker.prototype = { /** * click : called when input element is clicked */ - click : function () { - + click : function () + { /* init the datepicker if it doesn't exists */ if ($(this._id_datepicker) == null) this.load(); @@ -432,8 +433,8 @@ DatePicker.prototype = { /* position the datepicker relatively to element */ var a_lt = Element.positionedOffset($(this._relative)); $(this._id_datepicker).setStyle({ - 'left' : Number(a_lt[0]+this._leftOffset)+'px', - 'top' : Number(a_lt[1]+this._topOffset)+'px' + 'left' : Number(a_lt[0] + this._leftOffset) + 'px', + 'top' : Number(a_lt[1] + this._topOffset) + 'px' }); this._isPositionned = true; } @@ -507,9 +508,9 @@ DatePicker.prototype = { setPosition : function ( t, l ) { var h_pos = { 'top' : '0px', 'left' : '0px' }; if (!Object.isUndefined(t)) - h_pos['top'] = Number(t) + this._topOffset +'px'; + h_pos['top'] = Number(t) + this._topOffset + 'px'; if (!Object.isUndefined(l)) - h_pos['left']= Number(l) + this._leftOffset +'px'; + h_pos['left'] = Number(l) + this._leftOffset + 'px'; $(this._id_datepicker).setStyle(h_pos); this._isPositionned = true; }, @@ -518,7 +519,7 @@ DatePicker.prototype = { * _getMonthDays : given the year and month find the number of days. */ _getMonthDays : function ( year, month ) { - if ((((year%4) === 0) && (((year%100) !== 0) || ((year%400) !== 0))) && (month === 1)) + if ((((year % 4) === 0) && (((year % 100) !== 0) || ((year % 400) !== 0))) && (month === 1)) return 29; return this._daysInMonth[month]; }, @@ -526,9 +527,9 @@ DatePicker.prototype = { /** * _buildCalendar : draw the days array for current date */ - _buildCalendar : function () { - - var tbody = $(this._id_datepicker +'-tbody'); + _buildCalendar : function () + { + var tbody = $(this._id_datepicker + '-tbody'); try { while ( tbody.hasChildNodes() ) tbody.removeChild(tbody.childNodes[0]); @@ -592,7 +593,7 @@ DatePicker.prototype = { d : daysIndex, m : currentMonth, y : currentYear, - c : (switchNextMonth ? 'outbound' : (((daysIndex === this._todayDate.getDate()) && (this._current_mon === this._todayDate.getMonth()) && (this._current_year === this._todayDate.getFullYear())) ? 'today' : null)) + c : (switchNextMonth ? 'outbound' : (((daysIndex === this._todayDate.getDate()) && (this._current_mon === this._todayDate.getMonth()) && (this._current_year === this._todayDate.getFullYear())) ? 'today' : null)) }; daysIndex++; @@ -621,7 +622,7 @@ DatePicker.prototype = { /* don't forget to add 1 on month for proper formmatting */ var id = $A([ this._relative, - this._df.date_to_string(h_ij["y"], h_ij["m"]+1, h_ij["d"], '-') + this._df.date_to_string(h_ij["y"], h_ij["m"] + 1, h_ij["d"], '-') ]).join('-'); /* set id and classname for cell if exists */ @@ -646,7 +647,7 @@ DatePicker.prototype = { } else { this._bindCellOnClick( td, false ); } - td.innerHTML= h_ij["d"]; + td.innerHTML = h_ij["d"]; tr.appendChild( td ); } tbody.appendChild( tr ); @@ -663,7 +664,7 @@ DatePicker.prototype = { if ( compareresult ) { doBind = true; } else { - td.className= ( h_ij_c ) ? 'nclick-outbound' : 'nclick'; + td.className = ( h_ij_c ) ? 'nclick-outbound' : 'nclick'; } } else { doBind = true; @@ -671,12 +672,12 @@ DatePicker.prototype = { if ( doBind ) { var _self = this; td.onclick = function () { - $(_self._relative).value = String($(this).readAttribute('id')).replace(_self._relative+'-','').replace(/-/g, _self._df.separator); + $(_self._relative).value = String($(this).readAttribute('id')).replace(_self._relative + '-','').replace(/-/g, _self._df.separator); - /* if we have a cellCallback defined call it and pass it the cell */ - if (_self._cellCallback) - _self._cellCallback(this); - _self.close(); + /* if we have a cellCallback defined call it and pass it the cell */ + if (_self._cellCallback) + _self._cellCallback(this); + _self.close(); }; } }, @@ -772,26 +773,26 @@ DatePicker.prototype = { this._buildCalendar(); }, - _setLocaleHdr : function () { - + _setLocaleHdr : function () + { /* prev year link */ var a_prevy = this._prevYear(); - $(this._id_datepicker_prev_year).setAttribute('title', this.getMonthLocale(a_prevy[0]) +' '+ a_prevy[1]); + $(this._id_datepicker_prev_year).setAttribute('title', this.getMonthLocale(a_prevy[0]) + ' ' + a_prevy[1]); /* prev link */ var a_prev = this._prevMonthYear(); - $(this._id_datepicker_prev).setAttribute('title', this.getMonthLocale(a_prev[0]) +' '+ a_prev[1]); + $(this._id_datepicker_prev).setAttribute('title', this.getMonthLocale(a_prev[0]) + ' ' + a_prev[1]); /* next link */ var a_next = this._nextMonthYear(); - $(this._id_datepicker_next).setAttribute('title', this.getMonthLocale(a_next[0]) +' '+ a_next[1]); + $(this._id_datepicker_next).setAttribute('title', this.getMonthLocale(a_next[0]) + ' ' + a_next[1]); /* next year link */ var a_nexty = this._nextYear(); - $(this._id_datepicker_next_year).setAttribute('title', this.getMonthLocale(a_nexty[0]) +' '+ a_nexty[1]); + $(this._id_datepicker_next_year).setAttribute('title', this.getMonthLocale(a_nexty[0]) + ' ' + a_nexty[1]); /* header */ - $(this._id_datepicker_hdr).update(' '+ this.getMonthLocale(this._current_mon) +' '+ this._current_year +' '); + $(this._id_datepicker_hdr).update(' ' + this.getMonthLocale(this._current_mon) + ' ' + this._current_year + ' '); } }; @@ -801,8 +802,7 @@ function msieversion() var ua = window.navigator.userAgent var msie = ua.indexOf ( "MSIE " ) if ( msie > 0 ) // If Internet Explorer, return version number - return parseInt (ua.substring (msie+5, ua.indexOf (".", msie ))) + return parseInt (ua.substring (msie + 5, ua.indexOf (".", msie ))) else // If another browser, return 0 return 0 } - diff --git a/html/include/fusiondirectory.js b/html/include/fusiondirectory.js index b11bd354d0af34017404f796924abc622e1f35b6..1bf81670aaab84754f9836e6f13563da94c9e935 100644 --- a/html/include/fusiondirectory.js +++ b/html/include/fusiondirectory.js @@ -114,8 +114,8 @@ function focus_field() while (focus_field.arguments[i] && !found) { var tmp = document.getElementsByName(focus_field.arguments[i]); - for (var e = 0 ; e < tmp.length ; e++) { - if ((tmp[e].disabled !== true) && (tmp[e].type !== "none") && (tmp[e].type !== "hidden")) { + for (var e = 0; e < tmp.length; e++) { + if ((tmp[e].disabled !== true) && (tmp[e].type !== "none") && (tmp[e].type !== "hidden")) { found = true; element = tmp[e]; break; @@ -167,15 +167,15 @@ function next_msg_dialog() a_pending = s_pending.split(","); if (a_pending.length) { i_id = a_pending.pop(); - for (var i = 0 ; i < a_pending.length; ++i) { + for (var i = 0; i < a_pending.length; ++i) { tmp = tmp + a_pending[i] + ','; } tmp = tmp.replace(/,$/g,""); if (i_id !== "") { ele = document.getElementById('e_layer' + i_id); - ele2 = document.getElementById('e_layer2') ; + ele2 = document.getElementById('e_layer2'); ele3 = document.getElementById('e_layerTitle' + i_id); - ele.style.display = 'block' ; + ele.style.display = 'block'; document.getElementById('pending_msg_dialogs').value = tmp; document.getElementById('current_msg_dialogs').value = i_id; ele3.onmousedown = start_move_div_by_cursor; @@ -230,15 +230,15 @@ function start_move_div_by_cursor(e) if (window.event) { event = window.event; if (event.offsetX) { - div_offset_x = event.clientX -x; - div_offset_y = event.clientY -y; + div_offset_x = event.clientX - x; + div_offset_y = event.clientY - y; enable_move_div_by_cursor = true; } } else if(e) { event = e; if (event.layerX) { - div_offset_x = event.screenX -x; - div_offset_y = event.screenY -y; + div_offset_x = event.screenX - x; + div_offset_y = event.screenY - y; enable_move_div_by_cursor = true; } } @@ -331,18 +331,18 @@ function setProgressPie(context, percent) b = "15"; } - context.strokeStyle = "#" + r + g + b + context.strokeStyle = "#" + r + g + b context.fillStyle = context.strokeStyle; context.beginPath(); context.moveTo(11,11) - context.arc(11,11,8,-Math.PI/2,-Math.PI/2 + Math.PI*percent/50,true); + context.arc(11,11,8,-Math.PI / 2,-Math.PI / 2 + Math.PI * percent / 50,true); context.closePath(); context.fill(); context.moveTo(11,11) context.beginPath(); - context.arc(11,11,8,0,Math.PI*2,false); + context.arc(11,11,8,0,Math.PI * 2,false); context.closePath(); context.stroke(); } @@ -371,8 +371,8 @@ function initProgressPie() { time += interval; // Generate title - var minutes = parseInt((timeout-time) / 60 ); - var seconds = '' + parseInt((timeout-time) % 60); + var minutes = parseInt((timeout - time) / 60 ); + var seconds = '' + parseInt((timeout - time) % 60); if (seconds.length === 1) { seconds = '0' + seconds; } diff --git a/html/include/pulldown.js b/html/include/pulldown.js index 67bc6c612d934f754f1aa9755e0ed13088487abc..19bffcf2e739845b345020d65cedf2b313a493bb 100644 --- a/html/include/pulldown.js +++ b/html/include/pulldown.js @@ -31,7 +31,6 @@ var MenuItem = Class.create(); Menu.prototype = { initialize: function(idOrElement, name, customConfigFunction) { - this.name = name; this.type = "menu"; this.closeDelayTimer = null; @@ -121,11 +120,11 @@ MenuContainer.prototype = { var value; for (var i = 0; i < ltrb.length; ++i) { if (this.element.currentStyle) { - value = parseInt(this.element.currentStyle["border"+ltrb[i]+"Width"]); + value = parseInt(this.element.currentStyle["border" + ltrb[i] + "Width"]); } else if (window.getComputedStyle) { - value = parseInt(window.getComputedStyle(this.element, "").getPropertyValue("border-"+ltrb[i].toLowerCase()+"-width")); + value = parseInt(window.getComputedStyle(this.element, "").getPropertyValue("border-" + ltrb[i].toLowerCase() + "-width")); } else { - value = parseInt(this.element.style["border"+ltrb[i]]); + value = parseInt(this.element.style["border" + ltrb[i]]); } result[ltrb[i].toLowerCase()] = isNaN(value) ? 0 : value; } @@ -151,11 +150,11 @@ MenuContainer.prototype = { (window.innerWidth ? window.innerWidth : document.body.offsetWidth) ) { Element.setStyle(this.element,{ - left: (- this.element.offsetWidth - (this.root.collapseBorders ? 0 : parentMenuBorders["left"])) + "px" + left: (- this.element.offsetWidth - (this.root.collapseBorders ? 0 : parentMenuBorders["left"])) + "px" }); } else { Element.setStyle(this.element,{ - left: (this.parentMenu.element.offsetWidth - parentMenuBorders["left"] - (this.root.collapseBorders ? Math.min(parentMenuBorders["right"], thisBorders["left"]) : 0)) + "px" + left: (this.parentMenu.element.offsetWidth - parentMenuBorders["left"] - (this.root.collapseBorders ? Math.min(parentMenuBorders["right"], thisBorders["left"]) : 0)) + "px" }); } Element.setStyle(this.element,{ @@ -198,9 +197,9 @@ Object.extend(Object.extend(MenuItem.prototype, MenuContainer.prototype), { } var linkTag = this.element.getElementsByTagName("A")[0]; if (linkTag) { - linkTag.onfocus = this.element.onmouseover; - this.link = linkTag; - this.text = linkTag.text; + linkTag.onfocus = this.element.onmouseover; + this.link = linkTag; + this.text = linkTag.text; } if (this.subMenu) { this.element.onmouseout = function() { diff --git a/html/include/pwdStrength.js b/html/include/pwdStrength.js index 95b21b30859916dd2a5776ef41065179047f4e45..3c5051d04a9e8661b72c530a7ad9e0aab95c4c4f 100644 --- a/html/include/pwdStrength.js +++ b/html/include/pwdStrength.js @@ -55,66 +55,66 @@ function testPasswordCss(passwd) if ((passwd.length === 0) || !passwd.length) { intScore = -1 } else if (passwd.length > 11) { - intScore = (intScore+18) + intScore = (intScore + 18) } else if (passwd.length > 7) { - intScore = (intScore+12) + intScore = (intScore + 12) } else if (passwd.length > 4) { - intScore = (intScore+6) + intScore = (intScore + 6) } else { - intScore = (intScore+3) + intScore = (intScore + 3) } // LETTERS (Not exactly implemented as dictacted above because of my limited understanding of Regex) if (passwd.match(/[a-z]/)) // [verified] at least one lower case letter { - intScore = (intScore+1) + intScore = (intScore + 1) } if (passwd.match(/[A-Z]/)) // [verified] at least one upper case letter { - intScore = (intScore+5) + intScore = (intScore + 5) } // NUMBERS if (passwd.match(/\d+/)) // [verified] at least one number { - intScore = (intScore+5) + intScore = (intScore + 5) } if (passwd.match(/(.*[0-9].*[0-9].*[0-9])/)) // [verified] at least three numbers { - intScore = (intScore+5) + intScore = (intScore + 5) } // SPECIAL CHAR if (passwd.match(/.[!,@,#,$,%,^,&,*,?,_,~]/)) // [verified] at least one special character { - intScore = (intScore+5) + intScore = (intScore + 5) } // [verified] at least two special characters if (passwd.match(/(.*[!,@,#,$,%,^,&,*,?,_,~].*[!,@,#,$,%,^,&,*,?,_,~])/)) { - intScore = (intScore+5) + intScore = (intScore + 5) } // COMBOS if (passwd.match(/([a-z].*[A-Z])|([A-Z].*[a-z])/)) // [verified] both upper and lower case { - intScore = (intScore+2) + intScore = (intScore + 2) } if (passwd.match(/([a-zA-Z])/) && passwd.match(/([0-9])/)) // [verified] both letters and numbers { - intScore = (intScore+2) + intScore = (intScore + 2) } // [verified] letters, numbers, and special characters if (passwd.match(/([a-zA-Z0-9].*[!,@,#,$,%,^,&,*,?,_,~])|([!,@,#,$,%,^,&,*,?,_,~].*[a-zA-Z0-9])/)) { - intScore = (intScore+2) + intScore = (intScore + 2) } diff --git a/html/index.php b/html/index.php index 8baf9ff8a4ef5064f4cd4520716aa2a574197832..c91c6e6a9d16d53de60524b5e5aff2491fd10d72 100644 --- a/html/index.php +++ b/html/index.php @@ -202,7 +202,7 @@ if (($config->get_cfg_value('forcessl') == 'TRUE') && ($ssl != '')) { } if (isset($_REQUEST['message'])) { - switch($_REQUEST['message']) { + switch ($_REQUEST['message']) { case 'expired': $message = _('Your FusionDirectory session has expired!'); break; @@ -367,7 +367,7 @@ class Index { /* Run each step in $steps, stop on errors */ static function runSteps($steps) { - foreach($steps as $step) { + foreach ($steps as $step) { $status = static::$step(); if (is_string($status)) { msg_dialog::display(_('LDAP error'), $status, LDAP_ERROR); diff --git a/html/plugins/users/style/user_tab.css b/html/plugins/users/style/user_tab.css index a1a3d232bf8afa8ddf467c56b89f46bf396b5a97..4687b0f160b3fbd67abf176d4ba1250249ce7296 100644 --- a/html/plugins/users/style/user_tab.css +++ b/html/plugins/users/style/user_tab.css @@ -1,4 +1,3 @@ - /* On big screens */ @media (min-width: 640px) { .plugin-section#perso img#jpegPhoto_img { diff --git a/html/themes/breezy/datepicker.css b/html/themes/breezy/datepicker.css index 2793aa8900261e93be2f622452eb7b9e8194714a..09d97c1a9130cc58e84aa67e083c3b2a438c9db7 100644 --- a/html/themes/breezy/datepicker.css +++ b/html/themes/breezy/datepicker.css @@ -1,4 +1,3 @@ - div.datepicker { position: absolute; text-align: center; diff --git a/html/themes/breezy/dialog.css b/html/themes/breezy/dialog.css index c18d96f38e34aa64629983da2ce0a70ea561504d..38847827c0f54c2bcd360cf66c971eea27f208df 100644 --- a/html/themes/breezy/dialog.css +++ b/html/themes/breezy/dialog.css @@ -1,4 +1,3 @@ - div.msgtitle { width: auto; background-color: #f0f0f0; diff --git a/html/themes/breezy/lists.css b/html/themes/breezy/lists.css index 0e0f2619e8a1b390d20ae9e11691d2ddb2ad17ab..61734148fedc88db9f42fda47dc91d2d23c176e1 100644 --- a/html/themes/breezy/lists.css +++ b/html/themes/breezy/lists.css @@ -1,4 +1,3 @@ - /******************************** * L i s t s * ********************************/ diff --git a/html/themes/breezy/login.css b/html/themes/breezy/login.css index 3c3b32a8b3c3785e5dbce7a27a58acc5b84cd701..685d00a2d1d4a622f99894e2068f74c7798d16e5 100644 --- a/html/themes/breezy/login.css +++ b/html/themes/breezy/login.css @@ -120,4 +120,3 @@ color: #31363b; margin-bottom: 0; } } - diff --git a/html/themes/breezy/style.css b/html/themes/breezy/style.css index a3617f6b7bdedaeac90972bdc3e482294937ec23..582e6c1bb7f85b4258499190861ec510820c7177 100644 --- a/html/themes/breezy/style.css +++ b/html/themes/breezy/style.css @@ -64,7 +64,6 @@ text-align: right; a.maintitlebar,div.maintitlebar { font-family: arial,helvetica,sans-serif; text-decoration: none; -/*color:#ffffff;*/ font-size: 12px; text-align: center; vertical-align: middle; diff --git a/html/themes/legacy/lists.css b/html/themes/legacy/lists.css index ebf60d5fe91a24de728e6344b0d75fd51c3bbdf3..7e9104e907a2ec65f5ab9fbc2c46d30531ff23fc 100644 --- a/html/themes/legacy/lists.css +++ b/html/themes/legacy/lists.css @@ -1,4 +1,3 @@ - /******************************** * L i s t s * ********************************/ diff --git a/html/themes/legacy/login.css b/html/themes/legacy/login.css index b903261fb6c06ff9d7ef560e9428a7893a49ab66..23ff0106296525606e1d3c0f9d709c61113c1232 100644 --- a/html/themes/legacy/login.css +++ b/html/themes/legacy/login.css @@ -109,4 +109,3 @@ color: #31363b; margin-bottom: 0; } } - diff --git a/html/themes/legacy/style.css b/html/themes/legacy/style.css index f94556b41a385bc85b60874a9f27ac1bd8321c2b..3bd943b3444e1fd5807d7c917904c981fbd51dbe 100644 --- a/html/themes/legacy/style.css +++ b/html/themes/legacy/style.css @@ -64,7 +64,6 @@ text-align: right; a.maintitlebar,div.maintitlebar { font-family: arial,helvetica,sans-serif; text-decoration: none; -/*color:#ffffff;*/ font-size: 12px; text-align: center; vertical-align: middle; diff --git a/include/accept-to-gettext.inc b/include/accept-to-gettext.inc index ff70a21339e2ab096da9d86acc7d97479bc384fc..259510bb1b0aad7684785acbb7310b06f16158af 100644 --- a/include/accept-to-gettext.inc +++ b/include/accept-to-gettext.inc @@ -181,7 +181,7 @@ function al2gt($gettextlangs, $mime) * through a "*" qualifier.*/ list ($lang, $country, $char) = parse_gettext_lang($max_lang); if (!headers_sent()) { - header("Content-Language: $lang".(empty($country)?"":"-$country")); + header("Content-Language: $lang".(empty($country) ? "" : "-$country")); if (!empty($char)) { header("Content-Type: $mime; charset=$char"); } diff --git a/include/class_IconTheme.inc b/include/class_IconTheme.inc index 5be5c0c6aeb67a0443701be7f125fcfbecfe9e2f..f8ef4b63d33426a120f6f2b1b710e7ae8cbe0d75 100644 --- a/include/class_IconTheme.inc +++ b/include/class_IconTheme.inc @@ -18,7 +18,9 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */ -class ThemeFileParsingException extends Exception {} +class ThemeFileParsingException extends Exception +{ +} class IconThemeDir { diff --git a/include/class_SnapshotHandler.inc b/include/class_SnapshotHandler.inc index 60e55bf0c13131ec28c59a82ba90c7c3e430b6ba..74bdc79d9adae974a7df3473e1f105ba63e026fb 100644 --- a/include/class_SnapshotHandler.inc +++ b/include/class_SnapshotHandler.inc @@ -140,7 +140,7 @@ class SnapshotHandler */ function hasSnapshots($dn) { - return (isset($this->snapshotsCache[$dn])); + return isset($this->snapshotsCache[$dn]); } /*! diff --git a/include/class_acl.inc b/include/class_acl.inc index 4a35e8c84e335124ec94718795d0997a06709a6f..8c8753f8707c95a48eea5692c72ecc9c8d6cd3a6 100644 --- a/include/class_acl.inc +++ b/include/class_acl.inc @@ -58,8 +58,8 @@ class acl { $infos_a = pluglist::pluginInfos(preg_replace('|^[^/]*/|', '', $a)); $infos_b = pluglist::pluginInfos(preg_replace('|^[^/]*/|', '', $b)); - $pa = (isset($infos_a['plPriority'])?$infos_a['plPriority']:0); - $pb = (isset($infos_b['plPriority'])?$infos_b['plPriority']:0); + $pa = (isset($infos_a['plPriority']) ? $infos_a['plPriority'] : 0); + $pb = (isset($infos_b['plPriority']) ? $infos_b['plPriority'] : 0); if ($pa == $pb) { return 0; } diff --git a/include/class_config.inc b/include/class_config.inc index 5abea57a113a2a41f21e0967a6bb9f7b44018554..297c99a31727f91e2ffb7ec98f34858eaf7a3927 100644 --- a/include/class_config.inc +++ b/include/class_config.inc @@ -979,8 +979,8 @@ class config if (isset($this->data['OBJECTS'][$obj])) { $this->data['OBJECTS'][$obj]['management'] = $class; if (isset($class::$skipTemplates) && ($class::$skipTemplates == FALSE)) { - $this->data['OBJECTS'][$obj]['templateActive'] = TRUE; - $this->data['CATEGORIES'][$cat]['classes'][] = 'template'; + $this->data['OBJECTS'][$obj]['templateActive'] = TRUE; + $this->data['CATEGORIES'][$cat]['classes'][] = 'template'; } } } diff --git a/include/class_exceptions.inc b/include/class_exceptions.inc index 7bbb356c97a03335f76135722e8784be71524e8b..ac67ff135b72e9ae4e086019cdb4211aeb49c82d 100644 --- a/include/class_exceptions.inc +++ b/include/class_exceptions.inc @@ -26,21 +26,44 @@ /*! \class FusionDirectoryException \brief Parent class for all exceptions thrown in FusionDirectory */ -class FusionDirectoryException extends Exception {} +class FusionDirectoryException extends Exception +{ +} /*! \class LDIFImportException \brief Exception class which can be thrown by LDAP if the LDIF format is broken */ -class LDIFImportException extends FusionDirectoryException {} +class LDIFImportException extends FusionDirectoryException +{ +} /*! \class LdapGeneralizedTimeBadFormatException \brief Exception class which can be thrown by LdapGeneralizedTime if the format does not match */ -class LdapGeneralizedTimeBadFormatException extends FusionDirectoryException {} - -class NonExistingObjectTypeException extends FusionDirectoryException {} -class NonExistingBranchException extends FusionDirectoryException {} -class NonExistingLdapNodeException extends FusionDirectoryException {} -class EmptyFilterException extends FusionDirectoryException {} -class NoManagementClassException extends FusionDirectoryException {} -class LDAPFailureException extends FusionDirectoryException {} +class LdapGeneralizedTimeBadFormatException extends FusionDirectoryException +{ +} + +class NonExistingObjectTypeException extends FusionDirectoryException +{ +} + +class NonExistingBranchException extends FusionDirectoryException +{ +} + +class NonExistingLdapNodeException extends FusionDirectoryException +{ +} + +class EmptyFilterException extends FusionDirectoryException +{ +} + +class NoManagementClassException extends FusionDirectoryException +{ +} + +class LDAPFailureException extends FusionDirectoryException +{ +} diff --git a/include/class_filter.inc b/include/class_filter.inc index 3b5cea01fdf8cd7375e9aeb3988822295c1bc772..9b17226f8d2a1f3ec3303d3ef52d4eb06a234d6e 100644 --- a/include/class_filter.inc +++ b/include/class_filter.inc @@ -476,7 +476,16 @@ class filter $objectStorage = $this->objectStorage; if (isset($this->elements['FILTERTEMPLATE']) && $this->elementValues['FILTERTEMPLATE']) { - $objectStorage = array_merge($objectStorage, array_map(function ($oc) { return 'ou=templates,'.$oc; }, $objectStorage)); + $objectStorage = array_merge( + $objectStorage, + array_map( + function ($oc) + { + return 'ou=templates,'.$oc; + }, + $objectStorage + ) + ); } // Now call filter method and merge resulting entries. diff --git a/include/class_ldap.inc b/include/class_ldap.inc index 65076b294eba51392a3cf979d2f50482619bd81a..8a210bf2d12a2da76fd66c710d83b1b63c41ddd1 100644 --- a/include/class_ldap.inc +++ b/include/class_ldap.inc @@ -257,7 +257,7 @@ class LDAP throw new FusionDirectoryException('not implemented'); case 'one': $this->sr[$srp] = @ldap_list($this->cid, $this->basedn, $filter, $attrs); - break; + break; default: case 'subtree': $this->sr[$srp] = @ldap_search($this->cid, $this->basedn, $filter, $attrs); @@ -798,8 +798,8 @@ class LDAP } if ($type == 'dc') { /* This is bad actually, but - tell me a better way? */ - $na['objectClass'][] = 'organization'; - $na['o'] = $param; + $na['objectClass'][] = 'organization'; + $na['o'] = $param; } $na[$type] = $param; @@ -962,7 +962,7 @@ class LDAP trigger_error(sprintf("Invalid parameter for limit '%s', a numeric value is required."), $limit); return NULL; } - $limit = (!$limit)?'':' -z '.$limit; + $limit = (!$limit) ? '' : ' -z '.$limit; // Check scope values $scope = trim($scope); @@ -970,7 +970,7 @@ class LDAP trigger_error(sprintf("Invalid parameter for scope '%s', please use 'base', 'one', 'sub' or 'children'."), $scope); return NULL; } - $scope = (!empty($scope))?' -s '.$scope: ''; + $scope = (!empty($scope)) ? ' -s '.$scope : ''; // Prepare parameters to be valid for shell execution $dn = escapeshellarg($dn); diff --git a/include/class_listing.inc b/include/class_listing.inc index 2d2c0b4eaddf322f640a031f03bfd6c30afa7a33..e701fccb70710d614e7d52525b9c802e2300b235 100644 --- a/include/class_listing.inc +++ b/include/class_listing.inc @@ -309,7 +309,7 @@ class listing isset($cfg['sortType'])) { $this->sortAttribute = $cfg['sortAttribute']; $this->sortType = $cfg['sortType']; - $sorter = " <img class='center' title='".($this->sortDirection[$index]?_("Up"):_("Down"))."' src='geticon.php?context=actions&size=16&icon=view-sort-".($this->sortDirection[$index]?"descending":"ascending")."' alt='".($this->sortDirection[$index]?_('Sort up'):_('Sort down'))."'>"; + $sorter = " <img class='center' title='".($this->sortDirection[$index] ? _("Up") : _("Down"))."' src='geticon.php?context=actions&size=16&icon=view-sort-".($this->sortDirection[$index] ? "descending" : "ascending")."' alt='".($this->sortDirection[$index] ? _('Sort up') : _('Sort down'))."'>"; } $sortable = (isset($cfg['sortAttribute'])); @@ -996,8 +996,8 @@ class listing // If there's an objectclass definition and we don't have it // add an empty picture here. if (isset($action['objectclass'])) { - $objectclass = $action['objectclass']; - $skip = FALSE; + $objectclass = $action['objectclass']; + $skip = FALSE; if (preg_match('/^!(.*)$/', $objectclass, $m)) { $objectclass = $m[1]; if (in_array($objectclass, $classes)) { @@ -1060,8 +1060,8 @@ class listing } if ($action['type'] == 'copypaste') { - $copy = (!isset($action['copy']) || ($action['copy'] == 'true')); - $cut = (!isset($action['cut']) || ($action['cut'] == 'true')); + $copy = (!isset($action['copy']) || ($action['copy'] == 'true')); + $cut = (!isset($action['cut']) || ($action['cut'] == 'true')); $result .= $this->renderCopyPasteActions($row, $this->entries[$row]['dn'], $category, $class, $copy, $cut); } else { $result .= $this->renderSnapshotActions($row, $this->entries[$row]['dn'], $category); @@ -1350,7 +1350,7 @@ class listing // Skip entry if there're missing dependencies if (isset($action['depends'])) { - $deps = is_array($action['depends'])?$action['depends']:array($action['depends']); + $deps = is_array($action['depends']) ? $action['depends'] : array($action['depends']); foreach ($deps as $clazz) { if (!isset($class_mapping[$clazz])) { continue 2; diff --git a/include/class_pluglist.inc b/include/class_pluglist.inc index 6722fd430bc073bc7ac8f18b4119816b0e2dd84c..2e04f0e2a15027d9fc527410b58a0da5f5ea2a04 100644 --- a/include/class_pluglist.inc +++ b/include/class_pluglist.inc @@ -370,7 +370,7 @@ class pluglist { } $lines = preg_split("/\n/", $this->menu); foreach ($lines as &$line) { - if (preg_match('/'.preg_quote("main.php?plug=$plug&reset=1",'/').'/', $line)) { + if (preg_match('/'.preg_quote("main.php?plug=$plug&reset=1", '/').'/', $line)) { $line = preg_replace('/class="menuitem"/', 'class="menuitem menucurrent"', $line); } elseif (preg_match('/class="menuitem menucurrent"/', $line)) { $line = preg_replace('/class="menuitem menucurrent"/', 'class="menuitem"', $line); @@ -424,7 +424,7 @@ class pluglist { $entries .= '<div class="iconmenu" id="menuitem_icon_'.$id.'" onClick=\'location.href="'.$href.'"\' title="'.$plDescription.'">'; $item = '<div class="imgcontainer"><img src="'.$image.'" alt="'.$plHeadline.' icon"/></div><span> '.$plHeadline.'</span>'; - $entries .= $item."</div>\n"; + $entries .= $item."</div>\n"; } /* Append to menu */ diff --git a/include/class_template.inc b/include/class_template.inc index 20170011ec5d900e3e8bf29f624dff2e04f80681..c91d1592eed76ac7d61f5055bebbf10ae94a1c64 100644 --- a/include/class_template.inc +++ b/include/class_template.inc @@ -81,7 +81,7 @@ class template } $tempTabObject = objects::open($this->dn, $this->type); /* Used to know which tab is activated */ $this->attributes = array(); - foreach ($tempTabObject->by_object as $class => &$plugin) { + foreach ($tempTabObject->by_object as $class => $plugin) { if ($plugin->is_account || $plugin->ignore_account) { $this->tabObject->by_object[$class]->is_account = $plugin->is_account; $this->attributes[$class] = array(); @@ -108,7 +108,7 @@ class template $this->tabObject = objects::create($this->type); /* Used to know which tab is activated */ $tempTabObject = objects::open($this->dn, $this->type); - foreach ($tempTabObject->by_object as $class => &$plugin) { + foreach ($tempTabObject->by_object as $class => $plugin) { if ($plugin->is_account || $plugin->ignore_account) { $this->tabObject->by_object[$class]->is_account = $plugin->is_account; } @@ -139,7 +139,7 @@ class template function serialize() { $attributes = array(); - foreach ($this->tabObject->by_object as $class => &$plugin) { + foreach ($this->tabObject->by_object as $class => $plugin) { if (!isset($this->attributes[$class])) { continue; } @@ -219,7 +219,7 @@ class template if ($targetdn !== NULL) { $this->tabObject = objects::open($targetdn, $this->type); unset($this->attrs['objectClass']['count']); - foreach ($this->tabObject->by_object as $class => &$plugin) { + foreach ($this->tabObject->by_object as $class => $plugin) { if ($plugin->is_account || $plugin->ignore_account) { $this->attrs['objectClass'] = $plugin->mergeObjectClasses($this->attrs['objectClass']); } diff --git a/include/class_templateHandling.inc b/include/class_templateHandling.inc index 6752459c402ab58f7f59b02967b99d8e592c1095..7ee22cd7fa00d2886d158db07ccee3560c2e3e63 100644 --- a/include/class_templateHandling.inc +++ b/include/class_templateHandling.inc @@ -411,7 +411,13 @@ class templateHandling trigger_error('Missing "M" match modifier parameter'); $args[] = '/.*/'; } - $result = array(array_filter($str, function ($s) use ($args) { return preg_match($args[0], $s); })); + $result = array(array_filter( + $str, + function ($s) use ($args) + { + return preg_match($args[0], $s); + } + )); break; case '4': // IPv4 diff --git a/include/class_xml.inc b/include/class_xml.inc index 5b2549c04f211c27d867e2b8e2c5309b7740fc44..1efd43cc8ac7f22ed8178e5693d6f19f6251209c 100644 --- a/include/class_xml.inc +++ b/include/class_xml.inc @@ -58,7 +58,7 @@ class xml { xml_parser_free($parser); if (!$xml_values) { - return;//Hmm... + return; } //Initializations diff --git a/include/functions.inc b/include/functions.inc index 00100589a4d138201aac31438854c51c27c6bc85..1b1a1707c5fdb20d0c81c023ef8399d4328d72b6 100644 --- a/include/functions.inc +++ b/include/functions.inc @@ -908,22 +908,22 @@ function print_sizelimit_warning() function eval_sizelimit() { if (isset($_POST['set_size_action']) && isset($_POST['action'])) { - switch($_POST['action']) { + switch ($_POST['action']) { case 'newlimit': if (isset($_POST['new_limit']) && tests::is_id($_POST['new_limit'])) { session::global_set('size_limit', validate($_POST['new_limit'])); session::set('size_ignore', FALSE); } - break; + break; case 'ignore': session::global_set('size_limit', 0); session::global_set('size_ignore', TRUE); - break; + break; case 'limited': session::global_set('size_ignore', TRUE); - break; + break; default: - break; + break; } } @@ -2025,6 +2025,7 @@ function check_schema($cfg) /* core-fd */ $checks['core-fd'] = $def_check; + $checks['core-fd']['SCHEMA_FILE'] = 'core-fd.schema'; $checks['core-fd']['CLASSES_REQUIRED'] = array('fdLockEntry'); $checks['core-fd']['IS_MUST_HAVE'] = TRUE; @@ -2032,6 +2033,7 @@ function check_schema($cfg) /* core-fd-conf */ $checks['core-fd-conf'] = $def_check; + $checks['core-fd-conf']['SCHEMA_FILE'] = 'core-fd-conf.schema'; $checks['core-fd-conf']['CLASSES_REQUIRED'] = array('fusionDirectoryConf'); $checks['core-fd-conf']['IS_MUST_HAVE'] = TRUE; @@ -2039,6 +2041,7 @@ function check_schema($cfg) /* ldapns */ $checks['ldapns'] = $def_check; + $checks['ldapns']['SCHEMA_FILE'] = 'ldapns.schema'; $checks['ldapns']['CLASSES_REQUIRED'] = array('hostObject'); $checks['ldapns']['IS_MUST_HAVE'] = FALSE; @@ -2046,6 +2049,7 @@ function check_schema($cfg) /* template-fd */ $checks['template-fd'] = $def_check; + $checks['template-fd']['SCHEMA_FILE'] = 'template-fd.schema'; $checks['template-fd']['CLASSES_REQUIRED'] = array('fdTemplate'); $checks['template-fd']['IS_MUST_HAVE'] = FALSE; @@ -2054,6 +2058,7 @@ function check_schema($cfg) if (class_available('posixAccount')) { /* nis */ $checks['nis'] = $def_check; + $checks['nis']['SCHEMA_FILE'] = 'nis.schema'; $checks['nis']['CLASSES_REQUIRED'] = array('posixAccount'); $checks['nis']['IS_MUST_HAVE'] = FALSE; @@ -2077,6 +2082,7 @@ function check_schema($cfg) } $checks['posixGroup'] = $def_check; + $checks['posixGroup']['SCHEMA_FILE'] = 'nis.schema'; $checks['posixGroup']['CLASSES_REQUIRED'] = array('posixGroup'); $checks['posixGroup']['STATUS'] = TRUE; diff --git a/include/php_setup.inc b/include/php_setup.inc index 1c4ce0302154cbf0d3583516f2c85ad21a0ff10a..2cc4a09bc401f0a6e396a1a29722caca8dc0bda7 100644 --- a/include/php_setup.inc +++ b/include/php_setup.inc @@ -62,7 +62,7 @@ function html_trace($errstr = "") $loc .= _("class")." ".$ct['class']; $func .= $ct['class']; if (isset($ct['function'])) { - $loc .= ' / '; + $loc .= ' / '; $func .= '/'; } } @@ -127,7 +127,7 @@ function html_trace($errstr = "") } else { $line = ""; } - $color = ($index & 1)?'#404040':'606060'; + $color = ($index & 1) ? '#404040' : '606060'; $return_html .= "<tr style='background-color:$color'><td style='padding-left:20px' width=\"30%\">"._("Trace")."[$index]: $loc</td>"; $return_html .= "<td>"._("File").": $file ("._('Line')." $line)</td><td width=\"10%\">"._("Type").": $type</td></tr>"; $return_html .= "<tr style='background-color:$color'><td colspan=3 style='padding-left:20px;'>"._("Arguments").": $args</td></tr>"; diff --git a/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc b/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc index 4c4351a5bc649045565eb4f308786cbc79105983..567b648aba6255c04586bef78018b62fca1f287e 100644 --- a/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc +++ b/include/simpleplugin/attributes/class_BaseSelectorAttribute.inc @@ -59,7 +59,7 @@ class BaseSelectorAttribute extends Attribute } if ($this->plugin->dn == "new") { $ui = get_userinfo(); - $this->setValue(dn2base(session::global_is_set("CurrentMainBase")?"cn=dummy,".session::global_get("CurrentMainBase"):$ui->dn)); + $this->setValue(dn2base(session::global_is_set("CurrentMainBase") ? "cn=dummy,".session::global_get("CurrentMainBase") : $ui->dn)); } else { $this->setValue(dn2base($this->plugin->dn, $this->ou)); } diff --git a/include/simpleplugin/attributes/class_BooleanAttribute.inc b/include/simpleplugin/attributes/class_BooleanAttribute.inc index cc3f26068a6245a8a61fb4b348c5394ae18b6bbc..78e343da64a691f87adf64991d0a778684ad4db0 100644 --- a/include/simpleplugin/attributes/class_BooleanAttribute.inc +++ b/include/simpleplugin/attributes/class_BooleanAttribute.inc @@ -58,13 +58,13 @@ class BooleanAttribute extends Attribute function computeLdapValue () { - return ($this->value?$this->trueValue:$this->falseValue); + return ($this->value ? $this->trueValue : $this->falseValue); } function renderFormInput () { $id = $this->getHtmlId(); - $attributes = ($this->value?array('checked' => 'checked'): array()); + $attributes = ($this->value ? array('checked' => 'checked') : array()); if ($this->submitForm) { $js = 'document.mainform.submit();'; $attributes['onChange'] = 'javascript:'.htmlentities($js, ENT_COMPAT, 'UTF-8'); @@ -85,7 +85,7 @@ class BooleanAttribute extends Attribute if (isset($this->managedAttributesMultipleValues[$value])) { trigger_error('Multiple values are not available for boolean attributes'); } else { - $js .= 'disableAttributes = (document.getElementById('.json_encode($id).').checked == '.($value?'true':'false').');'."\n"; + $js .= 'disableAttributes = (document.getElementById('.json_encode($id).').checked == '.($value ? 'true' : 'false').');'."\n"; } foreach ($attributes as $attribute) { foreach ($this->plugin->attributesAccess[$attribute]->htmlIds() as $htmlId) { diff --git a/include/simpleplugin/attributes/class_FileAttribute.inc b/include/simpleplugin/attributes/class_FileAttribute.inc index 20de46d5c904d6b6291d70c2d12c5cb10bd79cb2..5d444d54d42c7e4592d531f5b7db693a817ee351 100644 --- a/include/simpleplugin/attributes/class_FileAttribute.inc +++ b/include/simpleplugin/attributes/class_FileAttribute.inc @@ -135,8 +135,8 @@ class FileDownloadAttribute extends FileAttribute $id = $this->getHtmlId(); $ids = array('download'.$id); if ($this->upload) { - $ids[] = $id; - $ids[] = 'upload'.$id; + $ids[] = $id; + $ids[] = 'upload'.$id; } return $ids; } @@ -200,7 +200,7 @@ class FileTextAreaAttribute extends FileDownloadAttribute { $id = $this->getHtmlId(); $display = '<textarea name="'.$id.'_text" id="'.$id.'_text"'. - ($this->disabled? 'disabled="disabled"':'').'>'. + ($this->disabled ? 'disabled="disabled"' : '').'>'. '{literal}'.htmlentities($this->getValue(), ENT_COMPAT, 'UTF-8').'{/literal}</textarea><br/>'; return $this->renderAcl($display).parent::renderFormInput(); } @@ -311,7 +311,7 @@ class ImageAttribute extends FileAttribute // Just to be sure the image is not cached srand((double)microtime() * 1000000); $display = '<img id="'.$id.'_img"'. - ($this->disabled? 'disabled="disabled"':''). + ($this->disabled ? 'disabled="disabled"' : ''). ' src="getbin.php?rand='.rand(0, 10000).'"'. ' style="border:1px solid black;"'. ' alt="'.$this->getDescription().'"'. diff --git a/include/simpleplugin/attributes/class_SetAttribute.inc b/include/simpleplugin/attributes/class_SetAttribute.inc index 53679615ddd99e59d72590e7537bc5ee552f5898..5d91cf2990a585329511ebf40b535484a1a43047 100644 --- a/include/simpleplugin/attributes/class_SetAttribute.inc +++ b/include/simpleplugin/attributes/class_SetAttribute.inc @@ -27,7 +27,7 @@ class SetAttribute extends Attribute protected $valueUnicity = TRUE; protected $editingValue = FALSE; protected $linearRendering = TRUE; - protected $size = 4; + protected $size = 4; /*! \brief The constructor of SetAttribute * @@ -170,7 +170,7 @@ class SetAttribute extends Attribute $smarty = get_smarty(); $smarty->assign($id.'_values', $this->getDisplayValues()); $display = '<select multiple="multiple" name="row'.$id.'[]" id="row'.$id.'" size="'.$this->size.'"'. - ($this->disabled? ' disabled="disabled"':''). + ($this->disabled ? ' disabled="disabled"' : ''). ' >'."\n"; $display .= '{html_options options=$'.$id.'_values}'; $display .= '</select><br/>'."\n"; @@ -226,8 +226,8 @@ class SetAttribute extends Attribute } else { $attributes[$this->getLdapName()] = array( 'htmlid' => $this->getForHtmlId(), - 'label' => '{literal}'.$this->getLabel().'{/literal}'.($this->isRequired()?'{$must}':''), - 'description' => ($this->isRequired()?sprintf(_("%s (required)"), $this->getDescription()):$this->getDescription()), + 'label' => '{literal}'.$this->getLabel().'{/literal}'.($this->isRequired() ? '{$must}' : ''), + 'description' => ($this->isRequired() ? sprintf(_("%s (required)"), $this->getDescription()) : $this->getDescription()), 'input' => $this->renderOnlyFormInput(), ); $this->handleEditingValue(); @@ -450,8 +450,8 @@ class OrderedArrayAttribute extends SetAttribute { $id = $this->getHtmlId(); - $img = ''; - $nbicons = 1; + $img = ''; + $nbicons = 1; if ($this->order) { $nbicons += 2; diff --git a/include/simpleplugin/attributes/class_StringAttribute.inc b/include/simpleplugin/attributes/class_StringAttribute.inc index c9a7ab8c151129f4f4f5a993a730c8353627cea5..1d66c61cd41d02352db159e0ecad06adc63c6483 100644 --- a/include/simpleplugin/attributes/class_StringAttribute.inc +++ b/include/simpleplugin/attributes/class_StringAttribute.inc @@ -26,7 +26,7 @@ class StringAttribute extends Attribute protected $pattern; protected $example; protected $autocomplete = NULL; - protected $trim = FALSE; + protected $trim = FALSE; /*! \brief The constructor of StringAttribute * diff --git a/include/simpleplugin/class_dialogAttributes.inc b/include/simpleplugin/class_dialogAttributes.inc index 2fb432e15391ff6f422492615a7b95bed6ee1f74..dc7e3ca005f8dcfefe43e31f12c350e0eea01369 100644 --- a/include/simpleplugin/class_dialogAttributes.inc +++ b/include/simpleplugin/class_dialogAttributes.inc @@ -501,7 +501,7 @@ class MailsAttribute extends DialogAttribute function addValue ($dn, $attrs) { - $value = ($attrs != NULL?$attrs['mail'][0]:$dn); + $value = (($attrs != NULL) ? $attrs['mail'][0] : $dn); if (!in_array($value, $this->value)) { $this->value[] = $value; } diff --git a/include/simpleplugin/class_simpleManagement.inc b/include/simpleplugin/class_simpleManagement.inc index 10e1de5171e71bf27c9aca9b9da38356d940b37b..f81c6d5196140ce34d7cd8e651915d3425f99321 100644 --- a/include/simpleplugin/class_simpleManagement.inc +++ b/include/simpleplugin/class_simpleManagement.inc @@ -436,6 +436,7 @@ class simpleManagement 'set' => '(objectClass=fdTemplate)' ); $this->filter->elementValues[$tag] = TRUE; + $attributes[] = 'fdTemplateField'; } $filter .= ')'; diff --git a/include/simpleplugin/class_simplePlugin.inc b/include/simpleplugin/class_simplePlugin.inc index a09f7317b4dc168fc76674010751434d39ab0326..05f7b891bebfc5646b694741e77a94a3ff9c9a94 100644 --- a/include/simpleplugin/class_simplePlugin.inc +++ b/include/simpleplugin/class_simplePlugin.inc @@ -958,7 +958,7 @@ class simplePlugin function remove_from_parent() { if (!$this->initially_was_account || !$this->acl_is_removeable()) { - return; + return array(); } $this->prepare_remove(); if ($this->is_template && (!defined('_OLD_TEMPLATES_') || !_OLD_TEMPLATES_)) { @@ -975,7 +975,7 @@ class simplePlugin return $errors; } $this->post_remove(); - return; + return array(); } /* Remove FusionDirectory attributes */ @@ -1194,7 +1194,7 @@ class simplePlugin } $this->cleanup(); if (!$this->shouldSave()) { - return; /* Nothing to do here */ + return array(); /* Nothing to do here */ } /* Pre hooks */ $errors = $this->pre_save(); @@ -1209,7 +1209,7 @@ class simplePlugin $this->prepareNextCleanup(); /* Post hooks and logging */ $this->post_save(); - return; + return array(); } protected function shouldSave() @@ -1571,6 +1571,7 @@ class simplePlugin $filter = templateHandling::parseString($filter, array('oldvalue' => $oldvalue, 'newvalue' => $newvalue), 'ldap_escape_f'); } elseif ($mode == 'references') { $foreignRefs[$objectType]['refs'][$class]['name'] = $cinfos['plShortName']; + $foreignRefs[$objectType]['refs'][$class]['fields'][$ofield][$field] = array( 'tab' => $tabclass, diff --git a/include/simpleplugin/class_simpleTabs.inc b/include/simpleplugin/class_simpleTabs.inc index 02bd7bf91a04c843fe74a0de9b0e899a15c250d6..fd42f6838747653c0dcb8498140e7d0f7c84d0b7 100644 --- a/include/simpleplugin/class_simpleTabs.inc +++ b/include/simpleplugin/class_simpleTabs.inc @@ -33,7 +33,7 @@ class simpleTabs var $acl; var $is_template; - public $objectType = FALSE; + public $objectType = FALSE; protected $specialTabs = TRUE; protected $plNotify = array(); diff --git a/plugins/addons/dashboard/class_dashBoardUsers.inc b/plugins/addons/dashboard/class_dashBoardUsers.inc index a69ec9d3a1f67e4252ce41a590ef6ae827da0463..1a7aa87e5240a46c142d09fa2679605b98a5a4ce 100644 --- a/plugins/addons/dashboard/class_dashBoardUsers.inc +++ b/plugins/addons/dashboard/class_dashBoardUsers.inc @@ -105,7 +105,7 @@ class dashboardUsers extends simplePlugin array('name' => 'posix', 'nb' => $nb_posix_accounts, 'img' => 'geticon.php?context=applications&icon=os-linux&size=16'), array('name' => 'samba', 'nb' => $nb_samba_accounts, 'img' => 'geticon.php?context=applications&icon=os-windows&size=16') ), - 'nb' => $nb_accounts, + 'nb' => $nb_accounts, 'img' => 'geticon.php?context=types&icon=user&size=16', ); } @@ -128,7 +128,7 @@ class dashboardUsers extends simplePlugin array('name' => 'mail', 'nb' => $nb_mail_groups, 'img' => 'geticon.php?context=applications&icon=internet-mail&size=16'), array('name' => 'samba', 'nb' => $nb_samba_groups, 'img' => 'geticon.php?context=applications&icon=os-windows&size=16') ), - 'nb' => $nb, + 'nb' => $nb, 'img' => 'geticon.php?context=types&icon=user-group&size=16', ); } @@ -200,8 +200,8 @@ class dashboardUsers extends simplePlugin return array( 'uid' => $attrs['uid'][0], 'cn' => $attrs['cn'][0], - 'telephoneNumber' => (isset($attrs['telephoneNumber'][0])?$attrs['telephoneNumber'][0]:''), - 'mail' => (isset($attrs['mail'][0])?$attrs['mail'][0]:''), + 'telephoneNumber' => (isset($attrs['telephoneNumber'][0]) ? $attrs['telephoneNumber'][0] : ''), + 'mail' => (isset($attrs['mail'][0]) ? $attrs['mail'][0] : ''), 'manager_cn' => $manager_cn, 'manager_mail' => $manager_mail, 'manager_phone' => $manager_phone, diff --git a/plugins/admin/aclrole/class_aclEditionDialog.inc b/plugins/admin/aclrole/class_aclEditionDialog.inc index 89ed55392fe93706666de1eeba940cc49340ed07..26f8d05429f6e18ca6fec0e6a363427bfa725129 100644 --- a/plugins/admin/aclrole/class_aclEditionDialog.inc +++ b/plugins/admin/aclrole/class_aclEditionDialog.inc @@ -277,6 +277,7 @@ class ACLEditionDialog extends GenericDialog /* Add select all/none buttons */ $style = 'style="width:100px;"'; + $display .= '<input '.$style.' type="button" name="toggle_all_create" onClick="acl_toggle_all(\'_0_c$\');" value="Toggle C"/>'; $display .= '<input '.$style.' type="button" name="toggle_all_move" onClick="acl_toggle_all(\'_0_m$\');" value="Toggle M"/>'; $display .= '<input '.$style.' type="button" name="toggle_all_remove" onClick="acl_toggle_all(\'_0_d$\');" value="Toggle D"/> - '; @@ -346,16 +347,16 @@ class ACLEditionDialog extends GenericDialog /* Generate options */ $spc = ' '; - $options = $this->mkchkbx($key.'_0_c', _('Create objects'), preg_match('/c/', $overall_acl)).$spc; - $options .= $this->mkchkbx($key.'_0_m', _('Move objects'), preg_match('/m/', $overall_acl)).$spc; - $options .= $this->mkchkbx($key.'_0_d', _('Remove objects'), preg_match('/d/', $overall_acl)).$spc; + $options = $this->mkchkbx($key.'_0_c', _('Create objects'), preg_match('/c/', $overall_acl)).$spc; + $options .= $this->mkchkbx($key.'_0_m', _('Move objects'), preg_match('/m/', $overall_acl)).$spc; + $options .= $this->mkchkbx($key.'_0_d', _('Remove objects'), preg_match('/d/', $overall_acl)).$spc; if ($plist[preg_replace('%^.*/%', '', $key)]['plSelfModify']) { $options .= $this->mkchkbx($key.'_0_s', _('Grant permission to owner'), preg_match('/s/', $overall_acl)).$spc; } /* Global options */ - $more_options = $this->mkchkbx($key.'_0_r', _('read'), preg_match('/r/', $overall_acl)).$spc; - $more_options .= $this->mkchkbx($key.'_0_w', _('write'), preg_match('/w/', $overall_acl)); + $more_options = $this->mkchkbx($key.'_0_r', _('read'), preg_match('/r/', $overall_acl)).$spc; + $more_options .= $this->mkchkbx($key.'_0_w', _('write'), preg_match('/w/', $overall_acl)); $display .= ' <tr>'."\n". ' <td style="background-color:#E0E0E0" colspan="'.($cols - 1).'">'.$options.'</td>'."\n". diff --git a/plugins/admin/groups/class_ogroup.inc b/plugins/admin/groups/class_ogroup.inc index 190c24dc2a1516b11232fc175bfeed42f3d45dda..78dc7aa3216bd122a5b573359b3c4f28f85689fb 100644 --- a/plugins/admin/groups/class_ogroup.inc +++ b/plugins/admin/groups/class_ogroup.inc @@ -74,7 +74,7 @@ class ObjectsAttribute extends GenericDialogAttribute } $id = $this->getHtmlId(); $display = '<select multiple="multiple" name="row'.$id.'[]" id="row'.$id.'" size="'.$this->size.'"'. - ($this->disabled? ' disabled="disabled"':''). + ($this->disabled ? ' disabled="disabled"' : ''). ' >'."\n"; foreach ($this->getDisplayValues() as $key => $value) { try { diff --git a/plugins/admin/users/class_userManagement.inc b/plugins/admin/users/class_userManagement.inc index c8acd109c0ac2bf78652481563784e4254529b19..84837ebe2aa0c7b627313a3dee12253a5abbd5d2 100644 --- a/plugins/admin/users/class_userManagement.inc +++ b/plugins/admin/users/class_userManagement.inc @@ -82,21 +82,21 @@ class userManagement extends simpleManagement $classes = array(); if (class_available('posixAccount')) { - $classes[]= 'posixAccount'; + $classes[] = 'posixAccount'; } else { /* If posix plugin is not installed, ignore posix filter */ $this->filter->elements['POSIX']['unset'] = ''; $this->filter->elements['POSIX']['set'] = ''; } if (class_available('mailAccount')) { - $classes[]= 'gosaMailAccount'; + $classes[] = 'gosaMailAccount'; } else { /* If mail plugin is not installed, ignore mail filter */ $this->filter->elements['MAIL']['unset'] = ''; $this->filter->elements['MAIL']['set'] = ''; } if (class_available('sambaAccount')) { - $classes[]= 'sambaSamAccount'; + $classes[] = 'sambaSamAccount'; } else { /* If samba plugin is not installed, ignore samba filter */ $this->filter->elements['SAMBA']['unset'] = ''; diff --git a/setup/class_setupStep.inc b/setup/class_setupStep.inc index 08182b0e9fe3d3a94830f27ff02ec5d003110b21..2ed18fe53544c0934818c7d407744a5825f26c88 100644 --- a/setup/class_setupStep.inc +++ b/setup/class_setupStep.inc @@ -24,6 +24,7 @@ class setupStep extends simplePlugin protected $s_short_name = 'Still undefined'; protected $s_title = 'Still undefined'; protected $s_description = 'Still undefined'; + var $is_active = FALSE; var $is_enabled = FALSE; var $is_completed = FALSE; diff --git a/setup/class_setupStepMigrate.inc b/setup/class_setupStepMigrate.inc index c3d60da3b0bdd7b16c783b3a2e1c904a8353570b..6613a3207d19f5b045d13fd88feed1514d9db6cf 100644 --- a/setup/class_setupStepMigrate.inc +++ b/setup/class_setupStepMigrate.inc @@ -622,6 +622,7 @@ class setupStepMigrate extends setupStep } /* Fix displayed dn syntax */ $var = $checkobj->name.'_toMigrate'; + $infos['entries'] = $this->$var; foreach ($infos['entries'] as $key => $data) { $infos['entries'][$key]['dn'] = $data['dn'];