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

Fixes: #2595 The code should follow code guidelines

parent 5f8398c4
......@@ -440,22 +440,22 @@ sub check_config {
sub write_vars {
my $filecontent = <<eof;
<?php
require_once('variables_common.inc');
require_once('variables_common.inc');
/*! \\file
* Define common locations and variables
* Generated by fusiondirectory-setup */
/*! \\file
* Define common locations and variables
* Generated by fusiondirectory-setup */
if(!defined("CONFIG_DIR")){
define ("CONFIG_DIR", "$vars{fd_config_dir}/"); /* FusionDirectory etc path */
}
if (!defined("CONFIG_DIR")) {
define ("CONFIG_DIR", "$vars{fd_config_dir}/"); /* FusionDirectory etc path */
}
/* Allow setting the config file in the apache configuration
e.g. SetEnv CONFIG_FILE fusiondirectory.conf 1.0
*/
if(!defined("CONFIG_FILE")){
define ("CONFIG_FILE", "$vars{config_file}"); /* FusionDirectory filename */
}
/* Allow setting the config file in the apache configuration
e.g. SetEnv CONFIG_FILE fusiondirectory.conf 1.0
*/
if (!defined("CONFIG_FILE")) {
define ("CONFIG_FILE", "$vars{config_file}"); /* FusionDirectory filename */
}
/* Path for smarty3 libraries */
define("SMARTY", "$vars{fd_smarty_dir}");
......@@ -463,26 +463,26 @@ define("SMARTY", "$vars{fd_smarty_dir}");
/* Smarty compile dir */
define ("SPOOL_DIR", "$vars{fd_spool_dir}/"); /* FusionDirectory spool directory */
/* Global cache dir */
define ("CACHE_DIR","$vars{fd_cache}/"); /* FusionDirectory var directory */
/* Global cache dir */
define ("CACHE_DIR", "$vars{fd_cache}/"); /* FusionDirectory var directory */
/* Global locale cache dir */
define ("LOCALE_DIR", "$locale_cache_dir/"); /* FusionDirectory locale directory */
/* Global locale cache dir */
define ("LOCALE_DIR", "$locale_cache_dir/"); /* FusionDirectory locale directory */
/* Global tmp dir */
define ("TEMP_DIR", "$tmp_dir/"); /* FusionDirectory tmp directory */
/* Global tmp dir */
define ("TEMP_DIR", "$tmp_dir/"); /* FusionDirectory tmp directory */
/* Directory containing the configuration template */
define ("CONFIG_TEMPLATE_DIR", "$template_dir/"); /* FusionDirectory template directory */
/* Directory containing the configuration template */
define ("CONFIG_TEMPLATE_DIR", "$template_dir/"); /* FusionDirectory template directory */
/* Directory containing the fai logs */
define ("FAI_LOG_DIR", "$fai_log_dir/"); /* FusionDirectory fai directory */
/* Directory containing the fai logs */
define ("FAI_LOG_DIR", "$fai_log_dir/"); /* FusionDirectory fai directory */
/* Directory containing the supann files
define ("SUPANN_DIR", "$vars{fd_config_dir}/supann/"); /* FusionDirectory supann template directory */
/* Directory containing the supann files
define ("SUPANN_DIR", "$vars{fd_config_dir}/supann/"); /* FusionDirectory supann template directory */
/* name of the class.cache file */
define("CLASS_CACHE", "$vars{class_cache}"); /* name of the class cache */
/* name of the class.cache file */
define("CLASS_CACHE", "$vars{class_cache}"); /* name of the class cache */
?>
eof
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier
......@@ -46,6 +45,7 @@ if (!defined("CONFIG_FILE")) {
define("SMARTY", "/usr/share/php/smarty3/Smarty.class.php");
/*!
* \brief Smarty compile dir
*/
define ("SPOOL_DIR", "/var/spool/fusiondirectory/"); /* FusionDirectory spool directory */
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003-2010 Cajus Pollmeier
......@@ -29,16 +28,16 @@
* \brief Allow setting the config file in the apache configuration
* e.g. SetEnv CONFIG_DIR /etc/fusiondirectory
*/
if(isset($_SERVER['CONFIG_DIR'])){
define ("CONFIG_DIR",$_SERVER['CONFIG_DIR']);
if (isset($_SERVER['CONFIG_DIR'])) {
define ("CONFIG_DIR", $_SERVER['CONFIG_DIR']);
}
/*
* \brief Allow setting the config file in the apache configuration
* e.g. SetEnv CONFIG_FILE fusiondirectory.conf 1.0
*/
if(isset($_SERVER['CONFIG_FILE'])){
define ("CONFIG_FILE",$_SERVER['CONFIG_FILE']);
if (isset($_SERVER['CONFIG_FILE'])) {
define ("CONFIG_FILE", $_SERVER['CONFIG_FILE']);
}
/*!
......@@ -54,7 +53,7 @@ define ("PEAR_DIR", "/usr/share/php"); /*! Define PEAR directory */
/*!
* \brief fpdf library path
*/
define("FPDF","/usr/share/php/fpdf/fpdf.php"); /*! Define fpdf library path */
define("FPDF", "/usr/share/php/fpdf/fpdf.php"); /*! Define fpdf library path */
/*!
* \brief Global FPDF FONT define
......@@ -70,4 +69,5 @@ define ("FD_VERSION", "1.0.8-dev"); /*! Define FusionDirectory version */
* \brief FusionDirectory config object RDN
*/
define ("CONFIGRDN", "cn=fusiondirectory,ou=configs,"); /*! Define FusionDirectory config object */
?>
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003 Cajus Pollmeier
......@@ -30,7 +29,7 @@ class password extends plugin
function password(&$config, $dn = NULL, $parent = NULL)
{
plugin::plugin($config, $dn, $parent);
parent::__construct($config, $dn, $parent);
// Try to generate a password proposal, if this is successfull
// then preselect the proposal usage.
......@@ -47,8 +46,8 @@ class password extends plugin
function refreshProposal()
{
$this->proposal = passwordMethod::getPasswordProposal($this->config);
$this->proposalEnabled = (!empty($this->proposal));
$this->proposal = passwordMethod::getPasswordProposal($this->config);
$this->proposalEnabled = (!empty($this->proposal));
}
function execute()
......
<?php
/*
This code is part of FusionDirectory (http://www.fusiondirectory.org/)
Copyright (C) 2003 Cajus Pollmeier
......@@ -21,39 +20,36 @@
*/
/* Remove locks created by this plugin */
$lock_msg="";
if ($remove_lock){
if(session::is_set('password')){
$lock_msg = "";
if ($remove_lock) {
if (session::is_set('password')) {
//Nothing to do here
}
}
/* Remove this plugin from session */
if ( $cleanup ){
if ($cleanup) {
session::un_set('password');
session::un_set('edit');
}else{
} else {
/* Reset requested? */
if (isset($_POST['edit_cancel'])){
session::un_set ('edit');
session::un_set ('password');
if (isset($_POST['edit_cancel'])) {
session::un_set('edit');
session::un_set('password');
}
/* Create password object on demand */
if (!session::is_set('password') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
if (!session::is_set('password') || (isset($_GET['reset']) && $_GET['reset'] == 1)) {
session::set('password', new password ($config, $ui->dn));
}
$password = session::get('password');
/* Execute formular */
$display.= $password->execute ();
$display .= $password->execute();
/* Page header*/
$display = print_header(get_template_path('plugins/password/images/icon.png'),
_("Password settings"), "").$display;
}
// 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