summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c7c87bf)
raw | patch | inline | side by side (parent: c7c87bf)
author | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 31 Aug 2009 16:58:30 +0000 (16:58 +0000) | ||
committer | cajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Mon, 31 Aug 2009 16:58:30 +0000 (16:58 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@14174 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/plugins/personal/posix/class_posixAccount.inc | patch | blob | history | |
gosa-core/plugins/personal/posix/generic.tpl | patch | blob | history |
diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc
index c26f27af6b509d331f46e3266ad6bc46cb5db995..788f72cd2672945e34c808e32fdace089d91d84a 100644 (file)
var $secondaryGroups= array();
var $primaryGroup= 0;
var $was_trust_account= FALSE;
- var $memberGroup = array();
- var $grouplist = array();
- var $ui = array();
+ var $memberGroup= array();
+ var $grouplist= array();
+ var $ui= array();
+ var $ssh= null;
- var $GroupRegex = "*";
- var $GroupUserRegex = "*";
- var $SubSearch = false;
+ var $GroupRegex= "*";
+ var $GroupUserRegex= "*";
+ var $SubSearch= false;
- var $view_logged = FALSE;
+ var $view_logged= false;
/* attribute list for save action */
var $CopyPasteVars =
'dn' from LDAP */
function posixAccount (&$config, $dn= NULL)
{
+ global $class_mapping;
+
/* Configuration is fine, allways */
$this->config= $config;
$this->savedGroupMembership= $this->groupMembership;
$this->savedUidNumber= $this->uidNumber;
$this->savedGidNumber= $this->gidNumber;
+
+ // Instanciate SSH object if available
+ if (isset($class_mapping["sshPublicKey"])){
+ $this->ssh= new sshPublicKey($this->config, $this->dn);
+ }
}
/* Adjust shadow checkboxes */
}
}
}
+
/* Trigger group edit? */
if (isset($_POST['edit_groupmembership'])){
$this->group_dialog= TRUE;
$smarty->assign("alphabet", generate_alphabet());
$smarty->assign("depselect", session::get('CurrentMainBase'));
$smarty->assign("hint", print_sizelimit_warning());
-
$smarty->assign("apply", apply_filter());
+
$display.= $smarty->fetch (get_template_path('posix_groups.tpl', TRUE, dirname(__FILE__)));
return ($display);
}
+ // Handle ssh dialog?
+ if ($this->ssh && preg_match('/[rw]/', $this->getacl("sshPublicKey"))) {
+ if ($result= $this->ssh->execute()) {
+ $this->dialog= true;
+ return $result;
+ }
+ $this->dialog= false;
+ }
+
+
/* Show main page */
$smarty= get_smarty();
/* In 'MyAccount' mode, we must remove write acls if we are not in editing mode. */
$SkipWrite = (!isset($this->parent) || !$this->parent) && !session::is_set('edit');
+ $smarty->assign("sshPublicKeyACL", $this->getacl("sshPublicKey"));
+
/* Depending on pwmode, currently hardcoded because there are no other methods */
if ( 1 == 1 ){
$smarty->assign("pwmode", dirname(__FILE__)."/posix_shadow");
$smarty->assign("workstations", $this->accessTo);
+ // Add SSH button if available
+ if ($this->ssh) {
+ $smarty->assign("sshPublicKey", 1);
+ }
+
$smarty->assign("apply", apply_filter());
$smarty->assign("multiple_support" , $this->multiple_support_active);
$display.= $smarty->fetch (get_template_path('generic.tpl', TRUE, dirname(__FILE__)));
/* Remove lock needed for unique id generation */
del_lock ("uidnumber");
+ // Save ssh stuff if needed
+ if ($this->ssh) {
+ $this->ssh->setDN($this->dn);
+ $this->ssh->save();
+ }
/* Take care about groupMembership values: add to groups */
foreach ($this->groupMembership as $key => $value){
diff --git a/gosa-core/plugins/personal/posix/generic.tpl b/gosa-core/plugins/personal/posix/generic.tpl
index 061b87840bf5d3b6f4c6a9878dea171f5f88c52b..a02e385f482f73ee58fceda3b9e34a9bc4a9336e 100644 (file)
<table summary="" style="width:100% ; vertical-align:top; text-align:left;" cellpadding=0 border=0>
<tr>
<td style='width:50%;vertical-align:top'>
+ {if $sshPublicKey == 1}
+ {render acl=$sshPublicKeyACL}
+ <h2><img alt="" class="center" align="middle" src="images/lists/key.png" /> {t}SSH keys{/t}</h2>
+ <input type=submit value="{t}Edit public ssh keys...{/t}" name="edit_sshpublickey">
+ <div style='border-bottom:1px solid #A0A0A0;height:8px'></div>
+ {/render}
+ {/if}
<h2><img alt="" class="center" align="middle" src="plugins/posix/images/terminal_small.png" /> {t}Account{/t}</h2>
{include file="$pwmode.tpl"}
</td>