demo mode (you can't update password in demo mode
0
img/messages/close.png
Executable file → Normal file
Before Width: | Height: | Size: 662 B After Width: | Height: | Size: 662 B |
0
img/messages/cross.png
Executable file → Normal file
Before Width: | Height: | Size: 655 B After Width: | Height: | Size: 655 B |
0
img/messages/help.png
Executable file → Normal file
Before Width: | Height: | Size: 786 B After Width: | Height: | Size: 786 B |
0
img/messages/tick.png
Executable file → Normal file
Before Width: | Height: | Size: 537 B After Width: | Height: | Size: 537 B |
0
img/messages/warning.png
Executable file → Normal file
Before Width: | Height: | Size: 666 B After Width: | Height: | Size: 666 B |
@ -14,6 +14,7 @@ if (!is_dir('db/')) {
|
|||||||
@mkdir('db/',0705);
|
@mkdir('db/',0705);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
define ('MODE_DEMO', FALSE);
|
||||||
define ('ABS_PATH', 'assets/');
|
define ('ABS_PATH', 'assets/');
|
||||||
define ('CONVERT_LINKS_FOOTNOTES', TRUE);
|
define ('CONVERT_LINKS_FOOTNOTES', TRUE);
|
||||||
define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE);
|
define ('REVERT_FORCED_PARAGRAPH_ELEMENTS',FALSE);
|
||||||
|
@ -74,6 +74,13 @@ class Sqlite extends Store {
|
|||||||
return isset($pass[0]['value']) ? $pass[0]['value'] : FALSE;
|
return isset($pass[0]['value']) ? $pass[0]['value'] : FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function updatePassword($password)
|
||||||
|
{
|
||||||
|
$sql_update = "UPDATE config SET value=? WHERE name='password'";
|
||||||
|
$params_update = array($password);
|
||||||
|
$query = $this->executeQuery($sql_update, $params_update);
|
||||||
|
}
|
||||||
|
|
||||||
private function executeQuery($sql, $params) {
|
private function executeQuery($sql, $params) {
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
11
index.php
@ -54,14 +54,17 @@ elseif (isset($_GET['config'])) {
|
|||||||
if (isset($_POST['password']) && isset($_POST['password_repeat'])) {
|
if (isset($_POST['password']) && isset($_POST['password_repeat'])) {
|
||||||
if ($_POST['password'] == $_POST['password_repeat'] && $_POST['password'] != "") {
|
if ($_POST['password'] == $_POST['password_repeat'] && $_POST['password'] != "") {
|
||||||
logm('password updated');
|
logm('password updated');
|
||||||
$store->updatePassword(encode_string($_POST['password'] . $_SESSION['login']));
|
if (!DEMO) {
|
||||||
$msg->add('s', 'your password has been updated');
|
$store->updatePassword(encode_string($_POST['password'] . $_SESSION['login']));
|
||||||
|
$msg->add('s', 'your password has been updated');
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$msg->add('i', 'in demo mode, you can\'t update password');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
$msg->add('e', 'your password can\'t be empty and you have to repeat it in the second field');
|
$msg->add('e', 'your password can\'t be empty and you have to repeat it in the second field');
|
||||||
}
|
}
|
||||||
else
|
|
||||||
$msg->add('e', 'error in your password update');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Traitement des paramètres et déclenchement des actions
|
# Traitement des paramètres et déclenchement des actions
|
||||||
|