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

Fixes: #2595 Some code cleaning

parent 7052c02b
...@@ -54,7 +54,7 @@ class passwordRecovery { ...@@ -54,7 +54,7 @@ class passwordRecovery {
var $usealternates; var $usealternates;
/* Constructor */ /* Constructor */
function passwordRecovery() function __construct()
{ {
global $config, $ssl; global $config, $ssl;
/* Destroy old session if exists. /* Destroy old session if exists.
...@@ -152,8 +152,6 @@ class passwordRecovery { ...@@ -152,8 +152,6 @@ class passwordRecovery {
} else { } else {
$this->uid = ""; $this->uid = "";
} }
} }
function execute() function execute()
...@@ -401,7 +399,6 @@ class passwordRecovery { ...@@ -401,7 +399,6 @@ class passwordRecovery {
function isValidPassword($new_password, $repeated_password) function isValidPassword($new_password, $repeated_password)
{ {
//$MinDiffer = $this->config->get_cfg_value("passwordMinDiffer", 0);
$MinLength = $this->config->get_cfg_value("passwordMinLength", 0); $MinLength = $this->config->get_cfg_value("passwordMinLength", 0);
if ($new_password != $repeated_password) { if ($new_password != $repeated_password) {
......
<?php <?php
/* /*
This code is part of FusionDirectory (http://www.fusiondirectory.org/) This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier Copyright (C) 2003-2010 Cajus Pollmeier
...@@ -21,18 +20,18 @@ ...@@ -21,18 +20,18 @@
*/ */
/* Basic setup, remove eventually registered sessions */ /* Basic setup, remove eventually registered sessions */
@require_once ("../include/php_setup.inc"); @require_once("../include/php_setup.inc");
@require_once ("functions.inc"); @require_once("functions.inc");
@require_once ("variables.inc"); @require_once("variables.inc");
error_reporting (0); error_reporting (0);
session_cache_limiter("private"); session_cache_limiter("private");
session::start(); session::start();
session::global_set('errorsAlreadyPosted',array()); session::global_set('errorsAlreadyPosted', array());
/* Logged in? Simple security check */ /* Logged in? Simple security check */
if (!session::global_is_set('ui')){ if (!session::global_is_set('ui')) {
new log("security","unknown","",array(),"Error: getbin.php called without session") ; new log("security", "unknown", "", array(), "Error: getbin.php called without session");
header ("Location: index.php"); header ("Location: index.php");
exit; exit;
} }
...@@ -52,6 +51,4 @@ if (session::is_set('binaryfile')) { ...@@ -52,6 +51,4 @@ if (session::is_set('binaryfile')) {
echo session::get('binary'); echo session::get('binary');
error_reporting (E_ALL | E_STRICT); error_reporting (E_ALL | E_STRICT);
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?> ?>
...@@ -157,7 +157,6 @@ class SnapShotDialog extends plugin ...@@ -157,7 +157,6 @@ class SnapShotDialog extends plugin
/* Should we only display all snapshots of already deleted objects /* Should we only display all snapshots of already deleted objects
or the snapshots for the given object dn */ or the snapshots for the given object dn */
$res = array();
$tmp = array(); $tmp = array();
if ($this->display_all_removed_objects) { if ($this->display_all_removed_objects) {
$snap_shot_bases = $this->snapHandler->getSnapshotBases(); $snap_shot_bases = $this->snapHandler->getSnapshotBases();
......
...@@ -349,7 +349,7 @@ class acl extends plugin ...@@ -349,7 +349,7 @@ class acl extends plugin
unset($attrs['gosaAclEntry']['count']); unset($attrs['gosaAclEntry']['count']);
// Remove entry directly // Remove entry directly
foreach ($attrs['gosaAclEntry'] as $id => $entry) { foreach ($attrs['gosaAclEntry'] as $entry) {
$parts = explode(':', $entry); $parts = explode(':', $entry);
$members = explode(',', $parts[2]); $members = explode(',', $parts[2]);
$new_members = array(); $new_members = array();
......
...@@ -40,31 +40,30 @@ class timezone { ...@@ -40,31 +40,30 @@ class timezone {
static public function get_default_timezone($stamp = NULL) static public function get_default_timezone($stamp = NULL)
{ {
global $config; global $config;
$tz =""; $tz = "";
/* Default return value if zone could not be detected */ /* Default return value if zone could not be detected */
$zone = array("name" => "unconfigured", "value" => 0); $zone = array("name" => "unconfigured", "value" => 0);
/* Use current timestamp if $stamp is not set */ /* Use current timestamp if $stamp is not set */
if($stamp === NULL){ if ($stamp === NULL) {
$stamp = time(); $stamp = time();
} }
/* Is there a timezone configured in the fusiondirectory configuration (fusiondirectory.conf) */ /* Is there a timezone configured in the fusiondirectory configuration (fusiondirectory.conf) */
if ($config->get_cfg_value("timezone") != ""){ if ($config->get_cfg_value("timezone") != "") {
/* Get zonename */ /* Get zonename */
$tz = $config->get_cfg_value("timezone"); $tz = $config->get_cfg_value("timezone");
if(!@date_default_timezone_set($tz)){ if (!@date_default_timezone_set($tz)) {
msg_dialog::display(_("Configuration error"), sprintf(_("The timezone setting '%s' in your fusiondirectory.conf is not valid. Cannot calculate correct timezone offset."), $tz), ERROR_DIALOG); msg_dialog::display(_("Configuration error"), sprintf(_("The timezone setting '%s' in your fusiondirectory.conf is not valid. Cannot calculate correct timezone offset."), $tz), ERROR_DIALOG);
} }
$tz_delta = date("Z", $stamp); $tz_delta = date("Z", $stamp);
$tz_delta = $tz_delta / 3600 ; $tz_delta = $tz_delta / 3600;
return(array("name" => $tz, "value" => $tz_delta)); return array("name" => $tz, "value" => $tz_delta);
} }
return($zone); return $zone;
} }
...@@ -78,6 +77,4 @@ class timezone { ...@@ -78,6 +77,4 @@ class timezone {
return DateTimeZone::listIdentifiers(); return DateTimeZone::listIdentifiers();
} }
} }
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
?> ?>
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