Fix sshkey
This commit is contained in:
parent
049c0ce221
commit
ec811e437c
|
@ -6,6 +6,7 @@ use experimental 'signatures';
|
|||
use Mojo::Base 'Mojolicious::Controller', -signatures;
|
||||
use Net::LDAPS;
|
||||
use Net::LDAP::Extension::SetPassword;
|
||||
require unix_dog::Util;
|
||||
|
||||
sub update_account($self) {
|
||||
my $v = $self->validation;
|
||||
|
@ -28,7 +29,7 @@ sub update_account($self) {
|
|||
my $loginShell = $self->param('loginShell');
|
||||
my $roomNumber = $self->param('roomNumber');
|
||||
my $telNum = $self->param('telNum');
|
||||
my @sshKeys = Util::split_keys($self->param('sshKeys'));
|
||||
my @sshKeys = unix_dog::Util::split_keys($self->param('sshKeys'));
|
||||
|
||||
my $curPasswd = $self->param('curPasswd');
|
||||
my $newPasswd = $self->param('newPasswd');
|
||||
|
@ -76,7 +77,7 @@ sub update_account($self) {
|
|||
loginShell => $loginShell,
|
||||
roomNumber => $roomNumber || [],
|
||||
telephoneNumber => $telNum || [],
|
||||
sshPublicKey => @sshKeys,
|
||||
sshPublicKey => \@sshKeys,
|
||||
}
|
||||
);
|
||||
$mesg->code and die $mesg->error;
|
||||
|
|
|
@ -11,6 +11,7 @@ use Email::Simple;
|
|||
use Email::Sender::Simple;
|
||||
use Email::Sender::Transport::Sendmail;
|
||||
|
||||
|
||||
sub registration($self) {
|
||||
$self->render('register/registerPage');
|
||||
}
|
||||
|
@ -28,6 +29,7 @@ sub register($self) {
|
|||
my $password = $self->param('password');
|
||||
my $email = $self->param('email');
|
||||
my $pubkeys = $self->param('pubkey');
|
||||
my @sshKeys = unix_dog::Util::split_keys($pubkeys);
|
||||
my $bio = $self->param('bio');
|
||||
my $fromIP = $self->tx->remote_address;
|
||||
|
||||
|
@ -99,7 +101,7 @@ sub register($self) {
|
|||
attrs => [
|
||||
cn => $username,
|
||||
mail => $username . '@unix.dog',
|
||||
sshPublicKey => Util::split_keys($pubkeys),
|
||||
sshPublicKey => \@sshKeys,
|
||||
objectClass => [
|
||||
'top',
|
||||
'extensibleObject',
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package Util;
|
||||
package unix_dog::Util;
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use experimental 'signatures';
|
||||
|
@ -8,5 +8,4 @@ sub split_keys($input) {
|
|||
@out = grep (defined && length, @out);
|
||||
return @out;
|
||||
}
|
||||
|
||||
1;
|
||||
|
|
Loading…
Reference in New Issue