Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
unix
FI printers over Samba on Linux
Commits
b92bda9a
Commit
b92bda9a
authored
Nov 04, 2021
by
Martin Klimeš
Browse files
add URI encoding
parent
10756b3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
install.pl
View file @
b92bda9a
...
...
@@ -140,11 +140,16 @@ sub prompt_password {
}
return
$password1
;
}
sub
encode_uri
{
my
(
$source
)
=
@_
;
$source
=~
s/([^^A-Za-z0-9])/ sprintf "%%%02x", ord $1 /
eg
;
return
$source
}
sub
get_url
{
my
(
$printer_name
)
=
@_
;
my
$user
=
prompt_username
();
my
$password
=
prompt_password
();
my
$user
=
encode_uri
(
prompt_username
());
my
$password
=
encode_uri
(
prompt_password
());
$printer_name
=
encode_uri
(
$printer_name
);
return
"
smb://NTFI
\\
${user}
:
${password}
\@
print.fi.muni.cz/
$printer_name
";
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment