gosa-plugin-ssh-2.7.4/0000755000175000017500000000000011752422557013552 5ustar cajuscajusgosa-plugin-ssh-2.7.4/contrib/0000755000175000017500000000000011752422557015212 5ustar cajuscajusgosa-plugin-ssh-2.7.4/contrib/openssh-lpk.schema0000644000175000017500000000103111247000435020614 0ustar cajuscajus# # LDAP Public Key Patch schema for use with openssh-ldappubkey # Author: Eric AUGE # # Based on the proposal of : Mark Ruijter # # octetString SYNTAX attributetype ( 1.3.6.1.4.1.24552.500.1.1.1.13 NAME 'sshPublicKey' DESC 'MANDATORY: OpenSSH Public key' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 ) # printableString SYNTAX yes|no objectclass ( 1.3.6.1.4.1.24552.500.1.1.2.0 NAME 'ldapPublicKey' SUP top AUXILIARY DESC 'MANDATORY: OpenSSH LPK objectclass' MAY ( sshPublicKey $ uid ) ) gosa-plugin-ssh-2.7.4/contrib/openssh-lpk.ldif0000644000175000017500000000142011550602576020307 0ustar cajuscajus# ################################################################################ # dn: cn=openssh-lpk,cn=schema,cn=config objectClass: olcSchemaConfig cn: openssh-lpk # ################################################################################ # olcAttributeTypes: ( 1.3.6.1.4.1.24552.500.1.1.1.13 NAME 'sshPublicKey' DESC 'MANDATORY: OpenSSH Public key' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 ) # ################################################################################ # olcObjectClasses: ( 1.3.6.1.4.1.24552.500.1.1.2.0 NAME 'ldapPublicKey' DESC 'MANDATORY: OpenSSH LPK objectclass' SUP top AUXILIARY MAY ( sshPublicKey $ uid ) ) # ################################################################################ # gosa-plugin-ssh-2.7.4/plugin.dsc0000644000175000017500000000036011336200072015522 0ustar cajuscajus[gosa-plugin] name = ssh description = "SSH key plugin" version = 2.6.8 author = "Cajus Pollmeier " maintainer = "GOsa packages maintainers group " homepage = https://oss.gonicus.de/labs/gosa/ gosa-plugin-ssh-2.7.4/personal/0000755000175000017500000000000011752422557015375 5ustar cajuscajusgosa-plugin-ssh-2.7.4/personal/ssh/0000755000175000017500000000000011752422557016172 5ustar cajuscajusgosa-plugin-ssh-2.7.4/personal/ssh/class_sshPublicKey.inc0000644000175000017500000001623711470716535022467 0ustar cajuscajusinitTime = microtime(TRUE); $this->config= &$config; $this->dn= $dn; $this->acl= $acl; // Load list of public keys $data= array(); $ldap= $this->config->get_ldap_link(); $ldap->cat($this->dn, array('objectClass')); if ($attrs= $ldap->fetch()){ if(in_array_ics('ldapPublicKey', $attrs['objectClass'])){ $this->enabled= true; $data= $ldap->get_attribute($this->dn, "sshPublicKey", 1); if(is_array($data)){ unset($data['count']); } } } // Analyze keys for type, bits and comment foreach ($data as $key) { list($type, $data, $comment)= preg_split('/\s/', $key); $this->publicKeys[]= array("type" => $type, "fingerprint" => $this->fingerprint(base64_decode($data)), "comment" => $comment, "data" => $key); } // Save copy for later usage $this->storedPublicKeys= $this->publicKeys; // Create statistic table entry stats::log('plugin', $class = get_class($this), $category = array($this->acl_category), $action = 'open', $amount = 1, $duration = (microtime(TRUE) - $this->initTime)); } function setDN($dn) { $this->dn= $dn; } function execute() { global $ui; // Check if we need to open a dialog if (isset($_POST['edit_sshpublickey'])){ $this->dialog= true; } if (isset($_POST['cancel_sshpublickey'])){ $this->dialog= false; if ($this->modified) { $this->publicKeys= $this->storedPublicKeys; } $this->modified= false; } if (isset($_POST['save_sshpublickey'])){ $this->dialog= false; if ($this->modified) { $this->storedPublicKeys= $this->publicKeys; } } // If we do not need the dialog, don't show it if (!$this->dialog) { return null; } // Remove action? 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]); $this->modified= true; } } $this->publicKeys= array_values($this->publicKeys); } // Upload action? 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 { $lines= gosa_file($_FILES['key']['tmp_name']); foreach ($lines as $line) { if (preg_match('/^(ssh-(dss|rsa))\s+([a-zA-Z0-9+\/.=]+)\s+([[:print:]]+)$/', $line, $match)) { $fingerprint= $this->fingerprint(base64_decode($match[3])); // Check if we already have it $found= false; foreach ($this->publicKeys as $key) { if ($key['fingerprint'] == $fingerprint) { $found= true; msg_dialog::display(_("Upload error"), _("This key is already used!"), ERROR_DIALOG); break; } } // If not used, just add it if (!$found) { $this->publicKeys[]= array("type" => $match[1], "fingerprint" => $fingerprint, "comment" => $match[4], "data" => $line); $this->modified= true; } } else { msg_dialog::display(_("Upload error"), _("Unknown public key format!"), ERROR_DIALOG); } } } } // Show the ssh page now $smarty= get_smarty(); $data= array(); foreach ($this->publicKeys as $index => $info) { $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__))); } function save() { if ($this->modified) { $attrs= array(); $ldap= $this->config->get_ldap_link(); // SSH stuff removed? if (count($this->publicKeys) == 0) { $ldap->cat($this->dn, array("objectClass", "sshPublicKey")); $nattrs= $ldap->fetch(); $attrs['objectClass']= array_remove_entries_ics(array("ldapPublicKey"), $nattrs['objectClass']); unset($attrs['objectClass']['count']); if (isset($nattrs['sshPublicKey'])){ $attrs['sshPublicKey']= array(); } $ldap->cd($this->dn); $ldap->modify($attrs); new log("modify","posix/ssh",$this->dn,array_keys($attrs),$ldap->get_error()); } else { // If it was enabled before, we just need to update the // attributes, elseways modify objectclasses, too. if (!$this->enabled) { $ldap->cat($this->dn, array("objectClass")); $nattrs= $ldap->fetch(); $attrs['objectClass']= $nattrs['objectClass']; unset($attrs['objectClass']['count']); $attrs['objectClass'][]= "ldapPublicKey"; } // Save public key $attrs['sshPublicKey']= array(); foreach($this->publicKeys as $key) { $attrs['sshPublicKey'][]= $key['data']; } $ldap->cd($this->dn); $ldap->modify($attrs); new log("modify","posix/ssh",$this->dn,array_keys($attrs),$ldap->get_error()); } // LDAP error? if (!$ldap->success()) { msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_MOD, ERROR_DIALOG)); } } } function fingerprint($data) { $result= md5($data); $result= preg_replace('/(..)/', '\1:', $result); return rtrim($result, ':'); } } // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: ?> gosa-plugin-ssh-2.7.4/personal/ssh/sshPublicKey.tpl0000644000175000017500000000143711344214263021313 0ustar cajuscajus

{t}List of SSH public keys for this user{/t}

{render acl=$sshPublicKeyACL}     {/render}
gosa-plugin-ssh-2.7.4/locale/0000755000175000017500000000000011752422557015011 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/ru/0000755000175000017500000000000011752422557015437 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/ru/LC_MESSAGES/0000755000175000017500000000000011752422557017224 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/pl/0000755000175000017500000000000011752422557015424 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/pl/LC_MESSAGES/0000755000175000017500000000000011752422557017211 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/it/0000755000175000017500000000000011752422557015425 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/it/LC_MESSAGES/0000755000175000017500000000000011752422557017212 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/pt_BR/0000755000175000017500000000000011752422557016017 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/pt_BR/LC_MESSAGES/0000755000175000017500000000000011752422557017604 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/pt_BR/LC_MESSAGES/messages.po0000644000175000017500000000337511475426262021762 0ustar cajuscajus# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # msgid "" msgstr "" "Project-Id-Version: GOsa plugins - ssh\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-11-04 15:24+0100\n" "PO-Revision-Date: 2010-03-11 21:00-0300\n" "Last-Translator: Marcos Amorim \n" "Language-Team: Marcos Amorim Clever de Oliveira " "\n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=utf-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Poedit-Language: Portuguese\n" "X-Poedit-Country: BRAZIL\n" #: personal/ssh/sshPublicKey.tpl:2 msgid "List of SSH public keys for this user" msgstr "Lista de chaves públicas SSH para este usuário" #: personal/ssh/sshPublicKey.tpl:12 msgid "Upload key" msgstr "Carregar chave" #: personal/ssh/sshPublicKey.tpl:15 msgid "Remove key" msgstr "Remover chave" #: personal/ssh/class_sshPublicKey.inc:122 #: personal/ssh/class_sshPublicKey.inc:135 #: personal/ssh/class_sshPublicKey.inc:150 msgid "Upload error" msgstr "Erro ao carregar" #: personal/ssh/class_sshPublicKey.inc:122 msgid "Error uploading the key!" msgstr "Erro carregando a chave!" #: personal/ssh/class_sshPublicKey.inc:135 msgid "This key is already used!" msgstr "Esta chave já esta em uso!" #: personal/ssh/class_sshPublicKey.inc:150 msgid "Unknown public key format!" msgstr "Formato de chave pública desconhecida" #: personal/ssh/class_sshPublicKey.inc:160 #, php-format msgid "SSH %s key, Fingerprint: %s, Comment: %s" msgstr "Chave SSH %s, Figerprint: %s, Comentário: %s" #: personal/ssh/class_sshPublicKey.inc:214 msgid "LDAP error" msgstr "Erro LDAP" gosa-plugin-ssh-2.7.4/locale/es/0000755000175000017500000000000011752422557015420 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/es/LC_MESSAGES/0000755000175000017500000000000011752422557017205 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/de/0000755000175000017500000000000011752422557015401 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/de/LC_MESSAGES/0000755000175000017500000000000011752422557017166 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/de/LC_MESSAGES/messages.po0000644000175000017500000000401311475426262021332 0ustar cajuscajus# translation of messages.po to deutsch # translation of messages.po to # GOsa2 Translations # Copyright (C) 2003 GONICUS GmbH, Germany # This file is distributed under the same license as the GOsa2 package. # # # Alfred Schroeder , 2004. # Cajus Pollmeier , 2004, 2005, 2006, 2008, 2009. # Jan Wenzel , 2004,2005, 2008. # Stefan Koehler , 2005. msgid "" msgstr "" "Project-Id-Version: messages\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-11-04 15:24+0100\n" "PO-Revision-Date: 2009-08-26 15:37+0200\n" "Last-Translator: Cajus Pollmeier \n" "Language-Team: de \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: Lokalize 1.0\n" "Plural-Forms: nplurals=2; plural=n != 1;\n" #: personal/ssh/sshPublicKey.tpl:2 msgid "List of SSH public keys for this user" msgstr "Liste der öffentlichen SSH-Schlüssel für diesen Benutzer" #: personal/ssh/sshPublicKey.tpl:12 msgid "Upload key" msgstr "Schlüssel hochladen" #: personal/ssh/sshPublicKey.tpl:15 msgid "Remove key" msgstr "Schlüssel entfernen" #: personal/ssh/class_sshPublicKey.inc:122 #: personal/ssh/class_sshPublicKey.inc:135 #: personal/ssh/class_sshPublicKey.inc:150 msgid "Upload error" msgstr "Übertragung fehlgeschlagen!" #: personal/ssh/class_sshPublicKey.inc:122 msgid "Error uploading the key!" msgstr "Fehler beim hochladen des Schlüssels!" #: personal/ssh/class_sshPublicKey.inc:135 msgid "This key is already used!" msgstr "Dieser Schlüssel wird bereits verwendet!" #: personal/ssh/class_sshPublicKey.inc:150 msgid "Unknown public key format!" msgstr "Unbekanntes Format für öffentliche Schlüssel!" #: personal/ssh/class_sshPublicKey.inc:160 #, php-format msgid "SSH %s key, Fingerprint: %s, Comment: %s" msgstr "SSH %s-Schlüssel, Fingerabdruck: %s, Kommentar: %s" #: personal/ssh/class_sshPublicKey.inc:214 msgid "LDAP error" msgstr "LDAP-Fehler" gosa-plugin-ssh-2.7.4/locale/fr/0000755000175000017500000000000011752422557015420 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/fr/LC_MESSAGES/0000755000175000017500000000000011752422557017205 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/fr/LC_MESSAGES/messages.po0000644000175000017500000000335011475426262021354 0ustar cajuscajus# translation of messages.po to # Copyright (C) 2009 The GOsa Project # This file is distributed under the same license as the GOsa package. # # Benoit Mortier , 2009. msgid "" msgstr "" "Project-Id-Version: messages\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-11-04 15:24+0100\n" "PO-Revision-Date: 2009-09-01 09:42+0200\n" "Last-Translator: Benoit Mortier \n" "Language-Team: \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "X-Generator: KBabel 1.11.4\n" "Plural-Forms: nplurals=2; plural=(n > 1);\n" #: personal/ssh/sshPublicKey.tpl:2 msgid "List of SSH public keys for this user" msgstr "Liste des clefs SSH publiques pour cet utilisateur" #: personal/ssh/sshPublicKey.tpl:12 msgid "Upload key" msgstr "Télécharger une clef" #: personal/ssh/sshPublicKey.tpl:15 msgid "Remove key" msgstr "Enlever une clef" #: personal/ssh/class_sshPublicKey.inc:122 #: personal/ssh/class_sshPublicKey.inc:135 #: personal/ssh/class_sshPublicKey.inc:150 msgid "Upload error" msgstr "Erreur de téléchargement" #: personal/ssh/class_sshPublicKey.inc:122 msgid "Error uploading the key!" msgstr "Erreur lors du téléchargement !" #: personal/ssh/class_sshPublicKey.inc:135 msgid "This key is already used!" msgstr "Cette clef est déjà utilisée !" #: personal/ssh/class_sshPublicKey.inc:150 msgid "Unknown public key format!" msgstr "Format de la clef inconnue !" #: personal/ssh/class_sshPublicKey.inc:160 #, php-format msgid "SSH %s key, Fingerprint: %s, Comment: %s" msgstr "Clef SSH %s, Empreinte Digitale: %s, Commentaire: %s" #: personal/ssh/class_sshPublicKey.inc:214 msgid "LDAP error" msgstr "Erreur LDAP" gosa-plugin-ssh-2.7.4/locale/en/0000755000175000017500000000000011752422557015413 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/en/LC_MESSAGES/0000755000175000017500000000000011752422557017200 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/messages.po0000644000175000017500000000261511475426262017163 0ustar cajuscajus# SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER # This file is distributed under the same license as the PACKAGE package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-11-04 15:24+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" "Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" #: personal/ssh/sshPublicKey.tpl:2 msgid "List of SSH public keys for this user" msgstr "" #: personal/ssh/sshPublicKey.tpl:12 msgid "Upload key" msgstr "" #: personal/ssh/sshPublicKey.tpl:15 msgid "Remove key" msgstr "" #: personal/ssh/class_sshPublicKey.inc:122 #: personal/ssh/class_sshPublicKey.inc:135 #: personal/ssh/class_sshPublicKey.inc:150 msgid "Upload error" msgstr "" #: personal/ssh/class_sshPublicKey.inc:122 msgid "Error uploading the key!" msgstr "" #: personal/ssh/class_sshPublicKey.inc:135 msgid "This key is already used!" msgstr "" #: personal/ssh/class_sshPublicKey.inc:150 msgid "Unknown public key format!" msgstr "" #: personal/ssh/class_sshPublicKey.inc:160 #, php-format msgid "SSH %s key, Fingerprint: %s, Comment: %s" msgstr "" #: personal/ssh/class_sshPublicKey.inc:214 msgid "LDAP error" msgstr "" gosa-plugin-ssh-2.7.4/locale/zh/0000755000175000017500000000000011752422557015432 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/zh/LC_MESSAGES/0000755000175000017500000000000011752422557017217 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/nl/0000755000175000017500000000000011752422557015422 5ustar cajuscajusgosa-plugin-ssh-2.7.4/locale/nl/LC_MESSAGES/0000755000175000017500000000000011752422557017207 5ustar cajuscajus