Merge branch 'develop'
This commit is contained in:
@@ -128,5 +128,12 @@
|
||||
<message id="Wt.Auth.user-name-invalid">Invalide</message>
|
||||
<message id="Wt.Auth.password-info"></message>
|
||||
<message id="Wt.Auth.password-invalid">Mot de passe invalide</message>
|
||||
<message id="Wt.Auth.passwdqc.reason-short">Trop court</message>
|
||||
<message id="Wt.Auth.passwdqc.reason-long">Trop long</message>
|
||||
<message id="Wt.Auth.passwdqc.reason-simpleshort">Pas assez de caractères ou de classes différentes pour cette longueur de mot de passe</message>
|
||||
<message id="Wt.Auth.passwdqc.reason-simple">Pas assez de caractères ou de classes différentes</message>
|
||||
<message id="Wt.Auth.passwdqc.reason-personal">Basé sur des informations personnelles</message>
|
||||
<message id="Wt.Auth.passwdqc.reason-word">Basé sur un mot de dictionnaire</message>
|
||||
<message id="Wt.Auth.passwdqc.reason-seq">Basé sur une séquence de caractères</message>
|
||||
|
||||
</messages>
|
||||
|
||||
@@ -537,6 +537,11 @@ LmsApplication::post(std::function<void()> func)
|
||||
Wt::WServer::instance()->post(LmsApp->sessionId(), func);
|
||||
}
|
||||
|
||||
static std::string escape(std::string str)
|
||||
{
|
||||
return replaceInString(std::move(str), "\'", "\\\'");
|
||||
}
|
||||
|
||||
void
|
||||
LmsApplication::notifyMsg(MsgType type, const Wt::WString& message, std::chrono::milliseconds duration)
|
||||
{
|
||||
@@ -545,7 +550,7 @@ LmsApplication::notifyMsg(MsgType type, const Wt::WString& message, std::chrono:
|
||||
std::ostringstream oss;
|
||||
|
||||
oss << "$.notify({"
|
||||
"message: '" << message.toUTF8() << "'"
|
||||
"message: '" << escape(message.toUTF8()) << "'"
|
||||
"},{"
|
||||
"type: '" << msgTypeToString(type) << "',"
|
||||
"placement: {from: 'top', align: 'center'},"
|
||||
|
||||
@@ -114,7 +114,8 @@ UsersView::refreshView()
|
||||
user.remove();
|
||||
_container->removeWidget(entry);
|
||||
}
|
||||
delBtn->removeChild(msgBox);
|
||||
else
|
||||
delBtn->removeChild(msgBox);
|
||||
});
|
||||
|
||||
msgBox->show();
|
||||
|
||||
@@ -102,3 +102,18 @@ bufferToString(const std::vector<unsigned char>& data)
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
std::string
|
||||
replaceInString(std::string str, const std::string& from, const std::string& to)
|
||||
{
|
||||
size_t pos = 0;
|
||||
|
||||
while ((pos = str.find(from, pos)) != std::string::npos)
|
||||
{
|
||||
str.replace(pos, from.length(), to);
|
||||
pos += to.length();
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -60,3 +60,6 @@ boost::optional<T> readAs(const std::string& str)
|
||||
return res;
|
||||
}
|
||||
|
||||
std::string
|
||||
replaceInString(std::string str, const std::string& from, const std::string& to);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user