2016-10-06 15:57:01 +00:00
< ? php
2017-01-13 12:45:12 +00:00
2016-10-06 15:57:01 +00:00
/**
* Project :
* Contenido Content Management System
*
* Description :
*
* Requirements :
* @ con_php_req 5
*
* @ package ContenidoBackendArea
* @ version 0.2
* @ author unknown
* @ copyright four for business AG < www . 4 fb . de >
* @ license http :// www . contenido . org / license / LIZENZ . txt
* @ link http :// www . 4 fb . de
* @ link http :// www . contenido . org
*
*
*
* { @ internal
* created unknown
* modified 2008 - 07 - 07 , bilal arslan , added security fix
* modified 2011 - 03 - 21 , Murat Purc , usage of new db connection
*
2019-07-03 11:58:28 +00:00
* $Id $ :
2016-10-06 15:57:01 +00:00
* }}
*
*/
2017-01-13 12:45:12 +00:00
if ( ! defined ( 'CON_FRAMEWORK' )) {
die ( 'Illegal call' );
2016-10-06 15:57:01 +00:00
}
2017-01-13 12:45:12 +00:00
class cSetupClientAdjust extends cSetupMask {
public function __construct ( $step , $previous , $next ) {
global $cfg ;
$cfg [ " tab " ][ " sequence " ] = $_SESSION [ " dbprefix " ] . " _sequence " ;
parent :: __construct ( " templates/setup/forms/pathinfo.tpl " , $step );
$this -> setHeader ( i18n_setup ( " Client Settings " ));
$this -> _oStepTemplate -> set ( " s " , " TITLE " , i18n_setup ( " Client Settings " ));
$this -> _oStepTemplate -> set ( " s " , " DESCRIPTION " , i18n_setup ( " Please check the directories identified by the system. If you need to change a client path, click on the name and enter your new path in the available input box. " ));
2016-10-06 15:57:01 +00:00
$db = getSetupMySQLDBConnection ();
2017-01-13 12:45:12 +00:00
$aClients = listClients ( $db , $_SESSION [ " dbprefix " ] . " _clients " );
$cHTMLErrorMessageList = new cHTMLErrorMessageList ;
$cHTMLErrorMessageList -> setStyle ( " width: 580px; height: 200px; overflow: auto; border: 1px solid black; " );
2023-04-07 17:50:44 +00:00
$cHTMLFoldableErrorMessages = [];
2017-01-13 12:45:12 +00:00
2023-04-07 17:50:44 +00:00
$aPathList = [];
2017-01-13 12:45:12 +00:00
2023-04-07 17:50:44 +00:00
[ $a_root_path , $a_root_http_path ] = getSystemDirectories ();
2017-01-13 12:45:12 +00:00
@ include ( $a_root_path . " data/config/ " . CL_ENVIRONMENT . " /config.php " );
foreach ( $aClients as $iIdClient => $aInfo ) {
if ( ! isset ( $_SESSION [ " frontendpath " ][ $iIdClient ]) || $_SESSION [ " frontendpath " ][ $iIdClient ] == " " ) {
$iDifferencePos = findSimilarText ( $cfg [ 'path' ][ 'frontend' ] . " / " , $aInfo [ " frontendpath " ]);
if ( $iDifferencePos > 0 ) {
$sClientPath = $a_root_path . " / " . substr ( $aInfo [ " frontendpath " ], $iDifferencePos + 1 , strlen ( $aInfo [ " frontendpath " ]) - $iDifferencePos );
$_SESSION [ " frontendpath " ][ $iIdClient ] = $sClientPath ;
} else {
$_SESSION [ " frontendpath " ][ $iIdClient ] = $aInfo [ " frontendpath " ];
}
}
if ( ! isset ( $_SESSION [ " htmlpath " ][ $iIdClient ]) || $_SESSION [ " htmlpath " ][ $iIdClient ] == " " ) {
/* Use frontendpath instead of htmlpath as the directories should be aligned pairwhise */
$iDifferencePos = findSimilarText ( $cfg [ 'path' ][ 'frontend' ] . " / " , $aInfo [ " frontendpath " ]);
if ( $iDifferencePos > 0 ) {
$sClientPath = $a_root_http_path . " / " . substr ( $aInfo [ " frontendpath " ], $iDifferencePos + 1 , strlen ( $aInfo [ " frontendpath " ]) - $iDifferencePos );
$_SESSION [ " htmlpath " ][ $iIdClient ] = $sClientPath ;
} else {
$_SESSION [ " htmlpath " ][ $iIdClient ] = $aInfo [ " htmlpath " ];
}
}
$sName = sprintf ( i18n_setup ( " Old server path for %s (%s) " ), $aInfo [ " name " ], $iIdClient );
$sName .= " :<br> " . $aInfo [ " frontendpath " ] . " <br><br> " ;
$sName .= sprintf ( i18n_setup ( " New server path for %s (%s) " ), $aInfo [ " name " ], $iIdClient );
$sName .= " :<br> " ;
$oSystemPathBox = new cHTMLTextbox ( " frontendpath[ $iIdClient ] " , $_SESSION [ " frontendpath " ][ $iIdClient ]);
$oSystemPathBox -> setWidth ( 100 );
$oSystemPathBox -> setClass ( " small " );
2023-04-07 17:50:44 +00:00
$oClientSystemPath = new cHTMLInfoMessage ([ $sName , $oSystemPathBox ], " " );
2017-01-13 12:45:12 +00:00
$oClientSystemPath -> _oTitle -> setStyle ( " padding-left: 8px; padding-bottom: 8px " );
$aPathList [] = $oClientSystemPath ;
$sName = sprintf ( i18n_setup ( " Old web path for %s (%s) " ), $aInfo [ " name " ], $iIdClient );
$sName .= " :<br> " . $aInfo [ " htmlpath " ] . " <br><br> " ;
$sName .= sprintf ( i18n_setup ( " New web path for %s (%s) " ), $aInfo [ " name " ], $iIdClient );
$sName .= " :<br> " ;
$oSystemPathBox = new cHTMLTextbox ( " htmlpath[ $iIdClient ] " , $_SESSION [ " htmlpath " ][ $iIdClient ]);
$oSystemPathBox -> setWidth ( 100 );
$oSystemPathBox -> setClass ( " small " );
2023-04-07 17:50:44 +00:00
$oClientSystemPath = new cHTMLInfoMessage ([ $sName , $oSystemPathBox ], " " );
2017-01-13 12:45:12 +00:00
$oClientSystemPath -> _oTitle -> setStyle ( " padding-left: 8px; padding-bottom: 8px " );
$aPathList [] = $oClientSystemPath ;
}
$cHTMLErrorMessageList -> setContent ( $aPathList );
$this -> _oStepTemplate -> set ( " s " , " CONTROL_PATHINFO " , $cHTMLErrorMessageList -> render ());
$this -> setNavigation ( $previous , $next );
}
2016-10-06 15:57:01 +00:00
}
2017-01-13 12:45:12 +00:00
2016-10-06 15:57:01 +00:00
?>