Welcome to mirror list, hosted at ThFree Co, Russian Federation.

part.admin.php « templates - github.com/nextcloud/passman.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9673d540320433f541c5af18fac149beebcac62e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
<?php
/** @var \OCP\IL10N $l */
/** @var array $_ */
use \OCP\App;

script('passman', 'settings-admin');

style('passman', 'admin');
style('passman', 'vendor/font-awesome/font-awesome.min');

$checkVersion = OC::$server->getConfig()->getAppValue('passman', 'check_version', '1') === '1';
$AppInstance = new App();
$localVersion = $AppInstance->getAppInfo("passman")["version"];
if ($checkVersion) {
	// get latest master version
	$version = false;
	$githubVersion = $l->t('Unable to get version info');

	$url = 'https://raw.githubusercontent.com/nextcloud/passman/master/appinfo/info.xml';
	try {
		$client = OC::$server->getHTTPClientService()->newClient();
		$response = $client->get($url);
		$xml = $response->getBody();
	} catch (\Exception $e) {
		$xml = false;
	}

	if ($xml) {
		$loadEntities = libxml_disable_entity_loader(true);
		$data = @simplexml_load_string($xml);
		libxml_disable_entity_loader($loadEntities);
		if ($data !== false) {
			$version = (string)$data->version;
		} else {
			libxml_clear_errors();
		}
	}

	if ($version !== false) {
		$githubVersion = $version;
	}
}
$ciphers = openssl_get_cipher_methods();
?>

<div id="passwordSharingSettings" class="followup section">
	<h2><?php p($l->t('Passman Settings')); ?></h2>
	<?php
	if ($checkVersion) {
		p($l->t('Github version:') . ' ' . $githubVersion);
		print '<br />';
	} ?>
	Local version: <?php p($localVersion); ?><br/>
	<?php
	if ($checkVersion && version_compare($githubVersion, $localVersion) === 1) {
		p($l->t('A newer version of passman is available'));
	}
	?>
	<div id="passman-tabs">
		<ul>
			<li>
				<a href="#general"><?php p($l->t('General settings')); ?></a>
			</li>
			<li>
				<a href="#sharing"><?php p($l->t('Password sharing')); ?></a>
			</li>
			<li>
				<a href="#mover"><?php p($l->t('Credential mover')); ?></a>
			</li>
			<li>
				<a href="#tabs-3"><?php p($l->t('Vault delete requests')); ?></a>
			</li>
		</ul>
		<div id="general">
			<form name="passman_settings">
				<p>
					<input type="checkbox" name="check_version"
						   id="passman_check_version" class="checkbox"
						   value="0"/>
					<label for="passman_check_version">
						<?php p($l->t('Check for new versions')); ?>
					</label>
				</p>
				<p>
					<input type="checkbox" name="https_check"
						   id="passman_https_check" class="checkbox"
						   value="0"/>
					<label for="passman_https_check">
						<?php p($l->t('Enable HTTPS check')); ?>
					</label>
				</p>
				<p>
					<input type="checkbox" name="disable_contextmenu"
						   id="passman_disable_contextmenu" class="checkbox"
						   value="0"/>
					<label for="passman_disable_contextmenu">
						<?php p($l->t('Disable context menu')); ?>
					</label>
				</p>
				<p>
					<input type="checkbox" name="passman_disable_debugger"
						   id="passman_disable_debugger" class="checkbox"
						   value="0"/>
					<label for="passman_disable_debugger">
						<?php p($l->t('Disable javascript debugger')); ?>
					</label>
				</p>
				<p>
					<label for="vault_key_strength">Minimum vault key
						strength:</label>
					<select name="vault_key_strength" id="vault_key_strength">
						<option value="0">
							Poor
						</option>
						<option value="2">
							Weak
						</option>
						<option value="3">
							Good
						</option>
						<option value="4">
							Strong
						</option>
					</select>
				</p>
			</form>
		</div>
		<div id="sharing">
			<p>
				<input type="checkbox" name="passman_link_sharing_enabled"
					   id="passman_link_sharing_enabled" class="checkbox"
					   value="1"/>
				<label for="passman_link_sharing_enabled">
					<?php p($l->t('Allow users on this server to share passwords with a link')); ?>
				</label>
			</p>

			<p>
				<input type="checkbox" name="passman_sharing_enabled"
					   id="passman_sharing_enabled" class="checkbox"
					   value="1"/>
				<label for="passman_sharing_enabled">
					<?php p($l->t('Allow users on this server to share passwords with other users')); ?>
				</label>
			</p>
		</div>
		<div id="mover">
			<p><?php p($l->t('Move credentials from one account to another')); ?></p>
			<br/>
			<table class="table">
				<tr>
					<td><?php p($l->t('Source account')); ?> </td>
					<td><input class="username-autocomplete" type="text" id="source_account" name="source_account"></td>
				</tr>
				<tr>
					<td><?php p($l->t('Destination account')); ?> </td>
					<td><input class="username-autocomplete" type="text" id="destination_account" name="destination_account"></td>
				</tr>
			</table>
			<button class="success" id="move_credentials">Move</button>
			<span id="moveStatus" style="display: none;"><?php p($l->t('Credentials moved!')); ?></span>

		</div>
		<div id="tabs-3">
			Requests to delete vault
		</div>

	</div>
</div>