summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: cb5a285)
raw | patch | inline | side by side (parent: cb5a285)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 1 Sep 2009 06:51:10 +0000 (06:51 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 1 Sep 2009 06:51:10 +0000 (06:51 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14178 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-plugins/ssh/personal/ssh/class_sshPublicKey.inc | patch | blob | history | |
gosa-plugins/ssh/personal/ssh/sshPublicKey.tpl | patch | blob | history |
diff --git a/gosa-plugins/ssh/personal/ssh/class_sshPublicKey.inc b/gosa-plugins/ssh/personal/ssh/class_sshPublicKey.inc
index a87787c63e84cc791604232acada7b1e012f3407..bd286eaafaa89e5117a4b9767f018da74c05796a 100644 (file)
var $dn;
var $dialog= false;
var $enabled= false;
+ var $acl;
- function sshPublicKey(&$config, $dn)
+ function sshPublicKey(&$config, $dn, $acl)
{
/* Configuration is fine, allways */
$this->config= &$config;
$this->dn= $dn;
+ $this->acl= $acl;
// Load list of public keys
$data= array();
}
// Remove action?
- if (isset($_POST['remove_sshpublickey']) && isset($_POST['keylist'])){
+ if (isset($_POST['remove_sshpublickey']) && isset($_POST['keylist']) && preg_match('/w/', $this->acl)){
foreach($_POST['keylist'] as $index){
if (isset($this->publicKeys[$index])){
unset($this->publicKeys[$index]);
}
// Upload action?
- if (isset($_POST['upload_sshpublickey'])) {
+ if (isset($_POST['upload_sshpublickey']) && preg_match('/w/', $this->acl)) {
if ($_FILES['key']['error'] > 0){
msg_dialog::display(_("Upload error"), _("Error uploading the key!")." (".$_FILES['key']['error'].")", ERROR_DIALOG);
} else {
$data[$index]= sprintf(_("SSH %s key, Fingerprint: %s, Comment: %s"), $info['type']=='ssh-dss'?"DSA":"RSA", $info['fingerprint'], $info['comment']);
}
$smarty->assign("keylist", $data);
+ $smarty->assign("sshPublicKeyACL", $this->acl);
return $smarty->fetch (get_template_path('sshPublicKey.tpl', TRUE, dirname(__FILE__)));
}
return rtrim($result, ':');
}
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
diff --git a/gosa-plugins/ssh/personal/ssh/sshPublicKey.tpl b/gosa-plugins/ssh/personal/ssh/sshPublicKey.tpl
index 132eec55816289314765c0e5eeb4a5a098626dcf..a53b64e6dec2bab9615496e301bc4336600f4531 100644 (file)
{html_options options=$keylist}
</select>
</p>
+{render acl=$sshPublicKeyACL}
<input type=file name="key">
<input type=submit name="upload_sshpublickey" value="{t}Upload key{/t}">
<input type=submit name="remove_sshpublickey" value="{t}Remove key{/t}">
+{/render}
<p class="plugbottom">
<input type=submit name="save_sshpublickey" value="{msgPool type=saveButton}">