mirror of
https://github.com/nextcloud/passman.git
synced 2025-11-08 05:04:04 +08:00
Passman 2.0.1
Merge branch 'fixes' Signed-off-by: Passman Bot <info@passman.cc>
This commit is contained in:
parent
e88df533ea
commit
20875de23e
4 changed files with 154 additions and 194 deletions
|
|
@ -1,56 +1 @@
|
|||
/**
|
||||
* Nextcloud - passman
|
||||
*
|
||||
* @copyright Copyright (c) 2016, Sander Brand (brantje@gmail.com)
|
||||
* @copyright Copyright (c) 2016, Marcos Zuriaga Miguel (wolfi@wolfi.es)
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
header, nav {
|
||||
display: none; }
|
||||
|
||||
#content-wrapper {
|
||||
padding-top: 0; }
|
||||
|
||||
#app-content-wrapper {
|
||||
min-height: inherit !important; }
|
||||
|
||||
.warning_bar .fa-times {
|
||||
margin-right: 20px; }
|
||||
|
||||
.tab_container {
|
||||
padding-top: 10px;
|
||||
margin-bottom: 20px; }
|
||||
.tab_container div {
|
||||
margin-bottom: 5px;
|
||||
overflow: hidden; }
|
||||
|
||||
.vault_wrapper {
|
||||
margin-top: 70px; }
|
||||
|
||||
.active_vault {
|
||||
float: right;
|
||||
text-align: right;
|
||||
padding-right: 5px;
|
||||
font-size: 10px; }
|
||||
|
||||
.tab_header {
|
||||
margin: 0; }
|
||||
|
||||
.angularjs-datetime-picker {
|
||||
z-index: 9999; }
|
||||
|
||||
/*# sourceMappingURL=bookmarklet.css.map */
|
||||
header,nav{display:none}#content-wrapper{padding-top:0}#app-content-wrapper{min-height:inherit!important}.warning_bar .fa-times{margin-right:20px}.tab_container{padding-top:10px;margin-bottom:20px}.tab_container div{margin-bottom:5px;overflow:hidden}.vault_wrapper{margin-top:70px}.active_vault{float:right;text-align:right;padding-right:5px;font-size:10px}.tab_header{margin:0}.angularjs-datetime-picker{z-index:9999}
|
||||
|
|
@ -1,128 +1 @@
|
|||
/**
|
||||
* Nextcloud - passman
|
||||
*
|
||||
* @copyright Copyright (c) 2016, Sander Brand (brantje@gmail.com)
|
||||
* @copyright Copyright (c) 2016, Marcos Zuriaga Miguel (wolfi@wolfi.es)
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Nextcloud - passman
|
||||
*
|
||||
* @copyright Copyright (c) 2016, Sander Brand (brantje@gmail.com)
|
||||
* @copyright Copyright (c) 2016, Marcos Zuriaga Miguel (wolfi@wolfi.es)
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
/**
|
||||
* Nextcloud - passman
|
||||
*
|
||||
* @copyright Copyright (c) 2016, Sander Brand (brantje@gmail.com)
|
||||
* @copyright Copyright (c) 2016, Marcos Zuriaga Miguel (wolfi@wolfi.es)
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
header {
|
||||
display: none; }
|
||||
|
||||
#content-wrapper {
|
||||
padding-top: 0; }
|
||||
|
||||
.credential_container {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 20px;
|
||||
padding: 20px;
|
||||
background: #f8f8f8;
|
||||
border: 1px solid #c9c9c9;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
background-clip: padding-box;
|
||||
/* stops bg color from leaking outside the border: */ }
|
||||
.credential_container .text {
|
||||
text-align: center; }
|
||||
.credential_container h2 {
|
||||
font-weight: bold; }
|
||||
.credential_container button, .credential_container .text {
|
||||
margin: 0 auto;
|
||||
display: block; }
|
||||
.credential_container button i, .credential_container .text i {
|
||||
margin-right: 5px; }
|
||||
|
||||
.credential_field {
|
||||
overflow: hidden; }
|
||||
.credential_field .cell, .credential_field .value {
|
||||
float: left; }
|
||||
.credential_field .tools {
|
||||
margin-left: 10px;
|
||||
overflow: hidden;
|
||||
float: left; }
|
||||
.credential_field .tools .cell {
|
||||
cursor: pointer;
|
||||
margin-right: 4px; }
|
||||
|
||||
table {
|
||||
white-space: normal; }
|
||||
table td:first-child {
|
||||
min-width: 110px; }
|
||||
table td {
|
||||
padding-bottom: 1em;
|
||||
vertical-align: top; }
|
||||
|
||||
.tags .tag {
|
||||
background-color: rgba(240, 240, 240, 0.9);
|
||||
padding: 4px;
|
||||
font-size: 12px;
|
||||
margin-right: 3px;
|
||||
-webkit-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
background-clip: padding-box;
|
||||
/* stops bg color from leaking outside the border: */ }
|
||||
.tags .tag:last-child {
|
||||
margin-right: 8px; }
|
||||
|
||||
.footer {
|
||||
font-size: 10px;
|
||||
position: relative;
|
||||
bottom: -20px;
|
||||
text-align: center; }
|
||||
|
||||
/*# sourceMappingURL=public-page.css.map */
|
||||
.credential_container .text,.footer{text-align:center}header{display:none}#content-wrapper{padding-top:0}.credential_container{margin-top:20px;margin-bottom:20px;padding:20px;background:#f8f8f8;border:1px solid #c9c9c9;-webkit-border-radius:5px;border-radius:5px;background-clip:padding-box}.credential_container h2{font-weight:700}.credential_container .text,.credential_container button{margin:0 auto;display:block}.credential_container .text i,.credential_container button i{margin-right:5px}.credential_field{overflow:hidden}.credential_field .cell,.credential_field .value{float:left}.credential_field .tools{margin-left:10px;overflow:hidden;float:left}.credential_field .tools .cell{cursor:pointer;margin-right:4px}table{white-space:normal}table td:first-child{min-width:110px}table td{padding-bottom:1em;vertical-align:top}.tags .tag{background-color:rgba(240,240,240,.9);padding:4px;font-size:12px;margin-right:3px;-webkit-border-radius:5px;border-radius:5px;background-clip:padding-box}.tags .tag:last-child{margin-right:8px}.footer{font-size:10px;position:relative;bottom:-20px}
|
||||
29
js/passman.min.js
vendored
29
js/passman.min.js
vendored
File diff suppressed because one or more lines are too long
133
js/settings-admin.js
Normal file
133
js/settings-admin.js
Normal file
|
|
@ -0,0 +1,133 @@
|
|||
/**
|
||||
* Nextcloud - passman
|
||||
*
|
||||
* @copyright Copyright (c) 2016, Sander Brand (brantje@gmail.com)
|
||||
* @copyright Copyright (c) 2016, Marcos Zuriaga Miguel (wolfi@wolfi.es)
|
||||
* @license GNU AGPL version 3 or any later version
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as
|
||||
* published by the Free Software Foundation, either version 3 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program 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 program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
*/
|
||||
|
||||
$(document).ready(function () {
|
||||
|
||||
var Settings = function (baseUrl) {
|
||||
this._baseUrl = baseUrl;
|
||||
this._settings = [];
|
||||
};
|
||||
|
||||
Settings.prototype = {
|
||||
load: function () {
|
||||
var deferred = $.Deferred();
|
||||
var self = this;
|
||||
$.ajax({
|
||||
url: this._baseUrl,
|
||||
method: 'GET',
|
||||
async: false
|
||||
}).done(function (settings) {
|
||||
self._settings = settings;
|
||||
}).fail(function () {
|
||||
deferred.reject();
|
||||
});
|
||||
return deferred.promise();
|
||||
},
|
||||
|
||||
setUserKey: function (key, value) {
|
||||
var request = $.ajax({
|
||||
url: this._baseUrl + '/' + key + '/' + value,
|
||||
method: 'POST'
|
||||
});
|
||||
request.done(function () {
|
||||
$('.msg-passwords').removeClass("msg_error");
|
||||
$('.msg-passwords').text('');
|
||||
});
|
||||
request.fail(function () {
|
||||
$('.msg-passwords').addClass("msg_error");
|
||||
$('.msg-passwords').text(t('passwords', 'Error while saving field') + ' ' + key + '!');
|
||||
});
|
||||
},
|
||||
|
||||
setAdminKey: function (key, value) {
|
||||
var request = $.ajax({
|
||||
url: this._baseUrl + '/' + key + '/' + value +'/admin1/admin2',
|
||||
method: 'POST'
|
||||
});
|
||||
request.done(function () {
|
||||
$('.msg-passwords').removeClass("msg_error");
|
||||
$('.msg-passwords').text('');
|
||||
});
|
||||
request.fail(function () {
|
||||
$('.msg-passwords').addClass("msg_error");
|
||||
$('.msg-passwords').text(t('passwords', 'Error while saving field') + ' ' + key + '!');
|
||||
});
|
||||
},
|
||||
getKey: function (key) {
|
||||
if(this._settings.hasOwnProperty(key)){
|
||||
return this._settings[key];
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getAll: function () {
|
||||
return this._settings;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
var settings = new Settings(OC.generateUrl('apps/passman/api/v2/settings'));
|
||||
settings.load();
|
||||
|
||||
// ADMIN SETTINGS
|
||||
|
||||
// fill the boxes
|
||||
$('#passman_link_sharing_enabled').prop('checked', (settings.getKey('link_sharing_enabled').toString().toLowerCase() === '1'));
|
||||
$('#passman_sharing_enabled').prop('checked', (settings.getKey('user_sharing_enabled').toString().toLowerCase() === '1'));
|
||||
$('#passman_check_version').prop('checked', (settings.getKey('check_version').toString().toLowerCase() === '1'));
|
||||
$('#passman_https_check').prop('checked', (settings.getKey('https_check').toString().toLowerCase() === '1'));
|
||||
$('#passman_disable_contextmenu').prop('checked', (settings.getKey('disable_contextmenu').toString().toLowerCase() === '1'));
|
||||
$('#passman_disable_debugger').prop('checked', (settings.getKey('disable_debugger').toString().toLowerCase() === '1'));
|
||||
$('#vault_key_strength').val(settings.getKey('vault_key_strength'));
|
||||
|
||||
|
||||
$('#passman_check_version').change(function () {
|
||||
settings.setAdminKey('check_version', ($(this).is(":checked")) ? 1 : 0);
|
||||
});
|
||||
|
||||
$('#passman_https_check').change(function () {
|
||||
settings.setAdminKey('https_check', ($(this).is(":checked")) ? 1 : 0);
|
||||
});
|
||||
|
||||
$('#passman_disable_contextmenu').change(function () {
|
||||
settings.setAdminKey('disable_contextmenu', ($(this).is(":checked")) ? 1 : 0);
|
||||
});
|
||||
|
||||
$('#passman_disable_debugger').change(function () {
|
||||
settings.setAdminKey('disable_debugger', ($(this).is(":checked")) ? 1 : 0);
|
||||
});
|
||||
|
||||
$('#passman_sharing_enabled').change(function () {
|
||||
settings.setAdminKey('user_sharing_enabled', ($(this).is(":checked")) ? 1 : 0);
|
||||
});
|
||||
|
||||
$('#passman_link_sharing_enabled').change(function () {
|
||||
settings.setAdminKey('link_sharing_enabled', ($(this).is(":checked")) ? 1 : 0);
|
||||
});
|
||||
$('#vault_key_strength').change(function () {
|
||||
settings.setAdminKey('vault_key_strength', $(this).val());
|
||||
});
|
||||
|
||||
if($('form[name="passman_settings"]').length === 2){
|
||||
$('form[name="passman_settings"]')[1].remove();
|
||||
}
|
||||
|
||||
});
|
||||
Loading…
Add table
Reference in a new issue