Exemplo n.º 1
0
                                $hash = $hashe["hash"];
                            }
                        }
                        if (!empty($_POST["aeskeynew"]) && !empty($_POST["aeskey"]) && !empty($hash)) {
                            if ($hash != hash("sha256", hash("sha256", $_POST["aeskey"]))) {
                                Session::addMessageAfterRedirect(__('Wrong encryption key', 'accounts'), true, ERROR);
                                Html::back();
                            } else {
                                PluginAccountsHash::updateHash($_POST["aeskey"], $_POST["aeskeynew"], $hash_id);
                                Session::addMessageAfterRedirect(__('Encryption key modified', 'accounts'), true);
                                Html::back();
                            }
                        } else {
                            Session::addMessageAfterRedirect(__('The old or the new encryption key can not be empty', 'accounts'), true, ERROR);
                            Html::back();
                        }
                    }
                } else {
                    if ($plugin->isActivated("environment")) {
                        Html::header(PluginAccountsAccount::getTypeName(2), '', "assets", "pluginenvironmentdisplay", "hash");
                    } else {
                        Html::header(PluginAccountsAccount::getTypeName(2), '', "admin", "pluginaccountsmenu", "hash");
                    }
                    $options = array("id" => $_GET['id'], "update" => false, "upgrade" => 0);
                    $hashClass->display($options);
                    Html::footer();
                }
            }
        }
    }
}