mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 07:12:26 +02:00
Aligned the authentication module with the one of 2.x, to enable the feature "Forgot password" for legacy data models -retrofit from trunk
SVN:2.0.2[3112]
This commit is contained in:
@@ -16,36 +16,17 @@
|
|||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Localized data
|
|
||||||
*
|
|
||||||
* @author Stephan Rosenke <stephan.rosenke@itomig.de>
|
* @author Stephan Rosenke <stephan.rosenke@itomig.de>
|
||||||
|
* @author David M. Gümbel <david.guembel@itomig.de>
|
||||||
* @copyright Copyright (C) 2010-2012 Combodo SARL
|
* @copyright Copyright (C) 2010-2012 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @licence http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Dictionnay conventions
|
|
||||||
// Class:<class_name>
|
|
||||||
// Class:<class_name>+
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>+
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>+
|
|
||||||
// Class:<class_name>/Stimulus:<stimulus_code>
|
|
||||||
// Class:<class_name>/Stimulus:<stimulus_code>+
|
|
||||||
|
|
||||||
//
|
|
||||||
// Class: UserLocal
|
|
||||||
//
|
|
||||||
|
|
||||||
Dict::Add('DE DE', 'German', 'Deutsch', array(
|
Dict::Add('DE DE', 'German', 'Deutsch', array(
|
||||||
'Class:UserLocal' => 'iTop-Benutzer',
|
'Class:UserLocal' => 'iTop-Benutzer',
|
||||||
'Class:UserLocal+' => 'Benutzer von iTop authentifiziert',
|
'Class:UserLocal+' => 'Benutzer von iTop authentifiziert',
|
||||||
'Class:UserLocal/Attribute:password' => 'Passwort',
|
'Class:UserLocal/Attribute:password' => 'Passwort',
|
||||||
'Class:UserLocal/Attribute:password+' => 'Benutzerpasswort',
|
'Class:UserLocal/Attribute:password+' => 'Benutzerpasswort',
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
51
datamodels/1.x/authent-local/es_cr.dict.authent-local.php
Normal file
51
datamodels/1.x/authent-local/es_cr.dict.authent-local.php
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
// Copyright (C) 2010-2013 Combodo SARL
|
||||||
|
//
|
||||||
|
// This file is part of iTop.
|
||||||
|
//
|
||||||
|
// iTop is free software; you can redistribute it and/or modify
|
||||||
|
// it under the terms of the GNU Affero General Public License as published by
|
||||||
|
// the Free Software Foundation, either version 3 of the License, or
|
||||||
|
// (at your option) any later version.
|
||||||
|
//
|
||||||
|
// iTop is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
// GNU Affero General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Localized data
|
||||||
|
*
|
||||||
|
* @copyright Copyright (C) 2010-2013 Combodo SARL
|
||||||
|
* @license http://opensource.org/licenses/AGPL-3.0
|
||||||
|
* @traductor Miguel Turrubiates <miguel_tf@yahoo.com>
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Dictionnay conventions
|
||||||
|
// Class:<class_name>
|
||||||
|
// Class:<class_name>+
|
||||||
|
// Class:<class_name>/Attribute:<attribute_code>
|
||||||
|
// Class:<class_name>/Attribute:<attribute_code>+
|
||||||
|
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>
|
||||||
|
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>+
|
||||||
|
// Class:<class_name>/Stimulus:<stimulus_code>
|
||||||
|
// Class:<class_name>/Stimulus:<stimulus_code>+
|
||||||
|
|
||||||
|
//
|
||||||
|
// Class: UserLocal
|
||||||
|
//
|
||||||
|
|
||||||
|
Dict::Add('ES CR', 'Spanish', 'Español, Castellano', array(
|
||||||
|
'Class:UserLocal' => 'Usuario de iTop',
|
||||||
|
'Class:UserLocal+' => 'Usuario Autenticado vía iTop',
|
||||||
|
'Class:UserLocal/Attribute:password' => 'Contraseña',
|
||||||
|
'Class:UserLocal/Attribute:password+' => 'Contraseña',
|
||||||
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
?>
|
||||||
@@ -16,36 +16,17 @@
|
|||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Localized data
|
|
||||||
*
|
|
||||||
* @author Hirofumi Kosaka <kosaka@rworks.jp>
|
* @author Hirofumi Kosaka <kosaka@rworks.jp>
|
||||||
|
|
||||||
* @copyright Copyright (C) 2010-2012 Combodo SARL
|
* @copyright Copyright (C) 2010-2012 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @licence http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Dictionnay conventions
|
|
||||||
// Class:<class_name>
|
|
||||||
// Class:<class_name>+
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>+
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>+
|
|
||||||
// Class:<class_name>/Stimulus:<stimulus_code>
|
|
||||||
// Class:<class_name>/Stimulus:<stimulus_code>+
|
|
||||||
|
|
||||||
//
|
|
||||||
// Class: UserLocal
|
|
||||||
//
|
|
||||||
|
|
||||||
Dict::Add('JA JP', 'Japanese', '日本語', array(
|
Dict::Add('JA JP', 'Japanese', '日本語', array(
|
||||||
'Class:UserLocal' => 'iTopユーザー', // 'iTop user',
|
'Class:UserLocal' => 'iTopユーザー',
|
||||||
'Class:UserLocal+' => 'iTopローカル認証ユーザー', // 'User authentified by iTop',
|
'Class:UserLocal+' => 'iTopローカル認証ユーザー',
|
||||||
'Class:UserLocal/Attribute:password' => 'パスワード', // 'Password',
|
'Class:UserLocal/Attribute:password' => 'パスワード',
|
||||||
'Class:UserLocal/Attribute:password+' => '認証文字列', // 'user authentication string',
|
'Class:UserLocal/Attribute:password+' => '認証文字列',
|
||||||
));
|
));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
@@ -74,7 +74,10 @@ class UserLocal extends UserInternal
|
|||||||
|
|
||||||
public function CanChangePassword()
|
public function CanChangePassword()
|
||||||
{
|
{
|
||||||
// For now everyone can change their password..
|
if (MetaModel::GetConfig()->Get('demo_mode'))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -84,6 +87,17 @@ class UserLocal extends UserInternal
|
|||||||
// Cannot compare directly the values since they are hashed, so
|
// Cannot compare directly the values since they are hashed, so
|
||||||
// Let's ask the password to compare the hashed values
|
// Let's ask the password to compare the hashed values
|
||||||
if ($oPassword->CheckPassword($sOldPassword))
|
if ($oPassword->CheckPassword($sOldPassword))
|
||||||
|
{
|
||||||
|
$this->SetPassword($sNewPassword);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use with care!
|
||||||
|
*/
|
||||||
|
public function SetPassword($sNewPassword)
|
||||||
{
|
{
|
||||||
$this->Set('password', $sNewPassword);
|
$this->Set('password', $sNewPassword);
|
||||||
$oChange = MetaModel::NewObject("CMDBChange");
|
$oChange = MetaModel::NewObject("CMDBChange");
|
||||||
@@ -92,11 +106,29 @@ class UserLocal extends UserInternal
|
|||||||
$oChange->Set("userinfo", $sUserString);
|
$oChange->Set("userinfo", $sUserString);
|
||||||
$oChange->DBInsert();
|
$oChange->DBInsert();
|
||||||
$this->DBUpdateTracked($oChange, true);
|
$this->DBUpdateTracked($oChange, true);
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
|
/**
|
||||||
|
* Returns the set of flags (OPT_ATT_HIDDEN, OPT_ATT_READONLY, OPT_ATT_MANDATORY...)
|
||||||
|
* for the given attribute in the current state of the object
|
||||||
|
* @param $sAttCode string $sAttCode The code of the attribute
|
||||||
|
* @param $aReasons array To store the reasons why the attribute is read-only (info about the synchro replicas)
|
||||||
|
* @param $sTargetState string The target state in which to evalutate the flags, if empty the current state will be used
|
||||||
|
* @return integer Flags: the binary combination of the flags applicable to this attribute
|
||||||
|
*/
|
||||||
|
public function GetAttributeFlags($sAttCode, &$aReasons = array(), $sTargetState = '')
|
||||||
|
{
|
||||||
|
$iFlags = parent::GetAttributeFlags($sAttCode, $aReasons, $sTargetState);
|
||||||
|
if (MetaModel::GetConfig()->Get('demo_mode'))
|
||||||
|
{
|
||||||
|
if (strpos('contactid,login,language,password,profile_list,allowed_org_list', $sAttCode) !== false)
|
||||||
|
{
|
||||||
|
// contactid and allowed_org_list are disabled to make sure the portal remains accessible
|
||||||
|
$aReasons[] = 'Sorry, this attribute is read-only in the demonstration mode!';
|
||||||
|
$iFlags |= OPT_ATT_READONLY;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $iFlags;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
?>
|
|
||||||
|
|||||||
@@ -17,32 +17,16 @@
|
|||||||
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
// along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Localized data
|
|
||||||
*
|
|
||||||
* @author Vladimir Shilov <shilow@ukr.net>
|
* @author Vladimir Shilov <shilow@ukr.net>
|
||||||
|
|
||||||
* @copyright Copyright (C) 2010-2012 Combodo SARL
|
* @copyright Copyright (C) 2010-2012 Combodo SARL
|
||||||
* @license http://opensource.org/licenses/AGPL-3.0
|
* @licence http://opensource.org/licenses/AGPL-3.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Dictionnay conventions
|
|
||||||
// Class:<class_name>
|
|
||||||
// Class:<class_name>+
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>+
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>
|
|
||||||
// Class:<class_name>/Attribute:<attribute_code>/Value:<value>+
|
|
||||||
// Class:<class_name>/Stimulus:<stimulus_code>
|
|
||||||
// Class:<class_name>/Stimulus:<stimulus_code>+
|
|
||||||
|
|
||||||
//
|
|
||||||
// Class: UserLocal
|
|
||||||
//
|
|
||||||
|
|
||||||
Dict::Add('RU RU', 'Russian', 'Русский', array(
|
Dict::Add('RU RU', 'Russian', 'Русский', array(
|
||||||
'Class:UserLocal' => 'Пользователь iTop',
|
'Class:UserLocal' => 'Пользователь iTop',
|
||||||
'Class:UserLocal+' => 'Пользователь аутентифицированный iTop',
|
'Class:UserLocal+' => 'Пользователь аутентифицированный iTop',
|
||||||
'Class:UserLocal/Attribute:password' => 'Пароль',
|
'Class:UserLocal/Attribute:password' => 'Пароль',
|
||||||
'Class:UserLocal/Attribute:password+' => 'строка аутентификации пользователя',
|
'Class:UserLocal/Attribute:password+' => 'строка аутентификации пользователя',
|
||||||
));
|
));
|
||||||
|
|
||||||
?>
|
?>
|
||||||
Reference in New Issue
Block a user