Commit 5b2a7729 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 23555304
......@@ -439,46 +439,46 @@ 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 */
}
/* Smarty compile dir */
define ("SPOOL_DIR","$vars{fd_spool_dir}/"); /* FusionDirectory spool directory */
/* 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
......@@ -20,63 +19,64 @@
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*!
* \file variables.inc
* Define common locations and variables
* Generated by fusiondirectory-setup
*/
require_once('variables_common.inc');
if(!defined("CONFIG_DIR")){
define ("CONFIG_DIR", "/etc/fusiondirectory/"); /* FusionDirectory etc path */
}
/*!
* \brief 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", "fusiondirectory.conf"); /* FusionDirectory filename */
}
/*!
* \brief Smarty compile dir
*/
define ("SPOOL_DIR","/var/spool/fusiondirectory/"); /* FusionDirectory spool directory */
/*!
* \brief Global cache dir
*/
define ("CACHE_DIR","/var/cache/fusiondirectory/"); /* FusionDirectory var directory */
/*!
* \brief Global locale cache dir
*/
define ("LOCALE_DIR", "/var/cache/fusiondirectory/locale/"); /* FusionDirectory locale directory */
/*!
* \brief Global tmp dir
*/
define ("TEMP_DIR", "/var/cache/fusiondirectory/tmp/"); /* FusionDirectory tmp directory */
/*!
* \brief Directory containing the configuration template
*/
define ("CONFIG_TEMPLATE_DIR", "/var/cache/fusiondirectory/template/"); /* FusionDirectory template directory */
/*!
* \brief Directory containing the fai logs
*/
define ("FAI_LOG_DIR", "/var/cache/fusiondirectory/fai/"); /* FusionDirectory fai directory */
/*!
* \brief Directory containing the vacation files
*/
define ("SUPANN_DIR", "/etc/fusiondirectory/supann/"); /* FusionDirectory supann template directory */
/*!
* \brief name of the class.cache file
*/
define("CLASS_CACHE", "class.cache"); /* name of the class cache */
/*!
* \file variables.inc
* Define common locations and variables
* Generated by fusiondirectory-setup
*/
require_once('variables_common.inc');
if (!defined("CONFIG_DIR")) {
define ("CONFIG_DIR", "/etc/fusiondirectory/"); /* FusionDirectory etc path */
}
/*!
* \brief 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", "fusiondirectory.conf"); /* FusionDirectory filename */
}
/*!
* \brief Smarty compile dir
*/
define ("SPOOL_DIR", "/var/spool/fusiondirectory/"); /* FusionDirectory spool directory */
/*!
* \brief Global cache dir
*/
define ("CACHE_DIR", "/var/cache/fusiondirectory/"); /* FusionDirectory var directory */
/*!
* \brief Global locale cache dir
*/
define ("LOCALE_DIR", "/var/cache/fusiondirectory/locale/"); /* FusionDirectory locale directory */
/*!
* \brief Global tmp dir
*/
define ("TEMP_DIR", "/var/cache/fusiondirectory/tmp/"); /* FusionDirectory tmp directory */
/*!
* \brief Directory containing the configuration template
*/
define ("CONFIG_TEMPLATE_DIR", "/var/cache/fusiondirectory/template/"); /* FusionDirectory template directory */
/*!
* \brief Directory containing the fai logs
*/
define ("FAI_LOG_DIR", "/var/cache/fusiondirectory/fai/"); /* FusionDirectory fai directory */
/*!
* \brief Directory containing the vacation files
*/
define ("SUPANN_DIR", "/etc/fusiondirectory/supann/"); /* FusionDirectory supann template directory */
/*!
* \brief name of the class.cache file
*/
define("CLASS_CACHE", "class.cache"); /* name of the class cache */
?>
<?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
......@@ -80,4 +79,5 @@ define ("FD_VERSION", "1.1-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