diff --git a/user_saml/ajax/regenerate_password.php b/user_saml/ajax/regenerate_password.php new file mode 100644 index 0000000000..f270df5687 --- /dev/null +++ b/user_saml/ajax/regenerate_password.php @@ -0,0 +1,22 @@ + $password)); +} else { + \OC_JSON::error(); +} + + diff --git a/user_saml/js/personalsettings.js b/user_saml/js/personalsettings.js new file mode 100644 index 0000000000..08afcecbab --- /dev/null +++ b/user_saml/js/personalsettings.js @@ -0,0 +1,17 @@ +$(document).ready(function() { + $('#regenerate_password_button').on( "click", function(){ + OC.dialogs.confirm( + t('user_saml', 'Are you sure to reset your desktop client password?'), + t('user_saml', 'Reset desktop client password?'), + function(reset) { + if(reset) { + $.post(OC.filePath('user_saml', 'ajax', 'regenerate_password.php'), "regenerate_password", function(data){ + $("#newpassword").text(data.data); + }); + } + }, + true + ); + + }); +}); diff --git a/user_saml/personalsettings.php b/user_saml/personalsettings.php new file mode 100644 index 0000000000..914d7a7dcf --- /dev/null +++ b/user_saml/personalsettings.php @@ -0,0 +1,45 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library 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 this library. If not, see . + * + */ + +OC_Util::checkLoggedIn(); + +$params = array('regenerate_password'); + +OCP\Util::addscript('user_saml', 'personalsettings'); + +if ($_POST) { + // CSRF check + OCP\JSON::callCheck(); + + foreach($params as $param) { + if (isset($_POST[$param])) { + var_dump($param); + } + } +} + +// fill template +$tmpl = new OCP\Template( 'user_saml', 'personalsettings'); + +// settings with default values + +return $tmpl->fetchPage(); diff --git a/user_saml/templates/personalsettings.php b/user_saml/templates/personalsettings.php new file mode 100644 index 0000000000..27101fef62 --- /dev/null +++ b/user_saml/templates/personalsettings.php @@ -0,0 +1,9 @@ + + +
+

t('Reset desktop client password'));?>

+ + +
And your new password is...
+
t("Be careful. We will show your new password only once. If you reset it you have to change all syncronizing devices' password."));?>
+