diff --git a/datamodels/1.x/authent-local/de.dict.authent-local.php b/datamodels/1.x/authent-local/de.dict.authent-local.php
index 46bd12596a..7589b25e62 100644
--- a/datamodels/1.x/authent-local/de.dict.authent-local.php
+++ b/datamodels/1.x/authent-local/de.dict.authent-local.php
@@ -16,36 +16,17 @@
// You should have received a copy of the GNU Affero General Public License
// along with iTop. If not, see
-
/**
- * Localized data
- *
- * @author Stephan Rosenke
+ * @author Stephan Rosenke
+ * @author David M. Gümbel
* @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:+
-// Class:/Attribute:
-// Class:/Attribute:+
-// Class:/Attribute:/Value:
-// Class:/Attribute:/Value:+
-// Class:/Stimulus:
-// Class:/Stimulus:+
-
-//
-// Class: UserLocal
-//
-
Dict::Add('DE DE', 'German', 'Deutsch', array(
'Class:UserLocal' => 'iTop-Benutzer',
'Class:UserLocal+' => 'Benutzer von iTop authentifiziert',
'Class:UserLocal/Attribute:password' => 'Passwort',
'Class:UserLocal/Attribute:password+' => 'Benutzerpasswort',
));
-
-
-
-?>
+?>
\ No newline at end of file
diff --git a/datamodels/1.x/authent-local/es_cr.dict.authent-local.php b/datamodels/1.x/authent-local/es_cr.dict.authent-local.php
new file mode 100644
index 0000000000..f283e1799e
--- /dev/null
+++ b/datamodels/1.x/authent-local/es_cr.dict.authent-local.php
@@ -0,0 +1,51 @@
+
+
+
+/**
+ * Localized data
+ *
+ * @copyright Copyright (C) 2010-2013 Combodo SARL
+ * @license http://opensource.org/licenses/AGPL-3.0
+ * @traductor Miguel Turrubiates
+ */
+
+// Dictionnay conventions
+// Class:
+// Class:+
+// Class:/Attribute:
+// Class:/Attribute:+
+// Class:/Attribute:/Value:
+// Class:/Attribute:/Value:+
+// Class:/Stimulus:
+// Class:/Stimulus:+
+
+//
+// Class: UserLocal
+//
+
+Dict::Add('ES CR', 'Spanish', 'Espaol, Castellano', array(
+ 'Class:UserLocal' => 'Usuario de iTop',
+ 'Class:UserLocal+' => 'Usuario Autenticado va iTop',
+ 'Class:UserLocal/Attribute:password' => 'Contraseña',
+ 'Class:UserLocal/Attribute:password+' => 'Contraseña',
+));
+
+
+
+?>
diff --git a/datamodels/1.x/authent-local/ja.dict.authent-local.php b/datamodels/1.x/authent-local/ja.dict.authent-local.php
index da25f93565..ba49f990a6 100644
--- a/datamodels/1.x/authent-local/ja.dict.authent-local.php
+++ b/datamodels/1.x/authent-local/ja.dict.authent-local.php
@@ -1,51 +1,32 @@
-
-
-
-/**
- * Localized data
- *
- * @author Hirofumi Kosaka
- * @copyright Copyright (C) 2010-2012 Combodo SARL
- * @license http://opensource.org/licenses/AGPL-3.0
- */
-
-// Dictionnay conventions
-// Class:
-// Class:+
-// Class:/Attribute:
-// Class:/Attribute:+
-// Class:/Attribute:/Value:
-// Class:/Attribute:/Value:+
-// Class:/Stimulus:
-// Class:/Stimulus:+
-
-//
-// Class: UserLocal
-//
-
-Dict::Add('JA JP', 'Japanese', '日本語', array(
- 'Class:UserLocal' => 'iTopユーザー', // 'iTop user',
- 'Class:UserLocal+' => 'iTopローカル認証ユーザー', // 'User authentified by iTop',
- 'Class:UserLocal/Attribute:password' => 'パスワード', // 'Password',
- 'Class:UserLocal/Attribute:password+' => '認証文字列', // 'user authentication string',
-));
-
-
-
-?>
+
+
+/**
+ * @author Hirofumi Kosaka
+
+ * @copyright Copyright (C) 2010-2012 Combodo SARL
+ * @licence http://opensource.org/licenses/AGPL-3.0
+ */
+
+Dict::Add('JA JP', 'Japanese', '日本語', array(
+ 'Class:UserLocal' => 'iTopユーザー',
+ 'Class:UserLocal+' => 'iTopローカル認証ユーザー',
+ 'Class:UserLocal/Attribute:password' => 'パスワード',
+ 'Class:UserLocal/Attribute:password+' => '認証文字列',
+));
+?>
\ No newline at end of file
diff --git a/datamodels/1.x/authent-local/model.authent-local.php b/datamodels/1.x/authent-local/model.authent-local.php
index d8e46e2094..b271a43148 100644
--- a/datamodels/1.x/authent-local/model.authent-local.php
+++ b/datamodels/1.x/authent-local/model.authent-local.php
@@ -74,7 +74,10 @@ class UserLocal extends UserInternal
public function CanChangePassword()
{
- // For now everyone can change their password..
+ if (MetaModel::GetConfig()->Get('demo_mode'))
+ {
+ return false;
+ }
return true;
}
@@ -85,18 +88,47 @@ class UserLocal extends UserInternal
// Let's ask the password to compare the hashed values
if ($oPassword->CheckPassword($sOldPassword))
{
- $this->Set('password', $sNewPassword);
- $oChange = MetaModel::NewObject("CMDBChange");
- $oChange->Set("date", time());
- $sUserString = CMDBChange::GetCurrentUserName();
- $oChange->Set("userinfo", $sUserString);
- $oChange->DBInsert();
- $this->DBUpdateTracked($oChange, true);
+ $this->SetPassword($sNewPassword);
return true;
}
return false;
}
+
+ /**
+ * Use with care!
+ */
+ public function SetPassword($sNewPassword)
+ {
+ $this->Set('password', $sNewPassword);
+ $oChange = MetaModel::NewObject("CMDBChange");
+ $oChange->Set("date", time());
+ $sUserString = CMDBChange::GetCurrentUserName();
+ $oChange->Set("userinfo", $sUserString);
+ $oChange->DBInsert();
+ $this->DBUpdateTracked($oChange, true);
+ }
+
+ /**
+ * 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;
+ }
}
-
-?>
diff --git a/datamodels/1.x/authent-local/ru.dict.authent-local.php b/datamodels/1.x/authent-local/ru.dict.authent-local.php
index 7c5f47b825..1f91fbbb25 100644
--- a/datamodels/1.x/authent-local/ru.dict.authent-local.php
+++ b/datamodels/1.x/authent-local/ru.dict.authent-local.php
@@ -17,32 +17,16 @@
// along with iTop. If not, see
/**
- * Localized data
- *
- * @author Vladimir Shilov
+ * @author Vladimir Shilov
+
* @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:+
-// Class:/Attribute:
-// Class:/Attribute:+
-// Class:/Attribute:/Value:
-// Class:/Attribute:/Value:+
-// Class:/Stimulus:
-// Class:/Stimulus:+
-
-//
-// Class: UserLocal
-//
-
Dict::Add('RU RU', 'Russian', 'Русский', array(
'Class:UserLocal' => 'Пользователь iTop',
'Class:UserLocal+' => 'Пользователь аутентифицированный iTop',
'Class:UserLocal/Attribute:password' => 'Пароль',
'Class:UserLocal/Attribute:password+' => 'строка аутентификации пользователя',
));
-
-?>
+?>
\ No newline at end of file