Merge remote-tracking branch 'origin/support/3.0' into develop

This commit is contained in:
Eric Espie
2022-03-03 10:23:38 +01:00
54 changed files with 631 additions and 901 deletions

View File

@@ -29,6 +29,8 @@ use utils;
*/
class CASLoginExtension extends AbstractLoginFSMExtension implements iLogoutExtension, iLoginUIExtension
{
const LOGIN_MODE = 'cas';
/**
* Return the list of supported login modes for this plugin
*
@@ -36,7 +38,7 @@ class CASLoginExtension extends AbstractLoginFSMExtension implements iLogoutExte
*/
public function ListSupportedLoginModes()
{
return array('cas');
return array(static::LOGIN_MODE);
}
protected function OnStart(&$iErrorCode)
@@ -47,12 +49,12 @@ class CASLoginExtension extends AbstractLoginFSMExtension implements iLogoutExte
protected function OnReadCredentials(&$iErrorCode)
{
if (Session::Get('login_mode') == 'cas')
if (empty(Session::Get('login_mode')) || Session::Get('login_mode') == static::LOGIN_MODE)
{
static::InitCASClient();
if (phpCAS::isAuthenticated())
{
Session::Set('login_mode', 'cas');
Session::Set('login_mode', static::LOGIN_MODE);
Session::Set('auth_user', phpCAS::getUser());
Session::Unset('login_will_redirect');
}
@@ -68,7 +70,7 @@ class CASLoginExtension extends AbstractLoginFSMExtension implements iLogoutExte
$iErrorCode = LoginWebPage::EXIT_CODE_MISSINGLOGIN;
return LoginWebPage::LOGIN_FSM_ERROR;
}
Session::Set('login_mode', 'cas');
Session::Set('login_mode', static::LOGIN_MODE);
phpCAS::forceAuthentication(); // Redirect to CAS and exit
}
}
@@ -77,7 +79,7 @@ class CASLoginExtension extends AbstractLoginFSMExtension implements iLogoutExte
protected function OnCheckCredentials(&$iErrorCode)
{
if (Session::Get('login_mode') == 'cas')
if (Session::Get('login_mode') == static::LOGIN_MODE)
{
if (!Session::IsSet('auth_user'))
{
@@ -94,7 +96,7 @@ class CASLoginExtension extends AbstractLoginFSMExtension implements iLogoutExte
protected function OnCredentialsOK(&$iErrorCode)
{
if (Session::Get('login_mode') == 'cas')
if (Session::Get('login_mode') == static::LOGIN_MODE)
{
$sAuthUser = Session::Get('auth_user');
if (!LoginWebPage::CheckUser($sAuthUser))
@@ -109,7 +111,7 @@ class CASLoginExtension extends AbstractLoginFSMExtension implements iLogoutExte
protected function OnError(&$iErrorCode)
{
if (Session::Get('login_mode') == 'cas')
if (Session::Get('login_mode') == static::LOGIN_MODE)
{
Session::Unset('phpCAS');
if ($iErrorCode != LoginWebPage::EXIT_CODE_MISSINGLOGIN)
@@ -124,7 +126,7 @@ class CASLoginExtension extends AbstractLoginFSMExtension implements iLogoutExte
protected function OnConnected(&$iErrorCode)
{
if (Session::Get('login_mode') == 'cas')
if (Session::Get('login_mode') == static::LOGIN_MODE)
{
Session::Set('can_logoff', true);
return LoginWebPage::CheckLoggedUser($iErrorCode);
@@ -205,7 +207,7 @@ class CASLoginExtension extends AbstractLoginFSMExtension implements iLogoutExte
$oLoginContext->SetLoaderPath(APPROOT.'env-'.utils::GetCurrentEnvironment().'/authent-cas/view');
$aData = array(
'sLoginMode' => 'cas',
'sLoginMode' => static::LOGIN_MODE,
'sLabel' => Dict::S('CAS:Login:SignIn'),
'sTooltip' => Dict::S('CAS:Login:SignInTooltip'),
);

View File

@@ -247,3 +247,5 @@ $ibo-vendors-c3--legend--fill: $ibo-color-white-200;
$ibo-vendors-c3--legend--background-color: $ibo-color-white-100;
$ibo-vendors-c3--legend-item--fill: $ibo-color-grey-100;
$ibo-vendors-c3--axis--fill: $ibo-color-grey-200;
$ibo-run-query--highlight--background-color: $ibo-color-primary-700;

View File

@@ -21,7 +21,8 @@
<module>combodo-db-tools</module>
<module>itop-core-update</module>
<module>itop-hub-connector</module>
<module>combodo-backoffice-darkmoon-theme</module>
<module>combodo-backoffice-darkmoon-theme</module>
<module>itop-themes-compat</module>
</modules>
<mandatory>true</mandatory>
</choice>

View File

@@ -0,0 +1,2 @@
# Extension Light grey and Test red themes compatibility

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('CS CZ', 'Czech', 'Čeština', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('DA DA', 'Danish', 'Dansk', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<itop_design version="3.0">
<branding>
<themes>
<theme id="light-grey" _delta="define">
<variables>
</variables>
<imports>
<import id="css-variables">itop-themes-compat/assets/css/css-variables.scss</import>
</imports>
<stylesheets>
<stylesheet id="jqueryui">itop-themes-compat/assets/css/compat.scss</stylesheet>
<stylesheet id="main">itop-themes-compat/assets/css/compat.scss</stylesheet>
<stylesheet id="fullmoon">../css/backoffice/main.scss</stylesheet>
</stylesheets>
</theme>
<theme id="test-red" _delta="must_exist">
<variables>
<variable id="backoffice-environment-banner-background-color" _delta="define">#C53030</variable>
<variable id="backoffice-environment-banner-text-color" _delta="define">#F7FAFC</variable>
<variable id="backoffice-environment-banner-text-content" _delta="define">"THIS IS A TEST INSTANCE"</variable>
</variables>
<imports>
<import id="css-variables" _delta="define">itop-themes-compat/assets/css/css-variables.scss</import>
</imports>
<stylesheets>
<stylesheet id="jqueryui" _delta="define">itop-themes-compat/assets/css/compat.scss</stylesheet>
<stylesheet id="main" _delta="define">itop-themes-compat/assets/css/compat.scss</stylesheet>
</stylesheets>
</theme>
</themes>
</branding>
</itop_design>

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('DE DE', 'German', 'Deutsch', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('EN US', 'English', 'English', array(
'theme:light-grey' => 'Light Grey (deprecated)',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('ES CR', 'Spanish', 'Español, Castellaño', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('FR FR', 'French', 'Français', array(
'theme:light-grey' => 'Light Grey (obsolète)',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('HU HU', 'Hungarian', 'Magyar', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('IT IT', 'Italian', 'Italiano', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('JA JP', 'Japanese', '日本語', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,17 @@
<?php
// PHP Data Model definition file
// WARNING - WARNING - WARNING
// DO NOT EDIT THIS FILE (unless you know what you are doing)
//
// If you provide a datamodel.xxxx.xml file with your module,
// this file WILL BE overwritten by the compilation of the
// module (during the setup) if the datamodel.xxxx.xml file
// contains the definition of new classes or menus.
//
// The recommended way to define new classes (for iTop 2.0 and later) is via the XML definition.
// This file remains in the module's template only for the cases where there is:
// - either no new class or menu defined in the XML file
// - or no XML file at all supplied by the module

View File

@@ -0,0 +1,52 @@
<?php
//
// iTop module definition file
//
SetupWebPage::AddModule(
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
'itop-themes-compat/3.0.1',
array(
// Identification
//
'label' => 'Light grey and Test red themes compatibility',
'category' => 'business',
// Setup
//
'dependencies' => array(
'itop-structure/3.0.1',
),
'mandatory' => false,
'visible' => true,
// Components
//
'datamodel' => array(
'model.itop-themes-compat.php', // Contains the PHP code generated by the "compilation" of datamodel.itop-themes-compat.xml
),
'webservice' => array(
),
'data.struct' => array(
// add your 'structure' definition XML files here,
),
'data.sample' => array(
// add your sample data XML files here,
),
// Documentation
//
'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
'doc.more_information' => '', // hyperlink to more information, if any
// Default settings
//
'settings' => array(
// Module specific settings go here, if any
),
)
);
?>

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('NL NL', 'Dutch', 'Nederlands', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('PT BR', 'Brazilian', 'Brazilian', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('RU RU', 'Russian', 'Русский', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('SK SK', 'Slovak', 'Slovenčina', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('TR TR', 'Turkish', 'Türkçe', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));

View File

@@ -0,0 +1,11 @@
<?php
/**
* Localized data
*
* @copyright Copyright (C) 2013 XXXXX
* @license http://opensource.org/licenses/AGPL-3.0
*/
Dict::Add('ZH CN', 'Chinese', '简体中文', array(
'theme:light-grey' => 'Light Grey (deprecated)~~',
));