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

Fixes: #2595 cleaning files in include folder

parent 6f1c30a7
...@@ -174,8 +174,7 @@ class CopyPasteHandler ...@@ -174,8 +174,7 @@ class CopyPasteHandler
*/ */
function execute($base) function execute($base)
{ {
$ui = get_userinfo(); $ui = get_userinfo();
$type = $this->current['method'];
/* Check which entries can be pasted directly. /* Check which entries can be pasted directly.
* Create a list of all entries that can be pasted directly. * Create a list of all entries that can be pasted directly.
......
...@@ -130,9 +130,6 @@ class SnapshotHandler { ...@@ -130,9 +130,6 @@ class SnapshotHandler {
return array(); return array();
} }
// Load user info
$ui = get_userinfo();
list($ldap, $snapshotLdap) = $this->get_ldap_links(); list($ldap, $snapshotLdap) = $this->get_ldap_links();
// Initialize base // Initialize base
...@@ -144,7 +141,6 @@ class SnapshotHandler { ...@@ -144,7 +141,6 @@ class SnapshotHandler {
$snapshotLdap->ls("(objectClass=gosaSnapshotObject)", $base, $snapshotLdap->ls("(objectClass=gosaSnapshotObject)", $base,
array("gosaSnapshotType", "gosaSnapshotTimestamp", "gosaSnapshotDN", "description")); array("gosaSnapshotType", "gosaSnapshotTimestamp", "gosaSnapshotDN", "description"));
while ($entry = $snapshotLdap->fetch()) { while ($entry = $snapshotLdap->fetch()) {
$chk = str_replace($base, "", $entry['dn']); $chk = str_replace($base, "", $entry['dn']);
if (preg_match("/,ou=/", $chk)) { if (preg_match("/,ou=/", $chk)) {
continue; continue;
...@@ -253,9 +249,6 @@ class SnapshotHandler { ...@@ -253,9 +249,6 @@ class SnapshotHandler {
$dns = array($dn); $dns = array($dn);
} }
/* Get configuration from fusiondirectory.conf */
$config = $this->config;
list($ldap, $ldap_to) = $this->get_ldap_links(); list($ldap, $ldap_to) = $this->get_ldap_links();
/* check if the dn exists */ /* check if the dn exists */
...@@ -309,7 +302,6 @@ class SnapshotHandler { ...@@ -309,7 +302,6 @@ class SnapshotHandler {
if (!$ldap->success()) { if (!$ldap->success()) {
msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $new_base, "", get_class())); msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $new_base, "", get_class()));
} }
} }
} }
...@@ -389,7 +381,6 @@ class SnapshotHandler { ...@@ -389,7 +381,6 @@ class SnapshotHandler {
/* Prepare bases */ /* Prepare bases */
$new_base = $this->snapshot_dn($base_of_object); $new_base = $this->snapshot_dn($base_of_object);
/* Fetch all objects and check if they do not exist anymore */ /* Fetch all objects and check if they do not exist anymore */
$ui = get_userinfo();
$tmp = array(); $tmp = array();
$ldap_to->cd($new_base); $ldap_to->cd($new_base);
$ldap_to->ls("(objectClass=gosaSnapshotObject)", $new_base, array("gosaSnapshotType","gosaSnapshotTimestamp","gosaSnapshotDN","description")); $ldap_to->ls("(objectClass=gosaSnapshotObject)", $new_base, array("gosaSnapshotType","gosaSnapshotTimestamp","gosaSnapshotDN","description"));
...@@ -442,7 +433,7 @@ class SnapshotHandler { ...@@ -442,7 +433,7 @@ class SnapshotHandler {
/* Get the snapshot */ /* Get the snapshot */
$ldap_to->cat($dn); $ldap_to->cat($dn);
$restoreObject = $ldap_to->fetch(); $ldap_to->fetch();
/* Prepare import string */ /* Prepare import string */
$data = gzuncompress($ldap_to->get_attribute($dn, 'gosaSnapshotData')); $data = gzuncompress($ldap_to->get_attribute($dn, 'gosaSnapshotData'));
...@@ -450,7 +441,7 @@ class SnapshotHandler { ...@@ -450,7 +441,7 @@ class SnapshotHandler {
/* Import the given data */ /* Import the given data */
try { try {
$ldap->import_complete_ldif($data, FALSE, FALSE); $ldap->import_complete_ldif($data, FALSE, FALSE);
} catch(Exception $e) { } catch (Exception $e) {
msg_dialog::display(_('LDAP error'), $e->getMessage(), ERROR_DIALOG); msg_dialog::display(_('LDAP error'), $e->getMessage(), ERROR_DIALOG);
} }
if (!$ldap->success()) { if (!$ldap->success()) {
......
...@@ -1072,8 +1072,8 @@ class config { ...@@ -1072,8 +1072,8 @@ class config {
/* Check if we have a current value for $name */ /* Check if we have a current value for $name */
if (isset($this->current[$name])) { if (isset($this->current[$name])) {
$res = $this->current[$name]; $res = $this->current[$name];
/* Check if we have a global value for $name */
} elseif (isset($this->data["MAIN"][$name])) { } elseif (isset($this->data["MAIN"][$name])) {
/* Check if we have a global value for $name */
$res = $this->data["MAIN"][$name]; $res = $this->data["MAIN"][$name];
} }
...@@ -1372,7 +1372,7 @@ class config { ...@@ -1372,7 +1372,7 @@ class config {
foreach ($this->data['CATEGORIES'] as $name => &$infos) { foreach ($this->data['CATEGORIES'] as $name => &$infos) {
$infos['classes'] = array_unique($infos['classes']); $infos['classes'] = array_unique($infos['classes']);
if (!isset($infos['description'])) { if (!isset($infos['description'])) {
trigger_error("ACL category '$name' for classes ".join(',',$infos['classes'])." has no definition"); trigger_error("ACL category '$name' for classes ".join(',', $infos['classes'])." has no definition");
$infos['description'] = $name; $infos['description'] = $name;
$infos['objectClass'] = array(); $infos['objectClass'] = array();
} }
......
...@@ -180,7 +180,7 @@ class divSelectBox ...@@ -180,7 +180,7 @@ class divSelectBox
$cnt = 0; $cnt = 0;
$this->cols = count($s_value); $this->cols = count($s_value);
foreach ($s_value as $s_key2 => $s_value2) { foreach ($s_value as $s_value2) {
$cnt++; $cnt++;
if (!isset($s_value2['class'])) { if (!isset($s_value2['class'])) {
......
...@@ -51,11 +51,8 @@ class filterLDAP { ...@@ -51,11 +51,8 @@ class filterLDAP {
*/ */
static function query($parent, $base, $scope, $filter, $attributes, $category, $objectStorage = array("")) static function query($parent, $base, $scope, $filter, $attributes, $category, $objectStorage = array(""))
{ {
$config = session::global_get('config');
$ldap = $config->get_ldap_link(TRUE);
$flag = ($scope == "sub"?GL_SUBSEARCH:0); $flag = ($scope == "sub"?GL_SUBSEARCH:0);
$result = filterLDAP::get_list($parent, $base, $filter, $attributes, $category, $objectStorage, $flag | GL_SIZELIMIT); return filterLDAP::get_list($parent, $base, $filter, $attributes, $category, $objectStorage, $flag | GL_SIZELIMIT);
return $result;
} }
/*! /*!
...@@ -152,7 +149,7 @@ class filterLDAP { ...@@ -152,7 +149,7 @@ class filterLDAP {
// In no-subsearch mode overwrite default method if // In no-subsearch mode overwrite default method if
// current base equals the initial base // current base equals the initial base
if ($base == $initial_base && !($flags & GL_SUBSEARCH)) { if ($base == $initial_base && !($flags & GL_SUBSEARCH)) {
$method = "ls"; $method = "ls";
} }
if ($method == "ls") { if ($method == "ls") {
...@@ -191,7 +188,7 @@ class filterLDAP { ...@@ -191,7 +188,7 @@ class filterLDAP {
$result[] = $attrs; $result[] = $attrs;
} }
} else { } else {
//trigger_error("Invalid objectType given, please check listing.xml '{$dn}'!"); @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $dn, "Invalid objectType given, please check listing.xml");
} }
} }
} }
......
...@@ -229,9 +229,6 @@ class listing { ...@@ -229,9 +229,6 @@ class listing {
'filter' => ldapFilter::parse($i['filter']), 'filter' => ldapFilter::parse($i['filter']),
'nameAttr' => $i['nameAttr'], 'nameAttr' => $i['nameAttr'],
); );
if (!isset($i['nameAttr'])) {
print_r($i);
}
} }
$this->categories = array(); $this->categories = array();
if (isset($this->xmlData['definition']['objectType'])) { if (isset($this->xmlData['definition']['objectType'])) {
...@@ -1178,7 +1175,6 @@ class listing { ...@@ -1178,7 +1175,6 @@ class listing {
*/ */
function getAction() function getAction()
{ {
global $config;
// Do not do anything if this is not our PID, or there's even no PID available... // Do not do anything if this is not our PID, or there's even no PID available...
if (!isset($_REQUEST['dn']) && (!isset($_REQUEST['PID']) || $_REQUEST['PID'] != $this->pid)) { if (!isset($_REQUEST['dn']) && (!isset($_REQUEST['PID']) || $_REQUEST['PID'] != $this->pid)) {
return; return;
......
...@@ -394,7 +394,7 @@ class management ...@@ -394,7 +394,7 @@ class management
if (!empty($altTabType)) $tabType = $altTabType; if (!empty($altTabType)) $tabType = $altTabType;
if (!empty($altAclCategory)) $aclCategory = $altAclCategory; if (!empty($altAclCategory)) $aclCategory = $altAclCategory;
@DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $target, "Entry removel confirmed!"); @DEBUG (DEBUG_TRACE, __LINE__, __FUNCTION__, __FILE__, $target, "Entry removal confirmed!");
foreach ($this->dns as $dn) { foreach ($this->dns as $dn) {
// Check permissions, are we allowed to remove this object? // Check permissions, are we allowed to remove this object?
......
...@@ -206,13 +206,9 @@ class msg_dialog ...@@ -206,13 +206,9 @@ class msg_dialog
$return = ""; $return = "";
$dialog_ids = ""; $dialog_ids = "";
$seen = ""; if (session::is_set('msg_dialogs') &&
/*if (isset($_POST['closed_msg_dialogs'])) { is_array(session::get('msg_dialogs')) &&
$seen = $_POST['closed_msg_dialogs']; count(session::get('msg_dialogs'))) {
}*/
if (session::is_set('msg_dialogs') && is_array(session::get('msg_dialogs')) && count(session::get('msg_dialogs'))) {
/* Get frame one */ /* Get frame one */
$smarty = get_smarty(); $smarty = get_smarty();
$smarty->assign("frame", TRUE); $smarty->assign("frame", TRUE);
...@@ -220,9 +216,7 @@ class msg_dialog ...@@ -220,9 +216,7 @@ class msg_dialog
$msg_dialogs = session::get('msg_dialogs'); $msg_dialogs = session::get('msg_dialogs');
foreach ($msg_dialogs as $key => $dialog) { foreach ($msg_dialogs as $key => $dialog) {
if (preg_match("/".$dialog->get_ID()."/", $seen)) { if (!preg_match("/".$dialog->get_ID()."/", "")) {
unset($msg_dialogs[$key]);
} else {
$return .= $dialog->execute(); $return .= $dialog->execute();
$dialog_ids = $dialog->get_ID().",".$dialog_ids; $dialog_ids = $dialog->get_ID().",".$dialog_ids;
} }
...@@ -239,6 +233,5 @@ class msg_dialog ...@@ -239,6 +233,5 @@ class msg_dialog
} }
return $return; return $return;
} }
} }
?> ?>
...@@ -1714,7 +1714,6 @@ class plugin ...@@ -1714,7 +1714,6 @@ class plugin
*/ */
function get_allowed_bases() function get_allowed_bases()
{ {
$ui = get_userinfo();
$deps = array(); $deps = array();
/* Is this a new object ? Or just an edited existing object */ /* Is this a new object ? Or just an edited existing object */
...@@ -1735,9 +1734,7 @@ class plugin ...@@ -1735,9 +1734,7 @@ class plugin
/* Add current base */ /* Add current base */
if (isset($this->base) && isset($this->config->idepartments[$this->base])) { if (isset($this->base) && isset($this->config->idepartments[$this->base])) {
$deps[$this->base] = $this->config->idepartments[$this->base]; $deps[$this->base] = $this->config->idepartments[$this->base];
} elseif (strtolower($this->dn) == strtolower($this->config->current['BASE'])) { } elseif (strtolower($this->dn) != strtolower($this->config->current['BASE'])) {
} else {
trigger_error("Cannot return list of departments, no default base found in class ".get_class($this).". (base is '".$this->base."')"); trigger_error("Cannot return list of departments, no default base found in class ".get_class($this).". (base is '".$this->base."')");
} }
return $deps; return $deps;
......
...@@ -222,9 +222,9 @@ class tabs ...@@ -222,9 +222,9 @@ class tabs
if (!$disabled) { if (!$disabled) {
$display .= '<input type="hidden" name="arg" value=""/>'; $display .= '<input type="hidden" name="arg" value=""/>';
} }
$display .= '<table class="tabs_header"><tbody><tr>'; $display .= '<table class="tabs_header"><tbody><tr>';
$index = 0; $index = 0;
$style = array("tab_left", "tab_active", "tab_near_active", "tab_right"); $style = array("tab_left", "tab_active", "tab_near_active", "tab_right");
foreach ($this->by_name as $class => $name) { foreach ($this->by_name as $class => $name) {
/* Activate right tabs with style "tab_right" /* Activate right tabs with style "tab_right"
...@@ -270,8 +270,8 @@ class tabs ...@@ -270,8 +270,8 @@ class tabs
} }
} }
$display.= "<td>\n"; $display .= "<td>\n";
$display.= "<div class=\"tab_border\">&nbsp;</div></td></tr></tbody></table>"; $display .= "<div class=\"tab_border\">&nbsp;</div></td></tr></tbody></table>";
return $display; return $display;
} }
......
...@@ -374,13 +374,11 @@ class tests { ...@@ -374,13 +374,11 @@ class tests {
*/ */
public static function is_date($date) public static function is_date($date)
{ {
global $lang;
if ($date == "") { if ($date == "") {
return TRUE; return TRUE;
} }
//TODO: use $lang to check date format //TODO: use global $lang to check date format
if (!preg_match("/([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{4})/", $date, $matches)) { if (!preg_match("/([0-9]{1,2})\.([0-9]{1,2})\.([0-9]{4})/", $date, $matches)) {
return FALSE; return FALSE;
} }
......
...@@ -183,7 +183,6 @@ class Print_a_class { ...@@ -183,7 +183,6 @@ class Print_a_class {
$this->output .= '</td>'; $this->output .= '</td>';
$this->output .= '<td nowrap="nowrap" style="background-color:#'.$this->value_bg_color.';font: '.$this->fontsize.' '.$this->fontfamily.'; color:black;">'; $this->output .= '<td nowrap="nowrap" style="background-color:#'.$this->value_bg_color.';font: '.$this->fontsize.' '.$this->fontfamily.'; color:black;">';
// value output // value output
if ($type == 'array') { if ($type == 'array') {
if (count($value)) { if (count($value)) {
......
...@@ -274,7 +274,6 @@ ini_set("include_path", ".:$BASE_DIR/include:".PHP_DIR.":".PEAR_DIR); ...@@ -274,7 +274,6 @@ ini_set("include_path", ".:$BASE_DIR/include:".PHP_DIR.":".PEAR_DIR);
/* Do smarty setup */ /* Do smarty setup */
require(SMARTY); require(SMARTY);
/*require(SMARTY_PATH);*/
$smarty = new Smarty; $smarty = new Smarty;
$smarty->template_dir = $BASE_DIR.'/ihtml/'; $smarty->template_dir = $BASE_DIR.'/ihtml/';
......
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