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

Fixes: #2595 Some code cleaning

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