Fix sshkey
This commit is contained in:
parent
7b59847470
commit
049c0ce221
|
@ -28,9 +28,7 @@ sub update_account($self) {
|
||||||
my $loginShell = $self->param('loginShell');
|
my $loginShell = $self->param('loginShell');
|
||||||
my $roomNumber = $self->param('roomNumber');
|
my $roomNumber = $self->param('roomNumber');
|
||||||
my $telNum = $self->param('telNum');
|
my $telNum = $self->param('telNum');
|
||||||
my $sshKeys = $self->param('sshKeys');
|
my @sshKeys = Util::split_keys($self->param('sshKeys'));
|
||||||
$sshKeys =~ s/\r//;
|
|
||||||
my @sshKeys = split "\n", $sshKeys;
|
|
||||||
|
|
||||||
my $curPasswd = $self->param('curPasswd');
|
my $curPasswd = $self->param('curPasswd');
|
||||||
my $newPasswd = $self->param('newPasswd');
|
my $newPasswd = $self->param('newPasswd');
|
||||||
|
@ -44,7 +42,7 @@ sub update_account($self) {
|
||||||
loginShell => $loginShell,
|
loginShell => $loginShell,
|
||||||
roomNumber => $roomNumber,
|
roomNumber => $roomNumber,
|
||||||
telNum => $telNum,
|
telNum => $telNum,
|
||||||
sshKeys => join("\n", @sshKeys),
|
sshKeys => join("\r\n", @sshKeys),
|
||||||
username => $username,
|
username => $username,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@ sub register($self) {
|
||||||
my $password = $self->param('password');
|
my $password = $self->param('password');
|
||||||
my $email = $self->param('email');
|
my $email = $self->param('email');
|
||||||
my $pubkeys = $self->param('pubkey');
|
my $pubkeys = $self->param('pubkey');
|
||||||
$pubkeys =~ s/\r//;
|
|
||||||
my $bio = $self->param('bio');
|
my $bio = $self->param('bio');
|
||||||
my $fromIP = $self->tx->remote_address;
|
my $fromIP = $self->tx->remote_address;
|
||||||
|
|
||||||
|
@ -100,7 +99,7 @@ sub register($self) {
|
||||||
attrs => [
|
attrs => [
|
||||||
cn => $username,
|
cn => $username,
|
||||||
mail => $username . '@unix.dog',
|
mail => $username . '@unix.dog',
|
||||||
sshPublicKey => (split "\n", $pubkeys),
|
sshPublicKey => Util::split_keys($pubkeys),
|
||||||
objectClass => [
|
objectClass => [
|
||||||
'top',
|
'top',
|
||||||
'extensibleObject',
|
'extensibleObject',
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
package Util;
|
||||||
|
use strict;
|
||||||
|
use warnings FATAL => 'all';
|
||||||
|
use experimental 'signatures';
|
||||||
|
|
||||||
|
sub split_keys($input) {
|
||||||
|
my @out = split /\R/, $input;
|
||||||
|
@out = grep (defined && length, @out);
|
||||||
|
return @out;
|
||||||
|
}
|
||||||
|
|
||||||
|
1;
|
Loading…
Reference in New Issue